Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

DCF77
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DCF77

by fenaco on Thu May 14, 2020 6:56 am

Hello,
is there an existing arduino sketch to make a clock with a dcf77 receiver and the adafruit 7segment i2c display?

fenaco
 
Posts: 3
Joined: Thu May 14, 2020 6:47 am

Re: DCF77

by mikeysklar on Thu May 14, 2020 12:08 pm

Hello fenaco,

We don't have a single sketch that includes the dcf77 receiver and 7-segment based i2c displays. However, there are some excellent sites that provide Arduino examples for the dcf77 code and we have plenty of i2c guides to work with. I'd start with these resources. Make both work indepently (dcf77 and 7-segment) and then merge your code into one.

dcf77
https://create.arduino.cc/projecthub/ed ... 2-0-c25404
https://create.arduino.cc/projecthub/ol ... mk2-aa18e7

7-segment
https://learn.adafruit.com/large-pi-bas ... -and-clock

mikeysklar
 
Posts: 1243
Joined: Mon Aug 01, 2016 8:10 pm

Re: DCF77

by fenaco on Thu May 14, 2020 12:53 pm

Thank you very much,
merging those two sketches is exactly my problem. I will try. But that can take a long time ...

fenaco
 
Posts: 3
Joined: Thu May 14, 2020 6:47 am

Re: DCF77

by ib130258 on Mon Jun 01, 2020 8:32 am

Hi, there, how are you doing with the DCF77 project?
I'm working on a DCF77 project too, but not with a 7-segment display - but I might too some day - but with nixie tubes (Dalibor Farny).
I'm like 90% on the way to complete this clock (technically/electronically) and I'm working on it since the start of march with no knowledge at all …
I knew nothing about Arduino, nor the Adafruit sensors … I had to learn it all, except programming (I have been programming for years, but not on C++). I had much time available (corona …) and I thought that I still had so many things to learn.
OK, I won't bother you with my story. The important thing to know is that you NEED to take your time to learn things, that's the fun about this. So many hurdles are already taken by companies like Adafruit (and others) and they make it possible to realize what you dream.
I recommend to learn as much as possible about DCF77, the way it works, it's history, etc... but take certainly a look at the project of Udo Klein. He has a finished and very good working library for Arduino (easy to find via Google search). That must be your starting point.
About the hardware: I strongly recommend modules of HKW (Germany) and a big antenna (as Udo says: bigger is better … in this case. They are not expensive, but they work very well together with de DCF library of Udo Klein.
And: DO NOT try to take power from the Arduino module for de DCF decoding. Rely on a external power supply of 5V. A good working power supply is worth the money … I had to fall over and step up again so many times.
I have no experience with 7-segment displays and I never worked with them. But I assume that a bit of self study on the subject will do much. The internet has so many resource available... and learning is great!

AND the most important thing: TAKE YOUR TIME, don't rush into it and you will see that it's a lot of fun!
Any questions? Don't be afraid to ask. All questions are welcome, I'll try to answer them as accurate as possible.

ib130258
 
Posts: 7
Joined: Mon Jun 01, 2020 8:09 am

Re: DCF77

by ib130258 on Mon Jun 01, 2020 8:39 am

I forgot to tell you …
I recommend NOT to start from the above mentioned sketches. They are way too complicated. You have to start drom something much easier. Like 'the simple clock' of Udo Klein.
That's what I did and up to now with succes ...

ib130258
 
Posts: 7
Joined: Mon Jun 01, 2020 8:09 am

Re: DCF77

by fenaco on Thu Jun 04, 2020 3:46 pm

Hello,

after some searching on the internet i found the fantastic work of "jurs".

DCFclockRTC.zip

It works perfectly!
My Arduino sketch looks like this:



// DCF77 and RTC test sketch by 'jurs' for Arduino forum
// hardware required:
// RTC module: DS1307 or DS3231
// DCF77 module


#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_7segment matrix = Adafruit_7segment ();

#define DEBUGMODE 0 // 1 or 0 to show or not show debug messages
#define DCFPIN 2 // data pin or DCF77 module
#define DCF_INPUTMODE INPUT // INPUT or INPUT_PULLUP
#define INVERTEDSIGNAL false // false = normal signal, true = inverted signal
#include "jursDCFtime.h"
boolean drawDots = true;
void setup () {

Serial.begin (9600);
Serial.println ("7 Segment Backpack Test");
matrix.begin (0x70);
Serial.println (F ("\ nDCF77 and RTC test sketch by 'jurs'"));
if (RTCinit ()) Serial.println (F ("RTC OK"));
else Serial.println (F ("RTC FAIL"));
pinMode (DCFPIN, DCF_INPUTMODE);
}
unsigned long lastPrintTimeMillis;

void loop () {

sTime time;
if (dcfUpdate ())
{
RTCwriteTime (lastValidDCFtime);
Serial.println ("DCF77 TIME TELEGRAM RECEIVED!");
}

tmElements_t tm;

if (RTC.read (tm)) {
int displayValue = tm.Hour * 100 + tm.Minute;
if (tm.Hour <= 24)
{
matrix.println (displayValue, DEC);
matrix.writeDisplay ();
Serial.println (displayValue);
uint16_t counter = 0;
boolean drawDots = true;
}
}
matrix.drawColon (drawDots);
matrix.writeDisplay ();
}


Thanks to Jurs, who did 99% of the work !!!

Kind regards
fenaco

fenaco
 
Posts: 3
Joined: Thu May 14, 2020 6:47 am

Re: DCF77

by ib130258 on Thu Jun 04, 2020 5:20 pm

Hi,

This looks pretty neat.
Good to hear that your sketch is working fine. Succes with the rest of the build!

I'll take a look at the DCF77 part. This library is new to me. Perhaps I'll use it too for my project.

Thank you and enjoy!
Ivan

ib130258
 
Posts: 7
Joined: Mon Jun 01, 2020 8:09 am

Please be positive and constructive with your questions and comments.