Introduction: Retro Analog Voltmeter
Before LEDs and computer screens were common methods for displaying information, engineers and scientists depended on analog panel meters. In fact, they are still in use in a number of control rooms to this day because they:
- can be made quite large
- provide information at a glance
In this project, we are going to use a servo to construct a simple analog meter and then use it as a DC voltmeter. Note that many of the parts for this project, including the TINKERplate are available here:
- A Pi-Plate TINKERplate connected to a Raspberry Pi running Raspian and with the Pi-Plates Python 3 modules installed. See more at: https://pi-plates.com/getting-started-tinkerkit/
- Five male to male jumper wires
- A 9G servo motor
- In addition, you will need some double sided sticky tape, some thick cardboard for the backing the arrow, and some white paper. Note: we decided to make our analog meter more rugged so we used a 3D printer to make the pointer and some scrap plexiglass for the backing.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Make a Pointer
Step 2: Attach Pointer to Servo Arm
Once you have made your pointer, use some double sided tape to attach it to one of the arms that come with the servo motor. Then press the arm onto the shaft.
Step 3: Cut the Backer
Cut a piece of cardboard approximately 200mm wide by 110mm high. And then cut a small 25mm by 12mm notch on the bottom edge for the servo motor. You will have to offset the notch about 5mm to the right of center to compensate for the shaft location on the servo. Above you can see what our plexiglass looked before we cut the top and pulled off the protective film. Note that we used a hacksaw and a Dremel to cut the notch.
Step 4: Mount Servo to Backer
Next slide the servo into place with the mounting tabs on the bottom. Use the mounting screws that come with the servo as pins to hold it in place. You may have to use a sharp pencil to punch holes in these locations first if you use cardboard or a drill with a 1/16" bit if you use wood or acrylic. Note how we made our notch too wide which led to the screw on the right missing the hole and getting wedged into the gap. Don't be like us.
Step 5: Print Out Scale
Print out the scale shown above. Cut along the dashed lines while noting the location of the vertical and horizontal lines around the notch. Use those lines to align the scale around the shaft of the servo. A downloadable copy of this scale can be found here: https://pi-plates/downloads/Voltmeter Scale.pdf
Step 6: Apply Scale to Backer
Pop the arm/pointer assembly off the servo shaft and position the piece of paper with the scale on the notched backing material from step three. Position it so that the lines around the notch are centered on the servo. We'll pop the pointer back on after we power up the servo motor.
Step 7: Electrical Assembly
Attach the servo motor and the "leads" to the Pi-Plates TINKERplate using the diagram above as a guide. Once the meter is assembled, the red and black wires connected to the Analog block on the left will be your voltmeter probes. Place the red wire on the positive terminal and the black wire on the negative terminal of the device you plan to measure.
Step 8: Final Assembly / Calibration
- After making the electrical connections, take the following steps:
- Power up the Raspberry Pi and then open a terminal window
- Create a Python3 terminal session, load the TINKERplate module, and set the mode of Digital I/O channel 1 as 'servo'. You should hear the servo move to the 90 degree position.
- Pop the servo arm back onto the shaft with pointer directed straight up at the 6V position.
- Type TINK.setSERVO(0,1,15) to move the servo to the 0V position. If it doesn't quite land on 0, type it in again but with a different angle such as 14 or 16. You may discover that directing the servo to move back and forth in small increments has no effect on the pointer - this is due to a common mechanical issue with gears called backlash which we discuss below. Once you have an angle that places the pointer on 0V, write it down as your LOW value.
- Type TINK.setSERVO(0,1,165) to move the servo to the 12V position. Again, if it doesn't quite land on 12, type it in again but with different angles such as 164 or 166. Once you have an angle that places the pointer on 12V, write it down as your HIGH value.
Step 9: Code 1
The VOLTmeter.py program is shown in the next step. You can either type it in yourself using the Thonny IDE on the Raspberry Pi or copy the below into your home directory. Note lines 5 and 6 - this is where you plug in the calibration values obtained in the last step. For us it was:
lLimit=12.0 #our LOW value
hLimit=166.0 #our HIGH value
Once the file is saved, run it by typing: python3 VOLTmeter.py and pressing the key in a terminal window. If your probe wires aren't touching anything the pointer will move to the 0 volts location on the scale. In fact, you may see the needle move back and forth just a little as it picks up 60Hz noise from nearby lights. Attaching the red probe to the +5V terminal on the analog block will make the pointer jump to the 5 volt mark on the meter.
Step 10: Code 2
import piplates.TINKERplate as TINK import time TINK.setDEFAULTS(0) #return all ports to their default states TINK.setMODE(0,1,'servo') #set Digital I/O port 1 to drive a servo lLimit=12.0 #The lower limit = 0 volts hLimit=166.0 #The upper limit = 12 volts while(True): analogIn=TINK.getADC(0,1) #read analog channel 1 #scale the data to an angle in the range of lLimit to hLimit angle=analogIn*(hLimit-lLimit)/12.0 TINK.setSERVO(0,1,lLimit+angle) #set servo angle time.sleep(.1) #delay and repeat
Step 11: Wrap Up
So, there it is, we used new technology to recreate what was state of the art in the 1950s. Feel free to create your own scales and share them with us
This began as a simple project but it quickly escalated as we thought of more refinements. You might also discover that sometimes the pointer doesn't land on quite the right spot - this is for two reasons:
- There are a series of gears inside of servo motors that, when assembled, suffer from a common problem referred to as backlash. You can read more about it here.
- We also suspect that our servo motor isn't quite linear across its full range.