MCP73831 - LiPo Charger STAT Output -  truth table for 2 stats - Page 1
Forum section: electronics / beginners

author: made2hack
author_rank: Frequent Contributor
timestamp: July 07, 2016, 11:38:42 am
content: Hello all,I want to know if my truth table makes sense. I want to charge 2 LiPo cells from 2 MCP73831 chips which output via a Stat pin as shown. When Charging, output is Low, When finished charging, output is High. When no battery, output is High-Z (this doesn't concern me).With one chip, my current setup works fine as in the schematic. What I want to know if I connect output of 2 Stat pins, what will happen when the batteries are not both finished charging at the same time?Ie, battery 1 is done so STAT is high, but battery 2 is charging, so STAT is Low. Will my output be Yellow? (Both Red & Green turned on? ) Or will the High output be sunk to grown by the Stat pin that is Low?Thanks

author: McBryce
author_rank: Super Contributor
timestamp: July 07, 2016, 12:12:32 pm
content: Quote from: trs80 on July 07, 2016, 11:38:42 amThe current will flow to ground through the open drain in the second STAT. R1 and R2 will then work as a voltage divider and depending on the values of R1 and R2 and the transistors you've chosen, the green LED may or may not turn on.McBryce.

author: made2hack
author_rank: Frequent Contributor
timestamp: July 07, 2016, 01:25:01 pm
content: Right ok. I'm gonna have to think about this some.

author: Ian.M
author_rank: Super Contributor
timestamp: July 07, 2016, 01:51:27 pm
content: You need some diodes. The conditions required are:* If either stat pin is low the Red LED must be on.* If either stat pin is high the Green LED must be on.You also cant use a common resistor for the two LEDs.This should work:Caution: If BOTH batteries are disconnected, both LEDs will glow dimmer than usual. To add a circuit to detect this would be quite complex. It will work correctly with one battery connected.

author: Buriedcode
author_rank: Super Contributor
timestamp: July 07, 2016, 01:52:07 pm
content: Generally, if both LED die's are going to be on at the same time, you'll need a current limiting resistor for each one. With a single resistor on the common the LED die with the lowest forward voltage will determine the voltage across both LED's - and green generally requires ~2.1V, whilst red = ~1.8v (these are rough numbers and depends on the material used in the dies).You've done well with your truth table. You could expand it out so that each LED has its own column - the fact they are in the same package just means they have a common cathode. With the last column being the truth table for the LED's - R+G = Y, R = R, G = G etc.That way you'll see that, according to your table the 'green' should always be on, except when both STAT outputs are pulled low.

author: made2hack
author_rank: Frequent Contributor
timestamp: July 07, 2016, 02:07:31 pm
content: @IanM Thanks Ian, didn't think about the diodes. It makes perfect sense the way you drew it out. I'm not worried about High-Z since the battery will always be present.@Buriedcode, You are right about the resistor no longer being common. It will work with Ian's schematic.

author: Ian.M
author_rank: Super Contributor
timestamp: July 07, 2016, 02:45:06 pm
content: There is one 'gotya' in my schematic. Because the NPN transistor is an emitter follower, it doesn't have a base resistor. Therefore the input signals must never be above the Vdd rail feeding the LEDs. Also expect to have to tweak the LED resistor values for equal brightness as the Red one pulls up to Vdd-Vce_sat, but the Green pulls up to two diode drops below the status signal high level.

author: made2hack
author_rank: Frequent Contributor
timestamp: July 07, 2016, 03:19:00 pm
content: @Ian.K will do.

author: KL27x
author_rank: Super Contributor
timestamp: July 07, 2016, 09:18:45 pm
content: Does your device have a power light?Why not just use the 78732, open drain output. Connect them both to a single LED and single resistor. Two components. When the LED is lit, one or both are charging. When it's out, charging is done. As long as there's some other indicator light when plugged in, you will know the USB power is good. And therefore, if the LED is off, both batteries are finished charging.I'm all about simple. Heck, give them each their own LED and resistor and add a dedicated Vusb LED and resistor. That's 3 LED and 3 resistors, and you are still ahead of the curve. Wash on parts counts, but fewer pads and much simpler routing.

author: McBryce
author_rank: Super Contributor
timestamp: July 08, 2016, 07:40:14 am
content: Quote from: Ian.M on July 07, 2016, 02:45:06 pmYou can just move R2 and D6 above Q1 and add a resistor to the base of Q1.McBryce.

author: Ian.M
author_rank: Super Contributor
timestamp: July 08, 2016, 08:35:37 am
content: No you cant, because D5 & D6 are a common cathode tricolour LED that shows Yellow when only one battery is fully charged so the two cathodes share a single lead.. Anyway, its not an issue if the LEDs are powered from the same Vdd as the MCP73831

author: McBryce
author_rank: Super Contributor
timestamp: July 08, 2016, 09:00:03 am
content: Ah, didn't realise that, I thought they were two seperate LEDs.McBryce.