Charging a Lifepo4 with an Lm2596 module - Page 1
Forum section: electronics / projects

author: Tj80
author_rank: Newbie
timestamp: August 15, 2020, 05:15:56 pm
content: Hi,I'm trying to build a project which includes a Lifepo4 battery to run a Wemos D1 Mini for many months using deep sleep. I also need a charger circuit to allow the battery to be charged when power is available.I'm trying to use an LM2596 constant current module to do this, and although it charges the battery fine I am having trouble with the battery discharging through the LM2596 module at around 9mA when no power is being input.I have tried putting a diode between the positive output of the LM2596 module and the battery positive and increasing the output voltage of the module to overcome the diode drop. This stops the discharge from the battery into the LM2596 module - but now the battery won't charge! Actually, it does charge - but only at 0.9mA compared to ~150mA at the current state of charge without the diode. I can't fathom out what's going on and why the simple addition of a forward biased diode is stopping the thing from working!Any advice gratefully received!Many thanks,Tim

author: bin_liu
author_rank: Contributor
timestamp: August 17, 2020, 01:02:15 am
content: LM2596 is constant voltage module,you need CC and CV circuits.LM2596 can be completed with LM358. . .

author: Tj80
author_rank: Newbie
timestamp: August 17, 2020, 08:39:19 am
content: Hi,Thanks for the reply. The module I'm using is one of the commonly available CC and CV ones - same as this:https://www.ebay.co.uk/itm/292139967286I have set a 500ma current limit and 3.6v constant voltage, this all works fine to charge the battery without the diode but not with.I'm wondering if the forward biased resistance of the diode is high enough to affect it?Many thanks,Tim

author: bin_liu
author_rank: Contributor
timestamp: August 18, 2020, 12:54:50 am
content: The voltage setting is wrong. When the battery is not connected, it should be 4.2V. If a diode is connected to the output, must be 4.2V+VF.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 18, 2020, 01:27:13 am
content: Quote from: bin_liu on August 18, 2020, 12:54:50 amLiFePO4 is only 3.6V fully charged. I actually recommend 3.45V since the extra charge you can get going to 3.6V is especially small with LiFePO4 but keeping the charge voltage lower increases service lifetime.

author: Tj80
author_rank: Newbie
timestamp: August 18, 2020, 02:33:42 pm
content: Yes, it's 3.6v for the LiFePO4 cell (I'm using one of these instead of a Li-ion battery because I want to run the Wemos D1 Mini without a power-sapping voltage converter). Agree on reducing the charge voltage, I was going to go for 3.5v but used 3.6 to get a higher charge rate while testing - interesting you suggest 3.45v, I may give that a try.My next option is to use a simple relay to completely disconnect the battery from the LM2596 module unless the module itself is powered, but that feels like a horribly clunky solution! It will also consume a bit more power, but at least it won't discharge the battery.Many thanks,Tim

author: magic
author_rank: Super Contributor
timestamp: August 18, 2020, 07:09:18 pm
content: It doesn't work because it takes some voltage drop across the diode to force current through it. See "typical forward characteristic" in the datasheet, it's gonna be 0.6~0.8V for reasonable currents. And no, you can't increase LM2596 output by 0.6V because it will also be 0.4V for slightly lower current, which my still end up slowly overcharging the battery by 0.2V.In theory you could take feedback to the LM2596 from behind the diode, maybe, but then the feedback divider would be discharging the battery so it's pointless.Some kind of "ideal diode" circuit would help, if you can find one that has negligible leakage when off. I'm not familiar with those things.A relay doesn't even look that bad at this point.

author: Tj80
author_rank: Newbie
timestamp: August 18, 2020, 09:10:11 pm
content: Interesting. Many thanks - relay it is then!Cheers,Tim

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 18, 2020, 11:40:22 pm
content: The voltage drop over the diode is the most likely cause of your troubles.The voltage to current curve is actually exponential, but for practical reasons it's usually taken as a constant 600mV voltage drop in forward direction (for silicon diodes) and some 300mV for Scottky diodes.You can make an "ideal" diode with a mosFET. MosFet's do not have an inherent voltage drop, they have a (relatively constant) resistance when "on". The "on" resistance of a Mosfet can easily be as low as 10mOhm, even for small mosfets (SOT023 housing).But in your case a simple mechanical relay seems a good solution.The relay is then directly powered from your external power source, so the current drain won't be a big problem.Also, think about any electronic component connected to the battery in your circuit.Current leakage through an electrolytic capacitor can be 100uA, and can be bigger than the current of your uC in deep sleep.

author: bin_liu
author_rank: Contributor
timestamp: August 19, 2020, 12:34:24 am
content: I'm wrong.mistake it is Li-ion.Lifepo4 OCV is 3.65V.after stopping charging.voltage will drop.is ～3.4V/CELL.