Part

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.

See every part
  • 4 pins
  • In 2 projects
Drawn live by the editor's own code, at the size you see it.
At a glance

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
Pins

4 pins

Named as the editor names them, so a wire lands where you expect it.

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 -.
How to use it

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.

Part pin
Board pin
IN+
Solar panel +
IN-
Solar panel -
BAT+
18650 V+, the cell rail
BAT-
18650 V-, ground
Pro Mini: solar sensor nodelive0.000 s 0.00x
Click to open it in the editor
This is the simulator itself, running here. Click anything to open it in the editor.
How it is modeled

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.

Projects

See the Li-ion charger, TP4056 in a project

2 built-in projects use it. Each opens in the editor, already wired.

Boards

The boards it is shown on

This board has a built-in project with the Li-ion charger, TP4056 in it.

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.