Project tutorial

# 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.

• 2,523 views
• 6 respects

## Components and supplies

 Arduino UNO & Genuino UNO
×1
 Jumper wires (generic)
×1
 AA Batteries
×1

## Apps and online services

 Arduino IDE

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.

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()
{
float volts = (val/1023) * referenceVolts;
Serial.println(volts);
}
```

• 7 projects
• 5 followers

#### Published on

December 16, 2018

#### Members who respect this project

and 3 others

See similar projects
you might like

#### DIY Voltmeter with Arduino and a Nokia 5110 Display

Project tutorial by Nick Koumaris

• 12,226 views
• 22 respects

#### Arduino Voltmeter (Standalone Application)

Project tutorial by abhinav

• 2,819 views
• 10 respects

#### Voltmeter Using Arduino

Project showcase by Next Tech Lab

• 34,054 views
• 69 respects

#### DIY Voltmeter Using Arduino and Smartphone

Project tutorial by IoT_hobbyist

• 2,792 views
• 30 respects

#### DIY Idea with RFID

Project tutorial by Electronic Clinic

• 11,474 views