DCF77 signal filtering and decoding

[Udo] decided to build a clock using the DCF77 radio module seen above. This of course has been done before: the hardware draws a clock signal from the atomic clock in Braunschweig, Germany. So he grabbed a library for Arduino and got to work. But he was getting rather poor results and upon further investigation realized that the library had been written for 20 Hz modules and his operates at 300 Hz. This means better accuracy but the drawback is that the hardware is more susceptible to noise.

22 thoughts on “DCF77 signal filtering and decoding”

Yes they did. However I did extensive research on the internet and found none that really implemented extensive denoising and error correction. If you look at my project goals this is what I will do. So yes, open source DCF77 decoders are not new. On the other hand I am not aware of any project that succeeded in implementing and documenting high quality noise supression / error correction. Wait and see ;)

there exists a somewhat difficult to find german description of the weather forecast data that is contained in the dcf77 protocol: http://tinyurl.com/dcf77protocol However using that would require license fees.

I can see you put in some effort to try to implement some “robust” dcf decoding but I really don’t see the point to this. In my opinion it’s far better to use some kind of quality estimation of the dcf signal and reject all time signals which are below your expected quality.

Some years ago I wrote an function which just uses the pin change interrupt to measure the pulse time with a free running counter. (on an atmega8). This code sometimes rejects all time signals for hours, but it resynchronises the clock, usually during the night, when DCF reception is much better and the time signals are more reliable. Even without checking the parity bits this code only once gave a false “true” in the 8 years it has been running.

I don’t know if those cheap commercial dcf clocks use the parity bits but I’ve seen more time decoding errors on those. Maybe it’s a bit paranoid, but if I thought it would be really important to make sure the signal is right I would implement some code and only accept the dcf time If its deviation from the internal clock is small or the time signal is decode correct several times in a short amount of time.

I’ve also noticed that dcf clocks with longer antennas have better reception of the dcf signal.

One more comment: if I really need reliable accurate timing I do not use DCF77 at all. I have a used trimble thunderbolt around here. I doubt that I can find any time source below the EUR 120 that I paid for it with close the performance. The question is: how far can I push DCF77?

Exponential smoothing takes into account all past samples. If you receive a strong outlier (say, a burst of interference), it would seem this would taint your smoothing. Perhaps a moving average filter with limited memory would be better?

This is the first stage for a significantly better DCF77 decoder. Right now it can deal with up to 98% noise. If I would have a better local clock I could push this even further. The only thing that stops me is the accuracy of the crystal oscillator. Read my blog for the details.

I bought one of those clocks that sets itself over the radio for 50 cents. It even displays indoor and outdoor temperatures (although I never put my receiver outside), and the phases of the Moon too. Yard sales FTW!

This one looks just like the one I have but I’m not sure if mine says La Crosse Technology on it or not. Pretty messed up because I look at the thing every day when I wake up.

I don’t feel like going upstairs right now to check either. Ah, I just found the manuals I downloaded for mine on this PC. I have a Skyscan brand. It is identical to that thing. I knew La Crosse didn’t sound right. Yup this is it:

Crappy pic I know, it is an old model and I think it is discontinued now or something. Still works though. All I had to do to get it up and running was put batteries in it.

How is it “everyone” seems to know how to write software filters, GUI’s, and FFT’s for micro controllers now, like it’s no big deal ??????
Really, I tried to read up on it and get my head around the math, but since I haven’t seen or used some of the formulas (integration I think was the first),so I’m thinking this isn’t something you all just picked up on after completing “hello world” and “blink the LED”.

Is FFT’s like a required but minor module in all software engineering classes now ?!!?

If there’s an online course that teaches this topic starting from “hello world” level, like university of India on-line for example, PLEASE post a link.

Maybe because it is no big deal? IMHO FFT is university beginner level stuff. Most probably this is taught even outside universities. However you need some mathmatical background to grasp it. So a “hello world” level example is probably a little bit to ambitious.

With regard to all this fancy stuff for MCs: I think this is because MCs are so much more accessible to software experts than they used to be.

And yeah, I know all this stuff. In fact I know significantly more. Wait till you see my next post ;)