Go Down

### Topic: question about battery (Read 731 times)previous topic - next topic

#### coos

##### Apr 09, 2011, 05:17 pm
is there any simple way to read a battery's voltage from arduino?
thx?

#### James C4S

#1
##### Apr 09, 2011, 05:42 pm
This is a pretty common question.  Search this forum and Google for "Measure Battery."

You've given no details (why kind of battery, how often you need to measure it, what you want to do based on the reading, etc.)
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

#### johnwasser

#2
##### Apr 09, 2011, 06:04 pm

is there any simple way to read a battery's voltage from arduino?

For a voltage between 5V and 0V, referenced to Arduino ground:  analogRead()

For a voltage ABOVE 5V, referenced to Arduino ground:  Voltage divider (two resistors) and analogRead()

For negative voltages things get complicated.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### coos

#3
##### Apr 09, 2011, 06:10 pm

This is a pretty common question.  Search this forum and Google for "Measure Battery."

You've given no details (why kind of battery, how often you need to measure it, what you want to do based on the reading, etc.)

It's 12V li-ion battery?i want to know when the battery should be replace?so i should measure it first

#### James C4S

#4
##### Apr 09, 2011, 07:53 pm
I have found that if you want to measure the same battery the arduino is on, you need to isolate the battery from the I/O pin when un-powered.  Otherwise the atmega will get "back powered" through the I/O pin, draining your battery.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up

Please enter a valid email to subscribe