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.
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?
The datasheet says maximum current 5uA. With a 10k pullup you draw 500uA. You are overloading it. You should try a 1M resistor.
Actually the datasheets states an output current > 5µA, but i will try a 1M resistor. Maybe it works. It won't hurt anyway
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.
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
Maybe you already killed the module. I am using this one: http://www.voelkner.de/products/162756/Dcf-Empfaengerplatine.html
Conrad and Völkner are different brands of the same company. They just address different market segments. See here: Conrad Electronic – Wikipedia
Didn't know that. Anyway the price is the same.
mrTee:
A little later than expected, the library now supports inverted pulses as input.The constructor now has an optional parameter OnRisingFlank:
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
Hello after downloading the DCF77 lib (including Time and TimeZone) I keep getting the following errors:
Build options changed, rebuilding all
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::finalizeBuffer()':
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:160:25: error: 'now' was not declared in this scope
filledTimestamp = now();
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::receivedTimeUpdate()':
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:189:50: error: 'now' was not declared in this scope
time_t processedTime = latestupdatedTime + (now() - processingTimestamp);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:197:20: error: 'SECS_PER_MIN' was not declared in this scope
if(difference < 2*SECS_PER_MIN) {
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:209:25: error: 'SECS_PER_MIN' was not declared in this scope
if(shiftDifference < 2*SECS_PER_MIN) {
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::processBuffer()':
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:271:2: error: 'tmElements_t' was not declared in this scope
tmElements_t time;
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:284:12: error: request for member 'Second' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
time.Second = 0;
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:285:9: error: request for member 'Minute' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
time.Minute = rx_buffer->Min-((rx_buffer->Min/16)*6);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:286:12: error: request for member 'Hour' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
time.Hour = rx_buffer->Hour-((rx_buffer->Hour/16)*6);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:287:12: error: request for member 'Day' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
time.Day = rx_buffer->Day-((rx_buffer->Day/16)*6);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:288:12: error: request for member 'Month' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
time.Month = rx_buffer->Month-((rx_buffer->Month/16)*6);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:289:12: error: request for member 'Year' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
time.Year = 2000 + rx_buffer->Year-((rx_buffer->Year/16)*6) -1970;
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:290:37: error: 'makeTime' was not declared in this scope
latestupdatedTime = makeTime(time);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getTime()':
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:310:48: error: 'now' was not declared in this scope
time_t currentTime =latestupdatedTime + (now() - processingTimestamp);
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getUTCTime()':
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:325:42: error: 'SECS_PER_HOUR' was not declared in this scope
int UTCTimeDifference = (CEST ? 2 : 1)*SECS_PER_HOUR;
^
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:326:68: error: 'now' was not declared in this scope
time_t currentTime =latestupdatedTime - UTCTimeDifference + (now() - processingTimestamp);
^
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
for just this code:
#include "DCF77.h"
#include "Time.h"
char time_s[9];
char date_s[11];
#define DCF_PIN 2 // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0 // Interrupt number associated with pin
time_t t;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);
void setup() {
Serial.begin(9600);
DCF.Start();
Serial.println("Warte auf Zeitsignal ... ");
Serial.println("Dies kann 2 oder mehr Minuten dauern.");
}
void loop() {
}
Any suggestions would be greatly appreciated!
Try:
#include <TimeLib.h>
Instead of:
#include "Time.h"
Hi, unfortunately I don't have the timeLib.h file, there is only time.h in the appropriate Time lib folder... Where do I get it?
regards
found it, thanks!
Hi, my name is Mateusz and I'm from west part of Poland, so distortions in signal I received is not bad. Thank you for your library!
My question is, How can I print on lcd or maybe just serial monitor parity bits of DCF77 signal? I have got built a prototype of DCF77 clock and I want to add some gadgets to it.
Thanks and regards!
The format of the signal is described here and includes the parity bits:
I guess when you say you want to print the parity bits, you mean you want to print if the parity bit check passed or failed.
CEST/CET timezones (bit 17 and 18) can also be used as a check. These bits cannot be equal.
6v6gt:
I guess when you say you want to print the parity bits, you mean you want to print if the parity bit check passed or failed.
Exactly!
I want to checks every parity bit in signal (P1, P2, P3 and maybe "S" bit too [yes I know S bit is not a parity bit]) and display it on lcd by
if (parityBitP1 == 1) {
lcd.print("1");
}
if (parityBitP2 == 1) ...
But I can't write program that will do this because I don't know how.
Can someone help me with that? I don't even know how to start writing this code...
You have got the code linked in the OP http://thijs.elenbaas.net/downloads/?did=1 installed and working ?
The parity checking is done here:
// Check parities
if (flags.parityMin == rx_buffer->P1 &&
flags.parityHour == rx_buffer->P2 &&
flags.parityDate == rx_buffer->P3 &&
rx_buffer->CEST != rx_buffer->CET)
{
. . .
// parity ok
}
else {
. . .
// parity check failed
}
So, for example, flags.parityMin is the parity pit for Minutes calculated from this bits received in the data stream from the DCF transmitter.
rx_buffer->P1 is the actual parity bit received in the data stream from the DCF transmitter.
Clearly, if the calculated and actual parity bits don't match, there is a parity error.
From that, you should be able to find something to print to the LCD screen.