4928

An ESP32-based NTP-interface for elder Gorgy Timing LED clocks. It replaces a DCF77-receiver and a plug-in interface.

Times are changing: In the past, clocks were set according to church bells, but this task was taken over by long-wave transmitters such as TDF and DCF77. Today, however, their signals are increasingly disappearing in the fog of interference from switching power supplies, DSL lines and many other devices. Often, even with an active antenna mounted away from the digital clock, reliable reception is no longer possible.
This problem makes many older DCF77-based, often very shapely and large-format digital clocks timelessly beautiful in the truest sense of the word.
It would be desirable if these clocks could also obtain the exact time -as is common today- from Internet time servers.


### THIS ARTICLE  WITH EMBEDDED FOTOS AND DIAGRAMS IS < HERE > AS WELL '###

Clocks without time:
A collector of professional LED digital clocks from the company Gorgy Timing asked me for a simple and inexpensive extension of his clocks, which he was proudly presenting in his living rooms. The clocks were mostly equipped for DCF77 reception, which was however locally very disturbed.
Circuit documents for the Gorgy clocks, the interface boards and the external DCF77 receivers could not be obtained even in the vastness of the Internet.

The task:
In the future, the Gorgy clocks should obtain the exact time via an existing 2.4GHz WLAN. Necessary technical interventions in the clocks should be as simple as possible, inexpensive and, in particular, reversible at any time.

The inner values of the Gorgy collectibles:
All collectibles had in common that they were equipped with an internal precision female connector 2.54 mm, 1X10. The insertion of an interface board (only present in a few of the clocks) then allowed the connection of a time source such as DCF77 receiver, TDF, AFNOR and SMPTE via a two-pin socket on the back of the clock.

The DCF77 interface board:
The exact function determination and circuit reconstruction of the interface board for DCF77 reception and the DCF77 receiver was not quite trivial. Ultimately, the interface consisted of a low-drop 9V voltage source that served as the operating voltage for the external DCF77 receiver via a series resistor. The receiver draws an increased current when a logical 1 is detected. This ultimately switches the LED and the transistor of an optocoupler by means of a transistor amplifier. It finally results in switching the interface pin #6 between 3v3 and 0V by the demodulated DCF77 signal.

The board additionally identifies itself as a DCF77 interface by means of two diodes on three contacts of the 1X10 connector strip. Some clocks had a four-pole plug-in connection to the receiver, where the two middle contacts had to be connected to each other for DCF reception.

NTP2DCF:
The now ubiquitous easy access to the Internet allows to provide a time telegram with quite little effort. A date and time transmitted with the NetworkTime protocol can be converted relatively easily with a WiFi capable microcontroller into the format used by DCF77. DCF77 continuously transmits 59 second pulses and encodes a logical 0 or 1 in their pulse length (100ms or 200ms). For synchronization, the last second of a minute remains without a second pulse. It is always the date and time of the future next minute that is transmitted.
This is actually quite trivial and also robust due to some included parity bits.
There are many programs executable on ESP8266 or ESP32 which reproduce this more or less exactly. [ ]

The Fake Antenna: The accumulated knowledge of the structure of the signal delivery to the mainboard of the Gorgy clocks finally led to a very simple autonomous replacement for the DCF77-receiver and the old plug-in interface.
The SoC ESP32, now synchronized with an internet NTP server, outputs a DCF77 coded signal and switches the interface pin#6 between 3V3 and GND via a protection resistor.

A new ATOMic heart for the clocks:

Actually every ESP32 fits here. If you use an ATOM lite from M5Stack, then outside of its small protective housing only a few components and the pin header have to be placed on a small perfboard. The 5V supply voltage from the clock is then connected to the Grove port of the ATOM lite. However, the output signal to the clock is also given via a pin of this port. Thus, the microcontroller can be placed outside the shielding metallic clock housing with a (also longer) ribbon cable and find more optimal WiFi conditions there.

Notes on the program code:
The programming of the ESP32 was done with the Arduino IDE in combination of different freely available code function blocks. The core of the project was the DCF77_ESP32 software available at [xx].
The used software library time.h [x] turned out to be unexpectedly functionally relevant. With a default version of time.h the initial synchronization with an Internet time server succeeded. However, the internal system time was then extremely inaccurate. Further synchronization attempts were silently suppressed, which led to a, at first not comprehensible, alternating strong time offset of up to 50 seconds.
After the optimizations, there was no longer any offset compared to other radio-based DCF clocks.

The final code [Zip-file-to-download] first allows the simple login to a new WiFi network by capturing the access data using an own temporary access point and a login page of the ESP32.
The ESP32 then fetches date and time from an NTP server on the Internet. The time telegrams for the clock are then transmitted semi-continuously in DCF format on an output pin. In the first 5-minute interval, at least four complete time telegrams are transferred to the clock, which is certainly sufficient for synchronization. This is followed by a 15-minute pause. After a renewed synchronization of the ESP32 clock with an Internet NTP server, time telegrams are sent again for five minutes.
This allows the exact time to be transferred within a maximum of four minutes and then to keep it accurate to the second. Summertime/wintertime changeover is also ensured.


Résumé:

  • The hardware effort is very low with the ESP32 ATOM lite and the mini interface.
  • The Gorgy Timing digital clocks remain technically unchanged.
  • The clocks synchronize very reliably within a short time after power-on.
  • Even a very inaccurate local quartz clock is forced back to the right time after a maximum of 20 minutes.
  • The required supply current is within the reserves of the clocks power supplies.
  • Especially in the optical parallel operation of the collectibles, an offset of the displayed seconds would be extremely disturbing and noticeable. This has been safely avoided with acceptably little effort.