Arduino Voltmeter

by Rezz on October 5, 2011

This arduino projects show how to make voltmeter with your arduino. It use voltage divider concept to estimate the voltage input.

Parts List;
1) 1x 16×2 parallel LCD display (compatible with Hitachi HD44780 driver)
2) 1x Arduino
3) 1x 10kΩ potentiometer
4) 5x 10kΩ resistor
5) 2x 2.2kΩ resistor
6) Jumper wire

1) Connect all jumper wire as shown in diagram.

Upload this code to your arduino

  Voltmeter base on voltage divider concept.
  Code based on:
  Coded by:

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

// variables for input pin and control LED
  int analogInput = 1;
  float vout = 0.0;
  float vin = 0.0;
  float R1 = 50000.0;    // !! resistance of R1 !!
  float R2 = 4400.0;     // !! resistance of R2 !!

// variable to store the value 
  int value = 0;

void setup(){
  // declaration of pin modes
  pinMode(analogInput, INPUT);

  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);

void loop(){
  // read the value on analog input
  value = analogRead(analogInput);

  vout = (value * 5.0) / 1024.0;
  vin = vout / (R2/(R1+R2));  

  // print result to lcd display
  lcd.setCursor(4, 0);

  // sleep...

a) You might saw some reading 0.06V even there is no Vin supply, this may caused by signal noise. You can add if statement to flush this reading. ie

if (vin<0.09) {
add before print result to lcd display line.

b) Reading didn’t match when using multimeter, this caused by 2 factor in the project. First actual resistance value in R1 and R2 is having 5% tolarance error. Use multimeter to find the actual resistance for R1 and R2, replace R1=50000 and R2=4400 in the code. Second factor is V supply by arduino itself, recheck the 5V supply with multimeter at pin GND and pin 5V. It might give you less, ie 4.85V. Replace this value into the code;
vout = (value * 5.0) / 1024.0;
replace the 5.0 value to the actual V reading in this case 4.85V.

{ 5 comments… read them below or add one }

Eric October 9, 2011 at 1:34 pm

What’s the highest voltage the meter can measure


Rezz October 11, 2011 at 5:38 am

9V still safe, I didn’t recommend higher than this your arduino might fry! Careful.


Jozsef January 21, 2016 at 12:48 pm

What is the maximum voltage?


Bhargav Dhokia August 24, 2016 at 5:02 pm

Does it can measure millivolt?


Danny van den Brande September 1, 2016 at 1:52 pm


I was fixing a broken Laptop adapter from a friend, i used it for the laptop charger/adapter. and i measured about 19/20 Volts without any problems.


Leave a Comment

Previous post:

Next post: