Li-ion charger, TP4056
Charges one lithium-ion cell at up to 1 A to 4.2 V. What goes into the cell comes in at the input.
- 4 pins
- In 2 projects
The Li-ion charger, TP4056 in brief
What it is, and where it sits on the bench.
The TP4056 module is the small board with a USB socket that charges one lithium-ion cell, usually an 18650. It is a linear charger: it holds the cell at 4.2 volts and never passes more than its programmed current, which the module’s 1.2 k program resistor sets at 1 amp. Its pads are IN+ and IN- for 4.5 to 8 volts in and BAT+ and BAT- for the cell. Mokxi charges at constant current until the cell reaches 4.2 volts, then tapers, through a 600 milliohm pass transistor, so a solar panel that can only give 170 milliamps charges at 170, its voltage pulled down to just above the cell’s. Nothing happens below 3.8 volts on IN, and the cell does not drain back when the input is gone. The red lamp is lit while charging and the blue once the cell is at 4.2 volts and the current is under a tenth of the programmed one. This is the version without the protection chip and OUT pads. Trickle charge, thermal regulation, and the cell’s charge actually rising are not modeled.
- Family
- Power and wiring
- Pins
- 4
4 pins
Named as the editor names them, so a wire lands where you expect it.
BAT- on the board.How to use the TP4056 charger with an Arduino
Wire the source to IN+ and IN-, the cell to BAT+ and BAT-, and take the board’s supply from the cell’s rail through a regulator. The project here charges an 18650 from a 6 V solar panel, and an MCP1700-3.3 low dropout regulator makes 3.3 V for a Pro Mini and an AHT20 sensor, because an AMS1117 would need a volt more than the cell has.
Drag the panel’s slider from full sun to dark: the charge current on the TP4056 follows the panel, and in the dark the cell carries the node alone. Two dividers let the Pro Mini read the cell on A0 and the panel on A1.
What is true about the Li-ion charger, TP4056, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
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).
Not modeled
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.
From TP4056 charger, in full.
See the Li-ion charger, TP4056 in a project
2 built-in projects use it. Each opens in the editor, already wired.
The boards it is shown on
This board has a built-in project with the Li-ion charger, TP4056 in it.
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the Li-ion charger, TP4056
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.