DCFake77 is an emulator for the DCF77 time signal

pushedAt 2 years ago



DCFake77 is an emulator for the DCF77 time signal, used to synchronize clocks, watches, appliances and industrial equipment. DCFake77 exploits hardware available on common development boards to generate a 77.5 kHz signal, AM-modulated to encode the DCF77 protocol.

Available implementations

So far two implementations are provided:

  • An ESP32 implementation based on the LED control PWM hardware, initially developed by Luigi Calligaris
  • A Raspberry implementation based on the General Purpose Clock generator hardware, initially developed by Renzo Davoli

Quick start

You'll need the following hardware:

  • An ESP32 development board. Cheap ones (around 4$) can be found online or in electronics shops.
  • A 330 ohm resistor or more (2 x 220 or 470 work fine), any power rating is fine. The setup is not picky, but don't go below 330, to keep currents acceptable.
  • An electromagnetic coil to couple the signal to the receiving device. I used a coil with around 20 turns made from old twisted pair. I recommend the diameter of the coil to be at least of the order of the distance between it and the receiver.
  • Using a breadboard to assemble the setup is helpful. Take care that most ESP32 boards do not fit very well on single-tile breadboards, leaving access to just one row of pins on one side of the board. Still, this is enough for our application.

ESP32 implementation

  • Choose the pin you want to use for signal output on the ESP32 (e.g. GPIO16)
  • Wire the resistor to it and then wire the coil in series with the resistor to the GND pin on the ESP32.

(ESP32 GPIO16)----(330 ohm)----(COIL)----(GND ESP32)

  • Power the ESP32 by connecting the USB cable to your computer
  • Launch Arduino IDE and load dcfake77-esp32.ino
  • Select the ESP32 board you're using in board settings. If you didn't do so yet, you may have to install the board in the IDE board manager
  • Set the output pin you chose before (in our case 16) as the led_pwm_pin constant in the top of the source file
  • Set username and password for your WiFi access point, so the ESP32 can fetch the current GMT time via NTP.ORG
  • Set the offsets between your time zone and GMT, for daylight saving time and summer time
  • Verify the code compiles (Ctrl+R)
  • If successful, compile and upload the code (Ctrl+U)
  • If all goes well, the ESP32 should connect to the WiFi, get GMT time and then start transmitting the emulated DCF77 signal via the coil
  • Some receiving devices need a few minutes (like 2-5) to validate the signal and synchronize to it. Be patient
  • Some debug information is sent through the UART interface while the code is running, you can monitor it using a program like GtkTerm

Raspberry implementation

Guide to be written

ucloud ads