LIPO charger schematic

@Robert93820
Hi everyone,
I have returned to a project that was shelved for a couple of months but I am now back working on. I am hoping to have a pcb manufactured using the attached schematic. The PCB will be mounted in a case and used to charge a LIPO battery with power from a micro USB. I have used some circuitry from the public arena with some modifications to give a desired 500mA output. I acquired an MCP73831T IC (datasheet here https://ww1.microchip.com/downloads/en/DeviceDoc/MCP73831-Family-Data-Sheet-DS20001984H.pdf) and managed to get it attached to a breakout SOT23 board so have been able to breadboard the schematic. The results seem to be OK in that I am getting 4.04v charge to the battery so that is as I think it should be.
I am hoping someone might cast an eye over the schematic and perhaps advise any glaring or even subtle problems they might see and I should address before I have the board manufactured. The major problem I am having on the breadboard is the LED indicators. The SMD LED I have specified have a Vf 2.2v so by my calculation they will require a 560ohm R1 & R2. However when I use a 3mm LED (2.3Vf)on my breadboard setup a 560Ohm resistor means the LED’s never light. If I use a 180ohm resistor the led do light but both come on. I am afraid my knowledge is too limited to even fully understand how the LED should operate but do believe the red should come when charging and green come on when fully charged but not sure if both should ever be on at the same time…
Hope someone can help and hopefully Bob you might see the post and offer some more advice as you have done so often in the past.

2 Likes

Hi Leslie,

Neat project :slight_smile:

Upon taking a read through the datasheet it looks like you’ve made a few modifications to the example schematic (IMO its usually best to keep your schematic closely resembling that of the example).

  • Is there any reason you are going for a 10uF cap instead of the recommended 4.7uF?
  • the LEDs seem to be setup correctly when using the reference point of the STAT pin, with a Vf of 2.2 (the lowest forward voltage) and a resistor of 560 ohm you will have a forward current of 0.005 A, this should be more than enough to light a 3mm LED - in the shutdown mode where a battery isn’t connected neither should light up
  • If you connect a LiPo what does the voltage read on the STAT pin with and without the LEDs?

PS: Looking at other designs are usually the way to go, Core made this one that works well - battery lights when charging is finished: Makerverse USB-C LiPo Charger | Core Electronics Australia

Is there a reason you want a charging and charged LED? Would a Power + Charge LED work?

EDIT: It would also be worth probing the output current to be sure that the Rprog resistor is making the IC behave as expected

3 Likes

Hi Liam, what great feed back. Thankyou. I will examine your suggestions more closely when back at my desk but to just answer a couple of obvious ones.
I am using a 10uF capacitor because a similar circuit was using a 10uF cap but yes as you point out the sdatasheet calls for something different. That is certainly something i need to explore
I really only need an led to say it is connected to power and one to show charging complete so again your question is spot on
I will explore your other suggestions tomorrow and no doubt have more to report and ask.
Hank you again
Les

3 Likes

Hi Leslie
If the “Stat” pin is floating you effectively have the 2 LEDs in series and with 180Ω resistors thee may be enough current to light the LEDs when USB power is available. They won’t be very bright but could be visible. I can see what your idea is though. If the “Stat” pin is low (0V) the Red one should be on and if this pin goes High (5V) the Green one should be on and the Red off. That is assuming the “Stat” pin can provide enough current to drive the Green LED on and sink enough to light the RED one.
Just had a quick look at the data sheet and it looks like the source and sink current capability is OK to operate the LEDs. BUT to source current to drive the Green one on and voltage to turn the Red one off the USB cable must be present and supply the required voltage. Came to this conclusion by looking at the chip block diagram as the source V and A comes from VDD.
Cheers Bob

3 Likes

@Robert93820 @Liam120347
The help from both of you is much appreciated and after looking at what I had drawn and recognising the very diplomatic comment by Liam I have now rebuilt my breadboard using the datasheet example and it is doing exactly as expected. One question that arises is the output current is 660mA not the 500mA I was expecting but I am not sure that is a problem. I have remeasured the Rprog resistor and it is showing 2kOhm so not sure why that is happening. I am using a bench power supply which is showing 5.1v and 530mA so could that be the reason. The final board will run from a Micro USB connection which typically should deliver 5v @ 500mA max I believe.
I would like to have a power and charging LED as Liam has suggested but not a Charging and Charged LED as I had on my previous schematic. I have been unable to ascertain from the Datasheet (although I am sure it is in there:-() what the LED in the example is indicating but assume it is telling me when lit that there is power to the system from the power input. If I require a second LED that would light when the battery is charged-although to some extent that is a debatable proposition because when exactly is the battery charged. Can either of you gentlemen suggest how I should set that second LED in the schematic?
I must say I have a dickens of a time calculating the Resistor sized as 470ohm. Not because I dont understand Ohms law (I do) and neot because of the maths (that is simple) but determing inputs is my problem and as I dont know the Vf of the LED in the sample schematic I cant arrive at the 470ohm resistor. Any help in this area would be really appreciated.
Cheers and thanks for getting me off in the now correct direction.
Les

2 Likes

Hi Leslie

I would not lose too much sleep over that. As this is only an indicator (most LEDs are) I don’t see the current and forward voltage drop as critical. most LEDs will have pretty much the same perceived brightness over a fairly wide current range. While there must be a brightness change which would be measurable the human eye probably won’t see it. With most LEDs you can get a glimmer with the very small current supplied by multimeters on the diode check function. There are exceptions of course with high sensitivity LEDs but these are not common in the 3mm range.

For most 3mm LEDs if you assume 2V to 2.5V forward voltage drop you won’t go far wrong. If in doubt just measure it. By my reckoning 470Ω should be about 6mA so you could probably use anything between 330Ω and 510Ω without too much drama.

As a matter of interest how did you measure that. Measuring current at these low voltages with a multimeter in series with the load is usually a bit tricky. On the mA ranges the “voltage burden”, that is the voltage actually dropped by the meter, is usually high enough to upset the operation of the load circuitry so what you read will not mean much. This can be overcome mostly by using the 10A range where this voltage will be very small. Most decent meters will have a 1mA resolution on this range. The other alternative is a non invasive method like a sensitive clamp meter which will read milliamps or a hall effect type of meter.

Just had a quick look at the data sheet and this indicates a sink current of 4mA at the stat pin so I would go for a LED resistor of 470Ω.
Cheers Bob

3 Likes

Hello Bob, good advice again! I measured the output current by placing my multimeter in line with the output voltage going to the battery. The MM i used is an auto ranging digital meter and I used the 10amp side then set the rotary dial to mA. I can easily believe your comment re the accuracy of the measurement as after i posted my reply i then checked it again and it was 510mA so i put that down to the battery becoming close to fully charged probably an erroneous conclusion
You are quite right regarding the LED resistor and brightness I just like to continue my learning process by working out how recommended sizes have been calculated not because i want to change them necessarily but i figure if i cant calculate the simple things where i seem to have all the inputs how can i calculate the important things without constantly relying on the goodwill and gracious input of others. No point asking a question and not fair to ask it if i haven’t at least attempted to solve it first.
Cheers and thank you.

PS. Bob you said
Just had a quick look at the data sheet and this indicates a sink current of 4mA at the stat pin so I would go for a LED resistor of 470Ω.
Would you mind giving me the maths for that calculation so i can better learn and understand?

3 Likes

Hi Leslie

Vin or VDD = 5V
LED forward drop say 2.3V
5V - 2.3V = 2.7V
Current through 470Ω = 2.7/470 = 0.0057A or 5.7mA
If you require 4mA = 2.7/0.004 = 675Ω or preferred value of 680Ω
But as I say this is not particularly critical so I would follow the manufacturers example and use 470Ω. If the manufacturer says it is OK it should be.
Cheers Bob

EDIT: Sorry just re-visited the data sheet. I completely mis read so delete all reference to 4mA above.That was a test condition. The Stat pin will sink 25mA and source 35mA so with 470Ω the LED current will be between 5mA and 6.5mA depending on actual LED forward voltage drop.

3 Likes

Hi Bob, as a friend often says things you dont know until you find out. Your last post has lead me to understand the difference and meaning of Sinking and Sourcing. The result is i think i am getting a glimmer of understanding about the two LED and how/why they work as indicators. I think what I am learning is The Stat pin can be a sink accepting up to 25mA current or a Source providing 35mA current and its state is determined by the charge condition of the battery. So when battery is low and charging Stat is in Sink mode and an LED btwn Vcc and the Stat pin will light. When the batt is charged Stat is in Source mode and the current it is now supplying will light an LED between the Stat pin and Gnd.
Do i have that correct- god i hope so as i have been wrestling with how that very small and unimportant part of the circuit works. What i am unsure of is what happns to the incoming current from Vcc (25mAa)when the Stat pin goes to Source does it just pick up 10mA from the Stat pin and provide 35mA to the Charged indicating LED on its way to Gnd or is that totally wrong??
Bob thank you for your help on this and all my questions.
Cheers

3 Likes

Hi Leslie

The data sheet does not say really which way around the Stat pin works unless I have missed it.

As I said I don’t really know. It will be one way or the other so aside from that you are essentially correct.

I don’t think you really get it so you could say you are totally wrong. The LEDs will want and only use the current dictated by the current limiting resistor. In the example 470Ω. I thought this has been explained time and time again. Just because the pin is capable of supplying 35mA does not mean it is going to do so. for instance if you have a 5V power supply capable of 2A and connect a LED with a 470Ω resistor in series across it the current will only be about 6mA, NOT the 2A the supply is capable of. I really am getting a bit fed up explaining this so please get a power supply and some bits and do some experimenting and measuring.

If you look at the chip diagram on page 2 of the data sheet you linked, at the bottom right you will see the Stat pin and what drives it. It should be obvious but you should see that in the sink mode current comes from outside and is passed to ground via the lower mosfet. In source mode the current is supplied from VDD (VCC) via the upper mosfet and is passed to a load (LED and resistor??) on the outside world thence to ground. If VDD is not connected there will be no source current. In the same breath if the “sink” LED is wired as the example circuit this LED will not come on without VDD connected either.

So in direct answer to your last question above, all of the source current is provided from VDD.
Cheers Bob

3 Likes

Bob thanks for your response and fair enough in your other comments. I wont bother you again
Cheers

2 Likes

Hi Leslie
It is not a real bother but I find I am repeating myself over and over. I think I have said to you in the past this is a rewarding hobby but you have to do some research of your own. You can’t do an electronics course in a few months especially starting in the middle by remote control. The problems you are just having are basic, volts, amps (current) and resistance. Ohm’s law. You need to get some sort of grasp with this and a lot of things will fall into place. It is not terribly mysterious but I think you need to do some reading and hands on experimenting. Don’t give up.
I will still help where I can.
Cheers Bob

3 Likes

Hi Leslie
If I have offended you I apologise. My reply above was meant to be constructive criticism and get you thinking and researching yourself. I have found over the years that if you can solve a problem with your own research you are more likely to retain that knowledge in the old grey bank.

Add on
Core have some tutorials when I found them. There are some of interest under the “Analog Electronics” banner you will find here

This is probably as good a place as any to start. There are lots of other articles and tutorials on the internet. For your present problems with LEDs and resistors and understanding what happens look under “Analog” as that is what it is (not digital).
Cheers Bob

2 Likes

Morning Bob, Thank you for your note and the tutotial links. I will say I was somewhat taken aback by your comments but not offended. At my age in life I dont get, nor expect, many admonitions however I do understand how frustrating it can be when people you are helping with some thing dont appear to put any effort in to learning more about the process. Thank you for the links i will explore them.
Cheers Les

2 Likes

Hi Leslie
I liked your bit about sailing lessons (which you seem to have deleted). That would be me. Anything smaller than the QE2 is too small.
Anyway I posted a bit of a water and tap analogy some time ago which may help with your understanding and I found it…
Quote…
There will be a voltage drop across a resistance when a current is passed through it BUT you need a voltage in the first place to force that current through the resistance.

Could use a water analogy.
Header tank providing water pressure = voltage source, battery etc. Voltage could be likened to pressure like EMF = ElectroMotive Force.
Pipe = wire to carry the water to do something = electrical current.
Tap = resistance. Turned fully on more water, less resistance more current. Turned partially on, less water, more resistance less current.

The thing to note here is the water pressure (Volts) does not change.

This hopefully might help you understand some of the tutoring material.

When you get your head around Volts, Amps, Resistance introduce Power (Watts) and the relationship to the other 3 units. When you get some understanding of all this I think some of your earlier queries and replies might make more sense.
Keep plugging away
Cheers Bob

2 Likes