An Arduino library for decoding DCF77 signals (with callbacks)
C++ Arduino
Pull request Compare This branch is 3 commits ahead, 6 commits behind fiendie:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This library is for decoding the DCF77 time signal broadcasted
by the german PTB (Physikalisch-Technische Bundesanstalt) in Mainflingen.

I used the Funkuhr library by Andreas Tacke and adapted it so that it can 
changed it so that it provides a callback for each sync. (In this way it's
easier to update the time of a not-so-accurate RTC module like the DS1307)

To be able to use this code you have to hook up a special DCF77 receiver 
to your Arduino. I used the one sold be german electronics retailer Reichelt.

Unfortunately the Reichelt module has a very weak push-pull output which 
provides only around +/- 5uA. 

To get usable readings out of it I used the following circuit:
                            |     R3     |
         ____     |/c-------+------------|---o PIN2
SIG o---|____|---b|                      | 
          R1      |\e->-----+            |
                            |    ____    |
VDD o---+-------+-------+---|---|____|---+---o +5V
       _|_     _|_     _|_  |     R2           
    D1 /_\  C1 ___  C2 ___  |                
        |       |       |   |                
GND o---+-------+-------+---+----------------o GND

D1: 3.9 Z-Diode 
C1: 100n Ceramic Capacitor
C2: 100u Electrolytic Capacitor
R1: 120k Resistor
R2: 2.2k Resistor
R3: 10k Resistor

To amplify the signal there is a 2N2222 Transistor between R1 and PIN2.

For a tutorial on how to install new libraries for use with the Arduino
development environment please refer to the following website:

This library assumes that you have SIG hooked up to Arduino's PIN2.
The reason for this is that most Arduino boards have two external interrupts: 
numbers 0 (on digital pin 2) and 1 (on digital pin 3). 
If you want to use PIN3 you would have to change the constant at the top of
Funkuhr.cpp and change the interrupt number in attachInterrupt() from 0 to 1.