Battery life indicator

Hi guys,

I need to implement a battery life indicator for my project. What I have in mind is a very simple battery life indicator for a 9V battery, using just 1 red LED. So what happens is that when the voltage reaches around 7.8V and below, the red LED lights up. If it is higher than 7.8V, the red LED does not light up. And when the red LED lights up, it sends a signal to the arduino which then displays a warning sign on the LCD display.

Can anyone help me with how the schematic should look like and connections for the battery life indicator should look like? Am totally clueless (New to arduino :blush:)

Many people have asked and done that very same thing, MANY times. Try to do a search in the forums, for reading a battery voltage.

Make a voltage divider from two 100K resistors, connect it between +9V and ground, and connect the midpoint to an analog input pin of the Arduino. Also connect a 10nF or 100nF capacitor between the midpoint and ground. When you do an analogRead from that pin, 7.8V will correspond to (7.8/2) * (1024/5) = 799. If you get a reading less than that, drive an output pin high to light the LED. How you display the battery state on the LCD is up to you - I normally display the battery voltage to 1 decimal place if there is enough space.

OP, I hope you're not trying to power an Arduino using one of those measly little 9V batteries.

Go with a 9.6V rechargeable battery pack

oric_dan(333):
OP, I hope you're not trying to power an Arduino using one of those measly little 9V batteries.

If I use these "measly little 9V batteries" with my arduino projects, which don't involve actuators but do have displays, I can have them run for a maximum of 2 days straight. If you just occasionally turn them on and look at them, they can last for quite some time. One of my projects from 2 years ago is still working with this battery since I turn it off after running it for a bit. These are two extremes but the OP really didn't say what amount of power is involved in the project so every 9V batteries are not totally unfit.

They only work for long if you sleep the Arduino most of the time. Most beginners do not know how to do it properly.

Looking at this d/s indicates 600 mA-hr for 25 mA load, so a regular Arduino without any loading will run
for maybe 24 hours. Poo on that, says I. Rechargeable 9V are only rated at 200 mA-hr, so 3X worse.

http://www.jameco.com/Jameco/Products/ProdDS/198731.pdf

I have used the 9V in dataloggers with 32-Khz xtal. At that rate, it will run for about 30,000 hours or
about 3 years. That makes more sense.

No I was refering to something like this,http://www.batteryground.com/product/3/382/One-96v-2000mah-Nimh-High-Capacity-Battery-Pack-For-Rc-Car-robots.html

I know those rechargeable 9 volt batteries suck.

I am thinking of running the arduino with a 9V b attery indeed..

The arduino is basically connected to a 16 by 2 LCD display, a RTC module, 2 push buttons and a servo. But the servo runs on its own battery source. so, the arduino powers everything else other than the servo. The servo rotates 180 degrees every 4 hrs per day max. And the LCD display sleeps after inputs have been transferred to it via the pushbuttons and only wakes up when the pushbutton is pressed again or when the battery gets low...

So if this is the case, any idea how long the 9V battery would last?
Or any other portable and not too expensive suggestions other than http://www.batteryground.com/product/3/382/One-96v-2000mah-Nimh-High-Capacity-Battery-Pack-For-Rc-Car-robots.html ?

To add on, I might not be using the backlight of the LCD as well

@oric_dan(333) : That is incredible -- how did using a 32-Khz xtal reduce the current draw that much? I'm curious what the exact numbers are on the current draw that you measured.

oric_dan(333):
I have used the 9V in dataloggers with 32-Khz xtal. At that rate, it will run for about 30,000 hours or
about 3 years. That makes more sense.