Introduction

Before LEDs and computer screens were common methods for displaying information, engineers and scientists depended on analog panel meters that looked like:

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

Required Parts

This project uses a few items from the TINKERkit:

  • the TINKERplate connected to the Raspberry Pi
  • five male to male jumper wires
  • the 9G servo motor
  • In addition, you will need some double sided sticky tape, some thick cardboard for the backing and 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.

Steps

Fabrication

  1. First cut a pointer 100mm long out of cardboard (yes we use metric sometimes):

    Here is an STL file if you have access to a 3D printer: https://www.thingiverse.com/thing:4007011. For a pointer that tapers to a sharp tip, try this one: https://www.thingiverse.com/thing:4008354
  2. 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:
  3. 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.

    Here's what our plexiglass looked like before we cut the top and pulled off the protective film. Note that we used a hacksaw and a Dremel to cut the notch.
  4. 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. Here's what ours looked like:

    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.
  5. Print out the scale shown below. 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.
  6. 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.

Electrical Assembly

Connect everything together as shown in the diagram below:

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.

Final Assembly / Calibration

After making the electrical connections, take the following steps:

  1. Power up the Raspberry Pi and then open a terminal window
  2. 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.
  3. Pop the servo arm back onto the shaft with pointer directed straight up at the 6V position.
  4. Type TINK.setSERVO(0,1,15) <ENTER> 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.
  5.  Type TINK.setSERVO(0,1,165) <ENTER> 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.

Code

The VOLTmeter.py program is shown below. You can either type it in yourself using the Thonny IDE or copy ours 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 <ENTER> 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.

The above code can be downloaded from github by typing the following instructions on the command line:

  1. git clone https://github.com/pi-plates/TINKERplate-Projects.git
  2. cd TINKERplate-Projects
  3. python3 AnalogVoltMeter.py

Conclusions

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:

  1. 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.
  2. We also suspect that our servo motor isn't quite linear across its full range.

To learn more about the inner workings of servo motors, read THIS document.

Series Navigation<< Ultrasonic Parking AssistantTemperature Controlled Fan >>
1 Comment
  1. Excellent project I always wanted to build the retro by latest available components .
    Keep it up your guidance is inspiration for my long time ambition to build such a nice meters

Comments are closed.