Introduction: Arduino DCF77 Pulse Clock
This Instructable show you how to make a digital pulse clock and adding it to an old 12" (300mm) clock case or dial & bezel. I have used an old English Dial Clock with 12" dial but any clock with a large enough case be used as long as there is room on the dial for the digital display and secondary analogue movement.
These old cases are available from ebay and sometimes come complete with a curved or angled back box see pics 5 & 6. If your clock has no back box just make one out of plywood and stain it to match the dial surround.
This clock came with a surround, brass dial bezel and dial so I just made a back box to fit and hinged it to the wooden dial surround. You can by dials and brass bezels new from Ebay if required.
The original dial that came with the clock was very yellow and had lots of chips to the paint. I decided to keep it as it made the clock look authentic. The only problem was the paint chipped off as I cut out the hole for the 7 segment display. I found an old tin of cream paint in my garage and this matched perfectly.
The seconds dial was applied using a dry transfer from a clock shop. I had purchased this some year ago but you can make you own wet transfer using inkjet transfer paper see one of my Reproduction Regulator Clock Instructable here step 4 for details and templates.
The analogue seconds display uses a standard quartz clock insert and is modified so it can be driven via the Arduino.
The Analogue hour and minutes display uses a electric 30 second slave movement. There are all types of these available across the world so just source the type that is available in your location. If your movement is not a 30 second type just modify the code to suit.
I have used the DCF77 radio code time signal from Germany to keep this clock telling perfect time so if you are not based in Europe you will need to use the relevant Arduino library for your location and mode the code accordingly.
If you are not that bothered about long term accuracy then a real time clock module could be used instead. Buttons for clock setting and code modding would be required.
I have used a 20x4 LCD large character display for clock and DCF77 info but a standard 20x4 display can be used without a changes to the code. The display uses a I2C module so only 2 wires ( plus 5v and 0v) are required to control it.
Digital Clock Display
An 8 digit 0.56" seven segment display module is used for the digital display of time.
These are available on Ebay as kits or prebuilt modules and only require 3 wires (plus 5v and 0v) to control them.
This clock has a 1 second tick tock sound from a long case (grand father) clock. This is played by an adafruit Audio FX Sound Board + 2x2W Amp that is controlled by the Arduino. The sound can be turned off or volume up or down as required.
As this is a one off the clock circuit is built on vero board. I have built an Arduino Uno into the design but a full size Uno can be used instead if required. Note the DCF77 library used in this clock required a quartz crystal on the Arduino.
Step 1: Basic Build
fig 1 Shows the completed clock. The clock is constructed from parts from a 12" (300mm) dial clock mounted on a new back box constructed from plywood.
The plywood box has been stained to match the dial surround. The Oak dial surround has been stripped back to bare wood and bleached to lighten the colour.
fig 2 Shows the clock with the dial cut away to show the positions of the movements and displays. The hacked quartz seconds movement top, the 30 second slave movement middle and the digital display bottom. The 30 second slave movement is fixed to the metal clock dial by two small screws. The quartz movement is then attached to the 30 second movement by a bracket. The quartz movement has had the quartz control board cut away and wires connected directly to the drive motor coil. The digital display is fixed to the wooden dial backing plate by two metal brackets.
fig 3 Shows the the dial surround and bezels removed so all components and modules can be seen. The dial and dial surround are hinged to side of the back box and can be opened and folded back to enable access to the controls and circuit boards
fig 4 Shows the back board and modules without the clock display and movements.
Top right - PSU Module adjusted to give 5 volts at the board after the protection diode. Middle - main Vero board with the Atemega 328 microcontroller and sound board module. Bottom - LCD display module with I2C control module mounted on the back. The quartz clock motor switch control panel is on the top left with sound and LCD backlight control switches mounted on the right. The sound board that creates the ticking sound is wired to the small speaker that fires through the bottom of the case. The tick-tock sound is sampled from a 1 second long case clock movement edited in Audacity down to a 1.5 second sample. The clock plays this sample every other second so the ticking is always in sync with all the clock displays. A LDR is mounted through a hole cut in the right side of the back box to control the 7 segment display intensity via the microcontroller. The LCD and 7 segment digital display are turned on by a PIR detector module located on the same room as the clock when ever someone is in the room.
fig 5 Shows the original dial complete with stains, chips and dents and has had a seconds dial added and a slot cut out for the digital display.
Step 2: Displays
7 segment display
The 7 segment display module is purchased as a kit of parts. The only item missing from the kit is a 10µF electrolytic capacitor.
I just solder one on the back of the PCB across +5v and 0v. The black plastic tape is used to mask out the 3rd and six characters so a colon separator is displayed.
The 7 segment display module is fixed to 2 aluminium brackets fig 2. The brackets then hold the display to the wooden dial bezel.
The LCD display is a 20x4 large character display fig 1 and shows information on the clock and DCF77 decoder.
The display is housed under the hinged dial bezel.
The display has an I2C module fig 4 soldered on the back to allow easy 4 wire connection and communication with the Arduino.
Step 3: Circuit Board
Main Vero board fig 1 with flipped down rear view fig 2. Full size front view in zip file
The Atemega 328 microcontroller provides DCF77 decoding and display of correct time and also provides timing pulses for the sound board and 30 second pulse to the 555 timer IC.Exact pulse length for operation of the 30 second slave for mins and hours is obtained using an adjustable resistor.
There are 2 outputs for driving slave quartz analogue movement motors, 1 is used for the analogue seconds on this clock and the other is spare both outputs are adjusted by variable resistors on each output. Reverse polarity protection is provided by a diode so the PSU is adjusted to give 5v on the protected side of the diode.
The board has 6 on board momentary tactile switches to control the following:
1 Hour Retard. The digital displays LCD and LED automatically adjust when the clocks go back to winter time. When the "Retard" button is pressed the clock waits for the next 30 second pulse and then stops the hour and minute slave from moving until 120 pulses have passed. This will stop the analogue mins and hour movement for 1 hour exactly and then start it again. The LCD display will show "Winter Retard" and also show the number of missed 30 second pulses.
1 Hour Advance. The digital displays LCD and LED automatically adjust when the clocks go forward for summer time. When the "Advance" button is pressed the clock starts to advance the analogue min and hour movement once per second. The movement has to be advanced an extra 120 pulses but as this will take 2 mins to complete extra pulses will be needed to keep the movement in time as it advances. It does this by not counting advance pulses on 0 and 30 seconds. The LCD display will show "Summer Advance" and also shows the number of advance 30 second pulses. This count will stop on 0 and 30 seconds.
Tick Tock On. On power up or reset the clock is set to silent mode and no pulses are sent to the sound board. On pressing this button the pulses are sent to the sound board to play the tick tock sound. The sound board on power up does not remember the last volume setting so this ensures loud sounds are not sent out until the button is pressed for example on power interruption in the middle of the night.
Volume + & - When the tick-tock sound is playing these buttons control the volume.
Step 4: Schematic
Schematic shown is for a Arduino UNO (Atmega 328 microprocessor) built into the circuit board. You can use a prebuilt Arduino as long as it has a quartz crystal on board not a resonator.
The library used for this clock needs an accurate time base on the Arduino to lock into the DCF77 frequency. Modern Arduino boards don't use a quartz crystal ( the one you see on the board is for the serial port) but an inferior 16MHz ceramic resonator. It is very easy to remove the resonator and replace it with a quartz crystal and a couple of capacitors. I have modified my Arduino UNO and it works perfectly with the library.
fig 2 shows a modified UNO board.
fig 3 shows a close up of the original board with resonator in place.
fig 4 shows the new quartz crystal and capacitors in place.
figs 5 & 6 show the schematic for the original resonator and then quartz crystal respectively.
Full size schematic in zip file
Step 5: Switch Contols
The Seconds Motor is controlled by 3 switches.
In the " Auto " position the seconds motor is controlled by the clock. In the "Man " position the Step button is used to control the motor.
Step is a 3 position switch normally middle "Off ". Lifting the switch up and down non latching manually steps the seconds motor.
On/Off is the master control and will always turn the motor on or off.
There are two further switches mounted separately.
Tick turns the Tick Tock sound on & off
LCD turns on the LCD back light.
Step 6: Seconds Movement Modification
The seconds hand is driven by a Lavet type stepping motor.
The motor is sourced from a quartz clock movement with the quartz control board cut out. The motor requires very low current to drive it and can be driven direct from the Arduino output via a trimmer resistor. The resistor is used to adjust the current to the motor so it works without being over driven.
The motor is driven by reversing the polarity to the drive coil which causes the permanent magnet toothed rotor (in red fig 1) to turn 180°. The toothed rotor will continue to turn in the same direction each time the drive motor polarity is reversed. 2 output pins from the Arduino are used to pulse the drive motor with 1 pin always the opposite to the other.
There are many different types of quartz movements but the instructions below should work for most.
Start by removing the adjustment knob (not always necessary).
fig.3 Carefully prise the case apart with your fingers or a plastic knife. On some cases the are 2 plastic tabs that have to be prised away to release the case.
fig.4 Once the lid is removed the movement is exposed. On some movements the printed circuit board can now be accessed (fig.6) but on this movement the lower part of the case has to be pulled away as well and turned over. It may be worth taken a few pics at this stage with your mobile phone in case the small gears fall out. Note this pic already shows the new wires connected to the coil drive pins.
fig.5 This shows two connections to the integrated circuit that have been cut away and the new wires soldered in place. Once this is completed the movement is put back together by reversing the above.
Push on a second hand and test the clock by briefly connecting the wires across a 1.5v battery - the second hand should step. Briefly connect the wires to the battery again but this time reversed and the clock should step again.
fig.6 Shows an alternative clock movement with the top cover removed. Slide out the PCB and cut away any tacks to the drive coil pins with a craft knife then solder wires to these pins.
To make sure there is space for the case to shut just cut a small slot in one half ot the case to allow the new wires to pass through.
Further reading There is a nice instructable here showing quartz clock movement disassembly
Step 7: Analogue Minute & Hour Movement
The minute & hour hands are driven by a 30 second slave clock movement. These movements were used in offices and schools throughout the UK and are readily available on Ebay. Depending on your location there will be different types of slave movements available that may require different pulse intervals and voltages. You will need to modify the code and or driver stage depending on the type.
There are 5 x 100 ohm resistor connected in parallel to the drive coil of this clock to get the equivalent of a 16 ohm resistor. As they are connected in parallel the wattage of the resistor goes up so it can easily handle the couple of watts for 200mS of the drive coil.
Also connected to the drive coil (physically) is a thermal fuse rated at 100°C. This is just a safety measure in case there is an error in the circuit and the drive coil gets powered up permanently. I have never seen them catch fire just get warm.
fig 1 shows a looped animation of the movement getting a 30 sec pulse. That is 1 pulse of a few hundred milliseconds every 30 seconds. The trimmer on the circuit board can be adjusted to give a nice drive pulse just enough to drive it without being over driven.
The parts and operation are as follows.
fig 2 A is the main ratchet-wheel, having 120 teeth B the operating electromagnet C the armature D the armature lever E the driving pawl, which moves the ratchet-wheel one tooth on the release of the armature F the driving spring, which normally holds the driving pawl in engagement with the ratchet wheel, and the armature away from the electromagnet G the back-stop lever, which prevents movement of the ratchet-wheel when the armature is attracted, as might be possible from vibration or on clocks with exposed dials - by pressure of wind on the hands H the momentum stop, which prevents the ratchet wheel being moved more than one tooth per impulse and, with the pawl E, locks the ratchet wheel between pulses J the stroke-limit stop, which limits the travel of the armature, and
When electromagnet B is energized by a pulse from the Master Clock, the armature C is attracted, pawl E is propelled to the right against the pressure of spring F, and drops into the next tooth on ratchet-wheel A. When the pulse ceases, spring F drives the paw! E forward, and the ratchet-wheel rotates one tooth, equivalent to a half-minute on the dial. The ‘minute’ hand is attached to the. ratchet-wheel which also drives the ‘hour’ hand through a train of gears having a reduction ratio of 12 to 1.
Operating current The operating current for the movement is 250 mA. The resistance of the electromagnets is between 7.5 and 10 ohms and they may be connected in circuit without reference to polarity.
Step 8: Summer Time Correction
Automatic Summer 1 hour Advance
The digital LED and LCD clocks automatically adjust for summer and winter time but the analogue minute and hour movement will need to be stepped forward by 1 hour.
To adjust the analogue clock for summer time (advance the clock 1hour) press the "Advance" button once on the main board on the lower right of the sound board. fig 3
The clock will start to advance and the LCD display will show "Summer Advance" and also show the number of advance pulses sent.
fig 1 the advance pulses and count are paused on the minute and half minute to keep the clock in sync. eg @ 09:06:59 the Advance Count =15, @ 09:07:00 the Advance Count =15 @ 09:07:01 the Advance Count =16 1 advance pulse count is missed out as a normal clock pulse would have happened at that time anyway.
fig 2 once the analogue clock has advanced 1 hour the LED display will return to normal and the advance pulses will stop.
The whole process can be seen on the video fig4.
Step 9: Winter Retard
Automatic 1 hour retard
The analogue minute & hour movement can not be stepped backwards so it is retarded by stopping pulsing for 1 hour (120 x 30 second pulses).
Winter retard is started by pressing the "Retard" key on the main board on the lower left of the sound board.
When the "Retard" key is pressed nothing happens until the clock reaches 0 or 30 seconds.
fig 1 when 0 or 30 seconds is reached "Winter Retard" is displayed on the LCD display and the retard count starts to count up. The analogue clock is not advanced.
fig 2 each time 0 or 30seconds is reached 1 is added to the retard count and the analogue clock does not advance.
fig 3 once the retard count has reached 120 then the LCD display reverts to normal and the clock advances as normal.
Step 10: Sound
The clock has a 1 second tick sampled from a long case clock. The sample has 2 sounds a tick followed by a tock and lasts 1.5 seconds.
This clock only uses 1 input to trigger the long case clock "tick tock" seconds sound. The file lasts around 1.5 seconds and is triggered every other second to keep it in sync with the clock.
Download Tick Tock sound
The sound is stored on a Audio FX Sound Board + 2x2W Amp - WAV/OGG Trigger - 16MB
16MB of storage on the board itself, so you can store up to 15 minutes of quality compressed audio. Double that if you go with mono instead of stereo
Built in Mass Storage USB - Plug any micro USB cable into the Sound Board and your computer, you can drag and drop your files right on as if it were a USB key
Compressed or Uncompressed audio - Go with compressed Ogg Vorbis files for longer audio files, or uncompressed WAV files
High Quality Sound -44.1KHz 16 bit stereo. The decoding hardware can handle any bit/sample rate and mono or stereo
11 Triggers - Connect up to 11 buttons or switches, each one can trigger audio files to play
Stereo line out - There's a breakout for both left and right channels, at line level, so you can always hook up to any kind of stereo or powered speaker
Five different trigger effects - by changing the name of the files, you can create five different types of triggers which will cover a large range of projects without any programming
Step 11: PIR
Pyroelectric IR Infrared PIR Motion Sensor Detector Module
The clock has infrared motion detection and this is detected off a remote sensor that is used for a number of clocks in the room.
The PIR is mounted high up on a wall in a face plate and the output goes to all the clocks in the room with a PIR input.
Step 12: Video
The video shows the clock working for a full minute.
Step 13: Code
Requires the following libraries
dcf77.h Note this clock uses Udo Kleins Release 2 library download here DCF77 Release 2
Participated in the
Arduino All The Things! Contest