Build it step by step
0 of 6 doneWire the module
Connect the signal side to A0 and ground, and the input to the voltage to measure.
Read the voltage
Open the Serial Monitor and compare with a multimeter on a 9 V battery.
Set the calibration
Adjust CAL until the two match.
Wire the servo
Add the capacitor and check the needle moves.
Print the dial
Draw a 0 to 15 V arc on card with ticks every volt, mounted behind the needle.
Calibrate the marks
Test at 3 V, 6 V, 9 V and 12 V and re-mark the dial if needed.
How do you build a servo needle voltmeter?
A servo needle on a printed dial shows a voltage like an old analogue meter. You need Arduino Nano, SG90 Micro Servo, Voltage sensor module (0 to 25 V), Electrolytic capacitor 1000 µF and Breadboard 830 Tie Points. It takes 6 steps and about 90 minutes.
- Level
- Beginner
- Time
- About 90 min
- Parts
- 5
Parts list
- Development BoardsBuyArduino Nano × 1
- Motors & ActuatorsBuySG90 Micro Servo × 1
- SensorsBuy
- PassivesBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Voltage module VCC pin (signal side) | Left unconnected | The module does not need it |
| Voltage module S (signal) | Nano A0 | Reduced voltage, one fifth of the input |
| Voltage module - (signal side) | Nano GND | Common ground |
| Voltage module input VCC+ and GND | Voltage to measure, 0 to 15 V only here | Input terminals |
| Servo signal | Nano D9 | Needle |
| Servo red | Nano 5V pin or a separate 5 V supply | Power |
| Servo brown | Nano GND | Ground |
| 1000 µF capacitor | Across the servo power wires, + to 5 V | Absorbs servo surges |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). No libraries needed beyond the built-in Servo. The 0 to 25 V sensor module divides the input by five, so A0 sees at most 5 V. Measure DC only, up to 15 V in this build (so the dial uses most of the servo's travel); never measure mains. Set CAL by comparing the Serial reading with a multimeter. Keep the servo's power wires short and use the capacitor, or power it from a separate 5 V supply with a common ground, so the needle does not twitch.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Servo.h>
Servo needle;
const byte SENSE = A0;
const float FULL_SCALE_V = 15.0; // voltage at the right-hand end of the dial
float CAL = 5.0; // module divider ratio; adjust against a multimeter
float shown = 0;
void setup() {
Serial.begin(9600);
needle.attach(9);
}
void loop() {
long s = 0;
for (byte i = 0; i < 16; i++) s += analogRead(SENSE);
float volts = (s / 16.0) * 5.0 / 1023.0 * CAL;
shown = 0.9 * shown + 0.1 * volts; // smoothing makes the needle glide
int angle = constrain(map((long)(shown * 100), 0, (long)(FULL_SCALE_V * 100), 20, 160), 20, 160);
needle.write(angle);
Serial.println(shown, 2);
delay(30);
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
0.50 0.95 1.36 1.72 2.05 2.35
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| 0 V | Needle at the left end |
| 7.5 V | Needle in the middle |
| 15 V | Needle at the right end |
| Changing voltage | Needle glides smoothly |
If it does not work
Needle twitches
Add the capacitor or power the servo separately.
Reading wrong
Set CAL against a multimeter and check the module's signal pin.
Needle at the end stop
The voltage is above FULL_SCALE_V. Lower the input.
Reading never changes
Check the ground link between the module and the Nano.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the servo needle voltmeter?
Arduino Nano, SG90 Micro Servo, Voltage sensor module (0 to 25 V), Electrolytic capacitor 1000 µF and Breadboard 830 Tie Points.
How long does the servo needle voltmeter take to build?
About 90 minutes for a beginner maker, in 6 steps.
How do I know the servo needle voltmeter works?
0 V: Needle at the left end. 7.5 V: Needle in the middle. 15 V: Needle at the right end.
Needle twitches: what should I check?
Add the capacitor or power the servo separately.
Reading wrong: what should I check?
Set CAL against a multimeter and check the module's signal pin.
Needle at the end stop: what should I check?
The voltage is above FULL_SCALE_V. Lower the input.
Reading never changes: what should I check?
Check the ground link between the module and the Nano.
