How to switch between USB charging and built-in battery power supply circuit?

2025-08-21 14:43:34

There are a few proven ways to let a device run from USB when present and fall back to the battery when not—without browning out the system or back-feeding the USB port. Below are the common architectures, when to use each, and practical schematics.

How to switch between USB charging and built-in battery power supply circuit?


0) First decide your requirements

  • Priority: Usually USB (5 V) → highest; Battery → backup

  • Battery type: Single-cell Li-ion/Li-Po is most common

  • System load: Peak/average current, inrush on plug-in

  • USB type: Micro-B vs USB-C (need CC resistors / current limits)

  • Protections: OVP/UVLO, reverse-current block, short-circuit, ESD

  • Features: “Load sharing” (supply the system while charging), shipping-mode, power-good signal, OTG/boost?


1) Quick & dirty: two Schottky diodes (OR-ing)

How it works: The higher source wins through a diode; the other is reverse-biased.

 

USB_5V ---|>|----+----> SYSTEM_V
Battery ---|>|----'

(Use low-VF Schottkys; add input caps and a fuse/TVS on USB.)

Pros

  • Cheapest, simplest, tiny BOM

  • No control logic needed

Cons

  • Wastes headroom: each diode drops ~0.25–0.45 V → heat + lower system voltage

  • No true reverse-current blocking into the “losing” source at 0 V

  • Marginal if system needs tight 5 V or high current

Use if: ultra-low cost, light loads, and you can tolerate the drop.


2) Ideal-diode OR-ing with P-MOSFETs (lossless “diodes”)

How it works: A P-MOSFET oriented so its body diode allows forward flow; a controller drives the gate to keep only milliohms of drop and blocks reverse current.

 
           P-MOSFET (Q1) as ideal diode
USB_5V --+--|<|--+--------+----> SYSTEM_V
                  |          |          |
                  |       G|          |
                  |  Ideal-diode |
                  |   controller   |
Battery -+--|<|--+--------'
           P-MOSFET (Q2)

Controller IC options (examples): ideal-diode or power-path controllers (e.g., LTC4412/4413 family, TI LM66100/LM66200, etc.).
RDS(on) of the FET sets loss; choose a logic-level P-FET with low RDS(on) at your worst-case VGS.

Pros

  • Very low drop (tens of mV), higher efficiency, less heat

  • True reverse-current blocking and smooth handover

  • Scales to higher current easily

Cons

  • Slightly higher BOM cost/complexity than two diodes

  • Need correct FET orientation and stable gate drive

Use if: efficiency matters, moderate–high current, tighter voltage budget.


3) Power-MUX / Autoswitch IC (one-chip decision maker)

How it works: A dedicated power multiplexer picks the active source by priority and handles inrush, reverse blocking, and fault protection.

 
USB_5V ----->| Power MUX |-----> SYSTEM_V
Battery    ---->|  (IC)              |
                 |-- PG/FLAG, ILIM, fast-swap

Typical devices (examples): TI TPS2113A/TPS2121, ADI/LTC power-path controllers, etc.

Pros

  • Cleanest solution: prioritization (USB first), fast-swap, current limit, inrush control

  • Often includes power-good and fault pins for the MCU

  • Minimal design risk

Cons

  • Highest IC cost among the three

  • Still need upstream ESD/OVP and layout care

Use if: you want robustness, surge control, explicit priority, and minimal tuning.


4) Charger with “Power-Path / Load-Sharing” built-in

For single-cell Li-ion, pick a linear or switching charger that exposes a “SYSTEM” pin separate from the “BAT” pin. When USB is present, the system runs from the input while the battery charges; if USB is removed, it seamlessly falls back to the battery.

 
          +5V USB
            |
         [ Charger IC with Power-Path ]
            |   |    |
          IN   SYS   BAT---- Battery
                  \
                 ---> SYSTEM_V (to load)

Charger IC examples (features vary): MCP73871, TI BQ2407x/BQ24195 families, etc.
Look for terms like Power-Path, Dynamic Power Management (DPM), Input current limit, Ship-mode.

Pros

  • One chip handles charge + source selection + load sharing

  • Input current limit respects USB (100 mA/500 mA/Type-C)

  • Often provides status/PG pins and battery temperature monitoring (NTC)

Cons

  • You’re tied to that charger’s limits (charge current, thermal)

  • Switching versions need careful layout (inductors)

Use if: you have a Li-ion/Li-Po and want the most integrated solution with seamless behavior.


Practical design notes (applies to any approach)

USB front-end

  • Protection: Polyfuse (e.g., 0.5–1.5 A), ESD diode (USB D+ / D− and VBUS), TVS on VBUS.

  • Type-C basics: If you only sink 5 V/Default current, place Rd on both CC pins. For 1.5 A/3 A, you must negotiate or use a source-advertised current (don’t assume 3 A!).

  • Input current limit: Set charger or MUX ILIM ≤ allowed USB current (Default 500 mA for 2.0 unless negotiated; 900 mA for 3.0; Type-C default 500–900 mA/1.5 A/3 A per advertisement/PD).

Inrush & hot-plug

  • Add soft-start / dV/dt control (often built-in to MUX ICs).

  • Place a bulk input cap (e.g., 10–47 µF) close to the MUX/charger IN; 0.1 µF nearby for HF.

Reverse current & back-feed

  • Ensure the chosen method blocks reverse current into USB and into the battery when appropriate.

  • Ideal-diode/MUX/charger power-path solutions handle this; plain diodes do not block into 0 V sources unless oriented correctly.

System brown-out immunity

  • Add adequate output capacitance on SYSTEM_V (e.g., 22–100 µF) to ride through switchover.

  • If your load has large step currents, consider a post-regulator (buck or LDO with good PSRR).

Battery safety

  • Use NTC sensing if supported; set charge current within the cell’s spec.

  • Add ship-mode (load switch or the charger’s ship-FET) to drop quiescent drain during storage.

Measuring source presence

  • Use the MUX/charger’s PG pin or a resistor divider to an MCU ADC to know when USB is present.


Minimal reference schematics

A) Power-path charger (recommended for single-cell Li-ion)

 
USB_5V --- Fuse --- TVS --- IN (Charger w/ Power-Path) --- SYS ----> Load
                                     |                     |
                                    BAT -------------------'---- Cell
                                     |
                                    NTC (thermistor to GND)
PG/STAT/ILIM pins -> MCU (optional)

B) Ideal-diode + separate charger (if you already have a favorite charger)

 

USB_5V --[Ideal-Diode Path]--+---> SYSTEM_V ----> Buck/LDO (if needed)
Battery --[Charger]---> BAT --'

(Ensure the ideal-diode path prefers USB by lower drop / controller priority.)

C) Power MUX in front, single charger tied to battery

 
USB_5V ----\
            +--> Power MUX --> SYS ----> Load
Battery ----/
                    |
                   CHG ---> Battery charger (from SYS or USB as spec allows)

(Choose topology so the charger always has valid input and you don’t “charge from the battery”. Many power-path chargers already solve this more elegantly—hence A.)


Quick chooser

Scenario Best fit
Lowest cost, tiny load, voltage drop OK Dual Schottky OR-ing
Efficiency + low drop, moderate/high current Ideal-diode P-FET(s) (with controller)
Robust priority, ILIM, inrush control Power-MUX IC
Single-cell Li-ion, seamless “runs while charging” Charger with Power-Path/Load-Sharing

Common pitfalls to avoid

  • Assuming USB-C can always supply 3 A without CC/PD negotiation.

  • Forgetting reverse-current blocking, causing battery to back-feed VBUS.

  • Insufficient inrush control, tripping port or browning out MCU on plug-in.

  • Placing large power traces without solid ground return → ringing/EMI.

  • Skipping layout guidance from the IC datasheet (thermal and sense routing).

Harendra Kumar
Harendra Kumar
Harendra Kumar holds a Ph.D. in Electrical Engineering with a specialization in power electronics. His academic expertise and years of experience allow him to break down complex concepts into clear, actionable information for his audience. Through his work, he aims to bridge the gap between advanced technology and its real-world applications. Harendra is an accomplished writer who specializes in creating high-quality, long-form technical articles on power electronics for B2B electronics platforms. His content combines deep technical knowledge with practical insights, making it a valuable resource for professionals in the electronics industry.