Network Time Protocol Clock

The Network Time Protocol (NTP) locked clock is a public design using off-the-shelf components such as the Espressif esp8266 system-on-a-chip WiFi-enabled processor combined with custom software.

  
  • The clock software is published on-line in my github resources, where a sequence of software releases is provided so that the reader can observe the iterative refinement that corresponds to the addition of capabilities. The software is written in C++ using the Arduino environment and first published in 2016. A toggle switch selects daylight savings mode and a push button switch selects the mode of operation at power up:
    • When powered up without the push button switch pressed, the clock initialises and then enters normal time display mode;
    • When powered up with the push button switch pressed until the display shows "ConF", the clock enters configuration mode where it becomes a wifi access point with its own web server;
    • In addition, hackers can attach an additional display or connect a serial terminal and ...
  • As mentioned, the clock hardware is based on an esp8266 processor device and an HT16K33 based LED driver circuit. The basic circuit diagram is included in the source code files (in github resources where some embedded system study notes are also available). The photograph above shows the clock electronics driving a 4 digit 7-segment 3cm high limited edition green LED display. This green display is termed "limited edition" because it is a pain to solder the display to the HT16K33 chip on a breakout board, in contrast to the alternative red LED modules which are pre-assembled and so only 4 or 5 wires must be soldered between display and esp8266. If you look at the source code, you will also see that it is possible to attach a 4 line/20 column LCD module and given this extra display capability, it is then possible to add optional sensors for temperature and humidity.
  • In normal operation (after configuration), the system establishes a link to the national atomic clock service of your country accessed at pool.ntp.org and then achieves sub-second accuracy synchronisation. I haven't bothered to have the software estimate the time difference between this clock and the remote ntp time server (like a Unix ntp client/server would), so there will normally be a small offset (approximately 0.5 second). Of course, if anyone gets the C++ hacking urge to remove this offset, please contact me!

View of 7-segment display and driver chip connected to the ESP8266



Wiring view for 7-segment display to driver chip to ESP8266 to switches



Alternative wiring view when using the pre-assembled red display module (easy to do)



Display Circuit (click to enlarge)



Wiring notes when soldering LED to HT16K33 (click to enlarge)

No comments: