During the project to create a Nixie clock based on an Arduino Nano Clone with a DCF77 receiver, I came across the DCF77 library by thijse on github. After installing the library I unfortunately found that the synchronization, despite the proximity to the transmitter in Mainflingen just would not work. Since I suspected at the beginning that the relatively cheap DCF77 module from eBay caused the problems, I checked the signal with the help of an oscilloscope. Here I could see clear “spikes” between the individual pulses. Therefore I connected the output signal of the receiver with the help of an impedance converter (LM741) to the input of the Arduino. This problem was already solved. Nevertheless, the synchronization did not work even after more than an hour of waiting (should be done after 180s at the latest).
After taking a closer look at the library, I came across the following variable definitions in the header file (DCF77.h):
#ifndef DCF77_h #define DCF77_h #if ARDUINO >= 100 #include <Arduino.h> #else #include <WProgram.h> #endif #include <Time.h> #define MIN_TIME 1334102400 // Date: 11-4-2012 #define MAX_TIME 4102444800 // Date: 1-1-2100 #define DCFRejectionTime 700 // Pulse-to-Pulse rejection time. #define DCFRejectPulseWidth 50 // Minimal pulse width #define DCFSplitTime 180 // Specifications distinguishes pulse width 100 ms and 200 ms. In practice we see 130 ms and 230 #define DCFSyncTime 1500 // Specifications defines 2000 ms pulse for end of sequence
I noticed that some of the timings were very tight. I have therefore changed the times as follows:
#define DCFRejectionTime 650//700 // Pulse-to-Pulse rejection time. #define DCFRejectPulseWidth 30//50 // Minimal pulse width #define DCFSplitTime 160//180 // Specifications distinguishes pulse width 100 ms and 200 ms. In practice we see 130 ms and 230 #define DCFSyncTime 1700//1500 // Specifications defines 2000 ms pulse for end of sequence
And lo and behold: the time is synchronized after latest 3 minutes and updates every minute 🙂