Project tutorial
Arduino as a Voltmeter

Arduino as a Voltmeter © GPL3+

Measure the juice left in your AA or AAA batteries anytime using an Arduino Uno and a couple of jumpers.

  • 1,670 views
  • 0 comments
  • 6 respects

Components and supplies

Apps and online services

About this project

Posted on January 13, 2017January 14, 2017 by electromaniaweb

This is a very simple project that introduces you to the world of analogWrite feature of arduino.

Hardware required :-

  • AA battery
  • Arduino Uno
  • 2 x Jumper cables.

Looking at the hardware that we are going to use in this experiment you can deduce it yorself that it is a very easy project and is uploaded for the understanding  the function of analog pins present in  arduino uno so we can use them gregariously in our future complex projects.

HOW YOUR CIRCUIT SHOULD LOOK LIKE :-

  • This is a DIY(do it yourself) project for you. The circuit is very simple so I am going to just explain the circuit design and you will have to try to make it by yourself. Comment if you come across any problem while doing it yourself.
  • On the left side of your Arduino Uno you can see 6 Analog-In pins(.A0, A1, A2, A3, A4, A5) An analog signal is one that can take on any number of values, unlike a digital signal which has only two values: HIGH and LOW. To measure the value of analog signals, the Arduino has a built-in analog-to-digital converter (ADC). The ADC turns the analog voltage into a digital value. The function that you use to obtain the value of an analog signal is analogRead(pin). This function converts the value of the voltage on an analog input pin and returns a digital value from 0 to 1023, relative to the reference value. The reference is 5V on most Arduinos, 7V on the Arduino Mini and Nano, and 15V on Arduino Mega. It has one parameter which is the pin number.
  • Insert a jumper wire in the A0 pin of your arduino
  • Connect the other jumper wire to the ground.
  • Connect the A0 jumper to the positive terminal of the battery you are measuring.
  • Connect the other jumper to the negative terminal of the battery.
  • Your circuit is ready! simple as that.!

After uploading the code open the serial monitor of your arduino by pressing—-> ctrl + shift +M

I have explained each line of code.

Although I have not mentioned one very important detail.

DO NOT CONNECT MORE THAN 5V battery TO YOUR ARDUINO. The analog pins and every input pin in the arduino has a threshold of maximum 5V. Any voltage above it will PERMANENTLY DAMAGE your uno.

Code

CODEArduino
const float referenceVolts = 5.0; 
const int batteryPin = 0;

void setup()
{
Serial.begin(9600);
}

void loop()
{
int val = analogRead(batteryPin);
float volts = (val/1023) * referenceVolts;
Serial.println(volts);
}

Comments

Similar projects you might like

DIY Voltmeter with Arduino and a Nokia 5110 Display

Project tutorial by Nick Koumaris

  • 9,086 views
  • 6 comments
  • 16 respects

Arduino Voltmeter (Standalone Application)

Project tutorial by abhinav

  • 1,730 views
  • 3 comments
  • 10 respects

Voltmeter Using Arduino

Project showcase by Team Next Tech Lab

  • 25,738 views
  • 25 comments
  • 64 respects

Arduino Digital Voltmeter 5V

Project tutorial by RoboCircuits

  • 3,712 views
  • 4 comments
  • 15 respects

Vintage Bench-Top DC Hybrid Voltmeter

Project tutorial by Shahariar

  • 1,366 views
  • 0 comments
  • 10 respects

Security System And Access Control With Arduino And RFID

Project tutorial by Sarath P

  • 7,945 views
  • 1 comment
  • 19 respects
Add projectSign up / Login