AJ-Explains-It-All
Published © GPL3+

Arduino as a Voltmeter

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

BeginnerFull instructions provided1 hour6,390
Arduino as a Voltmeter

Things used in this project

Story

Read more

Code

CODE

Arduino
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);
}

Credits

AJ-Explains-It-All
12 projects • 10 followers
Experienced embedded firmware and software developer. I have a great affinity towards ARM cortex based MCU's.
Contact

Comments

Please log in or sign up to comment.