An Arduino library for decoding DCF77 signals
C++ C Java
Latest commit d46b18c Jun 18, 2012 @jlesech jlesech Allow to configure used pins and signal.
Use tabs instead of spaces in keywords.txt to get working syntax highlight in Arduino IDE.


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

I used the sample code written by Matthias Dalheimer ( and 
adapted it so that it can be used as a library in other Arduino projects.

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.