Go Down

Topic: DCF77 library for Arduino - synchronize with atomic clock (Read 18636 times) previous topic - next topic

mrTee

A little later than expected, the library now supports inverted pulses as input.

The constructor now has an optional parameter OnRisingFlank:
Code: [Select]
DCF77(DCF77Pin, DCFinterrupt, OnRisingFlank)
If OnRisingFlank set to false, the algorithm will trigger on falling edge.

franzs

#16
Oct 31, 2012, 09:39 pm Last Edit: Nov 01, 2012, 06:49 am by franzs Reason: 1
Hi!

I wired a cheap DCF77 receiver from Pollin to an Arduino Uno: http://www.pollin.de/shop/dt/NTQ5OTgxOTk-/

It works out of the box. No extra components were necessary.

Then I ran the examples bundled with the DCF77 library. It turns out that SyncProvider is one minute ahead at the first sync. InternalClockSync works as expected.

Please find the output of InternalClockSync at http://pastebin.com/ZbtzWtqZ

The output of SyncProvider is here: http://pastebin.com/5DSfAkjZ
In line 4 of the output of SyncProvider it's 12:01:00 actually. After the next sync the time is corrected (line 126).

Another output is here: http://pastebin.com/SWJBXFSy

I enabled VERBOSE_DEBUG and recorded a video of the output:
http://dl.dropbox.com/u/87685034/SyncProvider_3_converted.avi

I tried both examples a couple of times. The DCF77 signal is quite clear.

Any idea what's going wrong?

Best regards
Franz

Udo Klein

I implemented a DCF77 clock with an additional exponential filter in order to improve noise tolerance. You can find the experiment here: http://blog.blinkenlight.net/binary-clock/. This is actually part of a larger project where I intend to push the noise tolerance quite a lot further: http://blog.blinkenlight.net/2012/12/01/dcf77-project/.
Check out my experiments http://blog.blinkenlight.net

Nachtfalke

I am trying this module to get to work. According the example DCFSignal, the module seems to work, but the pulses seem to be to short so that the library cant interpret it (see attached screenshot). Does anyone have a clue how to fix that issue?

Udo Klein

How did you connect this module to your Arduino? This is a 3.3V module with ***very*** limited driving capability. In doubt I would say you are overloading the module.
Check out my experiments http://blog.blinkenlight.net

Nachtfalke

I connected the GND and the Vcc of the module with GND and the 5V-pin of the arduino. I tried connecting the signal pin with D2 of the arduino with and without a 10k pull up resistor. With the resistor, the signal on D2 stays at hi. Without the resistor the signal shows the behaviour seen in my attachment. The modules datasheet clearly states a supply voltage range from 1.2 V to 5 V, so there should be no overloading. The datasheet also states a maximum ripple of 10 mVeff. Maybe thats the problem. Does anyone know the ripple of the 5V supply voltage while arduino is connected to my PCs USB-port?

Udo Klein

The datasheet says maximum current 5uA. With a 10k pullup you draw 500uA. You are overloading it. You should try a 1M resistor.
Check out my experiments http://blog.blinkenlight.net

Nachtfalke

Actually the datasheets states an output current > 5µA, but i will try a 1M resistor. Maybe it works. It won't hurt anyway :D

Udo Klein

Yes, but it also says current consumption <100uA. Obviously the >5uA gives you a hint about the capabilities of the module. If it could drive 500uA they would have written it. This kind of module is designed to go into a clock --> low current consumption is a design goal, extended driving capability is not. --> I would be very suprised if it would be able to drive 500uA. This is the reason why I bought one with additional driver transistors.
Check out my experiments http://blog.blinkenlight.net

Nachtfalke

The 1M resistor does part of the trick. The signal doesn't stay at high with the 1M resistor connected, but it shows the same signal sequence as without any resistor, so the signal peaks are still much shorter than stated in the spec :(

Udo Klein

Check out my experiments http://blog.blinkenlight.net

Nachtfalke

Seems to be the same as this one. Maybe i drop by at the big blue C tomorrow to get it.

Udo Klein

Conrad and Völkner are different brands of the same company. They just address different market segments. See here: http://de.wikipedia.org/wiki/Conrad_Electronic
Check out my experiments http://blog.blinkenlight.net

Nachtfalke


Enam

#29
Sep 18, 2013, 11:37 am Last Edit: Sep 18, 2013, 12:39 pm by Enam Reason: 1

A little later than expected, the library now supports inverted pulses as input.

The constructor now has an optional parameter OnRisingFlank:
Code: [Select]
DCF77(DCF77Pin, DCFinterrupt, OnRisingFlank)
If OnRisingFlank set to false, the algorithm will trigger on falling edge.


Hello,

I think I have the same problem with the inverted signal, thank you for your hint.

But I don't know where in the code I put "false" in and which Version of the code did you use?

Thank you for help.

Kind Regards
Enam

Go Up