DCF77 master clock MK2 using Arduino

DCF77 master clock MK2

Features

Arduino 328 Microprocessor is used to decode and display Time & date from the DCF77 “Atomic” Clock in Mainflingen near Frankfurt Germany

The DCF77 signal is decoded using the fantastic new DCF77 library written by Udo Klein meaning the clock stays in sync and keeps perfect even with a massive amount of noise on the received DCF77 signal

Udo Klein’s DCF77 library continually “Auto Tunes” the quartz crystal so in the rare event the signal can’t be decoded the clock remains accurate within 1 sec over many days

The clock provides the following pulses to drive slave clocks 1 sec alternating, 30 sec, 1 min , 1 hour, 24 hr, 15 min chime of quarter hours, hourly chime of hours

Primary display of time in hours, minutes & seconds are displayed on 1″ (26mm) green LED 7 segment displays

Secondary 4×20 I2C LCD display is used to display time & date, fast or slow seconds, summer winter correction, display brightness, sync information, signal quality, auto tune’d frequency, auto tuned quartz accuracy and summer winter time mode

The primary and secondary displays are auto dimmed using and LDR and Pulse Width Modulation

The primary and secondary displays are shutdown during daytime and are activated by Passive Infrared detection when the clock detects someone entering the room

Manually triggered automatic Summer/Winter time correction of 30 second slave clocks

Blue-Tooth link for programming, clock pulse status and PIR adjusting

Auto leap second adjustment of 30 second slave and 1 second slave clocks time and date of leap second can be read via Blue-tooth on your PC or Android mobile or tablet

Recording of fast or slow 1 second slave clock pulses on the LCD display as well as time and date stamping of last fast or slow pulse accessible by Blue-Tooth on your PC or Android mobile or tablet

DCF77 master clock MK2

Design

I designed and built my old Master Clock see photos below in 2004 using a 32.768KHz quartz crystal and logic chips to display the time and derive the pulses to drive all my slave clocks. It also has a DCF77 decoder board that again uses logic chips to decode the DCF77 signal and get a 1 second synchronising pulse to keep the clock on time. The technology used in this clock was actually out of date when I built it as I used the technology I had leant about at college in the late 1970’s.  I soon found out from comments that no one really used logic chips for this sort of thing anymore and why had I not used a Microprocessor?

After a few years I gave microprocessors a try by building a PIC Microprocessor based  Calendar Slave  using Oshon Soft Basic , a Meter Clock using Picbasic Pro v3 and a DCF77 Master Bracket Clock using an Arduino 328.

I decided to use Arduino to control my new Master as it seemed tailor made for my basic programming skills as most of the complicated work is done by the people who design and then share the libraries. Arduino is very well supported hardware wise and many complete parts can be purchased ready built as building block for projects.

A MAX7219 drives the primary display, a 4×20 I2C LCD is used for the secondary these help keeping wiring and Arduino 328 pin use to a minimum.

I kept the same type of Oak case used in my old master Clock as it fitted 6 x 1″ 7 segment displays perfectly and gave me space to fit in all the other modules.

I have used a PIR module for display shutdown/wakeup with it’s own timer and sensitivity adjustment as this uses only 1 pin of the Arduino 328.

EZ Link Bluetooth Serial Board module enables me to program the clock and read data from it remotely from my desktop PC.

Arduino Libraries Used

dcf77.h this Library is the heart of the clock. This outstanding new library written by Udo Klein decodes even a noisy DCF77 signal and auto tunes the quartz crystal.

LedControl.h to drive the LED display and LDC backlight via a MAX7219 IC.

LiquidCrystal_I2C.h to drive the LCD display


Wire.h to communicate with I2C devices

Time keeping

My old Master Clock was a very good time keeper and as long as I had a good DCF77 signal to keep it in sync it was fine. Every now and then when the DCF77 signal was lost for some time it would gain a second and when correcting it it would then make the 1 second slaves loose a second. This only happened a couple of times a year but re-syncing all my 1 second slaves was a pain.

I have decided to keep using the DCF77 signal from the Atomic Clock in Germany. I could have used the MSF signal from the UK but reception is not good in Surrey as the transmitter has move further North. The DCF77 signal is also better supported as it is used across Europe not just the UK. I will be using the Arduino DCF77 decoder library written by Udo Klein . Udo has been developing this code over the last few years to make it synchronize and lock onto a signal even when there is a massive amount of noise and interference on the signal. While prototyping my new clock I consistently manage to synchronize and maintain a lock even though the DCF77 signal  receiver LED that should show a steady 1 second pulse from Germany is flashing multiple times a second.

Read more: DCF77 master clock MK2

Leave a Comment

Your email address will not be published. Required fields are marked *