Pages: [1]   Go Down
Author Topic: Measuring battery life remaining with just an analogue in pin  (Read 997 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
simple idea, unlikely to work.

When i test a battery with a multi-meter i measure its voltage, as the battery dies this decreases.

if i connect the battery that is powering my arduino into an analogue in pin as well as vin and ground can i not then estimated battery life remaining for the arduino with this read in value?

thanks
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 462
I am a amateur.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know if your method would work, but the Arduino can measure its own working voltage with this code: https://code.google.com/p/tinkerit/wiki/SecretVoltmeter.
Logged


Offline Offline
Edison Member
*
Karma: 22
Posts: 1164
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That should work just as well as a multimeter.   (If it's over 5V, of course, you'll need a voltage divider.)

Batteries don't discharge linearly, but once you get a feel for the discharge pattern of your particular battery in your particular application, you should get useful results.


smiley-grin My laptop usually thinks there's 3 hours left right before it dies!
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

simple idea, unlikely to work.

Correct.

Measuring battery life accurately is difficult, every battery is different.

Logged

No, I don't answer questions sent in private messages...

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Battery life remaining isn't overly simple to determine, but it's still a good idea to monitor
battery voltage so you know when the system is about ready to crash. If you're using an
LDO regulator that's known to dropout when Vin gets down to 6V, then when it reads
6.25V, you know it's time to make peace with the world. Save the data to EEPROM,
shutdown activities, and go to sleep.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Battery life remaining isn't overly simple to determine, but it's still a good idea to monitor
battery voltage so you know when the system is about ready to crash.

To clarify: Knowing remaining battery power is difficult unless you know which battery you're using and have watched it die before (this is how 'smart' laptop batteries work - they store their own discharge curve inside the battery). Even so, if the load is variable (eg. varying hard disk usage) the estimate is only approximate.

Detecting when the battery is actually in the process of dying isn't difficult - the voltage typically drops off very rapidly at the end.
« Last Edit: May 01, 2013, 02:21:01 am by fungus » Logged

No, I don't answer questions sent in private messages...

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1767
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When i test a battery with a multi-meter i measure its voltage, as the battery dies this decreases.

It depends on the battery type.  Non-rechargeable alkaline batteries do tend to have a slope in voltage as the battery is drained.  Ni-mh/li-po rechargeable batteries tend to deliver the same current for most of the time, until the battery is almost depleted, and then it will start dropping off.  Here is a site that discusses the different types of batteries: http://batteryuniversity.com/
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 100
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did exactly what you suggest. I know which batteries I use for my project, I drained them once to measure voltage versus total current in mAh, so I can estimate how much juice is left. If you change the batteries you most likely have to make a new curve, but it's better then nothing. I can also display voltage left from my battery pack, most of the time that is my queue to change batteries, in order to keep my LDO working.
Logged

Pages: [1]   Go Up
Jump to: