DCFake77: How to radio-control your clock by yourself
This project is composed by a DCF77 receiver (based on arduino) and a DCF77 Transmitter (based on Raspberry PI).
DCF77 is a radio signal at 77.5Khz. The transmitter is if Frankfurt. It broadcasts the synchronization signal for radio controlled watches and clocks.
Unfortunately it is getting harder and harder to get the signal from Frankfurt, as there are many sources of radio noise (e.g. several weakly designed switching power supplies).
I have built a simlpe receiver using a specific antenna and a Arduino.
I bought my antenna on e-bay
I connected the 4 pins of tha antenna to a Arduino Nano (clone) as follows:
- PON -> +3V3
- DATA -> D2
- GND -> GND
- VCC -> +3V3
and loaded the script DCFSignal (included as an example of the DCF77 library)
/*
* DCFSignal.ino - DCF77 debug Example
* Thijs Elenbaas, 2012
* This example code is in the public domain.
This simple example shows the raw signal coming from the DCF decoder.
Pulse-to-Pulse is approximately 1000 ms and pulse with is approx 100ms or 200ms
The axis underestimates the elapsed time slightly, because a single loop takes a bit
longer than 10ms.
*/
#define BLINKPIN 13
#define DCF77PIN 2
int prevSensorValue=0;
void setup() {
Serial.begin(9600);
pinMode(DCF77PIN, INPUT);
pinMode(13, OUTPUT);
Serial.println("0ms 100ms 200ms 300ms 400ms 500ms 600ms 700ms 800ms 900ms 1000ms 1100ms 1200ms");
}
void loop() {
int sensorValue = digitalRead(DCF77PIN);
if (sensorValue==1 && prevSensorValue==0) { Serial.println(""); }
digitalWrite(BLINKPIN, sensorValue);
Serial.print(sensorValue);
prevSensorValue = sensorValue;
delay(10);
}
Using a terminal emulator
screen /dev/ttyUSB0 115200
I get the following output:
0ms 100ms 200ms 300ms 400ms 500ms 600ms 700ms 800ms 900ms 1000ms 1100ms 1200ms 000 10 1000 100000000000 1000 10 10000000000000000 1111000 1100 11100000000000000000000000000000000000000000000000000000000 100 10000000000000000000 100000000 100000000000 1100000000 100000000000000000000000000000000000000000 100000000 10 100000000000000000000000000000000000000000000 100 100000 1000000 11000000000000000000 10000000000000000 1000000000000000000000000
.... while a "clean" output should be like this published here: