# Battery level indicator help

Discussion in 'The Projects Forum' started by plasmaninjaa, Jul 31, 2013.

1. ### plasmaninjaa Thread Starter New Member

Nov 16, 2012
5
0
Hello all! This is my first post.
Let me start by saying I am very very new at circuits so go easy on me haha.

I am using this circuit http://imgur.com/eUil72x
it works perfectly. Basically it fades an led from green to yellow to red as the battery runs out.

However, now I want it to work while charging the battery. So as the battery charges the led goes from red to yellow to green as the battery goes from dead to full charge.

But I have no idea how to get the circuit to read the voltage from the battery and not the power adapter that I am using to charge the battery!

2. ### MrChips Moderator

Oct 2, 2009
12,252
3,283
Use a duplicate of the same circuit but adjust the thresholds to 13.8V and 14.4V.

3. ### plasmaninjaa Thread Starter New Member

Nov 16, 2012
5
0
could you explain a little more? How will this measure the voltage of the battery as it charges?

Your saying I need 2 of each component? or is there a way to simplify that.
Believe it or not, this is for an invention of mine which I am currently prototyping and I am hoping to sell, so I need it to be professional but cheap!

4. ### MrChips Moderator

Oct 2, 2009
12,252
3,283
Hopefully if your charger is current limited the battery voltage will creep up as it is being charged.

You can use the same circuit but switch to different thresholds when charging and discharging.

Or put a single voltage monitor across the battery.

5. ### plasmaninjaa Thread Starter New Member

Nov 16, 2012
5
0
I'm still not sure I understand. I'll test out what you mean though

6. ### MrChips Moderator

Oct 2, 2009
12,252
3,283
What is the size (capacity) or model number of your battery?
What is the max current and voltage output of your charger?

7. ### plasmaninjaa Thread Starter New Member

Nov 16, 2012
5
0
the battery is 11.1v 1600mah li-ion
the charger is 12v 1a

8. ### wayneh Expert

Sep 9, 2010
11,930
2,861
You could set up a second voltage reference and switch to that while charging. This would add very little to your existing circuit.

You could even use a quad comparator LM339 instead of that op-amp (which is configured as 2 comparators), and then use another of the 4 comparators on that IC to detect charging, and then switch the reference voltage for you.

9. ### plasmaninjaa Thread Starter New Member

Nov 16, 2012
5
0
ok so your saying that the voltage taken from the charger and battery in parallel will rise as the battery charges? This makes a little more sense.
How would I go about switching?

Oct 2, 2009
12,252
3,283
11. ### wayneh Expert

Sep 9, 2010
11,930
2,861
Your current circuit uses the 5V regulator to provide the reference voltage.

A manual switch would be very simple. You could switch between 2 resistors to complete the existing voltage dividers that provide a measure of battery voltage to the 2 comparators. Flipping the switch would move the two set points.

You could instead add a voltage divider off the 5V reference, and then use a switch to choose between 5V and a lesser value from the divider. Personally, I think that's what I would do.

I'm sure there's a clever way to automatically switch from one to another with a comparator, but it's eluding me at the moment. It'll come. Hopefully someone else will come along with it first.