← Wiki · Component

LiPo charger and battery connector

The MCP73831 charges a single lithium-polymer cell from USB, at a current set by one resistor. With a JST PH connector and a power switch the board runs on battery.

What it does#

The MCP73831 charges a single Li-ion/LiPo cell to 4.20 V (the -2 variant), first with constant current, then constant voltage. Pins: 1 STAT, 2 VSS (GND), 3 VBAT, 4 VDD (from USB), 5 PROG.

Charge current = 1000 V / R_PROG. 2 kΩ → 500 mA, 4.7 kΩ → ~210 mA, 10 kΩ → 100 mA. A safe rule: at most 1 C (a 500 mAh cell → 500 mA). The datasheet allows 15–500 mA (R_PROG 2–67 kΩ); leaving PROG open disables the charger.

Capacitors: at least 4.7 µF from VDD to GND and from VBAT to GND (the VBAT one keeps the regulator stable when no battery is plugged in). The example uses 10 µF on each side.

Example circuit: VBUS in, VBAT out to the JST PH connector. 4.7 kΩ PROG gives ~210 mA. The LED lights while STAT pulls low (charging).
VBUS in, VBAT out to the JST PH connector. 4.7 kΩ PROG gives ~210 mA. The LED lights while STAT pulls low (charging). Open the lipo_charger example from this page in PCB Canvas: “Insert into my schematic”.

Load sharing#

Running the board from VBAT while the charger works confuses the charger (it sees the board’s current as charge current and may never finish). The usual fix: power the board from USB through a Schottky and from the battery through a P-MOSFET that turns off when USB is present.

Battery connector#

Hobby LiPo packs use a JST PH 2.0 mm 2-pin plug. Polarity is not standard: Adafruit/SparkFun packs have + on one side, many AliExpress packs on the other. Check with a multimeter before plugging in; a reversed cell destroys the charger.

A side slide switch (MSK12C02) in the battery line is the usual on/off for wireless keyboards.

Pitfalls#

  • Unprotected cells. Use packs with a protection board (over-discharge, short circuit).
  • Thermal limit. At 500 mA from 5 V the charger dissipates up to ~1 W early in the charge and throttles itself; give it copper.
  • STAT is three-state (low = charging, high = done, high-Z = no battery or shutdown): an LED to VBUS lights only while charging.

Footprint#

SOT-23-5; JLCPCB C424093 (extended). JST PH SMD side-entry C295747 and top-entry C160352 are in the catalog, plus a through-hole one for hand soldering.