Charging lipo while powering device? - Page 1
Forum section: electronics / projects

author: Peabody
author_rank: Super Contributor
timestamp: January 29, 2018, 05:05:17 pm
content: I have a DSO150 Shell kit oscilloscope, and I want to convert it to battery powered. There's a thread on this on the JYETech forum, and basically everyone is using some kind of single-cell 3.7V flat lithium polymer battery, a USB-powered charging and protection module using a TP4056 and DW01A, and a boost converter (to 9V) module using an MT3608. There's room for all that inside the case. The scope draws 120ma when powered by a 9V wall wart. The circuit is essentially the one shown here, except that his final output voltage is 5V:https://easyeda.com/GreatScott/LiPoChargeProtectBoost_copy-3d9f4c3ddc7347d7861776340b9b90b7The question I have is whether it makes sense to try to operate the scope while charging the battery. My battery will have a 1350 mha capacity, and I thought I would set the maximum current out of the charger to be just under 500ma, which is the maximum you can get from USB2, and a conservative charging rate for the battery even if more current is available. But it's not clear to me what would happen if the scope is turned on while the battery is charging. When the stuff I've ordered arrives I can experiment, but at this point I don't understand how the 500ma at the maximum 4.2V charging voltage would be divided up between the battery and the boost converter.Others in the JYETech forum thread report that they can power the scope while charging, but there's no detail on that. It just seems to me that doing that is problematical. Even if the boost converter is able to get enough current to operate the scope, the charger will never see the point where the current is less than 10% of the 500ma, and will therefore never shut down the charging session That means "charged" LED will never come on, and the battery will continue to see 4.2V after it is fully charged, which I understand is not good for it.One modification I've seen is to feed the boost converter from the charger/battery through a schottky diode, and also feed the converter from the USB 5V line though another schottky diode. So when USB is plugged in, it would separately power the charger and the boost converter. But for that you would need more than 500ma. So USB3 or a 5V charger would be needed.Most of the battery-powered devices I have can be operated while charging, and will shut down charging when fully charged. Is the diode arrangement the typical way to do that?Actually, it might work to replace the battery schottly with one backwards-oriented P-channel MOSFET (body diode forward biased). with its gate tied to USB 5V with a 100K pull-down resistor to ground. That MOSFET would be ON when USB isn't plugged in, and OFF when it is. Kinda like a reverse polarity protection setup.So what's the story on this issue? What would be best practice?

author: Peabody
author_rank: Super Contributor
timestamp: February 11, 2018, 05:53:33 pm
content: If possible, I would like to get more information on this.The situation is that the lipo charger is providing power not only to the battery, but also to the device being powered. If the device draws more current than 10% of the nominal full charge rate for the lipo, then the charging process will never shut down, and 4.2V will be applied to the lipo continuously. I've always heard that this is bad for the lipo, and may eventually make it swell or even catch fire.So the first question is - is that really true. If exactly 4.2V is applied continuously, why wouldn't the charging current eventually drop to zero, and no harm would be done?Second, if this really is a problem, how do all the devices which allow operating while charging deal with it? It seems they would have to power the device from the primary input power whenever that's plugged in. That would let the battery charging continue to shutdown normally. If so, how is that typically done circuit-wise?

author: soubitos
author_rank: Frequent Contributor
timestamp: February 11, 2018, 10:41:23 pm
content: i made a setup with two of my TP4056FlexAdv modules which are a voltage regulator a charger with protection and a booster in one pcb.First module is powered with 9.5A from a power supply and is set to charge the battery attached to it at 1A max while its output is set to 6V (xl2011 specs is for 8-45V input but with as low as 6 it only drops its output down to 4,8V which is perfectly fine for the TP4056). The battery on the first TP4056FlexAdv is fully charged.The second module is powered from the boosted output of the previous one set at 6V and its charge current is set to 120mA, the battery attached to it is at 3.7v and it draws 115-120mAAs you can see in the video, the first module only draws 6mA which is actually the TP4056 driving the Green LEDThe second module draws power from the battery and unless the battery drops bellow the TP4056 recharge threshold which is around 4.05-4.1VAs long as the charge current of the FIRST module is above the current drawn from its battery from the second one, or load, it will charge the battery to 4.2V again and will stop, This will take longer than normal but only because the voltage on the battery will not reach 4.2V while you draw power from it.Since in normal operation you will NOT leave the external power on the device while using it, the more likely situation is that the battery will drop lower and when you recharge it will only reach 100% and stop charging when you shut down the device and let it recharge.https://youtu.be/rIe90T1T6sw

author: soubitos
author_rank: Frequent Contributor
timestamp: February 11, 2018, 10:51:27 pm
content: This is how i actually use an early version of this module with my chinese "transistor" tester.Removed the DC jack from the tester pcb as it is replaced from the one on the module.In real life, you will be using the device until battery drops low.At that point you will be recharging it... you will be able to use it while recharging... but i dont see why you would be powering the device from an external power source while you have a lithium battery capable to power it for several hours with one charge and one that will recharge in a couple hours if left at 1A charge current

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 12, 2018, 01:04:37 am
content: It's fairly straightforward - the charger puts a particular current into that battery - if your load is drawing current that that will simply draw some of that reduce the charge rate (assuming max load is < charge rate).There may be issues if your load is noisy , which could confuse the charger. You also need to take care over grounding and lead resistance to make sure the charger is measuring the actual battery terminal voltage accurately and not getting offsets from load current drawthe ideal way is to have a bypass system to split the incoming supply between charging and load, but this can get surprisingly complex due to dealing with all the possible charge/discharge paths - Microchip do a few charger chips that support this. (e.g. MCP73871)

author: Peabody
author_rank: Super Contributor
timestamp: February 12, 2018, 02:01:39 am
content: Ok, I found a charging circuit that separates the load and the charging. The charger/battery output goes through a P-channel mosfet with very low RdsOn, so very little voltage drop. The mosfet is configured "backwards". Its gate is normally pulled down to ground, turning it on. But when USB or whatever is plugged in, the gate goes high, which turns it off. Then there's another path from USB V+ to the load through a diode. That's to prevent the battery from trying to power the charger when USB isn't plugged in. So anytime USB is plugged in, it directly powers the load, which leaves the battery charging to complete normally. I think this illustrates that something like this needs to be done, or you need to remember not to run and charge at the same time.https://www.jyetech.com/Products/118/Manual_118.pdfAN1149 also shows this setup for your MCP73871. So I guess that's the way it's done.But I still don't understand why applying 4.2V to a lipo continuously does any harm.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 08:05:50 am
content: Quote from: Peabody on February 12, 2018, 02:01:39 amThis is actually what the combination of TP4056+FS312G/DW01+FS8205 doesI charged the empty battery on the second module in my video without external power on the first one so the battery would drop down to 3.9V... Note that the second battery is 3x the capacity of the first one and down to 3.2V when i started this setup. When i connected power to the first module, it started charging too... since i set the charge current to 1A the module could supply the 120mA requested from the second module plus charge its own battery. These batteries are beat up but now in the morning that i checked it, first module was fully charged and the second one kept charging as i expected.As long as the current drawn through the TP4056 does not exceed the set charge current and the load does not consume more than the battery charged, it will eventually fully charge the battery without any problems....

author: Red Squirrel
author_rank: Super Contributor
timestamp: February 12, 2018, 08:39:35 am
content: One thing I always wondered is how do large scale systems do this? Ex: The Tesla powerwall or any situation where you have lithium ion batteries in a renewable energy application. It's more complicated with multi cell as you also have to balance charge the cells too! It seems to me it's almost easier to have at least two battery packs, one that is being charged and one that is being used, and a make before break switch that swaps them once in a while so that they are evenly charged/discharged.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 08:42:36 am
content: There is i think a logic of having a charge timer that will stop charging if charge current does not reach say 1/10C in x hours and after x hours from the moment it reaches that level

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 12, 2018, 09:41:45 am
content: Quote from: blueskull on February 12, 2018, 01:38:16 amThe charger will output a current depending on the terminal voltage, not maintain a constant output voltage.it _is_ important to ensure that the charger is sensing actual battery voltage.It's possible that more complex chargers with internal state or timers may get confused.It's not an ideal situation, and probably best avoided for higher loads where battery internal resistance becomes significant, but can be done as long as all the issues are understood.

author: Peabody
author_rank: Super Contributor
timestamp: February 12, 2018, 02:15:04 pm
content: Mike, my charger uses the TP4056, which begins in constant current mode, but when the resulting voltage reaches about 4.1V, it then switches over to constant voltage mode at 4.2V. It automatically terminates charging when current drops below 10% of the constant current level. So instead of reading the voltage across the cell, it fixes that voltage at 4.2V and then measures the current that flows as a result to tell it when to terminate. But it will stay at 4.2V forever if current drawn by the load keeps the total current above that 10% level.Blueskull's solution - charge to 4.1V - would work fine I think, but the 4.2V is baked into the TP4056.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 02:36:29 pm
content: Quote from: Peabody on February 12, 2018, 02:15:04 pmIt makes one wonder... since we all agree 4,2V is not ideal for the cells themselves, how come MOST of the ic's having anything to do with li-ion charging etc the voltages are 4.2...... 4.3V even... sometimes with tolerances and resolution taken into account this can reach 4.4V!For example, most of the TP4056 modules out there have DW01x battery protection ICsFrom their datasheet you can see the various versions (attached image).The "best" among them has a 4.25V overcharge protection but they all have very low overdischarge protection. In my modules i chosen to use FS312F-G which has the same overcharge protection setting but the most important parameter for this type of IC, being the overdischarge voltage, is set at 2.9V which is 0.5V higher than the DW01x parts....Of course, the chip responsible to terminate charging is the 4056 which depending on the manufacturer, tolerances etc is pretty much accurate and i have rarely seen cells being charged drawing under 1/10C and over 4.2-4.25V... I have seen though DW01x+FS8205 dual mosfet on a pcb strip attached to the battery terminals and being charged by a LED driver with nominal voltage of 4.2V

author: KhronX
author_rank: Frequent Contributor
timestamp: February 12, 2018, 03:18:57 pm
content: Well, nowadays you'll routinely see phone / tablet batteries with the max charging voltage spec'd at 4.35v, or even 4.4v. Like this Samsung S7 Edge battery right here:https://cdn.shopify.com/s/files/1/0790/7689/products/OBATG935FBULK_1024x1024.jpg?v=1462878780I tend to agree with what i was discussing with a buddy a few months back, that the max voltage is more a matter of manufacture rather than chemistry, in the sense that LiPo cells won't blow up if you go past 4.2v by, say, 5%, or a couple hundred mV either way.Regarding the discharge voltage, that'll very likely be under load. Once that's removed, you'll see the voltage come back up by a few hundred mV.I've collected a few used phone batteries of various sorts, and i use my Turnigy charger to gauge roughly how much capacity they have left (to see if they can still be useful or not).The discharge cutoff voltage is 3v (with anything between 500-1000mA discharge current), but once that's done, it's quite usual to see the unloaded voltage come back up to 3.2-3.4v.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 12, 2018, 03:49:55 pm
content: Directly powering a circuit from a battery charger while charging is usually not a good idea for several reasons. (That may be fine if the powered circuit draws very little current compared to the charging current.) But this won't be the case with your device, especially since you have a step-up regulator which will not only draw current in spikes, but draw in the order of twice (conversion ratio+efficiency) what you measured on 5V.The reasons I can think of:It may confuse the battery charger IC and make it stop charging;The charging current (during the constant current phase) will be split between the battery and your circuit. Thus, not only will you get a current limitation for your circuit that may make it fail especially if it draws current in spikes, but the battery charging current won't be constant anymore. Not that great;The set charging current must be high enough to accomodate for your circuit current draw. What happens when your circuit doesn't draw that current (such as when it's off or otherwise "sleeping") is that the charging current for the battery will be much higher. The right compromise may be hard to reach;Another potential issue is the output voltage you will get depending on the state of the battery. Your step-up regulator will draw much more current when the battery is fully discharged. Again, the charging current must accomodate for that, which may be problematic. In other setups in which there are only LDOs and/or step-down regs after the battery, this may also prevent them from functioning when powered with the charger adapter and the battery is fully discharged;Related to the first point, most safe battery charger ICs (maybe not all) have an internal charging timer that will make the charging stop after a given amount of time. Since the charger IC will never detect an end-of-charge condition (usually defined as a current draw of less than Ic/10 in constant voltage mode), the charger IC will just shutdown after this time-out (and so will your circuit);Probably other potential issues I can't think of at the moment.Again, if your circuit draws very little current compared to the charging current, you probably don't have to bother. But this won't be the case in your application (unless you choose an high-capacity battery - thus an high max charging current - which probably won't fit mechanically or even make sense).The usual approach to circumvent those problems is to implement some kind of switch-over circuit. You can do this with a PMOS and a diode or use charger ICs that already have such circuitry buit-in (often called "Power-path"). In case you go with the discrete PMOS approach, you have to select the transistor carefully so that its threshold and RDSon fit your application.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 04:07:09 pm
content: My personal conclusion is this... you dont add a rechargeable battery to a portable device to have a power cable hooked to it 24/7... the battery you choose to add in such a device should be able to provide you enough power for several hours of use, ideally for 8hrs between recharges... YOU SHOULD NOT BE USING THE DEVICE WHILE CHARGING and expect it to fully charge, more so to fully charge FAST... do you do that with your phone?IF NEEDED you should be able to use your device for a short period while charging and you will probably going to do that when then battery is near empty but you must use your device... again, isnt that how we ALL use our phones? LOLEven with a smaller battery to fit inside a given small box, like ie a NOKIA mobile phone battery, they have 800-900mAh capacity when new, they are sold cheaply and may be readily available as used with lower capacity surely.. Such a battery will keep a 120-200mA load ON for at least 3-4 hours maybe more... if that is not enough, you can add two such batteries... ask yourself, will i be using the device more than 3-4 or 6-8 hrs straight without a break to recharge the battery? If not, and if you will need to recharge so often why bother? you will be hooked to a mains adapter or usb source anyway most of the time so leave it like that...I havent measured how much current the transistor tester draws, i am sure its in the 50-80mA range though... the battery i have inside it now is beat up with around 1200mAh capacity left.... i recharged it like once a month over the past 3 months.. and i do use it quite a lot.....So, i would say to OP ... go on, using a TP4056 to drive a booster and power your device is perfectly fine...If you get theoretical, you might be afraid to walk the streets cause a car might hit you but that is not the norm is it? Sure a li-ion battery in certain conditions is potentially dangerous... did that stop you from using your phone and how many people you know of or how many cases are recorded out there with phones exploding out of the blue (most are charging failures from known reasons like faulty chargers by design etc)...

author: JVR
author_rank: Regular Contributor
timestamp: February 12, 2018, 04:15:56 pm
content: TI (and others) makes a range of chips for this, its called PowerPath, and they are designed for handeld single cell electronics. They can supply current to the load while chaging the battery, and will stop charging when the battery is full, while stiull supplying the load. When the charging voltage falls away, power is switched seamlessly to the battery.Have a look at the BQ24 series, I've worked mostly with the BQ24250 in production equipment, and while it has some drawbacks for our purpose, powering a widget is well within its capability.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 04:27:30 pm
content: So instead of a 1$ charger + 1$ booster and FULLY charging the battery only when NOT using the device, ie at night, he has to start with a 3$ VQFN-24pin chip a custom pcb, what would eventually cost him 3-5xWhat an overkill!!!!

author: KL27x
author_rank: Super Contributor
timestamp: February 12, 2018, 07:09:05 pm
content: Do you need to power the device from the charger? Why not power the DC boost from Vusb? You would need some rectification, of course. With a FET or an SSR, you could avoid the diode drop when powered from the battery.

author: Peabody
author_rank: Super Contributor
timestamp: February 12, 2018, 09:21:52 pm
content: I did a discharge test with the DW01. It shut down when the voltage under a 50 ma load was 2.38V. But then the LIPO recovered to a little over 2.9V, andthe DW01 unlocked it and let it continue discharging. It went through a couple more cycles like that, and finanlly ended up a little over 2.8V, still locked out. I thought the nominal 2.4V discharge cutoff was too low, but it may be pretty much right given where the LIPO finally settles down unloaded. Anyway, there's probably a DW01 in almost every LIPO which has protection built in. So it's not likely the 2.4V limit is doing any real harm.Well, I think the answer to my question is that I need to recharge the battery with the device turned off. And if I find that to be too inconvenient, which i won't, I can always add the P-channel mosfet and the diode so USB will power the device when USB is plugged in.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 09:50:40 pm
content: If you can replace the DW chip in your TP4056 board, try to find an FS312F-G, i can send you some but shipping is steep, especially comparing to the price of the chips we are talking about(FS312F-G has same or better over voltage protection and cuts off at 2.9V instead of 2.4 of the DW series)

author: Howardlong
author_rank: Super Contributor
timestamp: February 12, 2018, 10:10:39 pm
content: How about a single device that does the above, and has a gas/fuel gauge integrated, preferably with I2C/SMBUS? Can anyone suggest something?My last design needed three devices: considering it’s such a common use case, it seems there ought to besomethingavailable off the shelf.

author: soubitos
author_rank: Frequent Contributor
timestamp: February 12, 2018, 10:12:29 pm
content: Quote from: Howardlong on February 12, 2018, 10:10:39 pmI am in the process of doing something like that actually!

author: soubitos
author_rank: Frequent Contributor
timestamp: March 22, 2018, 01:12:22 am
content: sneak preview