# Powering a circuit from either USB or LIPO

I have a small hobby project which includes MCU and some peripherals.
It is powered by 3.3V power source and consumes 200mA-800mA for up to a minute. However, most of the time it's in deep sleep mode where is consumes very little current (as low as 5 µA, hopefully) in order for it to last longer when powered by battery.

Now I would like to power my project by USB when USB is connected, or by one cell LIPO battery when USB is disconnected. When USB is connected I would like it to both power the circuit and charge the LIPO.

Here is the high level scheme I had in mind:

simulate this circuit – Schematic created using CircuitLab

Since USB voltage (5V) is always higher than LIPO voltage, D1 and D2 make sure that when USB is connected the LIPO is disconnected from the DC converter, and when USB is disconnected the LIPO charger is disconnected.

### My questions are:

1. Does my high level scheme make sense? Any special consideration for selecting D1 and D2?
2. My main concern is how to select the DC converter.
Input voltage ranges from 3V to 5V although I can probably live with the converter shutting down when its input is below 3.3V as most of the LIPO power is consumed before it gets lower.
I'm looking for a high efficiency converter that can handle efficiently both high currents and very low currents, in order to make the battery last longer.
Would a step down converter be a better choice than LDO? What parameters should I look for in the data sheet?

Your thinking goes in right direction but the choice of components could be better. The task of charging single lithium battery from USB and powering system load at the same time is so common nowadays that there are literally dozens of chips designed exactly for this purpose.

What you are looking for is called "Power Path", and it is a technology that allows input power distribution between charging and system load, powering system from the battery when external adapter disconnected and even boosting external power with battery when system draws more current than available from adapter/USB.

Note, however, that while they all have either LDO or switching buck to get input voltage down to battery charging voltage, they do not have another one for 3.3 V. So, they usually output either regulated 4.2 V or direct cell voltage. Considering your 800 mA maximum system load I'd recommend using buck converter rather than LDO.

• Looking at an IC with a powerpath, for example bq2409x, it seems that the system load and the battery are connected in parallel to the OUT pin. This looks strange to me - if the system load increases suddenly it might draw power from the battery during charge cycle, affect the charging voltage etc. I would think a separate path for the system load and the battery would make more sense in order to protect battery. Is this the usual way "Power Path" is designed? Commented Oct 21, 2018 at 10:17
• No, that is not the usual way. As you've guessed it, that is rather an example of poor implementation. Usually either internal (e.g. BQ24232, MCP73871) or external ( e.g. BQ25060) MOSFET is used to connect a battery to the system load Commented Oct 21, 2018 at 11:54
• Having said that, keep in mind that your 800 mA is rather high for single-cell operation. There are countless applications where system load is only few mA, which does not affect charging at all and that chip will be perfect for them because of it's tiny footprint. That is the reason for so many different chips on the market - system designer can always find the one that better suits the requirements Commented Oct 21, 2018 at 12:11
• Thanks for that input, I've been looking for a decent 'small scale' charger, most have too much 'kitchen sink' but the bq25060 is a good match for one of my projects. Commented Oct 22, 2018 at 13:01

Overall looks reasonable.

Regarding D1, all diodes have reverse current leakage (temperature dependend, and usually in the microamp range, unless you're talking Schottkeys then it's considerably higher. The danger is that the leakage keeps (over)charging the battery until bad things happen (rupture, fire, etc.)

There are MOSFET based devices that are much better at preventing that sort of thing. Note this is a potential problem only if the USB is plugged into it nearly continuously (battery is basically a backup only). I'm assuming you're using one of those USB charger cubes, as older hubs still adhere to the USB 500mA current limit design. Newer ones are a toss-up, but if it can't charge your phone it probably has the 500mA restriction.

The term you want to use for the switching supply is pulse-skipping mode. That gives you a decent current range.

As a (starting) example Texas Instruments LM2640 or TPS64200 are an example of that technology, there are other manufacturers as well (disclaimer: I have no affiliation with any manufacturer).

Regarding the LDO vs switching decision, you're going to have to make that decision based on calculations of active vs sleep time, etc. Generally the closer the LDO input is to the output voltage the more efficient, and depending on the manufacturer you might find one that meets your needs exactly, but for both technologies, you need to evaluate quiescent current draw, operating efficiency, etc. My bet would be on the switcher.

• When you say "MOSFET based devices that are much better at preventing that sort of thing" do you mean using the body diode of a MOSFET while it's off? I was thinking of using P-MOSFET IRLML6401 instead of the diode, connecting it in reverse (+ to the drain, - to the source) and pull up the gate to turn the mosfet off (or can I leave it floating in this case since it's reversed?). Commented Oct 22, 2018 at 7:28
• properly designed the leakage through the mosfet switch will be much lower than a diode. If the current is at or below the self-discharge characteristics of the battery, it cannot overcharge. A slightly more energy wasteful way is to add a high value resistor across the battery terminals to bleed the excess current. Unless it's switched as well, though it will add (slightly) to the self discharge of the battery. This may or may not be of importance to you. Don't leave gates open- it leaves the device in an uncontrolled state and more sensitive to ESD. Commented Oct 22, 2018 at 12:08
• Thanks for the "pulse-skipping mode" reference. However, instead of pulse-skipping mode I'm thinking of using dual mode PWM-PFM step down converter (like M3406) which can provide up to 1A power on PWM mode when the load is high, but consumes only 20µA on PFM mode when the load consumes low currents. Commented Oct 25, 2018 at 14:59
• Yes, it's the whole "PSM" seems to stand for many variants from Power Saving Mode, to an extreme version of PFM. I'm glad you are able to source the chip, they don't seem to have any US distributors so for me it would be a high volume application design. Commented Oct 25, 2018 at 16:44