0 to 25 V DC voltmeter with LCD
Build it step by step
0 of 4 doneBuild the divider
100 kΩ from the red probe to A0, 22 kΩ from A0 to GND. The black probe goes to GND.
Wire the LCD
SDA A4, SCL A5, 5V, GND.
Calibrate
Measure the Uno's 5V pin with a multimeter and put that number in VREF. Upload.
Compare
Measure a 9 V battery and an AA cell with both this meter and a multimeter.
How do you build a 0 to 25 V DC voltmeter with LCD?
A 100 kΩ / 22 kΩ divider scales up to 25 V into the Arduino's 0 to 5 V range, and a 16x2 LCD shows the voltage to two decimals. You need Arduino Uno R3, Resistor 100 kΩ, Resistor 22 kΩ, 16x2 LCD with I2C backpack (PCF8574), Crocodile clip test leads (10 pack), Breadboard 400 points (half size) and Jumper wires male to female (40 pcs). It takes 4 steps and about 45 minutes.
- Level
- Beginner
- Time
- About 45 min
- Parts
- 7
Parts list
- Development BoardsBuyArduino Uno R3 × 1
- PassivesBuyResistor 100 kΩ × 1
- PassivesBuyResistor 22 kΩ × 1
- DisplaysBuy
- Connectors
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Red probe (+) | 100 kΩ to A0 | Upper divider resistor |
| A0 | 22 kΩ to GND | Lower divider resistor |
| Black probe (−) | Uno GND | Common ground with the circuit under test |
| LCD SDA / SCL / VCC / GND | Uno A4 / A5 / 5V / GND | Display |
Code
Arduino IDE, board "Arduino Uno". Install LiquidCrystal I2C. Measure the real 5V pin voltage with a multimeter and put it in VREF for better accuracy.
Runs on a virtual Arduino Uno 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 <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const float R1 = 100000.0, R2 = 22000.0;
float VREF = 5.00; // measure your Uno's 5V pin and put the real value here
void setup() { lcd.init(); lcd.backlight(); }
void loop() {
long sum = 0;
for (int i = 0; i < 32; i++) sum += analogRead(A0); // average out noise
float vA0 = sum / 32.0 * VREF / 1023.0;
float v = vA0 * (R1 + R2) / R2; // undo the divider (x 5.55)
lcd.setCursor(0, 0); lcd.print("DC voltmeter ");
lcd.setCursor(0, 1); lcd.print(v, 2); lcd.print(" V");
lcd.print(v > 25 ? " OVER! " : " ");
delay(300);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Probes shorted together | 0.00 V |
| AA cell | 1.4 to 1.6 V, within about 0.05 V of a multimeter |
| 9 V battery | 8 to 9.6 V, within about 0.1 V of a multimeter |
| Resolution | About 0.027 V per ADC step (5 V × 5.55 ÷ 1023) |
If it does not work
Reading a little off
Measure the 5V pin and set VREF. USB supplies are often 4.8 to 5.1 V.
Reading jumps around with probes open
Normal: an open input floats. Short the probes to see 0.
Never above 25 V, and DC only
More than 27 V puts over 5 V on A0. Never connect it to mains or AC.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the 0 to 25 V DC voltmeter with LCD?
Arduino Uno R3, Resistor 100 kΩ, Resistor 22 kΩ, 16x2 LCD with I2C backpack (PCF8574), Crocodile clip test leads (10 pack), Breadboard 400 points (half size) and Jumper wires male to female (40 pcs).
How long does the 0 to 25 V DC voltmeter with LCD take to build?
About 45 minutes for a beginner maker, in 4 steps.
How do I know the 0 to 25 V DC voltmeter with LCD works?
Probes shorted together: 0.00 V. AA cell: 1.4 to 1.6 V, within about 0.05 V of a multimeter. 9 V battery: 8 to 9.6 V, within about 0.1 V of a multimeter.
Reading a little off: what should I check?
Measure the 5V pin and set VREF. USB supplies are often 4.8 to 5.1 V.
Reading jumps around with probes open: what should I check?
Normal: an open input floats. Short the probes to see 0.
Never above 25 V, and DC only: what should I check?
More than 27 V puts over 5 V on A0. Never connect it to mains or AC.
