DCF77 with Arduino
Like many others I have tried to receive the DCF77 time signal. I wanted to do this but also wanted to decode the meteotime weather information created in Switzerland by Meteotime. Meteotime is transmitted from the DCF77 transmitter with 50kW power situated at Mainflingen near Frankfurt in Germany (50deg 01′ N 09deg 00′ E). It is operated by the German telekom and supervised by the Physikalisch-Technische Bundesanstalt (PTB) and has a 2000km range which means it can cover most of Europe. There are three atomic clocks which steer the time signals of the transmitter. The signal is transmitted at 77.5kHz and the amplitude is modulated by second markers. At the beginning of each second (except for the 59th seconnd) the amplitude of the carrier frequency is reduced to about 20% for a duration of 0.1s or 0.2s corresponding to a binary zero or one respectively. At the end of each minute there is one pulse not transmitted which indicates the beginning of the data package and allows receivers to synchronize for the reception of the data. So everall it means that in each minute 59 bits of information can be transmitted including time, day, date and also if summertime is present or not. Below you can see what all the different bits mean. The callsign DCF77 stands for D=Deutschland (Germany), C=long wave signal, F=Frankfurt and the 77 is the frequency which is transmitted. Three times per hour this call sign is sent as morsecode during the minutes 19, 39 and 59.
I innitially had many receiving problems. These were certainly in part due to interference from lamps etc. After discovering this link i found out that there were ways to improve reception by using a bigger size antenna and shielding this electrostatically. The people at C-Max were so kind as to send me a sample of the larger ferrite antenna of 100 mm (CMA-77-100) and together with some aluminium foil and a toilet roll (to create the electrostatic shield) i was able to get a good reception. If you want to get some of these 100mm antennas then they are available in the shop. They can be used with any DCF77 receiver and not only the conrad one.I used the commonly used receiver part no: 641138-89 from Conrad. The antenna is a small wound ferrite rod of 60mm. I initially had many receiving problems. These were certainly in part due to interference from lamps etc. After discovering this link i found out that there were ways to improve reception. Firstly the antenna is directional and by rotating it you find that the reception strength varies. In order to more simply see when i was getting a good signal i added a LED driven by a transistor. You can then see the blink, blink, blink of the receiver output in time with the time signal. If you are getting spurious blinks multiple times per second there is something wrong. I also found out that there were larger antennas available at 100mm and these also improved reception. Most of the inteference comes from electrostatic interference from computer monitors radios and the likes. It therefore helps to shield the antenna in all directions but the direction of the DCF77 transmitter and to place the antenna near a window away from any interference.
There is little information on internet about the civil defense warning system. I only found the following incomplete articles. If someone can tell me more i would appreciate it.
Bevoelkerungswarnung Article about the civil defense system in Germany.
Bevoelkerungswarnung local copy.
wird morgen die sonne scheinen ? Article about meteotime
Now that i was getting a consistent signal what could i decipher from the data stream. Obvious would be to get the time signal. I used the software from Thijs Elenbaas which i found to be very good. He also has some nice helper programs to get you started by visualizing the DCF77 signal as it is coming in. This helped me a lot de determine that the signal was not good and that i needed to fix the antenna issue described above first. I especially used his demonstration of how the library processes the binary data and returns a time and date. In order for the example to give output on the binary stream make sure that logging is turned on in the DCF library. You can do this by adding the #define VERBOSE_DEBUG 1 in Utils.cpp. There was a small imperfection in the software which displayed the first bit after the buffer full flag (BF) and before the time lag consistent statement. You can see this also on the output example Thijs has on his site (shown below). I think this is due to the timings around the interrupt. I made a small correction to his program in order to fix that. In addition i wanted to decode the Meteotime signal which is also transmitted via this time signal using the first 14 bits of three consecutive minutes. To do that you need to sort out the overall bitstream into the blocks of data that can be used for the decoding. Some more modifications to this program also fixed that. You can see from the output below right how the different data bits are put into place. (actually you can’t because its wrong in the picture. You need 40 bits though as shown) What you need is the BCD code for MIN units, MIN tens, Hr units, HR tens, Day units, Day tens, Month units, Month tens (1) , Weekday (3), year units, Year tens. Each is 4 bits unless the number in brackets indicates different. It’s a total of 40 bits.
Of course the library needs to be changed also and you can find that in my DCF77 library. Now that you have established contact with the DCF77 signal and are decoding it successfully you will want to try the next step which is to decode the meteotime weather information. This is not quite so easy because the signal has a DES encryption included in it. Nevertheless it is possible and i have written a separate article on this meteotime decoding. In researching DCF77 i can across many DCF77 links which you can find here.