DCF77 Project

This month I will start a series of experiments geared to develop a DCF77 clock decoder. The idea is of course to establish a binary clock for the Blinkenlighty.

You might wonder why I need a series of experiments for this. After all there are quite some DCF77 libraries readily available for download. Some are even featured in the Arduino playground.

The point is that they all perform very poor in the presence of noise. Unfortunately the DCF77 signal is almost always noisy. So my goal is to develop the most noise tolerant DCF77 clock decoder software ever.

As it turns out this is significantly harder as it appears at the first glance. Hence I will progress in steps that are hopefully not to hard to swallow.

My plan is to start with a standard library and then to refine it gradually:

  1. Exponential filtering of the signal
  2. Phase locked loop / optimal filter for 1Hz phase reconstruction
  3. Reconstruction of the seconds
  4. Hamming metric based reconstruction of the data
  5. Dealing with signal loss
  6. Tuning the crystal

Step (0) will already produce clocks that has superior filtering compared to most. After step (3) however we will have unprecedented noise resilence. An early prototype already locked to a signal with >80% noise – Something that is completely out of reach for any simple decoder.

Ironically there will be no video for the first stages of these experiments because my photo lights creates to much noise for the DCF77 receiver to demodulate any signal at all. No matter how much denoising is present, if there is no demodulated signal the clock has absolutely no chance.

Click on the diagrams to learn how I apply exponential filtering to improve an existing library.

Noise vs. Filters

In case you want to dig deeper into what I am going to do I strongly recommend the book Digital Signal Processing. A Practical Guide for Engineers and Scientists by Steven Smith. I also find Information Theory, Inference, and Learning Algorithms by David MacKay very inspiring. Basically I follow the ideas that you can find in these two books. A word of warning though: if you have no knowledge of mathematics they are not exactly an easy read 😉

This entry was posted in Uncategorized. Bookmark the permalink.

6 Responses to DCF77 Project

  1. Pingback: DCF77 signal filtering and decoding

  2. Helge says:

    Wow 🙂
    I am currently building an Arduino and Microcontroler-based Aquarium-controler with light dimming and so on. To get teh current time i have a simple dcf module from pollin. I lost hours the last weeks with the noise, because in ym first experiment i got a clean time signal after five minutes (breadboard, Arduino with USB cable), but no signal at all after one hour with the first prototype (direct current 12v and no breadboard). After trying much i realised that i got just gibberish signals.

    My only solution so far is to position the antena over one meter away from the power source and the arduino.

    I’m lookign forward to your project 🙂

  3. Ivo says:

    Great project! I’m about to build a timer switch box with 7 mains outlets which I want to switch via IR and timer based. So your clock will be a nice feature for that
    Are you going to add a RTC module for the standard time and use the DCF for exact calibration or are you using the DCF without any RTC backup? In the latter case there is a big chance that the clock will go out of sync quite fast when the DCF signal is lost.

    i’m a big fan of the DCF principle so I will definitely watch what you’ll come up with!!

    • Right now I do not plan to add RTC sync. However I plan to build it in such a way that this can be easily added. Anyway the clock will require a local clock that is not worse than 30 ppm. This implies it will NOT work with the “modern” resonator based Arduinos. It also implies that it will not go out of sync more than ~2-3s per day. Since I plan to make it ***very*** noise resilent I do not anticipate to lose the signal for such long periods.

      • Ivo says:

        That really sounds super, I can hardly wait. If you succeed in that I’m definitely interested.
        I think you have seen this page: http://fpga-xilinx.blogspot.nl/2012/04/your-6-hourly-digest-for-electronics_9462.html ?
        It is about the difference the DCF antenna can make.
        Too bad all that stuff is hard to get. I do not see it on ebay for instance. And the local shops don’t sell it either.

        I will keep my eyes on your project, I’m not very experienced in programming (I’m more a hardware guy)..

        • No, I think this did not yet catch my attention. So thanks for pointing this one out. However I found several similar pages. Of course you are right, the antenna can make a big difference. Unfortunately you are also right in pointing out that good antennas are hard to get. I often see commercial antennas for big price tags without any clear specification. So if anyone knows a good source for good and reasonable priced antennas any hints are welcome. Anyway I am going to push the denoising as far as I can.

Leave a Reply to blinkenlightblog Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.