March 16, 2024
Description
Let's make a clock that uses 3 analog voltmeters to display hours, minutes and seconds. Retro style!
Note: It is not super accurate. While the calculation for the positon may be as accurate as possible, there is no feedback from the gauge and the cheap chinese voltmeters may not be the most accurate ones you can get.Â
There are still some minor problems that I need to solve and I am still working on it.
Updates will follow
For version history and known issues, see bottom
The voltmeters are PWM-controlled by an Arduino nano since the PWM translates to an analog value due to the inertia of the analog gauges. To keep the precise time, we also need a Real Time Clock (RTC) which is an IC that is specialized on keeping a precise time, even if power is switched off by using a small battery.
To set the time, 2 momentary switches are used.
Note: currently the software only supports 24 hours mode altough I have included 12 hour scales in the pdf template
The Arduino syncs up with the RTC every 120 seconds. The values of hour, minute and second is then passed to a function that calculates the analog value for the gauges (0-255) depending on the number to indicate and the range the gauge can display.
There are some settings that you may want to change. Other than that you don't need to change anything.
const int stepdelay = 3; //determines the speed of the indicator, especially when bouncing back to 0, 0= very fast, 5= medium, 10= slowChanges the speed of the gauge when it has to make big jumps (startup routine, when jumping back to 0 etc.)
int settingtime = 200; //determines how long the button has to be held to activate setting modethe higher the value of settingtime, the longer the button has to be held for setting mode activation and confirmation of the set values. I found 200 to be a good value but you can change it if you want.
const bool h12mode = false; //set to true to use 12h modeSetting to activate 12 hour mode, but only partially implemented yet. Will not work!
At startup, all 3 gauges are moved to max and back to allow you to check if they can move freely. After a few seconds, the gauges jump to the current time.
Another function in the program checks the buttons and if Button 1 is pressed for long enough, the clock enters settings mode indicated by all 3 gauges being set to about halfway.
Hold Button 1 again and you can set the hour with Button 2. Hold Button 1 to confirm. Next, set Minutes with Button 2 and confirm with Button 1. Seconds is always set to 0. The clocks performs the startup routine and then displays the newly set time.
Via the calibration mode you can account for differences in output voltages of your arduino and also tolerances in the cheap voltmeters. It works by defining the maximum value which will then be the reference point for the calculations.
The Calibration works similarly to time setting, but hold both buttons to enter calibration mode. Needles will jump to about ¼ value to indicate calibration mode.
Hold Button 1 again and you can set the hour gauge calibration (drive the needle to the highest value on your scale (e.g. 24)) with Button 2. Hold Button 1 to confirm. Proceed the same way with the minute and second gauge.
These values will be stored in the EEPROM of your Arduino and will be kept even if power is off.
Hint: if your clocks gauges will not move after first flashing it, try starting the calibration mode, because the calibration values may be 0 initially in the EEPROM
The clock does not adapt automatically since that would require setting date and year too which is not that easy with the gauges. If your location is switching to DST and back, you need to re-set the time twice a year. It only takes a minute so not that much of a hassle.
I'll try to explain as good as possible. If anything is unclear, don't hesitate to leave a comment.
All parts of the housing can be printed in a material of your choice without supports. Rotate the parts by 45 degrees to fit on the Prusa Mini bed. Make sure to place the Z-Seam on the side that faces down after assembly
I got some pretty bad warping on the housing and had the Z-Seam on the top side but I decided to use it anyways for the initial build and then print a replacement at a later date (or probably never) ;-)
Print the scales for the voltmeters on 100% scaling, use normal paper or sticky labels.
To disassemble the voltmeter, remove the 2 screws on the sides and carefully remove the front part of the housing. Pay attention to not bend the needle.
Remove the 2 screws holding the scale and carefully remove it.
Turn around the plate you just removed because otherwise the original scale might shine through the paper.
Stick the new scale to the plate (as horizontally and centered as possible) and carefully cut around it with the knife. The round cutout at the bottom is especially important as the needle passes quite close to it and should not get stuck on paper sticking over the edge. The outer edge is not so important as it will be covered by the plastic ring later.
Assemble the scale to the voltmeter and check if the needle can move freely. Then assemble the voltmeter back together.
Above is the Pinout-Chart of the standard Arduino nano.Â
D9 → hour gauge positive pin
D10 → minute gauge positive pin
D11 → seconds gauge positive pin
Negative Pins of all three gauges → connect to GND
A4 → SDA pin of the DS3231 module
A5 → SCL pin of the DS3231 module
VCC and GND of the DS3231 module → Connect to 5V (VCC) and GND
D7 → Button 1
D8 → Button 2
the other sides of both buttons are connected to GND
The whole contraption is powered via the USB cable that we also use to program the Arduino. In the back cover there is a groove for the cable.
Alternatively you can hook up a 5V supply to the 5V and GND or if you have a power source with up to 12V you can hook it up to the VIN-Pin on the Arduino. There is an internal voltage regulator but it will get quite hot with 12V and may shorten the lifespan of the arduino.
I recommend using USB power (allows for easy reprogramming as a bonus) or a proper 5V supply.
I am still working on some things and will then update the files and description.
Solved Issues
If you like this printable and want to support future projects, you can contribute to my next roll of filament on Ko-Fi. https://ko-fi.com/smallthings_ch
*Links may contain affiliate links that give me a small commission when you buy
License:
Creative Commons — Attribution — Noncommercial — Share Alike