# Battery backup Indicator Circuit

Discussion in 'The Projects Forum' started by Renardak, Jan 29, 2013.

1. ### Renardak Thread Starter New Member

Jan 29, 2013
3
0
Hey Guys,

New to the forums but I've browsed them a few times and found some useful tips for sure. I also tried to do a search for similar problems I'm having with mine but no real avail.

I'm trying to build a Indicator circuit with Green, Yellow and Red LED's to signify the battery life. Where when one comes on the others are off.

Green 9V - 8.5 V
Yellow 8.4 V - 7.9-7.5 V
Red from 7.5 to 0V or as far as it stays lit.

I've tried multiple ways to do this both using BJT's, relays etc. I'm trying to do it using Comparitors as it seems like the simpilest way but I can't get the LED's to trigger at a threshold and having a hard time figuring out whats wrong. I'm new to electronics just in my second year engineering program so any guidance as to where to go or some help would be greatly appreciated.

P.s I know some of the values are messed up on the resistor I was just trying anything at this point.

[img=http://imageshack.us/scaled/thumb/715/schematics.jpg]

2. ### MrChips Moderator

Oct 2, 2009
12,652
3,461
Ok, you've got the right idea, except your inputs to the comparators are not quite right.

A basic analog comparator has two inputs. You will be comparing the voltage levels of the two inputs.
When the +ve input level falls below the -ve input level, the LED will be turned on.

For a basic analog comparator circuit, you will connect one input (-ve) to a reference voltage, let's say for example 4V. The other input (+ve) will be connected to the output of a voltage divider that is powered from your battery voltage. Calculate the proper resistances to give you the desired trip voltage.

Getting the LED to turn off when the next LED is on is a more difficult problem. You will need logic gates to do that.

3. ### Renardak Thread Starter New Member

Jan 29, 2013
3
0
Any chance that you could give me a quick example MrChips, even off one of the LEDs doesn't even have to be the right voltage. I may be able to figure out turning off the LED's with gates once I get this part down.

4. ### Renardak Thread Starter New Member

Jan 29, 2013
3
0
Sorry I meant a drawn out example.

5. ### wayneh Expert

Sep 9, 2010
12,405
3,256
You might like to read the datasheet for the LM3914. It's a single IC containing multiple (10?) comparators and can be used to produce either a bargraph or line display of input voltage.

6. ### MrChips Moderator

Oct 2, 2009
12,652
3,461
Circuit not tested:

7. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
Circuit not visible.

8. ### Evil Lurker Member

Aug 25, 2011
117
24
That's simple as pie. You only need an LM393 and a TL431. Configure one of the comparators so that the output is sinking current (or low) whenever the voltage being sensed is below X amount and configure the other comparator to do the same whenever the voltage goes above voltage y. The two outputs of the comparator are used to turn on two PNP transistors when they go low thus allowing either the red or green diode to light up depending on output has shifted, and the amber LED is driven off of VCC via NPN transistor. The trick is you simply take the base of the NPN transistor after the base resistor and tie it to each output of the comparator using a couple 1N4148 diodes. What you end up with if the sensed voltage is above x and below y, then both outputs are held high which then allows current to flow into the base of the NPN transistor driving the amber LED. Essentially its just a matter of adding a few logic gates with a little bit of extra silicon here and there.

And oh yeah, for your reference voltage, set up the TL431 with a current limiting resistor so around 2mA flows into the cathode at all times to ensure that you have enough quiescent current flowing at all times to produce a good clean reference voltage, then hook up a 10k trim pot configured as a voltage divider hooked up to the TL431's reference pin. Then its pretty much a simple matter of turning it one way or the other to set your reference voltage, feeding that voltage into your comparator inputs, and using the appropriate voltage divider resistors from your battery tied to the appropriate inverting and noninverting inputs on the comparator.

And oh yeah, unless you want the comparator to have more than one LED on whenever it approaches the edge of the window, be sure to add some hysteresis. Basically its more or less connecting your "+" input to the output of the comparator via a resistor... it doesn't take much, just enough to shift a few millivolts one way or the other