Pages: [1]   Go Down
Author Topic: Battery life indicator  (Read 742 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 98
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-red)
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3414
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

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

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

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3414
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Go with a 9.6V rechargeable battery pack
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

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

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.
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3414
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 98
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 98
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Portland, OR
Offline Offline
Sr. Member
****
Karma: 7
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.
Logged

Pages: [1]   Go Up
Jump to: