Back to Basic Projects

🔋 Arduino Digital Voltmeter

Turn your Arduino into a precision voltmeter — measure 0 to 25V DC using a resistor voltage divider and live LCD display.

📋 Overview

A digital voltmeter converts an analog voltage into a readable number. Arduino's built-in 10-bit ADC can measure voltages from 0 to 5V directly — but with a simple resistor divider, we extend the range to 0–25V.

Technical Insight: The voltage divider uses two resistors (R1=30kΩ, R2=7.5kΩ) to scale the input voltage down by a factor of 5. So 25V input becomes 5V at the Arduino pin, 10V becomes 2V, etc. The formula is: V_in = V_read × (R1+R2)/R2.

In simple terms: We 'shrink' the input voltage to a safe range Arduino can read, then 'stretch' the reading back to the original value in code — like scaling a map.

What you'll learn: Voltage divider design and math, ADC resolution and accuracy, analogRead(), I2C LCD integration, and real-world calibration techniques.

Estimated time: 35-50 minutes. Difficulty: ⭐⭐ Easy — great for electrical lab coursework.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Uno R35V1
Resistor R130kΩ (use 3×10kΩ in series)1Input voltage divider
Resistor R27.5kΩ (use 10kΩ || 30kΩ)1Divider reference
16x2 LCD with I2CHD44780 + PCF85741Or use Serial Monitor only
Breadboard + WiresHalf-size1
Test Battery/PSUUp to 25V DC1Source to measure

🗺️ Component Pin Mapping

Arduino Digital Voltmeter Component Pin Mapping Infographic

📖 Step-by-Step Tutorial

1

Build the Voltage Divider

Connect: V_in → R1 (30kΩ) → Node A → R2 (7.5kΩ) → GND. Wire Node A to Arduino analog pin A0.
2

Install LCD Library

Install LiquidCrystal_I2C by Frank de Brabander via Library Manager.
3

Connect the LCD

SDA → A4, SCL → A5, VCC → 5V, GND → GND. Default I2C address is 0x27.
4

Upload Code

Upload the sketch. The LCD will show the measured voltage updated 5 times per second.
5

Calibrate

Measure a known voltage (e.g. 9V battery) and adjust the CALIB constant in the code for maximum accuracy.
💡
For safety, NEVER measure AC mains (230V) with this circuit. It is designed for DC voltages only, up to 25V maximum. For higher voltages, you need a proper isolated probe and protection circuitry.

💻 Arduino Code

digital_voltmeter.ino
INO
// Digital Voltmeter — Volt X
// Voltage divider: R1=30kΩ, R2=7.5kΩ → measures 0-25V

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

const float R1     = 30000.0; // 30kΩ
const float R2     = 7500.0;  // 7.5kΩ
const float CALIB  = 1.00;    // Fine-tune for accuracy
const int   VPIN   = A0;

float readVoltage() {
  long sum = 0;
  for (int i = 0; i < 10; i++) { sum += analogRead(VPIN); delay(5); }
  float vRaw = (sum / 10.0) * (5.0 / 1023.0);
  return vRaw * ((R1 + R2) / R2) * CALIB;
}

void setup() {
  lcd.init(); lcd.backlight();
  lcd.setCursor(0, 0); lcd.print("  Volt X Meter  ");
  Serial.begin(9600);
}

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0
...

Loading reviews...

volt-X / Arduino Digital Voltmeter — Arduino Tutorial