How can i made A Digital Voltmeter Using Arduino

arduino based dc voltmeter circuit diagram
Block Diagram of DC Voltmeter
Component Required 
  1. 1 * Arduino Board(In this article we use Arduino UNO)
  2. 1 * LCD Module(Here we will use 16 * 2 LCD Module)
  3. 1 * 100K Resistor 
  4. 1* 10K Resistor
  5. 1 * 5K Potentiometer
  6. Some jumper wires
  7. Breadboard 
Circuit Diagram
Circuit diagram of this projects is very simple and easy to understand. Here we use a 16 * 2 LCD module to display the voltage. Read this article to learn How To Interface LCD With Arduino UNO.
arduino based DC Voltmeter circuit
Circuit Diagram
A voltage divider circuit is used here to divide the input voltage by the range  of Arduino board. As we all know that Arduino is compatible with till 5v only. Above this voltage, our Arduino may be damaged.
Analog input pin on the Arduino board measure the input voltage and convert it into digital format by using inbuilt ADC(analog to digital converter) that can be processed  by Arduino and then display it on LCD. In this project, we fed input voltage to analog pin A0 of Arduino by using the voltage divider circuit. A simple voltage divider circuit is made by using one 100kohm and one 10kohm resistor to make the 1:11 divider. Thus, by using this voltage divider circuit we can measure the voltage up to 55V.                      
         Voltage divider output  Vout  = Vin * ( R2/(R1+R2) )
It is good if you use this voltmeter project to measure the voltage within range 0v to 35v. Because large voltage may be damaged your Arduino board. 

Code 
In this project, we use inbuilt liquid crystal library for the display of voltage value and analogRead() function to read the input voltage at the analog pin A0. Here our reference voltage is 5V, hence we multiply read value with 5 and then divide it with 1024 to obtain the actual voltage. Then by using the voltage divider formula we can decrease this value within the range of Arduino board voltage.
/*
PROJECTSDUNIA
" DC Votmeter using ARDUINO "
Designed By Sachin Jaiswal
In this we measure the input voltage and display it on the 16 * 2 LCD Module
For Full Description Visit http://projectsdunia.blogspot.com
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins
float vin=0.0;
float temp=0.0;
float r1=100000.0; // Set the value of resister R1
float r2=10000.0; // Set the value of resister R2
void setup() {
Serial.begin(9600);
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.print("PROJECTSDUNIA"); // Print a message to the LCD.
delay(1000);
lcd.clear();
lcd.print("DC VoltMeter");
}
void loop() {
int analog_val=analogRead(A0); // read the value of analog pin A0 and store it in the variable analog_val
temp = (analog_val * 5.0)/1024.0;
vin = temp/(r2/(r1+r2));
if(vin<0.1)
{
vin=0.0;
}
lcd.setCursor(0, 1); // set the cursor to column 0 line 1
lcd.print("Voltage = "); // print the voltage
lcd.println(vin);
delay(300);
}