Arduino Analogue Clock Controller
Remotely Drive, Advance/Retard & Adjust Pulse Timings Of Up To 6 Quartz Clocks
Controls a single clock but includes an option to control up to 6 clocks
Clock info displayed on a 1.8" SPI TFT display
TFT display shows RTC time, temperature + daily min/max temperature, humidity, last sync time.
Also displayed are pulse polarity, pulse timing, amount of time to advance/retard, actual & remaining retard & advance pulses.
TFT backlight auto shuts down after 5 min or after advance retard + 5mins
Auto shutdown is disabled when in clock setting menus
TFT backlight comes on automatically when the Advance/Retard setting knob is moved
Manual time synchronisation to 30 seconds
Remote quartz slave clock setting (advance/retard) from the control panel rotary selector
There is a special setting to advance or retard 1 hour for summer/winter changes, including updating the real time clock
Controlled by a DS3231 AT24C32 I2C Precision Real Time Clock Module
The DS3231 module has been modified to run off a non rechargeable battery
Battery backup by 3 x 1.5v cells to keep the quartz clocks running in case of power loss (the RTC has it's own battery backup as well)
This controller is based on a design by FLORICA TUDOR-NICUSOR
I built this controller to drive my Pragotron PPH410 that has a hi-torque quartz clock movement fitted on import from eastern Europe.
Many Pragotron clocks are imported with their original stepper motors removed and a replacement hi-torque quartz motor fitted.
I usually convert these clocks back to their original 1 minute movements but these can be a bit noisy.
My PPH410 is mounted on a wall above the stairs the other side of which is a bedroom. The 1 minute stepping of the clock motor would be too noisy at night so I have left the quartz motor in place.
This means I would have to climb a ladder over the stairs to access the clock to set the time, change the battery or adjust for summer and winter time.
Using this controller means it can all be done remotely from the controller situated in a convenient location.
Pragotron PPH410 clock
My Pragotron PPH41 clock is high up on the wall above the
stairs and when I need to change it for summer / winter time or change the
battery I have to climb up a ladder to reach it.
The 2 wire cable from the controller is taken up the wall hidden behind the plasterboard out of site.
The controller is fitted in another room.
This controller allows remote clock setting as well as one touch summer/winter correction of the clock and has optional battery backup using 3 x 1.5v cells to keep the slave clocks running for a week during power fail.
The controller will work with any 1 second quartz clock movement and just supplies precise 1 second alternating pulses to drive a quartz clock motor.
Remote clock advance is provided by adding extra pulses on the half second and clock retarding is provided by simply stopping clock pulses (these movements cannot step backwards).
On initial setup the clock is advanced or retarded by selecting the adjustment minutes/seconds/hours using the rotary dial.
Then pressing the Advance button will advance the clock by the exact set time and vice versa hitting the Retard button will stop the clock for the same set time.
The Quartz clock motors will need a simply modification to allow them to be controlled by this project.
The battery is removed, the motor case prised apart. The drive coil is isolated then 2 wires from the controller are then soldered to the coil.
The case is then clipped back together.
Although my Pragotron Clock has no seconds hand I built in precise 1 second control in case it was needed to drive other clocks.
To test the controller to 1 second resolution a test clock was setup with a second hand in place.
below test rig with hour and minute hands removed
The controller uses a 18." SPI TFT display to show setting and control information.
1.8" SPI TFT Module
The TFT Display contains the following info
Name of controller (Pragotron as it's the type of clock it's controlling)
Name of controller / version number
Displays the Time and also displays the word "Sync" when sync is pressed
Temperature & Humidity
Max & Min Temperature
Motor coil pulse time ON and polarity
Amount of time slave clocks will be advanced or retarded if "Advance" or "Retard" buttons are pressed
Number of pulses to advance or retard and pulse on time in mS
Remaining pulses to advance or retard the clock
Instructions/ Clock Advancing/Retarding info
The TFT display is powered by the 5v power supply but the data pins are only rated at 3.3v.
I connect a HCF4050BE between the 5v data pins from the Arduino and the 3.3v pins of the TFT display to act as a buffer.
Important make sure the HCF4050BE is connected to the 3.3v power pin from the Arduino.
The actual TFT LCD display size is 28.03 mm x 35.04 mm.
The diagram below is the TFT size not the complete module.
Video showing controller setup and running
If only one slave clock is being controlled then the 2nd HCF4050BE IC is not required and the single slave is connected direct to the Arduino.
below MP1584 miniature power supply
The local PSU module uses a MP1584 miniature power supply to convert the 12v input to the 5v for the clock.
The clock controller draws 36mA with the display on and 14mA with the backlight LED off.
This is with the backlight LED set to 30mA.
On standby batteries the clock should run for around a week presuming the display is off.
The Arduino Nano can be powered via the Mini-B USB connection, 6-20V unregulated external power supply (pin 30), or 5V regulated external power supply (pin 27). The power source is automatically selected to the highest voltage source.
Additionally, some pins have specialized
The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the FTDI chip and USB connection to the computer (but not for serial communication on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Nano's digital pins. The ATmega328 also support I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus. To use the SPI communication, please see ATmega328 datasheet.
DS3231 Real Time Clock Module Modification
RTC Battery holder removal
To make a bit more space in the case I have de-soldered the backup battery holder from the RTC.
The battery holder pins can be seen to the right of the diode and just above the SCL label.
Battery holder in place on the back of the RTC
Once removed the battery holder is soldered on place of IC on the main Vero Board.
Modification of DS3231 AT24C32 I2C Precision Real Time Clock Module to allow use of non rechargeable batteries
My clock uses a DS3231 AT24C32 I2C Precision Real Time Clock Module.
The module comes supplied with a Lithium-Ion rechargeable battery see diagram above. I use a non rechargeable battery so have removed resistor R5
from the module as below.
Location of R5 on the DS3231 module.
Charging Resistor R5 removed.
The controller is built into a blank euro socket faceplate to match the other faceplates in my house.
The controller is being fitted to a stud wall so the faceplate is fitted to a 45mm deep box.
An aluminium plate is cut and fixed over the hole in the faceplate.
This is then spayed white to match the other socket surrounds.
Lazertran labels are then applied to the white plate then a clear lacquer is applied to protect the transfer.
Panel layout for switches and potentiometer
Drilling measurements from centreline of panel. I have used inches as the Vero board used for the switch
panel has 0.1 inch spacing
The main Vero Board is mounted to the back of the box.
The TFT display,RTC, switch Vero board and variable resistor are all mounted on the aluminium control panel.
The control panel is bolted onto the faceplate and the faceplate bolts to the back box
Rear of faceplate with RTC bolted to the switch Vero board.
The battery holder is de-soldered and mounted on the main Vero board
The 10K pot is fixed to the hole drilled in the aluminium faceplate
The TFT display is hot melt glued in place
The switch Vero board is fixed to two of the aluminium faceplate mounting bolts with additional self locking nuts as spacers
The aluminium faceplate is fixed to the double gang faceplate by 4 x M2 bolts and self locking nuts
The double gang faceplate has 4 x 2.5mm holes drilled to take the aluminium faceplate
Faceplate Construction Layers Animation
The animation below shows the construction layers for the rear of the faceplate.
The aluminium faceplate is bolted to the double gang faceplate.
The 10K pot is fixed to it along with the switch Vero board. The TFT display is hot melt glued in place.
The RTC with battery holder removed is bolted with spacer on the switch Vero board.
Control plate bolted to Euro socket cover
Wiring from main Vero board to control panel and other boards is via Dupont connectors.
To keep the wiring neat and to make connection simple I wire connections on the Vero board to strips of connector or arrange the Nano pins where possible in continuous rows.
I then use single Dupont connector joined by black tape to make multiple connector strips.
The wiring is then laced together to make cables.
below single factory made Dupont jumper wires are taped together to make a multi-connector
conductors are then "laced" together with waxed cotton lacing twine to make neat bundles
connectors are labled as required with a Dymo tape machine
just 3 "laced" cables and connectors connect the main board to the display and switch panel
Control panel mounted to a 45mm dry wall box.
Construction Layers Animation
The looped animation below shows the layers of construction.
Top layer double Euro socket faceplate.
2nd layer Rotary control knob and Lazertran lettering.
3rd layer white painted aluminium control panel.
4th Layer switches mounted on Veroboard.
5th layer RTC & 1.8" TFT
6th Layer Main Veroboard.
All housed in a 45mm deep back box.
Apart from the coin cell in the RTC that stores the time the clock controller has a battery backup to keep the controller and any connected clock working during power failure.
The backup battery should last for a week if the display backlight is off.
The backup battery comprises of 3 AA Alkaline batteries stored in a battery holder.
The batteries are isolated from the main 5v power in by diode D2. When main power is on the Diode is reverse biased (as the PSU voltage is greater than the battery voltage) and will not conduct.
On power fail the diode is forward biased and allows the battery to supply the controller and clocks.
D1 isolates the PSU from the batteries. The PSU is adjusted to 5v on the cathode side of D1 and must be greater than the battery voltage measured on the cathode of D2.
DHT22 Temperature & Humidity Sensor
The DHT22 is a basic, low-cost digital temperature and
humidity sensor. It uses a capacitive humidity sensor and a thermistor to
measure the surrounding air,
and sends out a digital signal on the data pin.
You can only get new data from it once every 2 seconds, so sensor readings can be up to 2 seconds old.
Simply connect the first pin on the left to 3-5V power, the second pin to your data input pin and the right most pin to ground.
Quartz Clock Movements
Quartz clocks are driven by a Lavet type stepping motor.
The motor is driven by reversing the polarity to the drive coil which causes the permanent magnet toothed rotor (in red below) 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.
Modifying the 12888 Type Seconds Motor
The quartz crystal with integrated circuit board are not
required and are cut out/disconnected from the drive coil pins.
The clock movement will need to be taken apart to access the electronics inside. There are many types of quartz movements but they usually have the same basic components.
The coil terminals need to be isolated from the rest of the
electronics and wires soldered to them so they can be driven by an external
My Pragotron PPH410 was fitted with a 12888 type movement.
To get to the control board most of the gear train has to be removed.
The animation below show the placement and order of the gears.
Pull the two battery connectors out and dispose of them
To release the coil and circuit board pull the stator out from inside the coil.
Cut the PCB tracks near the coil to isolate the other circuitry.
Solder a wire to each coil terminal and take them out through the battery bay.
Other Quartz Clock Motor Modification
U.T.S. Quartz Clock Movement
Carefully prise the movement apart and remove the top and bottom case sections.
The Quartz PCB and motor section can then be lifted out as 1 part.
Turn the Quartz PCB and motor section over to reveal the solder side of the PCB.
Cut one of the tracks to the motor coil to isolate it.
Solder wires to each of the coil solder pads and take them out of the clock into the battery bay.
Solder the wires to the "Clk Motor Coil" terminals on the Lavet type stepping motor.
Cut tiny slots in the case if required to let the wires pass through then clip the case back together.
If you are controlling a single clock then the 2 zener diodes and variable resistor can be located on the main board.
If multiple clocks are being controlled then make up a small Vero board for each clock to hold theses components along with a PCB mount switch so each clock can be turned off when on initial setup.
For multiple clock control the Lavet type stepping motor driver board is "hot melt" glued in place.
There are many different types of drive
motors around just follow the process above to convert them.
Other types of Quartz clock drive motors
Motor Pulse Control
Quartz clocks are driven by Levett type stepper motors and require an alternating 1 second 1.5v pulse to drive them.
The controller has a 5v power supply and this is fed via preset resistor VR2 adjusted to kick a good kick to the stepper motor without overdriving it.
The pulse duration is controlled by VR3 and is displayed on the TFT is mS. This should be adjusted to the lower setting possible along with VR2 to
keep the movement ticking without any missed steps. Make sure that the clock movement will still step with the hands at a quarter to nine as the
hands require the most power at this time to lift them up. My test clock ran well on a 40mS pulse and failed at around 10mS. This will vary on the
clock motor and hand combination. Make sure the settings work in clock advance mode as well.
Below the clock motor polarity is reversed precisely every second controlled by the RTC with coil A being the opposite of Coil B for the duration set by VR3.
Once the time set by VR3 has elapsed both coils are set to 0v.
Below. Looped animation showing coil polarity and pulse time indicators on the TFT display.
The indicators show the polarity of each coil input and only show when pulsing the coils.
The indicators show the polarity reversing on each second change.
The display also shows the pulse timings in mS 2 rows down from the polarity indicators.
This setting changes as VR3 is adjusted.
When the clock is set to advance time an extra pulse is added on the half second effectively doubling the speed of any clocks attached to the controller.
Slave Clock Setting/Correction
Advancing Slave Time
The animated loop shows the actual time on the TFT display is 23:08 & 10 seconds.
The slave clock is 10 seconds slow. To correct the slave clock the rotary dial is turned until the "Advance/Retard" time is shown as 10s.
The "Advance" button is then pressed and the slave clock receives an extra 10 pulses to correct the time.
While advancing the TFT display shows "Advancing Clocks Press Rtd to Cancel"
The slave clock is then back in sync 10 seconds later.
The TFT display shows the number of pulses and also the number of pulses to go before the slave clock is in sync.
Retarding Slave Time
The animated loop shows the actual time on the TFT display is 5:37 & 1 second.
The slave clock is 10 seconds fast. To correct the slave clock the rotary dial is turned until the "Advance/Retard" time is shown as 10s.
The "Retard" button is then pressed (in this case when the TFT display shows 7 seconds) and the slave clock then stops missing the next 10 pulses to correct the time.
While retarding the TFT display shows "Retarding Clocks Press Adv to Cancel"
The slave clock is then back in sync 10 seconds later.
The TFT display shows the number of pulses to miss and also the number of pulses to go before the slave clock is in sync.
Advance and Retard times
In order to advance and retard these clocks either they are stopped to retard or an extra pulse is added on the half second to retard.
Any change will take as long as the clock is out to correct. This means if the clock is an hour fast it will take an hour to correct as it will just sit and wait for time to catch up.
The same goes if the clock is an hour slow he clock will take an hour to catch up. Unless the clock being controlled is out of reach as my clock is it will be far quicker to change the clock by using the built in hand adjuster.
The controller can then be used for fine adjustments.
The amount the slaves are advanced or retarded is selected by rotating the "Retard/Advance" selector.
As the selector knob is rotated the selected "Advance/Retard" time is shown on the TFT display.
The display also shows the number of pulses and number of pulses remaining once the "Advance" or "Retard" buttons have been pressed.
The settings advance/retard the slave clock only apart from the Summer Winter setting where the controller RTC is also adjusted once the pulsing has completed.
The following settings are available
|Selector Setting||TFT Display||Pulses||Note|
|1||Sm/Wn||3600||Advances/Retards slave clocks and the RTC in the controller at end of advance/retard|
|2||1s||1||Advances/Retards slave clocks only. Hold button to keep slaves advancing/retarding|
|3||10s||10||Advances/Retards slave clocks only|
|4||30s||30||Advances/Retards slave clocks only|
|5||60s||60||Advances/Retards slave clocks only|
|6||5m||300||Advances/Retards slave clocks only|
|7||10m||600||Advances/Retards slave clocks only|
|8||15m||900||Advances/Retards slave clocks only|
|9||30m||1800||Advances/Retards slave clocks only|
|10||45m||2700||Advances/Retards slave clocks only|
|11||1hr||3600||Advances/Retards slave clocks only|
|12||6hr||21600||Advances/Retards slave clocks only|
The RTC clock setting mode is entered by pressing the "Menu" button (The slave clocks stop while in the Clock Setting Menu).
This displays the Hours setting screen.
Pressing the "Minus" or "Plus" buttons adjusts the hours up and down.
To select the Minutes setting menu press "Menu" again.
Pressing the "Minus" or "Plus" buttons adjusts the minutes up and down.
DAY OF WEEK
To select the Day of week setting menu press "Menu" again.
Pressing the "Minus" or "Plus" buttons adjusts the Day of week up and down.
To select the Year setting menu press "Menu" again.
Pressing the "Minus" or "Plus" buttons adjusts the Year up and down.
To select the Month setting menu press "Menu" again.
Pressing the "Minus" or "Plus" buttons adjusts the Month up and down.
To select the Day of month setting menu press "Menu" again.
Pressing the "Minus" or "Plus" buttons adjusts the Day of month up and down.
Pressing "Menu" again jumps back to the time screen with the time set as above.
The slave clocks now restart ready to be set to the correct time.
The clock can be manually synchronised by resetting the seconds to 30.
The animated loop below shows the clock that has just been set through the RTC setting menu. There is no Sync time shown on row 4 of the TFT display as the clock has not yet been synchronised.
The clock is running around 2 seconds slow compared to the time on my Mater clock.
When the correct time reaches 30 seconds the "Sync" button is pressed on the clock.
As soon as the "Sync" button is pressed the word "Sync" appears next to the time.
The seconds are reset to 30 to make the clock in sync with the correct time.
The time and date the clock was last synchronised is then recorded on row 4 of the TFT.
In this case the clock was synchronised at 20:59:28 on the 17/01/18 (English date format 17th Jan 2018).
As the synchronisation pulse is received at exactly 30 seconds you can see the clock was 2 seconds slow last time it was synchronised.
Vero Board Layouts
There are two Vero boards on this controller, one to hold the switches on the control panel and the main board to house the NANO and other components.
Main Vero Board without Nano and PSU Board
Note Diode D1 and link to SW4 not required
Complete Main Vero Board
Main Vero Board Option
As I am only controlling 1 clock I have removed the 4050BE IC that drives the other clocks and fitted
the battery holder from the RTC in its place. I found with the RTC mounted on the switch Vero board
the battery holder touched the top of the NANO when the case was shut.
If you fit the NANO on low profile sockets or solder direct to the board there should be enough clearance
without removing the battery holder from the RTC.
Rear of Main Vero Board
Switch Vero Board
As well as connections to the NANO 0v and 5v are connected to this board.
Miniature Push Button Momentary Tactile Switch SPST are soldered to the Vero Board and protrude through the holes drilled in the switch panel.
Schematic also shows alternative to IC1 HCF4050BE- an 8 way logic level converter.
Also optional extra quartz clock drivers made up of another HCF4050BE.
This can drive 6 clocks in total. If single clock drive required leave out IC2 and connect clock to Zener diodes D4 and D3.
Requires the following libraries
The code for this project can be downloaded here download v7.1
v7.1 on Sum/Win adv/rtd the RTC hour is changed when the timer records 3595 pulses to go rather than 1.