element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Data Conversion
  • Challenges & Projects
  • Project14
  • Data Conversion
  • More
  • Cancel
Data Conversion
Blog Digital Voltmeter
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Data Conversion to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: harjinagi
  • Date Created: 15 Mar 2021 6:19 AM Date Created
  • Views 1095 views
  • Likes 5 likes
  • Comments 1 comment
  • digital_voltmeter
  • dataconverch
  • arduino nano project
Related
Recommended

Digital Voltmeter

harjinagi
harjinagi
15 Mar 2021

Hello Everyone, My name is Harji Nagi. I am currently a third-year student studying electronics and communication engineering from Pranveer Singh Institute Of Technology (PSIT), Kanpur(Uttar Pradesh).I have a keen interest in robotics, Arduino, Artificial Intelligence, and Analog electronics.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Introduction:

It's easy to make a simple digital voltmeter using an Arduino and 16x2 liquid crystal display (LCD).

It's relatively simple to use an Arduino to measure voltages. The Arduino has several analog input pins that connect to an analog-to-digital converter (ADC) inside the Arduino. The Arduino ADC is a ten-bit converter, meaning that the output value will range from 0 to 1023. We will obtain this value by using the analogRead() function. If you know the reference voltage--in this case we will use four different power sources like 9V and 5 battery, Solar Panel. We can easily calculate the voltage present at the analog input.

To display the four measured voltages, we will use a liquid crystal display (LCD) that has two lines of 16 characters. LCDs are widely used to display data by devices such as calculators, microwave ovens, and many other electrical appliances. Therefore the monitoring system consists of 4 different parameters i.e V1, V2, V3, V4. In this project, I measured voltages of Solar panel, two 9V battery, and one 5V battery simultaneously

This project will also show you how to measure voltages above the reference voltage by using a voltage divider. In order to measure voltages greater than the 5 V reference voltage, we need to divide the input voltage so that the voltage actually input to the Arduino is 5 V or less. in this experiment, we will use a 100 Kohm resistor and a 10 Kohm resistor to create a 10:1 divider. This will allow us to measure voltages up to 50 V.

List of Components:

  • 1x Arduino Nano
  • 1x 100 Kohm resistor
  • 1x 10 Kohm resistor
  • 1x LCD (Liquid Crystal Display)
  • 1x 10k potentiometer
  • 1x breadboard
  • male and female jumper wires

 

Circuit Diagram

 

image

Circuit Diagram (1.0) for measuring single Voltage

In the above circuit diagram, the microcontroller is Arduino mega the same circuitry can be applied with Arduino Uno and Nano. And this circuit is for measuring a single voltage.

 

The potentiometer is connected to the 5V source and GND and the middle terminal is connected to pin 3 of LCD. Rotating this pot changes the brightness of the LCD. The four data pins DB4-DB7 are connected to the Arduino pins 4-7. Enable is connected to pin 9 of the Arduino and RS is connected to pin 8 of the Arduino. RW is connected to ground. The backlight LED is connected to 5V and ground. The following table shows the pin connections:

DB4 ----->pin4

DB5 ----->pin5

DB6 ----->pin6

DB7 ----->pin7

RS   ----->pin8

EN   ----->pin9

 

image

Circuit Diagram (1.1) for measuring for 4 voltages

The above circuit diagram will be the same as that of the circuit(1.0), the only difference is about the increase in the number of resistors and analog pins to measure different voltages simultaneously.

Code:

The program below uses the LiquidCrystal.h library. This library contains all of the functions needed to write to the LCD.

The loop reads the analog value from the analog input, and because the reference voltage is 5 V, it multiples that value by 5, then divides by 1024 to calculate the actual voltage value, once the voltage has been calculated we have to divide the calculated voltage by the ratio R2/(R1 + R2), which in this case is 10,000/(100000 + 10,000) ≈ 0.09.

 

, the value is written to the LCD.

 

/*1x Arduino Mega2560
1x 100 kohm resistor
1x 10 kohm resistor
1x LCD (Liquid Crystal Display)
1x 5k potentiometer
1x breadboard
female connector
jumper wires
*/
#include "LiquidCrystal.h"

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

float input_voltage = 0.0;
float temp=0.0;
float input_voltage1 = 0.0;
float temp1=0.0;
float input_voltage2 = 0.0;
float temp2=0.0;
float input_voltage3 = 0.0;
float temp3=0.0;
float r1=90900.0;
float r2=10000.0;


void setup()
{
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
  lcd.begin(16, 2); //// set up the LCD's number of columns and rows: 
}
void loop()
{
   
//Conversion formula

  int analog_value = analogRead(A0);
  temp = (analog_value * 5.0) / 1024.0; 
  input_voltage = temp / (r2/(r1+r2));
   
  if (input_voltage < 0.1) 
  {
  input_voltage=0.0;
  } 
  Serial.print("v= ");
  Serial.println(input_voltage);
  lcd.setCursor(0,0);
  lcd.print("V1=");
  lcd.print(input_voltage);
  delay(300);
  int analog_value1 = analogRead(A1);
  temp1 = (analog_value1 * 5.0) / 1024.0; 
  input_voltage1 = temp1 / (r2/(r1+r2));
   
  if (input_voltage1 < 0.1) 
  {
  input_voltage1=0.0;
  } 
  Serial.print("v= ");
  Serial.println(input_voltage1);
  lcd.setCursor(0,1);
  lcd.print("V2=");
  lcd.print(input_voltage1);
  delay(300);
  int analog_value2 = analogRead(A2);
  temp2 = (analog_value2 * 5.0) / 1024.0; 
  input_voltage2 = temp2 / (r2/(r1+r2));
   
  if (input_voltage2 < 0.1) 
  {
  input_voltage2=0.0;
  } 
  Serial.print("v= ");
  Serial.println(input_voltage2);
  lcd.setCursor(8,0);
  lcd.print("V3=");
  lcd.print(input_voltage2);
  delay(300);
  int analog_value3 = analogRead(A3);
  temp3 = (analog_value3 * 5.0) / 1024.0; 
  input_voltage3 = temp3 / (r2/(r1+r2));
   
  if (input_voltage3 < 0.1) 
  {
  input_voltage3=0.0;
  } 
  Serial.print("v= ");
  Serial.println(input_voltage3);
  lcd.setCursor(8,1);
  lcd.print("V4=");
  lcd.print(input_voltage3);
  delay(300);
}

  • Sign in to reply

Top Comments

  • michaelkellett
    michaelkellett over 4 years ago +4
    The Arduino doesn't have a very good resolution but the ADC can measure quite fast. You can improve the resolution by averaging several ADC readings per measurement. It isn't as good as having a better…
  • michaelkellett
    michaelkellett over 4 years ago

    The Arduino doesn't have a very good resolution but the ADC can measure quite fast. You can improve the resolution by averaging several ADC readings per measurement.

     

    It isn't as good as having a better ADC but will be an improvement on the basic single sample per measurement  method.

     

    MK

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube