Arduino DCF77 radio clock receiver
November 5, 2006 – 9:31 pm
As a first sketch, I developed a little DCF77 library for the arduino. The DCF77 sender broadcasts the exact time in Germany. It uses a binary format which needs to be decoded - which is exactly what the library does.
There are others around who wrote a DCF77 decoder: I would like to thank Captain for his DCF77 code. You need to have an Arduino and a DCF77 receiver in order to use this sketch.
I use the “DCF-Empfänger BN 641138″ of Conrad. You need a pull-up resistor as displayed here:


When everything is connected, the exact time is printed on the serial line. Note that this is a very early release of the software - there is a lot of functionality missing. From the README:
The current todo list is: * Use interrupt routines for detecting signal changes * Use interrupt routines to add seconds automatically (currently, the 59th second is shown properly) * Implement parity checks to prevent faulty time signals to be evaluated
The sketch eats up 6400 of the 7168 bytes in the Arduino. I am currently considering to upgrade my board to the ATMega 168 processor in order to have 16kb of memory…
You can download the code here:
The code is released under terms of the CC-GNU GPL.
4 Responses to “Arduino DCF77 radio clock receiver”
hallo, nice idea!
But is it so that the Arduino can get the time ONLY when you plug in the DCF77 or time is checked every now and then?
Thanks
Ale
By ale on Jan 26, 2008
In a private eMail, ale asked:
“Does your arduino code check the time on the DCF77 only once or it updates the time once in a while? I’ve read you still didn’t implement interrupts, but may be there’s a dummy time-update every.. ‘n’ seconds?”
Actually, the time is only updated when the DCF77 receiver is connected. I receive an external interrupt each second from the receiver. While I update my internal buffers, I also update the current second counter. If the received time is valid (i.e. the checksums match), I use this time as the current time. If something goes wrong, I use the old (internal) time which has been updated each second.
So, to sum it up: This version relies on a working receiver all the time.
By md on Jan 28, 2008
wow!
thanks for your answers! I’ll try the code as soon as I get a DCF77 receiver. Btw, you think that you can find a DCF77 receiver disassembling a DCF-clock? Some of them are ridicously cheap..
By ale on Jan 29, 2008
hi ale,
I heard of someone who disassembled an old radio-controlled clock and just used the receiver. Unfortunately, I don’t have a link ;-) You can try it. Typically, a DCF77 receiver module has an open-collector signal output as well as GND and VCC to power the module - so it’s pretty simple to connect. However, I don’t know whether the input voltage of 5V would be tolerated by a custom-build receiver for another device.
On the other hand, tinkering for 3 Euros… Give it a try and tell me!
-Mathias
By md on Jan 29, 2008