DCF77 can not use anything other than A5

Hello,

Some time ago, I decided to make a DCF clock to make a gift.

So I bought a receiver module from HKW, an I2C 7-segment display at Adafruit.

I downloaded a Sketch on the Blinkenlight GIT.

I did a montage on an Arduino UNO to do tests (the final editing will not be done on a UNO because of the resonator.) Sktech needs a real crystal.

If I connect my receiver on the A5 and I run the Sketch SCOPE to analyze the reception quality it works. On the other hand, if I use another PIN, and I modify the Sketch settings accordingly, I receive nothing.

I do not understand why I can not use anything other than the A5?

Thank you, before, for your advice.

If you have made changes here, you must ensure these match:

const uint8_t dcf77_analog_sample_pin = 5;
const uint8_t dcf77_sample_pin = 19; // A5
. . . 
const uint8_t dcf77_analog_samples = 1;

If you are using digital samples, then you give the "digital" number of the analog pin.

I did look at Blinkenlight at one time, but opted to write my own DCF77 code because, as I seem to remember, the Blinkenlight solution used a lot of resources and there was not much left for anything else.

Thank you for your answer 6v6gt,

I forgot to say that I have already tested other settings in the library.

For example if I connect to A3 with these parameters:

const uint8_t dcf77_analog_sample_pin = 3;
const uint8_t dcf77_sample_pin = 19; // A5 == D19 for standard Arduinos
const uint8_t dcf77_inverted_samples = 0;
const uint8_t dcf77_analog_samples = 1;

1, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
2, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
3, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
4, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
5, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
6, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
7, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
8, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
9, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
10, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------

The Scope is empty.

If I reconnect in A5.

const uint8_t dcf77_analog_sample_pin = 5;
const uint8_t dcf77_sample_pin = 19; // A5 == D19 for standard Arduinos
const uint8_t dcf77_inverted_samples = 0;
const uint8_t dcf77_analog_samples = 1;

1, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
2, +---------+---------+---------5XXXXXXXXXX2--------+---------+---------+---------+---------+---------
3, +---------+---------+---------8XXXXXXXXXXXXXXXXXXX2---------+---------+---------+---------+---------
4, +---------+---------+---------2XXXXXXXXX8---------+---------+---------+---------+---------+---------
5, +---------+---------+---------9XXXXXXXXX5---------+---------+---------+---------+---------+---------
6, +---------+---------+--------1XXXXXXXXXX1---------+---------+---------+---------+---------+---------
7, +---------+---------+---------1XXXXXXXXX3---------+---------+---------+---------+---------+---------
8, +---------+---------+--------3XXXXXXXXXXXXXXXXXXXX+---------+---------+---------+---------+---------
9, +---------+---------+--------6XXXXXXXXXX1---------+---------+---------+---------+---------+---------
10, +---------+---------+--------4XXXXXXXXXX2---------+---------+---------+---------+---------+---------
11, +---------+---------+--------3XXXXXXXXXXXXXXXXXXX5+---------+---------+---------+---------+---------

OK. And if you try:

const uint8_t dcf77_analog_sample_pin = 3;
const uint8_t dcf77_sample_pin = 17; // A3 = 17
. . .
const uint8_t dcf77_analog_samples = 0;  / 1=analog, 0=Digital

to force it to digital read, do you get any further ?

If I plug into D19 it works.

const uint8_t dcf77_analog_sample_pin = 5;
const uint8_t dcf77_sample_pin = 19; // A5 == D19 for standard Arduinos
const uint8_t dcf77_inverted_samples = 0;
const uint8_t dcf77_analog_samples = 0;

1, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
2, +---------+---------+---------+---------+---------+-------3XXXXXXXXXXXXXXXXXXXX8+---------+---------
3, +---------+---------+---------+---------+---------+--------6XXXXXXXXXXXXXXXXXXX1+---------+---------
4, +---------+---------+---------+---------+---------+-------1XXXXXXXXXXXXXXXXXXX9-+---------+---------
5, +---------+---------+---------+---------+---------+-------7XXXXXXXXX7-+---------+---------+---------
6, +---------+---------+---------+---------+---------+-------5XXXXXXXXX1-+---------+---------+---------
7, +---------+---------+---------+---------+---------+------1XXXXXXXXXX--+---------+---------+---------
8, +---------+---------+---------+---------+---------+------1XXXXXXXXXX2-+---------+---------+---------
9, +---------+---------+---------+---------+---------+-------XXXXXXXXXXXXXXXXXXXX9-+---------+---------
10, +---------+---------+---------+---------+---------+------3XXXXXXXXXX3-+---------+---------+---------

If I plug into D3 it does not work.

const uint8_t dcf77_analog_sample_pin = 3;
const uint8_t dcf77_sample_pin = 17; // A5 == D19 for standard Arduinos
const uint8_t dcf77_inverted_samples = 0;
const uint8_t dcf77_analog_samples = 0;

1, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
2, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
3, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
4, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
5, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
6, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
7, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
8, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
9, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
10, +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------

If I take the lib decodeurDCF1 from Bricoleau (forum member) I plug my module into D3 on the Uno it works perfectly.

Demo decodage signal DCF77

Recherche pulsation...
11
1111111111111111111011100100100101001100100010010011101000
0100000010100100010010010100000101001100100010010011101000 Jeudi 13/04/2017 14:14 (heure d'ete)
0111111001010000010011010100100101001100100010010001101000
0011001101011000010010110100100101001100100010010011101000 Jeudi 13/04/2017 14:16 (heure d'ete)
0101110011111000010011110100000101001100100010010011101000 Jeudi 13/04/2017 14:17 (heure d'ete)

But I lose the benefit of the correction with the crystal and algorithm of the bookstore that interests me.

This Blinkenlight DCF77_scope.ino (attached) worked for me on D2 with a Conrad DCF77 module . I haven't played with it for a long time so I can't remember if I made any other changes. I may even be able to find the entire library which matches this version if it helps.

DCF77_Scope.ino (7.93 KB)

Whaouu:
If I plug into D19 it works.

If I plug into D3 it does not work.

If I take the lib decodeurDCF1 from Bricoleau (forum member) I plug my module into D3 on the Uno it works perfectly.

But I lose the benefit of the correction with the crystal and algorithm of the bookstore that interests me.

I really not understand what "benefit" you are talking about.

The "minute mark" sent in the DCF77 time telegram is accurate to +/-40milliseconds always.

In case you need correct time, use the time received by DCF77 to set a DS3231 RTC module and ready you are with accurate time.
It really doesn't matter whether the Arduino board clocking is off by 0.8%, which might happen with bad ceramic resonators or just by 0.008%, which might be the case with a crystal oscillator design of the Arduino board.

Accuracy of the Atmega328s 16 MHz clocking does not affect accuracy of DCF77 time relegrams received. And it really doesn't matther which pin number you are using for connecting the DCF modules data signal.

Accuracy of DCF is "plus or minus 40 milliseconds at the full minute" and does not depend on the accuracy of the Atmega328s 16 MHz clocking .

What really matters ist thaT: You need a good and undisturbed DCF data signal from your DCF module, or receiving DCF data time telegrams may fail. But failing to decode DCF time is not caused by using different pin numbers, it might be caused by bad DCF receiving signal.

jurs:
I really not understand what "benefit" you are talking about.
. . .

Apparently this solution requires an accurate clock to maintain a phase lock loop which helps in error discrimination and, according to the documentation, allows it to be used in areas of very poor signal. See:

6v6gt:
Apparently this solution requires an accurate clock to maintain a phase lock loop which helps in error discrimination and, according to the documentation, allows it to be used in areas of very poor signal. See:
DCF77 Project | Blinkenlight

Yes, Udo Klein is using a rather complicated signal processing in his DCF receiving and decoding library.But all this complicated signal processing is only used within the library itself, and there is no "benefit" you can pull out of the library and use for something else.

About four years ago I tested his code and two different DCF receiving modules against the DCF library of Thijs Elenbaas and against an algorithm developed by myself.

That's what I found out about four years ago:
DCF library of Thijs Elenbaas ==> very bad with decoding of disturbed DCF signal
DCF Library of Udo Klein ==> very good with decoding of disturbed DCF signal
My own DCF decoding algorithm ==> very good with decoding of disturbed DCF signal

In fact I found out for myself: each disturbed DCF signal, which could be decoded by the complicated Udo Klein algorithm, could also be decoded using my own (much simpler) algorithm

Only the "time-split algorithm" used by Thijs Elenbaas, provided very poor results with disturbed DCF-signals.

Thijs is just doing it this way:
if signal time <150ms, then it must be a zero-bit, otherwise it's a one-bit.
That's much too simple and will only work with a good, undisturbed DCF signal from the DCF module.

I looked at quite a number of the various solutions before writing my own. The problem I had with the Blinkenlight was not its accuracy but the resources it used (RAM, Timers etc.)

The interrupt approach by Thijs Elenbaas is not really, to my mind, suitable for a signal like that from DCF77 unless it is a very well behaved signal with 2 clean edges per second pulse.

When using the tools to present the raw data from the DCF receiver, I found it is easy to determine visually whether a bit received is a 0 or 1. I used this logic in my own algorithm, simply looking for clusters to differentiate between a zero and a one.

The result is a little bit loose because I have tuned it try to make something out of even a poor signal, that is even though I check all the parity bits, so I added another check. To correct the RTC, I require 2 full plausible whole minute signals (these can be separated by rejected whole minute signals), but must have the same delta to the time in the RTC. Only then will I accept the change.

I handle daylight saving time myself, so that the clock is always accurate, even if there is no useable signal around the time of the DST change.

Hello,

Thank you very much for your help. It was the setting of the Monitor Led that was problematic and I noticed it by looking at your file.

This will allow me to move forward in my project.

6v6gt:
Apparently this solution requires an accurate clock to maintain a phase lock loop which helps in error discrimination and, according to the documentation, allows it to be used in areas of very poor signal. See:
DCF77 Project | Blinkenlight

This is exactly the interest of the bookstore. The clock will be locked in a piece of furniture with other appliances. This will not facilitate good reception of the signal.