Another clock,… certainly but with an accuracy of 1 ms !!!
Every electronicshobbyist must make a clock. I have built dozens of them with manual or automatic time setting using the DCF77, NTP, RDS info protocols, etc. This one is very simple to build and uses an ESP32 processor.
To have the ms precision, it must be connected to the Internet via a physical Ethernet port (via Wifi, I measured a precision of around 10mS, which is 10 times worse than via wired Ethernet). For this I use the Wiznet W5500 controller. The address is obtained by DHCP so there is no configuration required.
For the display, I used 4 x 4-digit LED blocks that I soldered onto a prototype board.
I made 2 types of proto: the first with a MAX7219 circuit driven by the ESP32 hardware SPI bus, the second using a TM1637 circuit driven by software.
Filming in slow motion video with my iPhone, the last of the digits which represents 1/100 S, we see all the digits between 0 and 9 with the MAX7219 circuit and one digit out of 2 with the TM1639 circuit.
This corresponds to display speeds of 5mS and 19mS depending on the circuit used.
Of course, the human eye doesn't care and can't notice it!
To verify that I was getting the ms correctly, I electronically compared the time on my clock with a reference clock driven by a GPS signal. I haven't observed any difference even over long periods of time.
I thank the author of the excellent ezTime library.
You must use the ezTime_ethernet.h library that I configured to be able to use the W5500 Ethernet controller.
To obtain this result (i.e. the ms of precision), the library uses version 3 of the NTP-RFC 1305 protocol.
The ESP32 time is updated every 15 minutes so that the ESP32 quartz drift remains reasonable.
If the NTP server cannot retrieve the time, the hours and minutes display flashes until synchronization is complete.
As NTP time does not manage summer/winter time changes, I implemented an automatic time change depending on the country where you live. The software is sufficiently documented to modify it according to your needs.
The electronics fit without any problem in a red Hammond case which allows for a beautiful display. Power is supplied by a small external 5W unit.
I installed this clock in my office, and at least I am sure of the time and date it shows! I plan to use it to synchronize my NTP server which I described in another lab article.
For the display, I used 4 x 4-digit LED blocks that I soldered onto a prototype board.
I made 2 types of proto: the first with a MAX7219 circuit driven by the ESP32 hardware SPI bus, the second using a TM1637 circuit driven by software.
Filming in slow motion video with my iPhone, the last of the digits which represents 1/100 S, we see all the digits between 0 and 9 with the MAX7219 circuit and one digit out of 2 with the TM1639 circuit.
This corresponds to display speeds of 5mS and 19mS depending on the circuit used.
Of course, the human eye doesn't care and can't notice it!
To verify that I was getting the ms correctly, I electronically compared the time on my clock with a reference clock driven by a GPS signal. I haven't observed any difference even over long periods of time.
I thank the author of the excellent ezTime library.
You must use the ezTime_ethernet.h library that I configured to be able to use the W5500 Ethernet controller.
To obtain this result (i.e. the ms of precision), the library uses version 3 of the NTP-RFC 1305 protocol.
The ESP32 time is updated every 15 minutes so that the ESP32 quartz drift remains reasonable.
If the NTP server cannot retrieve the time, the hours and minutes display flashes until synchronization is complete.
As NTP time does not manage summer/winter time changes, I implemented an automatic time change depending on the country where you live. The software is sufficiently documented to modify it according to your needs.
The electronics fit without any problem in a red Hammond case which allows for a beautiful display. Power is supplied by a small external 5W unit.
I installed this clock in my office, and at least I am sure of the time and date it shows! I plan to use it to synchronize my NTP server which I described in another lab article.
Discussion (2 comments)