Introduction: Voltmeter Clock
This clock tells the time - hours, mins, and seconds using 3 analogue voltmeters. A PIC16F628A microcontroller is used to display the time by varying the voltage to each voltmeter and also provides very basic timekeeping. The Microcontroller code is written in Picbasic Pro 3.
Accurate time is maintained by synchronising the clock to my Master Clock that is synchronised to a radio "atomic" clock.
The clock is based on an instructable "Multimeter Clock" by abbtech see pic 2. The instructable can be found here and website here alan-parekh.com .
I purchased a kit of parts from Alan's site and decided to change the design quite a bit and give the clock a retro industrial look.
I had a different version of Picbasic to the original code so first of all I had to convert it to run on PICBasic Pro version 3.
I added the following.
Switched display On and Off (keeping battery backup as per Alan's design) but also allows me to turn meters Off in full power mode whilst still keeping track of time.
Synchronization to my Master Clock every 30 seconds
Synchronized LED & Re-Synch LED
Synchronization On & Off
Transistor voltmeter drivers
The clock also has a chime board but this is completely separate from the clock and is controlled by my Master Clock so is not covered here.
If you want to see details of this board have a look at my Voltmeter Clock page for details.
In my latest clock I now use a sound board from Adafruit this is far more configurable and has CD quality sound.
Step 1: Design
I wanted an industrial/laboratory look to my clock so for the base I used a large lump of mahogany that had been laying around my workshop for years. I used off cuts to make the frame for the clear plastic cover (purchased from Ebay) and also for the panel meter decorative strips. All these were cut to size on my table saw. See pics 1 & 2
I wanted to use 7.2 x 7.2 (2.8" x 2.8") square 240° display panel meters (pic 3 right) as these displays give a far greater separation between digits but these were very expensive. You may be able to pick up cheap 2nd hand meters from Ebay. Instead I used far cheaper 7.2 x 7.2 (2.8" x 2.8") square 90° display panel meters (pic 3 left) new from Ebay Hong Kong. You can of course use any panel meter you like including horizontal or vertical mounting edgewise panel meters (pic 4). Pic 5 shows the original meter on the left and meters with modified dials on the right.
The three meters are mounted together at the rear of the cases using aluminium angle top and bottom. The meter assembly is then bolted to the mahogany base from the rear by a pair of brackets. This gives the impression that they are floating over the case. To keep in with the industrial look I used large push and toggle switches on the control panel mounted beneath the display. see pic 6 for display, indicators and control panel layout.
Pic 9 shows the aluminium angle running top and bottom of the 3 meters with the meter fixing bolts clamping the meters to the aluminium angle. The 2 meter fixing brackets and studs can be seen protruding from the lower aluminium angle. These are fixed through the mahogany base with studding.
Why synchronize?
Microcontrollers use a quartz crystal as a time base in this case 20Mhz but as this in not exactly divisible by 2 you will never get a precise 1 second pulse. Over a short period this will not matter and will not be noticed. Over a few days the clock will be many seconds out. You could use a real time clock as a time base as these use a 32.768Khz quartz crystal that when divided by two 15 times gives you a 1 second pulse. Given a bit of adjustment and a stable temperature you can get a second a week accuracy.
This clock goes 1 stage further and uses a 30 second synchronizing pulse (you can use any timed pulse) from my Master Clock to stay in sync. I use 30 seconds as my slave clocks are driven by 30 second pulses. Every 0 and 30 seconds past the minute the clock checks for a 30 second pulse if the pulse arrives earlier or later it resets the clock to stay in sync with this pulse.
There are 2 LEDs that monitor synchronization in-sync and re-sync. The in-sync LED pulses each time the a 30 second pulse is received. If the clock is not in sync the re-sync LED lights to show the clock has drifted and has been re-synchronized.
The timelapse video (pic 7) shows this synchronisation in progress. The Green LED shows the 30 second sync pulses arriving and the Red LED shows when the clock has been re-sync'd. The Red re-sync led pulses approx every 6 sync pulses showing that the clock has drifted by a few hundred milliseconds every 3 mins.
This can be seen in normal time in the sync video (pic 8). Synchronization has been turned off for some time to let the clock drift ahead of correct time by 3 seconds as shown by the Master Clock video overlay top centre. The clock can be seen stepping to 12 o'clock and the seconds resetting to zero. When the clock reaches 12:00:03 a 30 second pulse is received and this sets the clock back to 0 seconds. The clock is now showing the same time as the Master Clock in the background.
Step 2: Drawing Dials
To make the dials you need to draw them up on some kind of drawing package.
If you don't have a drawing package I have uploaded 4 types of files including are large jpg file for you to use or modify. In order below file 1 dwg format Autocad, file 2 dwl format, file 3 tcw TurboCAD and file 4 large jpg file zipped up.
I use TurboCAD but any cad or drawing package should work.
There are many different ways of drawing dials but this is the way I do it.
fig 1. Draw the outline of your meter marking the exact center point of the needle
fig 2. Draw 3 arcs. I use the arc center and radius tool. The center point being the needle pivot, the radius being the arc distance, the start point being 180° and the end point being 90°. Do this 3 times for the outer, middle and inner arc.
fig 3. Using the line tool draw 2 lines horizontal lines at the lower point of the arcs. The 1st from the end of the inner arc to the middle arc then the 2nd from the inner arc to the outer arc. These are the 2 elements you are going to radial copy. First radial copy the longer element from the inner to outer arc by selecting this element then choose Modify Array Radial from the top menu. Define the center of the arc by selecting the needle pivot point then set the step angle to -15° (15° into 90° is 6) and the number of steps to 6. This will copy the element rotate it around the needle pivot -15° paste it then do it again 6 times in total. With the last element ending at 90° and being vertical.
fig 4. Shows the results. We now have the 10 seconds lines on our dial. Repeat fig 3. for the 2 seconds lines by selecting the middle to outer horizontal element. This time we need 30 lines at an angle of 90/30 or -3°.
fig 5. Shows the 2 seconds lines drawn and the 10 second line labels added.
fig 6. Shows the full set of dials the mins dial is drawn in the same way as the seconds dial while the hour dial has 12 -7.5° lines drawn on just 2 arcs.
Step 3: Modifying Panel Meters and Printing/Applying New Dials
fig 1. I have used 3 of these Panel Meters from Ebay Size 72mm x 72mm x 57mm
fig 2. Unclip black plastic retaining strip from the left hand side of the meter and then slide out the dial.
fig 3. Dial slides out sideways.
fig 4. Carefully lift up black plastic bezel and remove it and the glass underneath.
fig 5. Now remove any components from inside the meter just leaving the wires to the coil.
fig 6. There are now 2 choices for adding the meter new scale.
Option 1 print out the new scale on stiff paper and stick over the old scale.
Option 2 and the method I used.
fig 7. remove the old scale by rubbing down with emery cloth and then
fig 8. spray paint a new coat of off white (white paint looks wrong on an old clock) paint to the dial surface.
fig 9.then print a new scale onto inkjet transfer paper and apply to the new painted surface. The white backing paper will dry opaque.
fig 10. Once the inkjet transfer paper is dry spray over with acrylic varnish to make the inkjet transfer backing go transparent where there is no ink to reveal the off white dial surface below.
fig 11. completed seconds meter
Inkjet transfer paper and detailed instruction are available from Lazertran.
Step 4: Electronics
The schematic fig 1. shows four basic parts to the circuit. View large version here
Power and backup power
Control
Synchronization
Output
Power is from a 12v power supply via a 5v regulator RG1. Diode D5 prevents power from being fed to the standby batteries. As long as the power is on and the display switch is on the displays are powered on. If power is off D4 prevents the standby batteries from keeping the displays on. D5 will then allow the standby batteries to keep the Micro controller powered up.
Control is via the Pic 16F628A microcontroller see code page for full details.
When the clock is first powered up the PWM outputs will default to about 50% of max output. You will first need to adjust the scale of all three meters. This is done by operating the “Scale Adjust” switch. In this mode only the meter being adjusted will be powered.
The first button “Hour/ Meter Select” (also used to advance the hours when in clock mode) is used to select which meter is to be adjusted.
The second button (also used to advance the minutes when in clock mode) is used to decrease the full scale setting of the powered meter.
The third button (also used to reset the seconds when in clock mode) is used to increase the full scale setting of the powered meter.
The goal here is to move all three meters to exactly full scale. When complete turn the scale adjust switch off to return to normal clock mode, at this time the settings will be saved to non-volatile memory.
The time will also need to be set. The time is adjusted using the three buttons.
The hour button increments the current time by one hour.
The minute button increments the current time by one minute.
The second button resets the seconds.
Once set the time and the “Sync” switch is operated the time is checked against the Master Clock 30 seconds pulses on zero and 30 seconds. If the clock is not in sync then the seconds are corrected on chip and the second hand is moved to show the exact time. In “Display Off “ mode the clock is also kept in sync but only on the 30 second pulse.
Synchronization is from my master Clock via a transistor pulse inverter and 555 timer via the Sync On/Off switch.
Output to the three meters is PWM and is via transistor drivers so many different voltmeters can be used.
Depending on your meters R6,7 & 8 can be changed to lower value if you can't get full scale deflection or to larger values if your meters are over driven.
fig 2. shows the prototyping board layout for the main control and power.
fig 3. shows the vero board layout for the transistor volt meter drivers.
fig 4. shows the vero board layout for the transistor pulse inverter for clock sync and chime trigger.
fig 5. shows the 55 timer board that converts the sync pulses from my master Clock
Step 5: Code
Enclosed HEX file and bas file for the clock
fig 1. shows the software flowchart for startup
fig 2. shows the software flowchart for general clock management and synchronization