Sysadmin > ArdUino > ArduinoDCF77

DCF77 with Arduino

#define BLINKPIN 13
#define DCF77PIN 2

int prevSensorValue=0;
  
void setup() {
  Serial.begin(9600);
  pinMode(DCF77PIN, INPUT);
  pinMode(13, OUTPUT);
  Serial.println("0ms       100ms     200ms     300ms     400ms     500ms     600ms     700ms     800ms     900ms     1000ms    1100ms    1200ms");
}

void loop() {
  int sensorValue = digitalRead(2);
  if (sensorValue==1 && prevSensorValue==0) { Serial.println("");   }
  digitalWrite(BLINKPIN, sensorValue);
  Serial.print(sensorValue);   
  prevSensorValue = sensorValue;
  delay(10);
}

produces for example the output

11111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000

Example 2

Attention - do not use your Computer with Power Adapter! Just use your Laptop with Battery - i get no signal with Power Adapter

/**
 * Arduino DCF77 decoder v0.2
 * Copyright (C) 2006 Mathias Dalheimer (md@gonium.net)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

 #include <MsTimer2.h>

/**
 * Where is the DCF receiver connected?
 */
#define DCF77PIN 2
/**
 * Where is the LED connected?
 */
#define BLINKPIN 13
/**
 * Turn debugging on or off
 */
#define DCF_DEBUG 1
/**
 * Number of milliseconds to elapse before we assume a "1",
 * if we receive a falling flank before - its a 0.
 */
#define DCF_split_millis 140
/**
 * There is no signal in second 59 - detect the beginning of
 * a new minute.
 */
#define DCF_sync_millis 1200
/**
 * Definitions for the timer interrupt 2 handler:
 * The Arduino runs at 16 Mhz, we use a prescaler of 64 -> We need to
 * initialize the counter with 6. This way, we have 1000 interrupts per second.
 * We use tick_counter to count the interrupts.
 */
#define INIT_TIMER_COUNT 6
#define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT
int tick_counter = 0;
/**
 * DCF time format struct
 */
struct DCF77Buffer {
  unsigned long long prefix   :21;
  unsigned long long Min   :7;   // minutes
  unsigned long long P1      :1;   // parity minutes
  unsigned long long Hour   :6;   // hours
  unsigned long long P2      :1;   // parity hours
  unsigned long long Day   :6;   // day
  unsigned long long Weekday   :3;   // day of week
  unsigned long long Month   :5;   // month
  unsigned long long Year   :8;   // year (5 -> 2005)
  unsigned long long P3      :1;   // parity
};
struct {
   unsigned char parity_flag   :1;
   unsigned char parity_min      :1;
   unsigned char parity_hour   :1;
   unsigned char parity_date   :1;
} flags;
/**
 * Clock variables
 */
volatile unsigned char DCFSignalState = 0;  
unsigned char previousSignalState;
int previousFlankTime;
int bufferPosition;
unsigned long long dcf_rx_buffer;
/**
 * time vars: the time is stored here!
 */
volatile unsigned char ss;
volatile unsigned char mm;
volatile unsigned char hh;
volatile unsigned char day;
volatile unsigned char mon;
volatile unsigned int year;
    

/**
 * used in main loop: detect a new second...
 */
unsigned char previousSecond;
    
/**
* Initialize the DCF77 routines: initialize the variables,
* configure the interrupt behaviour.
*/
void DCF77Init() {
previousSignalState=0;
previousFlankTime=0;
bufferPosition=0;
dcf_rx_buffer=0;
ss=mm=hh=day=mon=year=0;
#ifdef DCF_DEBUG
Serial.println("Initializing DCF77 routines");
Serial.print("Using DCF77 pin #");
Serial.println(DCF77PIN);
#endif
pinMode(BLINKPIN, OUTPUT);
pinMode(DCF77PIN, INPUT);

#ifdef DCF_DEBUG
Serial.println("Initializing timerinterrupt");
#endif
MsTimer2::set(1000, advanceClock); // 500ms period

#ifdef DCF_DEBUG
Serial.println("Initializing DCF77 signal listener interrupt");
#endif
attachInterrupt(0, int0handler, CHANGE);
}

/**
 * Append a signal to the dcf_rx_buffer. Argument can be 1 or 0. An internal
 * counter shifts the writing position within the buffer. If position > 59,
 * a new minute begins -> time to call finalizeBuffer().
 */
void appendSignal(unsigned char signal) {
#ifdef DCF_DEBUG
  Serial.print(", appending value ");
  Serial.print(signal, DEC);
  Serial.print(" at position ");
  Serial.println(bufferPosition);
#endif
  dcf_rx_buffer = dcf_rx_buffer | ((unsigned long long) signal << bufferPosition);
  // Update the parity bits. First: Reset when minute, hour or date starts.
  if (bufferPosition ==  21 || bufferPosition ==  29 || bufferPosition ==  36) {
   flags.parity_flag = 0;
  }
  // save the parity when the corresponding segment ends
  if (bufferPosition ==  28) {flags.parity_min = flags.parity_flag;};
  if (bufferPosition ==  35) {flags.parity_hour = flags.parity_flag;};
  if (bufferPosition ==  58) {flags.parity_date = flags.parity_flag;};
  // When we received a 1, toggle the parity flag
  if (signal == 1) {
    flags.parity_flag = flags.parity_flag ^ 1;
  }
  bufferPosition++;
  if (bufferPosition > 59) {
    finalizeBuffer();
  }
}

/**
 * Evaluates the information stored in the buffer. This is where the DCF77
 * signal is decoded and the internal clock is updated.
 */
void finalizeBuffer(void) {
  if (bufferPosition == 59) {
#ifdef DCF_DEBUG
    Serial.println("Finalizing Buffer");
#endif
    struct DCF77Buffer *rx_buffer;
    rx_buffer = (struct DCF77Buffer *)(unsigned long long)&dcf_rx_buffer;
    if (flags.parity_min == rx_buffer->P1  &&
     flags.parity_hour == rx_buffer->P2  &&
     flags.parity_date == rx_buffer->P3)
    {
#ifdef DCF_DEBUG
   Serial.println("Parity check OK - updating time.");
#endif
   //convert the received bits from BCD
   mm = rx_buffer->Min-((rx_buffer->Min/16)*6);
   hh = rx_buffer->Hour-((rx_buffer->Hour/16)*6);
   day= rx_buffer->Day-((rx_buffer->Day/16)*6);
   mon= rx_buffer->Month-((rx_buffer->Month/16)*6);
   year= 2000 + rx_buffer->Year-((rx_buffer->Year/16)*6);
    }
#ifdef DCF_DEBUG
   else {
     Serial.println("Parity check NOK - running on internal clock.");
    }
#endif
  serialDumpTime();
  }
  // reset stuff
  ss = 0;
  bufferPosition = 0;
  dcf_rx_buffer=0;
}

/**
 * Dump the time to the serial line.
 */
void serialDumpTime(void){
  Serial.print("Time: ");
  Serial.print(hh, DEC);
  Serial.print(":");
  Serial.print(mm, DEC);
  Serial.print(":");
  Serial.print(ss, DEC);
  Serial.print(" Date: ");
  Serial.print(day, DEC);
  Serial.print(".");
  Serial.print(mon, DEC);
  Serial.print(".");
  Serial.println(year, DEC);
}


/**
 * Evaluates the signal as it is received. Decides whether we received
 * a "1" or a "0" based on the
 */
void scanSignal(void){
    if (DCFSignalState == 1) {
   int thisFlankTime=millis();
   if (thisFlankTime - previousFlankTime > DCF_sync_millis) {
#ifdef DCF_DEBUG
     Serial.println("####");
     Serial.println("#### Begin of new Minute!!!");
     Serial.println("####");
#endif
     finalizeBuffer();
   }
   previousFlankTime=thisFlankTime;
#ifdef DCF_DEBUG
   Serial.print(previousFlankTime);
   Serial.print(": DCF77 Signal detected, ");
#endif
    }
    else {
   /* or a falling flank */
   int difference=millis() - previousFlankTime;
#ifdef DCF_DEBUG
   Serial.print("duration: ");
   Serial.print(difference);
#endif
   if (difference < DCF_split_millis) {
     appendSignal(0);
   }
   else {
     appendSignal(1);
   }
    }
}

/**
* The interrupt routine for counting seconds – increment hh:mm:ss.
*/
void advanceClock() {
ss++;
if (ss==60) {
ss=0;
mm++;
if (mm==60) {
mm=0;
hh++;
if (hh==24)
hh=0;
}
}
}

/**
* Interrupthandler for INT0 – called when the signal on Pin 2 changes.
*/
void int0handler() {
int length = millis() - previousFlankTime;
if (length < 10) {
// ignore jitter
return;
}
// check the value again – since it takes some time to
// activate the interrupt routine, we get a clear signal.
DCFSignalState = digitalRead(DCF77PIN);
}


/**
 * Standard Arduino methods below.
 */

void setup(void) {
  // We need to start serial here again,
  // for Arduino 007 (new serial code)
  Serial.begin(9600);
  DCF77Init();
}

void loop(void) {
  if (ss != previousSecond) {
    serialDumpTime();
    previousSecond = ss;
  }
  if (DCFSignalState != previousSignalState) {
    scanSignal();
    if (DCFSignalState) {
   digitalWrite(BLINKPIN, HIGH);
    } else {
   digitalWrite(BLINKPIN, LOW);
    }
    previousSignalState = DCFSignalState;
  }
    //delay(20);
} 

Output

Initializing DCF77 routines
Using DCF77 pin #2
Initializing timerinterrupt
Initializing DCF77 signal listener interrupt
Initializing DCF77 routines
Using DCF77 pin #2
Initializing timerinterrupt
Initializing DCF77 signal listener interrupt
####
#### Begin of new Minute!!!
####
10805: DCF77 Signal detected, duration: 1383, appending value 1 at position 0
####
#### Begin of new Minute!!!
####
12550: DCF77 Signal detected, duration: 31, appending value 0 at position 0
13548: DCF77 Signal detected, duration: 591, appending value 1 at position 1
14471: DCF77 Signal detected, duration: 32, appending value 0 at position 2
14760: DCF77 Signal detected, duration: 135, appending value 0 at position 3
15136: DCF77 Signal detected, duration: 336, appending value 1 at position 4
####
#### Begin of new Minute!!!
####
-27093: DCF77 Signal detected, duration: 139, appending value 0 at position 0
-26126: DCF77 Signal detected, duration: 87, appending value 0 at position 1
-25139: DCF77 Signal detected, duration: 106, appending value 0 at position 2
-24140: DCF77 Signal detected, duration: 207, appending value 1 at position 3
-23136: DCF77 Signal detected, duration: 106, appending value 0 at position 4
-22143: DCF77 Signal detected, duration: 108, appending value 0 at position 5
-21141: DCF77 Signal detected, duration: 210, appending value 1 at position 6
-20133: DCF77 Signal detected, duration: 199, appending value 1 at position 7
-19134: DCF77 Signal detected, duration: 105, appending value 0 at position 8
-18146: DCF77 Signal detected, duration: 209, appending value 1 at position 9
-17142: DCF77 Signal detected, duration: 109, appending value 0 at position 10
-16137: DCF77 Signal detected, duration: 108, appending value 0 at position 11
-15137: DCF77 Signal detected, duration: 103, appending value 0 at position 12
-14131: DCF77 Signal detected, duration: 95, appending value 0 at position 13
-13141: DCF77 Signal detected, duration: 100, appending value 0 at position 14
-12140: DCF77 Signal detected, duration: 110, appending value 0 at position 15
-11140: DCF77 Signal detected, duration: 106, appending value 0 at position 16
-10140: DCF77 Signal detected, duration: 98, appending value 0 at position 17
-9139: DCF77 Signal detected, duration: 107, appending value 0 at position 18
-8133: DCF77 Signal detected, duration: 102, appending value 0 at position 19
-7136: DCF77 Signal detected, duration: 105, appending value 0 at position 20
-6129: DCF77 Signal detected, duration: 100, appending value 0 at position 21
-5137: DCF77 Signal detected, duration: 107, appending value 0 at position 22
-4130: DCF77 Signal detected, duration: 101, appending value 0 at position 23
-3134: DCF77 Signal detected, duration: 115, appending value 0 at position 24
-2132: DCF77 Signal detected, duration: 203, appending value 1 at position 25
-1132: DCF77 Signal detected, duration: 111, appending value 0 at position 26
-131: DCF77 Signal detected, duration: 206, appending value 1 at position 27
861: DCF77 Signal detected, duration: 123, appending value 0 at position 28
1861: DCF77 Signal detected, duration: 106, appending value 0 at position 29
2867: DCF77 Signal detected, duration: 199, appending value 1 at position 30
3867: DCF77 Signal detected, duration: 106, appending value 0 at position 31
4871: DCF77 Signal detected, duration: 197, appending value 1 at position 32
5866: DCF77 Signal detected, duration: 96, appending value 0 at position 33
5974: DCF77 Signal detected, duration: 95, appending value 0 at position 34
6865: DCF77 Signal detected, duration: 101, appending value 0 at position 35
7869: DCF77 Signal detected, duration: 103, appending value 0 at position 36
8866: DCF77 Signal detected, duration: 104, appending value 0 at position 37
9861: DCF77 Signal detected, duration: 213, appending value 1 at position 38
10869: DCF77 Signal detected, duration: 117, appending value 0 at position 39
11860: DCF77 Signal detected, duration: 115, appending value 0 at position 40
12876: DCF77 Signal detected, duration: 197, appending value 1 at position 41
13864: DCF77 Signal detected, duration: 111, appending value 0 at position 42
14867: DCF77 Signal detected, duration: 111, appending value 0 at position 43
15868: DCF77 Signal detected, duration: 119, appending value 0 at position 44
16866: DCF77 Signal detected, duration: 206, appending value 1 at position 45
####
#### Begin of new Minute!!!
####
18867: DCF77 Signal detected, duration: 107, appending value 0 at position 0
19871: DCF77 Signal detected, duration: 203, appending value 1 at position 1
20870: DCF77 Signal detected, duration: 206, appending value 1 at position 2
21869: DCF77 Signal detected, duration: 100, appending value 0 at position 3
22873: DCF77 Signal detected, duration: 198, appending value 1 at position 4
23870: DCF77 Signal detected, duration: 97, appending value 0 at position 5
24870: DCF77 Signal detected, duration: 206, appending value 1 at position 6
25869: DCF77 Signal detected, duration: 109, appending value 0 at position 7
26870: DCF77 Signal detected, duration: 96, appending value 0 at position 8
27864: DCF77 Signal detected, duration: 114, appending value 0 at position 9
28872: DCF77 Signal detected, duration: 208, appending value 1 at position 10
29870: DCF77 Signal detected, duration: 203, appending value 1 at position 11
30865: DCF77 Signal detected, duration: 211, appending value 1 at position 12
31869: DCF77 Signal detected, duration: 205, appending value 1 at position 13
-32671: DCF77 Signal detected, duration: 212, appending value 1 at position 14
-31668: DCF77 Signal detected, duration: 102, appending value 0 at position 15
-30662: DCF77 Signal detected, duration: 102, appending value 0 at position 16
-29666: DCF77 Signal detected, duration: 206, appending value 1 at position 17
-28659: DCF77 Signal detected, duration: 99, appending value 0 at position 18
-27668: DCF77 Signal detected, duration: 108, appending value 0 at position 19
-26656: DCF77 Signal detected, duration: 195, appending value 1 at position 20
-25670: DCF77 Signal detected, duration: 114, appending value 0 at position 21
-24666: DCF77 Signal detected, duration: 208, appending value 1 at position 22
-23663: DCF77 Signal detected, duration: 199, appending value 1 at position 23
-22661: DCF77 Signal detected, duration: 107, appending value 0 at position 24
-21664: DCF77 Signal detected, duration: 103, appending value 0 at position 25
-20666: DCF77 Signal detected, duration: 97, appending value 0 at position 26
-19663: DCF77 Signal detected, duration: 101, appending value 0 at position 27
-18660: DCF77 Signal detected, duration: 104, appending value 0 at position 28
-17660: DCF77 Signal detected, duration: 105, appending value 0 at position 29
-16667: DCF77 Signal detected, duration: 101, appending value 0 at position 30
-15664: DCF77 Signal detected, duration: 104, appending value 0 at position 31
-14667: DCF77 Signal detected, duration: 108, appending value 0 at position 32
-13659: DCF77 Signal detected, duration: 110, appending value 0 at position 33
-12662: DCF77 Signal detected, duration: 104, appending value 0 at position 34
-11668: DCF77 Signal detected, duration: 116, appending value 0 at position 35
-10662: DCF77 Signal detected, duration: 102, appending value 0 at position 36
-9667: DCF77 Signal detected, duration: 103, appending value 0 at position 37
-8657: DCF77 Signal detected, duration: 101, appending value 0 at position 38
-7662: DCF77 Signal detected, duration: 204, appending value 1 at position 39
-6662: DCF77 Signal detected, duration: 112, appending value 0 at position 40
-5664: DCF77 Signal detected, duration: 208, appending value 1 at position 41
-4664: DCF77 Signal detected, duration: 110, appending value 0 at position 42
-3660: DCF77 Signal detected, duration: 105, appending value 0 at position 43
-2661: DCF77 Signal detected, duration: 204, appending value 1 at position 44
-1662: DCF77 Signal detected, duration: 110, appending value 0 at position 45
-662: DCF77 Signal detected, duration: 207, appending value 1 at position 46
333: DCF77 Signal detected, duration: 207, appending value 1 at position 47
1341: DCF77 Signal detected, duration: 96, appending value 0 at position 48
2334: DCF77 Signal detected, duration: 114, appending value 0 at position 49
3341: DCF77 Signal detected, duration: 99, appending value 0 at position 50
4338: DCF77 Signal detected, duration: 206, appending value 1 at position 51
5342: DCF77 Signal detected, duration: 100, appending value 0 at position 52
6337: DCF77 Signal detected, duration: 108, appending value 0 at position 53
7337: DCF77 Signal detected, duration: 207, appending value 1 at position 54
8341: DCF77 Signal detected, duration: 104, appending value 0 at position 55
9336: DCF77 Signal detected, duration: 112, appending value 0 at position 56
10338: DCF77 Signal detected, duration: 107, appending value 0 at position 57
11337: DCF77 Signal detected, duration: 210, appending value 1 at position 58
####
#### Begin of new Minute!!!
####
Finalizing Buffer
Parity check OK - updating time.
13342: DCF77 Signal detected, duration: 105, appending value 0 at position 0
14338: DCF77 Signal detected, duration: 109, appending value 0 at position 1
15340: DCF77 Signal detected, duration: 204, appending value 1 at position 2
16343: DCF77 Signal detected, duration: 101, appending value 0 at position 3
17338: DCF77 Signal detected, duration: 106, appending value 0 at position 4
18342: DCF77 Signal detected, duration: 103, appending value 0 at position 5
19341: DCF77 Signal detected, duration: 204, appending value 1 at position 6
20342: DCF77 Signal detected, duration: 210, appending value 1 at position 7
21342: DCF77 Signal detected, duration: 107, appending value 0 at position 8
22338: DCF77 Signal detected, duration: 109, appending value 0 at position 9
23346: DCF77 Signal detected, duration: 105, appending value 0 at position 10
24342: DCF77 Signal detected, duration: 108, appending value 0 at position 11
25345: DCF77 Signal detected, duration: 103, appending value 0 at position 12
26344: DCF77 Signal detected, duration: 205, appending value 1 at position 13
27343: DCF77 Signal detected, duration: 206, appending value 1 at position 14
28339: DCF77 Signal detected, duration: 110, appending value 0 at position 15
29341: DCF77 Signal detected, duration: 109, appending value 0 at position 16
30344: DCF77 Signal detected, duration: 201, appending value 1 at position 17
31345: DCF77 Signal detected, duration: 104, appending value 0 at position 18
32342: DCF77 Signal detected, duration: 109, appending value 0 at position 19
-32189: DCF77 Signal detected, duration: 200, appending value 1 at position 20
-31194: DCF77 Signal detected, duration: 205, appending value 1 at position 21
-30194: DCF77 Signal detected, duration: 207, appending value 1 at position 22
-29194: DCF77 Signal detected, duration: 206, appending value 1 at position 23
-28191: DCF77 Signal detected, duration: 104, appending value 0 at position 24
-27195: DCF77 Signal detected, duration: 111, appending value 0 at position 25
-26193: DCF77 Signal detected, duration: 107, appending value 0 at position 26
-25191: DCF77 Signal detected, duration: 108, appending value 0 at position 27
-24194: DCF77 Signal detected, duration: 207, appending value 1 at position 28
-23193: DCF77 Signal detected, duration: 109, appending value 0 at position 29
-22193: DCF77 Signal detected, duration: 111, appending value 0 at position 30
-21192: DCF77 Signal detected, duration: 106, appending value 0 at position 31
-20193: DCF77 Signal detected, duration: 108, appending value 0 at position 32
-19192: DCF77 Signal detected, duration: 107, appending value 0 at position 33
-18189: DCF77 Signal detected, duration: 109, appending value 0 at position 34
-17189: DCF77 Signal detected, duration: 102, appending value 0 at position 35
-16191: DCF77 Signal detected, duration: 106, appending value 0 at position 36
-15189: DCF77 Signal detected, duration: 103, appending value 0 at position 37
-14193: DCF77 Signal detected, duration: 110, appending value 0 at position 38
-13193: DCF77 Signal detected, duration: 210, appending value 1 at position 39
-12189: DCF77 Signal detected, duration: 106, appending value 0 at position 40
-11189: DCF77 Signal detected, duration: 203, appending value 1 at position 41
-10191: DCF77 Signal detected, duration: 105, appending value 0 at position 42
-9186: DCF77 Signal detected, duration: 103, appending value 0 at position 43
-8186: DCF77 Signal detected, duration: 203, appending value 1 at position 44
-7189: DCF77 Signal detected, duration: 103, appending value 0 at position 45
-6192: DCF77 Signal detected, duration: 209, appending value 1 at position 46
-5186: DCF77 Signal detected, duration: 202, appending value 1 at position 47
-4189: DCF77 Signal detected, duration: 106, appending value 0 at position 48
-3189: DCF77 Signal detected, duration: 104, appending value 0 at position 49
-2186: DCF77 Signal detected, duration: 104, appending value 0 at position 50
-1189: DCF77 Signal detected, duration: 206, appending value 1 at position 51
-189: DCF77 Signal detected, duration: 106, appending value 0 at position 52
811: DCF77 Signal detected, duration: 109, appending value 0 at position 53
1809: DCF77 Signal detected, duration: 209, appending value 1 at position 54
2813: DCF77 Signal detected, duration: 108, appending value 0 at position 55
3812: DCF77 Signal detected, duration: 106, appending value 0 at position 56
4808: DCF77 Signal detected, duration: 113, appending value 0 at position 57
5814: DCF77 Signal detected, duration: 207, appending value 1 at position 58
####
#### Begin of new Minute!!!
####
Finalizing Buffer
Parity check OK - updating time.
7812: DCF77 Signal detected, duration: 107, appending value 0 at position 0
8815: DCF77 Signal detected, duration: 111, appending value 0 at position 1
9809: DCF77 Signal detected, duration: 209, appending value 1 at position 2
10814: DCF77 Signal detected, duration: 106, appending value 0 at position 3
11813: DCF77 Signal detected, duration: 203, appending value 1 at position 4
12815: DCF77 Signal detected, duration: 104, appending value 0 at position 5
13813: DCF77 Signal detected, duration: 207, appending value 1 at position 6
14817: DCF77 Signal detected, duration: 204, appending value 1 at position 7
15809: DCF77 Signal detected, duration: 211, appending value 1 at position 8
####
#### Begin of new Minute!!!
####
17881: DCF77 Signal detected, duration: 16, appending value 0 at position 0
18253: DCF77 Signal detected, duration: 586, appending value 1 at position 1
18841: DCF77 Signal detected, duration: 34, appending value 0 at position 2
18952: DCF77 Signal detected, duration: 924, appending value 1 at position 3
19895: DCF77 Signal detected, duration: 44, appending value 0 at position 4
19940: DCF77 Signal detected, 20855: DCF77 Signal detected, duration: 104, appending value 0 at position 5
20975: DCF77 Signal detected, duration: 866, appending value 1 at position 6
21844: DCF77 Signal detected, 

The last two minutes with Power Adapter!