Arduino Panel Meter Clock By Russ Hughes (russ@owt.com)
OVERVIEW My father has been a lifelong Ham Radio Operator with a fondness for almost anything with a panel meter. After seeing the Trinket Powered Analog Meter Clock by Mike Barela on the Adafruit website (https://learn.adafruit.com/trinketpowered-analog-meter-clock) I knew I had to create one. 3D PRINTING All parts print without support. I printed mine in PLA with a 0.2mm layer height using 3 top, bottom and perimeter shells CUSTOM METER FACES The Hour and Minute meter faces were created using MeterBasic from Tonne Software. MeterBasic is a fine program for the hobbyist who wants to generate a simple scale occasionally. MeterBasic is based on a subset of the features found in Meter and there are no plans to update it regularly. It requires no key and has no time or usage limitations. To provide an incentive to upgrade from MeterBasic to Meter, many of the features found in Meter are absent.. Download and install a copy from http://www.tonnesoftware.com/meter2.html. The source files for the meter faces are included in my project files so print one (or two, stuff happens) of each of the meters. Take apart the meters by removing the two small screws on front of the meter and remove the cover. Carefully remove the two small screws that hold the meter s scale plate and remove the plate by sliding it up and off the two very easily broken plastic or metal pins. Glue the new meter face to the back side of the plate (they are usually blank) and replace the scale plate with the new face showing. Reassemble the meter and congratulate yourself either on a job well done or the fact that you bought extra meters and nobody has to see havoc you have wrought on a poor panel meter.
PARTS LIST 1 3D Printed Case & Buttons 1 Arduino Pro Mini 328-5V/16MHz https://www.sparkfun.com/products/11113 2 0-5 Vdc Analog Panel Meters http://www.amazon.com/dp/b0051e8ona 1 DS3231 RTC http://www.amazon.com/dp/b00hr8ldgs 2 6x6x4.3mm Tactile Push Buttons http://www.amazon.com/dp/b008ds1gy0 1 DC Power Jack Socket http://www.amazon.com/dp/b00cklzhmi 1 Vero 250D Protoboard http://www.amazon.com/dp/b00g3ehatg 4 M3-0.5 Screws (around 8mm length) http://www.amazon.com/dp/b00f32dmqy 7 M2-0.4 Screws (around 6mm length) http://www.amazon.com/dp/b00f33tfrs 10 short lengths of wire http://www.amazon.com/dp/b00x7bqyke 1 2.54mm Single Row Female Header http://www.amazon.com/dp/b00899wq6u 1 2.54mm Single Row Male Header http://www.amazon.com/dp/b00uvpt5ri 1 6 to 12Vdc wall power adapter
ASSEMBLY Solder the headers to the Arduino Pro Mini including the A4 & A5 pins on the top of the board. It should look similar to the picture below. Drill two additional holes in the protoboard mirroring the two existing holes so they line up with the 4 standoffs on the rear panel of the case. Cut 2 pieces 12 pins in length from the Female Pin Header and solder them to the top side of the protoboard as shown below.
Solder the two Tactile Push Buttons to the backside of the protoboard as shown below. These buttons should be directly above the time button adjust holes in the rear panel of the case when the board is mounted to the four standoffs. The orientation of the switches is important as the two sets legs are tied together. If you have the switch rotated 90 degrees it will act like it is always pressed. Use a multimeter to verify that the normally open pins are arranged horizontally and they are closed when the buttons are pressed. The lower pins of the buttons should line up with the Arduino s D8 and D11 pins.
Turn the board over so you re looking at the top side again. The solid yellow boxes in the picture below show the position of the legs of the tactile buttons. I usually fold the legs over to keep the button in place while soldering but be careful that the lower two legs don t make connection with any of the adjacent solder pads. The lower two pins of the buttons should line up with the Arduino s D8 and D11 pins Cut three 2 pin strips from the male header and solder in the locations marked by the red boxes in the picture below. One 2 pin header should line up vertically with the Arduino s D5 & D6 pins. The second 2 pin header should line up horizontally with the Arduino s GND pin. The third 2 pin header should line up vertically with the Arduino s RAW and GND pins. Cut a 3 pin strip from the male header and solder in the location marked by the yellow box Solder two short lengths of wire between the solder pads as show below in blue. Each of the wires should run from one of the Arduino s ground pins to the bottom outside pins of the tactile buttons.
Turn the protoboard over so you are looking at the bottom side again. Solder short lengths of wire or create solder bridges between the pads as shown by the red boxes.
THE RTC BOARD If your RTC board has a diode located near the red arrow in the picture below, remove it from the board. It is intended to be a charging circuit and it should not be used as it can cause damage to your battery. Take a look at these web pages for more information on this charging circuit: http://woodsgood.ca/projects/2014/10/21/the-right-rtc-battery/ http://forum.arduino.cc/index.php?phpsessid=7g23qcadtiqrk6098k53ceok96&topic=278270.msg2330192#msg233019 2 Remove the 6 pin header from the RTC board if it has one. You can unsolder it or just clip it with wire cutters. Solder a 4 pin male header or 4 short lengths of wire to the battery side of the RTC board.
Use M2 screws to mount the RTC board battery side up to back of the case as shown below. Mount the power jack through the large hole in the back of the case as shown below. Solder 2 short lengths of wire to the positive and ground tabs of the connector.
Place the two 3d printed buttons through the two holes (they have notches not shown in this picture to clear the standoffs) so the small nubs of the buttons stick out the back of the case leaving the large flat surfaces inside the case so they can activate the time adjust buttons on the protoboard. Mount the protoboard in the back of the case as shown using M2 screws. The 3d printed buttons should line up with the two tactile buttons on the other side of the protoboard.
MOUNTING THE METERS Mount the meters through the front of the case and secure them in place.
MAKING THE CONNECTIONS I used premade cables with female Dupont Connectors at each end and an assortment of 2, 3 and 4 pin housings to make these connections but you could use any small diameter wire. Connect the RTC board to the protoboard and Arduino as follows; RTC SCL to Arduino A5, RTC SDA to Arduino A4, RTC VCC to Arduino VCC, RTC GND to Arduino GND If you plan to run the clock off a regulated 5 volt supply like a USB port or charger connect the power jacks positive wire to one of the VCC pins. If you plan to use a 6 to 12Vdc wall power adapter connect the power jack s positive wire to the header pin connected to the Arduino s RAW pin. Connect the power jacks GND wire to the header pin connected to Arduino s GND pin. Make two cables with 2 wires each with small round crimp terminal at one end. I just soldered the crimp on terminals over the existing female connectors since they fit. Attach one of the cables to the 2 pin ground header on the right side of the protoboard. Attach the other end of each wire to the - terminal on each of the panel meters. Connect the other cable to the 2 pin header connected to the Arduino s D5 & D6 pins. Connect the wire from the D5 pin to the + terminal of the HOUR meter and the wire from the D6 pin to the + terminal of the MINUTE meter.
PROGRAMMING The Arduino Pro Mini has no USB port so it requires a 5V FTDI board or other device to program. I use a FTDI Basic Breakout from Sparkfun available from http://www.amazon.com/dp/b0068qkqea or https://www.sparkfun.com/products/9716. The clock sketch uses an additional library to communicate with the RTC board that you will need to install. See the Arduino website if you need more information on how to install libraries. The RTCLib library is available from https://github.com/mizraith/rtclib Load the PanelMeterClock sketch into the Arduino IDE then compile and upload it to the Arduino Pro Mini. The clock should automatically set the time to the time that sketch was compiled and start displaying the time. You can set the time by pressing either the Hour or Minuet adjust buttons. Due to variances in meters your clock may need to be calibrated if the needle does not point to the correct digit for each hour and minute. The clock sketch contains two arrays hpwm[] and mpwm[] that hold the PWM values used for each hour and minute. You can step thru the hours and minutes using the time adjust buttons making note of any inaccurate readings and then adjust the corresponding values in each array to get a more accurate display. I have also included a CalibrateMeter sketch that will let you step thru all the possible PWM values from 0 to 255 using the time adjust buttons. The current PWM values will be printed to the Serial Monitor in the Arduino IDE. You can use this to step through each hour and minute to determine the best PWM value for each. FINAL ASSEMBLY Carefully tuck the wires into the case and attach the back of the case with four M3-0.5 machine screws. Enjoy your new clock. Russ