JAL Library DCF77 decoder (for JAL users in Europe)

59 views
Skip to first unread message

rob...@hotmail.com

unread,
Sep 23, 2023, 10:13:44 AM9/23/23
to jallist
Hi all,

While I made the remote control decoding routines for NEC and Philips Remote Controls I re-used - a small - part of that code to make a decoder for the DCF77 transmitter.

This only works for people in Europe since the DCF77 signal is transmitted from Germany  and covers a big part of Europe.

In short it sends out time and date (and other) information which makes it possible to automatically synchronize the time for e.g. a  clock.

I had such a clock but it broke so I removed the DCF module and used it for making this library. 

As part of the promotion of JAL I made a video on Youtube: 

Enjoy

Kind regards,

Rob


David VB

unread,
Sep 23, 2023, 10:41:34 AM9/23/23
to jallist
Thank you Rob !     I need such a library since so long, but was too lazy (or not patient enough ;-) ) to write it !

There are several projects that I put on pause because ofthe lack of a DCF77 decoder....

THANKS !!!!!
(No enough emojis here to express my joy and gratitude ;) 

Rob CJ

unread,
Sep 23, 2023, 11:20:30 AM9/23/23
to jal...@googlegroups.com
Hi David,

Good to hear and thanks for the feedback.

If there are any issues let me know. I tested it for some time and it seems to work fine.

During one test I kept track of how often a valid DCF77 message was received. On average in 1 hour, it received about 32 valid messages. Of course you only need one to synchronize but about 50% gets lost.

One important thing I noticed. If you use the receiver too close to the other hardware (PIC microcontroller and display), the number of valid messages descreases rapidly. That's why you see the receiver on a separate breadboard in the video.  I assume this is module dependent. For the same reason I made sample files where the PIC runs at 4 MHz (you could even run it at 1 MHz since the bit-rate of the DCF77 is very low).

Good luck with your project.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens David VB <pinhe...@gmail.com>
Verzonden: zaterdag 23 september 2023 16:41
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Re: JAL Library DCF77 decoder (for JAL users in Europe)
 
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallist/4ccf46e7-5994-4265-9f2b-98e1091ad61cn%40googlegroups.com.

vasi vasi

unread,
Sep 23, 2023, 2:56:36 PM9/23/23
to jal...@googlegroups.com

David VB

unread,
Sep 24, 2023, 11:42:16 AM9/24/23
to jallist
I would not bother having 50% of the messages lost.   The DCF clocks I have here (not built by me, but bought) always need several minutes to be correctly set.   If 100% of the messages were correctly received, it should only take 2 minutes at most (First, wait for the sync signal of a new minute beginning, and then, that minute to gather all info for the current time).  
This never happens....

I suggest you make your test again during the night, when there is less EM pollution, and I am pretty sure you will see your success rate increase.....

As you say, only one message is needed to adjust your clock, so, if you have already a relatively stable oscillator for it, one update per day is already more than enough....   Program your clock to make that update once per hour for example between 1:01 AM and 5:01 AM (Doing it one minute after the hour gets you free of the logic of dealing with the DST change twice a year....)

I will definitively wake up at least one of my projects (a miniature of the Berlin clock, DCF77 driven).   But I am first busy rebuilding my new lab, and gathering the needed tools.
For example, I will try to convert Scullcom's GPS disciplined frequency reference from Arduino Nano to PIC and JAL, by making good use of the recently published Neo 6 library.... ;-)

When I'll have a good working project, I will also publish some advertisement for JAL (for example on Instructables).....

Rob CJ

unread,
Sep 24, 2023, 11:59:28 AM9/24/23
to jallist
Hi David,

Interesting.

About the GPS libary. I did indeed an update and changed a few things:
  1. I made it interrrupt driven. The previous version just waited for a signal to arrive and so your main program would 'hang' as long as the library was receiving and processing one message. This made the library bigger but I think this is better to use.
  2. I am using two different GPS strings to get the data (first I only used one).
  3. I added the GPS coordinates. I hope I did it correctly. It works with floats and you see some rounding differences compared to the original data. I wonder if I should have used float or just use a dword (and multiply the coordinate to get rid of what is behing the '.').
So if you are going to use it I am interested if 3) is working correctly for you.

I did not extract all GPS information (like speed) since I was not sure that people would need it.

Kind regards,

Rob


Verzonden: zondag 24 september 2023 17:42
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Re: JAL Library DCF77 decoder (for JAL users in Europe)
 

David VB

unread,
Sep 24, 2023, 12:20:57 PM9/24/23
to jallist
I was not going to use the coordinates.
The only info I will extract from the string are:
- If the GPS signal is locked or not (otherwise the module generates the frequency by its own means, and with less precision)
- The number of satellites connected
- and maybe time and date, just because....

On the other hand, I will, as Scullcom did, build an interface (that's what the Pic is for: LCD + keyboard), to program the GPS module to output an arbitrary frequency.   Maybe I will add to his design the possibility to store and recall several frequencies, and to change the duty cycle as well (which can be done with those modules, but was not exploited by Scullcom)00

As a proof-of-concept, I will first use such modules as frequency reference for my frequency meter and my AWG.   Only to test how well they'll work in my lab (with an active antenna, of course).

If you are interested in Scullcom's project, here is the 1st part of 4: https://youtu.be/lbns-FvpzK4?si=G9vKmqzC56GIIzXG

And his website, full of very interesting projects for the lab: http://www.scullcom.uk/ 

Rob CJ

unread,
Sep 24, 2023, 12:40:13 PM9/24/23
to jallist
Hi David,

Ah, I did not - yet - add that to the library. I am using a string that has that information (locked and number of satellites).

Maybe I will add it later.

I will have a look Scullcom's project.

Kind regards

Rob

Verzonden: zondag 24 september 2023 18:20

David VB

unread,
Sep 24, 2023, 1:01:21 PM9/24/23
to jallist
You'll see: he explains that the programming of the GPS module to output different frequencies and duty cycles is usually done with a utility program you download from u-blox website, and connect your GPS module to your PC with a USB-to-TTL converter.

Once that said, it means that you can immediatly send serial commands to the GPS module from your embedded project....

It's very simple, the code is straightforward, the hardware totally basic, and you'll get a reliable and flexible frequency reference on the cheap ! 

After that, feel free to add the needed harware to get other waveforms..... (but I will not go so far).

With the help of the following JAL libraries, the transposition of the Arduino code is very simple:
- keyboard.jal
- lcd (one of them).jal
- neo_6m. jal   (maybe adapted to another module I would use.... not decided yet)   We can work together to add the configuration functionnality, if you wish

I will also adapt the Kicad files to the new hardware (Pic based), external power supply (or rechargeable Li-Ion), and other enhancements that may still pop-up in my twisted mind ;-))
(Yes, I have a tendancy to over-engineer !)

David VB

unread,
Sep 24, 2023, 6:14:13 PM9/24/23
to jallist
By the way, where did you get your GPS modules from ?

It appears that almost all of those found on AliExpress are fake.  In fact, they are not u-blox, so they do not have the ful functionalities.  For example, the frequency of the Pulse output ca NOT be adjusted, which completely ruins the idea of using it as a clock reference.....
See this short video on how (simply) detect if the modules are real u-blox or fake ones: https://youtu.be/buyFIcgee5w?si=NT8AY6N_jgR5DCl0 

I've search a bit and usual retailer (conrad, reichelt...) sell the modules at a (too) high price (much higher than the u-blox website itself).  And I do not trust Amazon either because they do not check their sources.

It leaves me with mikroE modules, but I would prefer a less bulky module, or Mouser/Digikey that sell the bare modules for a moderate/high price, or the modues from MikroE or SparkFun (these are expensive too).....

So, all in all, where is there a reliable seller selling the u-blox modules on a small PCB with the basic needed additionnal components for RF input, and so on.... ?

If not, I could live with a bare module also.....

And, I could also go explore the product list of another manufacturer....

Other consideration:
NEO-6x is apparently obsolete nowadays.   The 10th generation has hit the market.
If I could find a module, any module, that could work without an active antenna, it would be a great asset for me.....

(Shouldn't we start a new topic for the GPS subject ?)

Rob CJ

unread,
Sep 25, 2023, 1:52:57 AM9/25/23
to jal...@googlegroups.com
Hi David,

I do not know where this module was purchased. I got it from Peter who asked for a library and since I had no GPS module he sent me one but he could tell you. I assume he follows this discussion and if not I will ask him where he got it from.

This is what my module says when you power it up:

$GPTXT,01,01,02,u-blox ag - www.u-blox.com*50
$GPTXT,01,01,02,HW  UBX-G60xx  00040007 FF7FFFFFp*53
$GPTXT,01,01,02,ROM CORE 7.03 (45969) Mar 17 2011 16:18:34*59
$GPTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*20
$GPTXT,01,01,02,ANTSTATUS=DONTKNOW*33

So not a Chinese copy?

Kind regards,

Rob



Verzonden: maandag 25 september 2023 00:14

David VB

unread,
Sep 25, 2023, 8:02:42 AM9/25/23
to jallist
The second line identifies the hardware (HW)
$GPTXT,01,01,02,HW  UBX-G60xx  00040007 FF7FFFFFp*53

It is, indeed, an authentic u-blox.   Lucky you ;-)

Hans van Veldhuizen

unread,
Sep 25, 2023, 10:54:30 AM9/25/23
to jallist
Hello,
Is this what you guys are talking about? I have been using this for 20 years with a C-Control from Conrad. This unit has two frequency inputs, one of which can be used for this antenna. Unfortunately I always had to find a good spot for it because I didn't get reception everywhere. I now use the GPS modules for all my watches and they work fine almost everywhere.
Hans
PS is this lib ok to use in other PICs?20230925_163853[1].jpg

Op maandag 25 september 2023 om 14:02:42 UTC+2 schreef David VB:

Rob CJ

unread,
Sep 25, 2023, 12:16:13 PM9/25/23
to jal...@googlegroups.com
Hi Hans,

It looks like a standard DCF receiver so it should work (not sure if there is a difference between a DCF receiver and a  DCF77 receiver).

The default of the library is to use a signal that gives a high pulse as 0 and 1 but there are receiver that have it inverted but you can switch the polarity of the library. It seems that you receiver has both outputs.

Normally you should be able to receive the DCF signal everywhere since it is often used in clocks that you have in your living room but I assume it depends on the quality of the receiver.

One of the big advantages of these receivers is the low power consumption which makes them very suitable being used in combination with a battery. A GPS module can not meet those power specifications. 

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Hans van Veldhuizen <hanz...@zeelandnet.nl>
Verzonden: maandag 25 september 2023 16:54

Zet Weeh

unread,
Sep 26, 2023, 9:00:56 AM9/26/23
to jal...@googlegroups.com
Hi David and Rob

I bought it indeed by AliExpress. Because the antenna had a short cord I bought antennas with a 2m cord. That’s working easy and…..faster. 

Kind regards
Peter 

Mijn spreuk: liever kort en goed dan te uitgebreid. 

Op 25 sep. 2023 om 07:52 heeft Rob CJ <rob...@hotmail.com> het volgende geschreven:



Zet Weeh

unread,
Sep 26, 2023, 9:07:03 AM9/26/23
to jal...@googlegroups.com
Hi David and Rob
I’m lucky too. 
If you are interested I can try to find out where I bought them. 
They were not the cheapest but also not too expensive. 
Best regards 
Peter 



Mijn spreuk: liever kort en goed dan te uitgebreid. 

Op 25 sep. 2023 om 14:02 heeft David VB <pinhe...@gmail.com> het volgende geschreven:


Reply all
Reply to author
Forward
0 new messages