This is my first Arduino Project so I am sure you will find plenty of ways to improve on my code.
I wanted to build a clock as a backup to my old logic controlled Master Clock http://home.btconnect.com/brettoliver1/masterclock.htm this clock had a DCF77 decoder using logic gates that was just used to keep the clock in sync every minute.
I wanted a true DCF77 decoder that would set the time and provide pulse outputs to drive all my different types of slave clocks.
I came across Arduino and in particular the Time, DCF77 and Timezone libraries. All the hard work was done for me. I found a cheap 20x4 LCD display on ebay http://www.ebay.co.uk/itm/161107072069?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649 that only required 2 wires plus power and I was away.
I built the circuit out on breadboard to test it and then fitted into a "hacked" Ikea lanten. To keep the size down I fitted the Arduino chip on to the vero board with the other components.
I added an old skeleton clock movement to show the time and used an LED panel to monitor the clock pulses. I cut out the old quartz driver from this clock then connected my "quartz motor" drive pulse from the Arduino to it.
The skeletal movement caused some problems as I found when the clock synchronised (about 6 times a day) the LCD display would jump a second to show the corrected time but of course the clock motor would not. I had to add a bit of code to make the quartz cock motor double pulse when the clock corrected. I have also done the same for a few of the clock pulses.
I have also added a battery to keep the clock running if I need to "carry time" around the house to check my slave clocks are in sync.
My master and voltmeter slave clock chime the hours in sync so I have added a quarter chime to this clock. On the hour the quarter chime goes off 3 seconds early so the chime stops just in time for the hour chimes on the other clocks to start.
The chime is a sample and is played back via an ISD1730 chip.
The LCD display shows time and date, time last synchronized, synchronization status, time of last missed pulse and number of missed pulses per day.
Here is a link to a very short video animation I made showing the clock from 23:59:55 seconds to 00:00:32 and gives an idea of the clock working including the chimes. The hour chimes are from my other clock and the clunk every 30 seconds are from my 30 second slaves.
You Tube Video Link
Here is my code. Bear in mind it is my first attempt at writing for Arduino!
I have based lots of the code on the example files provided with the libraries.
The timezone is set for London England.