DCF77 module doesn't get any signal

I've connected my DCF77 module to my Arduino Nano at PIN 2 and try to get a signal with it. Unfortunately the module won't get any signal after more than half an hour.
Here's my code:

#include <DCF77.h>       //https://github.com/thijse/Arduino-Libraries/downloads
#include <TimeLib.h>        //http://www.arduino.cc/playground/Code/Time
#include <Timezone.h>    //https://github.com/JChristensen/Timezone

#define DCF_PIN 2	         // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0		 // Interrupt number associated with pin

// more time zones, see  http://en.wikipedia.org/wiki/Time_zones_of_Europe
//United Kingdom (London, Belfast)
const TimeChangeRule rBST = {"BST", Last, Sun, Mar, 1, 60};        //British Summer Time
const TimeChangeRule rGMT = {"GMT", Last, Sun, Oct, 2, 0};         //Standard Time
const Timezone UK(rBST, rGMT);

//Eastern European Time (Finland, Greece, etc)
const TimeChangeRule rEST = {"EST", Last, Sun, Mar, 1, 180};      //Eastern European Time
const TimeChangeRule rEET = {"EET", Last, Sun, Oct, 1, 120};      //Eastern European Summer Time
const Timezone EET(rEST, rEET);


time_t prevDisplay = 0;          // when the digital clock was displayed
time_t time;
const DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);


void setup() {
  Serial.begin(9600); 
  DCF.Start();
  setSyncInterval(30); 
  setSyncProvider(getDCFTime);
  // It is also possible to directly use DCF.getTime, but this function gives a bit of feedback
  //setSyncProvider(DCF.getTime);

  Serial.println("Waiting for DCF77 UK local time ... ");
  Serial.println("It will take at least 2 minutes until a first update can be processed.");
  while(timeStatus()== timeNotSet) { 
     // wait until the time is set by the sync provider     
     Serial.print(".");
     delay(2000);
  }
}


void loop()
{  
  if( now() != prevDisplay) //update the display only if the time has changed
  {
    prevDisplay = now();
    digitalClockDisplay();  
  }
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.println("");
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 
}

void printDigits(const uint8_t &digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

unsigned long getDCFTime()
{ 
  const time_t DCFtime = DCF.getUTCTime(); // Convert from UTC
  
  if (DCFtime!=0) {
    Serial.print("X");    // Indicator that a time check is done
    const time_t LocalTime = UK.toLocal(DCFtime);
    return LocalTime;
  }
  return 0;
}

Does anyone know how I'm able to get any signal?

Hello shuzo
Take a view here.

Yes, I have already looked at this article and since I live in Germany and there are less than 2000km between Mainflingen and my home, the receiver should receive the signal without problems, but this is not the case.

Hello

DCF77 is online.

grafik

In this case check all connections especially the connetion of the antenna.

What DCF77 kit do you use?

Are you sitting in the cellar ?

Did you connect it to a 3.3V (max) power source?

Yes, just used the one on the Nano board.

I had some problems with one of these (maybe the same) modules too. None of the standard libraries seemed to work, so I ended up writing my own library which uses analogRead to read the signal.

Perhaps you could use parts of this idea for debugging purposes. What do you see when you connect the module output to one of the analog pins and write the output of analogRead to the serial device?

There are alternative libraries by Udo Klein but the decoder is specifically for processor with quartz hi-stab clocks. However I think (IIRC) he also provides some test tools that could help you diagnose your problem, some of which I have used successfully.

Also you may need a pullup resistor in the module output.

Do you have an oscilloscope?

One thing to beware of is that if the module is near your Arduino board the wanted signal will probably be swamped by clock hash from the latter. 2 metres of twisted 3-wire may help!

Before you even start with a library, you can use a very simple sketch to see if there is any activity.
Simply poll the pin to which the module is connected. If the pin is high switch a led high. if low, switch the led low.
With those Pollin modules, you have to connect the pin marked PON to ground to activate the module.
One issue with using a library is to be able to define if the signal from the DCF module is inverted or not. There are unfortunately various definitions of inversion.

Well, it finally works somehow... I missed to give it a negative slope at the PON pin, but after a few times it stops receiving data.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.