DCF77 Signal with Arduino

The DCF77 signal is a puls-signal with AM modulation with carrier frequency 77.5kHz. It has a small bandwidth.

The carries include time and date information and will be transmitted in a simple binary-coded format by on-off modulation of the carriers.  (100ms/200ms)
The Signal time and date code include the following information:

  • year, month, day of month, day of week
  • hour, minute, second, summer time

DCF receiver module with antenna (Radio Controlled Clock)

This module comes in different variants and forms and receive the 77.5 kHz signal from Frankfurt and decodes and sends the data stream to the output. The output signal can be processed by a microcontroller.

The normal inputs/outputs on a DCF receiver module are:

TCON = Digital output of carrier signal
PON (if provided) usually grounded to GND to enable the receiver.
Operating voltage from  +2.5V to +5.5V

The data input should be connected to a digital pin of arduino that uses  a interrupt!


Arduino only has two pins that are digital and each uses an interrupt.

 

Digital 2 with INT0/0

DCF77 Code
DCF77 Code

Digital 3 with INT0/1

 

Digital output of carrier signal has to connected to D2 pin OR D3 pin.

If the device dose not received clear signal, make sure the DCF-Antenne is enough away from the interfering source. (At least 2m)
For example:

– Monitor, Computer
– Fluorescent lamps
– Power supplies

 

The amplitude of the carrier is reduced every second to 25% (- 6db) in order to code “0/1” logic by the length of the amplitude (simple pulse width signal). A 100ms lowering is a logic “0” whereas 200ms is a logic”1″.

Every second is equal to one bit. The start of a new time sequence is signalized by the 59th second after which there is not lowering of the amplitude.
The week-day is coded as “1” for Monday and “7” for  Sunday.


/*
 * DCFSignal.ino - DCF77 debug Example
*/

#include <DCF77.h>
#include <Time.h>
using namespace Utils;
 
#define DCF_PIN 2         // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0   // Interrupt number associated with pin
#define BLINK_PIN 13

time_t time;
DCF77 DCF = DCF77(DCF_PIN, DCF_INTERRUPT);
 
void setup() {
  Serial.begin(9600);
  pinMode(DCF_PIN, INPUT);
  pinMode(BLINK_PIN, OUTPUT);
  Serial.println("Waiting for DCF77 time ... ");
  DCF.Start();
}
 
void loop() {
 delay(1000);
 time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available
 if (DCFtime!=0) {
    Serial.println("Time is updated");
    setTime(DCFtime);
 }
 digitalClockDisplay(DCFtime);
}
 
void digitalClockDisplay(){
   Serial.print(hour());
   printDigits(minute());
   printDigits(second());
   Serial.print(" ");   Serial.print(day());
   Serial.print(" ");   Serial.print(month());
   Serial.print(" ");   Serial.print(year()); 
   Serial.println(); 
}
 
void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

2 Comments on “DCF77 Signal with Arduino

Leave a Reply

Your email address will not be published. Required fields are marked *

*