Go Down

### Topic: Battery life indicator (Read 3715 times)previous topic - next topic

#### kurtselva

##### Dec 13, 2012, 08:03 pm
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  )

#### HazardsMind

#1
##### Dec 13, 2012, 08:28 pm
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.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

#### dc42

#2
##### Dec 13, 2012, 08:53 pm
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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### oric_dan

#3
##### Dec 13, 2012, 09:24 pm
OP, I hope you're not trying to power an Arduino using one of those measly little 9V batteries.

#### HazardsMind

#4
##### Dec 13, 2012, 09:28 pm
Go with a 9.6V rechargeable battery pack
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

#### liuzengqiang

#5
##### Dec 13, 2012, 11:33 pm

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.

#### sbright33

#6
##### Dec 14, 2012, 01:35 am
They only work for long if you sleep the Arduino most of the time.  Most beginners do not know how to do it properly.

#### oric_dan

#7
##### Dec 14, 2012, 02:28 am
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.

#### HazardsMind

#8
##### Dec 14, 2012, 02:37 am
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.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

#### kurtselva

#9
##### Dec 14, 2012, 04:00 am
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 ?

#### kurtselva

#10
##### Dec 14, 2012, 04:08 am
To add on, I might not be using the backlight of the LCD as well

#### giants_fan3

#11
##### Dec 14, 2012, 05:09 am
@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.

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.

Go Up