When building an uninterruptible power supply for embedded systems like the ESP32 or Raspberry Pi, the primary challenge is maintaining a stable system voltage during the transition from wall power to battery. To build a reliable 5V/3.3V UPS for loads drawing between 500mA and 3A, use a switch-mode charger with integrated power path management (PPM)—specifically the Texas Instruments BQ24295—rather than a linear charger paired with discrete MOSFETs. This topology eliminates switchover brownouts, minimizes thermal throttling, and natively handles USB input fluctuations.
Topology Comparison: Linear vs. Switching Power Path
The most common mistake in DIY UPS design is pairing a linear charger (like the MCP73833) with a discrete P-channel MOSFET for load sharing. While cheap, this approach fails under continuous loads exceeding 500mA due to thermal saturation and slow switchover times. Here is how the two dominant topologies compare for a 2A embedded load.
| Criteria | Linear Charger + Discrete P-FET | Switching Charger with Integrated PPM |
|---|---|---|
| Efficiency (5V to 4.2V) | ~84% (Linear drop) | ~88-92% (Buck conversion) |
| Heat Dissipation (at 1.5A charge) | 1.2W (Requires large heatsinks) | 0.15W (Managed by IC thermal pad) |
| Switchover Transient | 10-50ms (Causes ESP32 brownout reset) | <10µs (Seamless, no system reset) |
| Output Noise / Ripple | Very low (<5mV p-p) | Moderate (20-40mV p-p at 1.5MHz) |
| BOM Cost & Footprint | $1.50 / Large (Discrete FETs + passives) | $3.50 / Compact (Highly integrated QFN) |
The Verdict: For microcontrollers running continuous sensor polling or WiFi transmission, the switching topology is mandatory. The 1.2W of heat generated by a linear charger in a sealed 3D-printed enclosure will trigger thermal shutdown within minutes. The switching regulator's high-frequency ripple is easily filtered, making it the superior choice.
Input Protection and Ripple Expectations
USB-C inputs are notoriously hostile environments. A misconfigured cable or faulty PD adapter can expose your 5V rail to 9V, 12V, or even 20V. According to the USB Type-C Specification, sink devices must tolerate transient overvoltages.
Never rely solely on the charger IC's internal Over-Voltage Protection (OVP). The BQ24295 has an internal OVP threshold of 6.5V (typical) and 7.2V (max). A 20V PD fault will destroy the IC before it can clamp. Always place a 5.0V TVS diode (e.g., Littelfuse SMAJ5.0A) on the VBUS line immediately after the connector.
Ripple and Noise Management:
Switch-mode chargers operating at 1.5MHz will inject 20mV to 40mV peak-to-peak ripple onto the SYS rail. If your ESP32 design relies on the internal 12-bit ADC for precision analog sensing, this noise will corrupt your readings. To mitigate this, insert an LC pi-filter between the charger's SYS output and your microcontroller's VCC pin. Use a 10µH ferrite bead (rated for >3A DC) followed by a 10µF X7R MLCC capacitor placed within 2mm of the MCU power pins. This drops the high-frequency ripple below 3mV p-p.
Design Example: 5V/2A Embedded UPS Spec Sheet
Below is a validated component list and electrical specification for a 5V input, single-cell Li-ion (18650) UPS designed to deliver a continuous 2A to a Raspberry Pi Zero 2 W or an ESP32-S3 cluster.
| Parameter / Component | Specification / Part Number | Design Notes & Math |
|---|---|---|
| Input Voltage Range | 4.5V to 5.5V (Nominal 5.0V) | Standard USB-A/C 5V tolerance. |
| Charger / PPM IC | TI BQ24295 (RGE Package) | I2C configurable, integrated power path FET. |
| Power Inductor | Wurth 744774215 (1.5µH, 4.5A sat) | Must exceed peak inductor current (3.2A min). |
| Battery | 1x 18650 Li-ion (3000mAh min) | Must include DW01A/8205A protection BMS. |
| Input Protection | SMAJ5.0A TVS + Bourns MF-MSMF200-2 PTC | Clamps at 9.2V; PTC trips at 2A hold / 4A trip. |
| Headroom / Dropout Math | VBUS-to-SYS Dropout: ~150mV at 2A | At 4.8V USB input, SYS outputs 4.65V (safe for Pi/ESP32 onboard LDOs). |
Dropout and Headroom Verification:
The internal power path FET in the BQ24295 has an Rds(on) of approximately 75mΩ. At a 2A system load, the voltage drop (V = I × R) is 150mV. If your USB cable sags to 4.7V under load, the SYS pin will output 4.55V. Because the ESP32's internal LDO requires a minimum of 3.6V to regulate down to 3.3V, you have nearly 1V of headroom, ensuring no brownout resets during heavy WiFi transmission spikes.
Thermal Derating and Heat Management
Even with a switching topology, thermal management dictates your maximum continuous current. The BQ24295 is housed in a 24-pin VQFN package with an exposed thermal pad.
You must place an array of thermal vias (0.3mm diameter, 1.0mm pitch) directly under the IC's exposed pad, routing heat to a solid copper pour on the bottom layer. Without these vias, the junction-to-ambient thermal resistance (RθJA) spikes from 35°C/W to over 80°C/W, forcing the IC to throttle charge current at just 1A.
Derating Calculation:
Assume a 5V input, 4.0V battery voltage, 1.5A charge current, and 1.5A system load. The IC is dissipating heat from both the buck converter and the internal path FET. Total power dissipation (P_DIS) is roughly 0.4W. With a properly via-stitched PCB (RθJA = 35°C/W), the temperature rise is 14°C above ambient. In a 40°C enclosure, the IC junction sits at 54°C—well below the 125°C thermal shutdown threshold. If you omit the thermal vias, the junction hits 72°C, and at 60°C ambient (common in solar or automotive enclosures), you will trigger thermal regulation.
Decision Tree: Picking Your UPS Architecture
Use this decision matrix to select the exact power path architecture for your specific embedded load. Do not default to discrete components unless your load is under 100mA.
| System Condition | If True... | Then Select... |
|---|---|---|
| Load is < 100mA (e.g., deep-sleep sensor node) | Heat is negligible; prioritize ultra-low Iq. | TI BQ25180 (Linear) + TI LM66100 (Ideal Diode) |
| Load is 100mA - 500mA (e.g., basic ESP32 web server) | Moderate heat; I2C config not strictly required. | TI BQ24074 (Linear with integrated PPM, up to 1.5A) |
| Load is 500mA - 3A (e.g., Pi Zero, ESP32 + Relays) | High heat risk; switching and active path management mandatory. | DEFAULT PICK: TI BQ24295 (Switching PPM) |
| Load is > 3A (e.g., Raspberry Pi 4/5 under load) | Single IC cannot handle path current; requires external FETs. | TI BQ24195 + External Back-to-Back P-FETs (e.g., Si2301) |
For 90% of maker and commercial IoT projects drawing between 500mA and 2A, the TI BQ24295 is the definitive choice. It eliminates the need for external switchover FETs, handles the buck conversion efficiently, and provides I2C telemetry so your ESP32 can read exact battery voltage and charge current without external ADCs.
Switchover Verification and Testing
Never deploy a UPS design without verifying the switchover transient under worst-case load conditions. A multimeter is useless here; it averages voltage over time and will completely miss a 2ms brownout dip that resets your microcontroller.
The Bench Test Procedure:
- Setup the Load: Connect a 500mA active dummy load (or a power resistor drawing equivalent current) to the SYS output, alongside your ESP32/Pi.
- Probe the Rail: Connect an oscilloscope probe to the SYS pin. Critical: Use the probe's spring-clip ground attachment (not the long alligator lead) to minimize loop inductance, and set the scope to AC coupling with a 20MHz bandwidth limit.
- Trigger the Fault: Set the scope to trigger on a falling edge at 4.0V. Physically disconnect the USB-C input cable.
- Analyze the Dip: The BQ24295 should transition from VBUS to BAT in under 10µs. You should see a voltage dip of no more than 150mV to 200mV, recovering instantly. If the dip exceeds 500mV, your SYS output capacitance is too low. Add a 47µF low-ESR polymer capacitor directly on the SYS rail to supply the instantaneous transient current while the internal FET turns on.
By adhering to this switching topology and validating the transient response on the bench, your embedded system will ride through power grid failures, USB cable bumps, and brownouts without dropping a single MQTT packet or corrupting the SD card filesystem.






