TP4056 charger
The TP4056 lithium-ion charger module, the small board with a USB socket that charges one 18650 cell. Aliases: Li-ion charger, 18650 charger.
The TP4056 is a linear charger: a pass transistor and an amplifier, set to hold the cell at 4.2 V and never to pass more than its programmed current. A flat cell takes that current; as it fills and reaches 4.2 V the current tapers off. What goes into the cell comes in at the input, so a solar panel that can only give 170 mA charges the cell at 170 mA.
Pins
| Pin | What it does |
|---|---|
IN+ |
The input, 4.5 V to 8 V (the USB socket is the same input). |
IN- |
Input ground, joined to BAT- on the board. |
BAT+ |
The cell's +. |
BAT- |
The cell's -. |
While it runs
The readout is the charge current. The red lamp is lit while it charges, and the blue one once the cell is full.
What the model gets right
Constant current, then constant voltage. Up to 1000 mA (the module's 1.2 k program resistor) until the cell reaches 4.2 V, then less and less. A half-empty 18650 on a stiff supply takes the full amp.
Weak sources. The pass transistor is 600 milliohm, so from a solar panel the cell charges at what the panel gives, with the panel's voltage pulled down to a little above the cell's.
Lockout and no drain. Nothing below 3.8 V on IN, and with IN gone the cell
does not discharge back through the module.
The lamps. The done lamp lights once the cell is at 4.2 V and the current has fallen below a tenth of the programmed one, which is where the chip ends a charge.
The figures are from the TP4056 datasheets (4.2 V float, 3.8 V lockout, 600 milliohm pass transistor, the current set by 1200 V over the program resistor).
What it does not model
The trickle charge below 2.9 V, the chip ending the charge and restarting it 200 mV
lower (the lamp shows the end, but the current tapers on its own), the thermal
regulation that cuts the current when the chip gets hot, and the 150 mV input to
cell lockout. The module modeled is the one without the DW01 protection chip and
its OUT pads. The cell's charge does not change as it charges: set it with the
battery's charge property.
Common mistakes
Putting the load on BAT+ of a module with OUT pads: on those, the load belongs on
OUT, behind the protection. This model has no OUT pads.
Expecting a small solar panel to charge at 1 A. The panel sets the current.
See it in action
Solar sensor node charges an 18650 from a 6 V panel. Open it at /templates.