ESP8266 - Li-Ion Battery Rechargeable Battery Power Solution





Introduction: ESP8266 - Li-Ion Battery Rechargeable Battery Power Solution

I was asked many times for a flexible, compact and easy to recharge battery pack solution for the ESP8266 Modules.

After many test with different battery configurations and charging circuits, from simple AA batteries to CR2032 stacks I think I found the best one from all the desired points of view:

- Widely available battery pack

- Simple charging circuit

- USB compatible

- Proper battery protection

- Enough power to run for days

- Cost efective

Step 1: Project Details

What we will need:

  1. 18650 Rechargeable 3,7V/2600mAh Li-ion Cell - You can find them all over the place, from your old laptop battery pack to Ebay. Usually in a laptop battery pack olny one or 2 of the Li-ion cells are in trouble, you can recover the other ones and use for your projects for years
  2. 18650 Cell holder
  3. Li-ion Charger/Monitor with protection. Take care when looking for it, be sure you have one with battery protection circuit
  4. Asorted wires - choose your desired color but red/black, blue/white standard coding with be better :)

Step 2: Charger/Monitor Module Description

The Li-ion Cell Charger/Monitor module used for this Battery pack solution is based on TP4056 1A Standalone Linear Li-lon Battery Charger with Thermal Regulation chip.

The TP4056 is a complete constant-current/constant-voltage linear charger for single celllithium-ion batteries. Its SOP package and low external component count make the TP4056
ideally suited for portable applications. Furthermore, the TP4056 can work within USB and wall adapter.

No blocking diode is required due to the internal PMOSFET architecture and have prevent to negative Charge Current Circuit. Thermal feedback regulates the charge current to limit the die temperature during high power operation or high ambient temperature. The charge voltage is fixed at 4.2V, and the charge current can be programmed externally with a single resistor. The TP4056 automatically terminates the charge cycle when the charge current drops to 1/10th the programmed value after the final float voltage is reached.

TP4056 Other features include current monitor, under voltage lockout, automatic recharge and two status pin to indicate charge termination and the presence of an input voltage.


  • Programmable Charge Current Up to 1000mA
  • No MOSFET, Sense Resistor or Blocking Diode Required
  • Complete Linear Charger in SOP-8 Package for Single Cell Lithium-Ion Batteries
  • Constant-Current/Constant-VoltageCharges Single Cell Li-Ion Batteries Directly from USB Port
  • Preset 4.2V Charge Voltage with 1.5% Accuracy
  • Automatic Recharge
  • Two Charge Status Output PinsC/10 Charge Termination
  • 2.9V Trickle Charge Threshold (TP4056)
  • Soft-Start Limits Inrush Current

For more details please see TP4056 Datasheet

Step 3: Battery Protection Circuit Description

TP4056 is accompanied with DW01-G battery protection IC.

DW01-G is designed to protect lithium-ion/polymer battery from damage or degrading the lifetime due to overcharge,overdischarge, and/or overcurrent for one-cell lithium-ion/polymer battery powered systems, such as cellular phones.

DW01-G has an accuracy of ±50mV overcharging detection voltage that
ensures safe and full utilization charging. Also the very low standby current drains little current from the cell while in storage.


  • Reduction in Board Size due to Miniature SOT-23-6 Package
  • Ultra-Low Quiescent Current at 3μA (Vcc=3.9V)
  • Ultra-Low Power-Down Current at 0.1μA (Vcc=2.0V)
  • Precision Overcharge Protection Voltage 4.25V ± 50mV
  • Load Detection Function during Overcharge Mode
  • Two Detection Levels for Overcurrent Protection
  • Delay times are generated by internal circuits. No external capacitors required

Battery Protection Swithing is done with 8205A Mosfet.
The ML8205A uses advanced trench technology to provide excellent RDS(ON), low gate charge and operation with gate voltages as low as 2.5V. This device is suitable for use as a Battery protection or in other Switching application.

DW01-G Datasheet

8205A Mosfet Datasheet

Step 4: Conclusion

As you can see from the quick presentation done here, it's very easy to have a battery powered project that can run for days and can be easy recharged from a USB port, USB charger or even a solar panel.

For more details and other related projects take a look at ESP8266 Projects


  • I've just tested a 3...-thesk

    thesk made it!


  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018

We have a be nice policy.
Please be positive and constructive.




ESP8266 boards like wemos d1 have low cost readily avaliable shields for li-ion/li-po battery.

hello. may i know the connection of esp8266 to tp4056?

HI, I dont know if you still responds comments. But i have a question. Iam using this module in my datalogger project, and i need the battery as backup, like UPS, so when the power is off, the battery gives the power. But I am a little bit worried about the life time of the battery. what is your opinion?

Thank you very much.!!!!!

Is it possible to charge a battery with a plugged (working) load, using this charger?
I mean, is it possible to work like mobile phone works - without turning off during charge process.
(Of course it is possible to mix a charging external +5V and battery output from this charger through two Shottke diodes, but is it really nessesary?)

It is possible but "not recommended" as it looks like it will not finish gracefuly the last stageof the charging process when load present (means battery will be not fully 100% charged) .
They are actually a lot of debates about.
If you want to use the option "better safe than sorry" then off course you can use anytime the Shottky diodes connection.


im using the same lithium ion 18560 3.7 around 2000 - 3000 maH the
thing is charging since i removed them out of the laptop battery i have a
problem charging some could i charge these lithium of a 5v @ 1a charger
or is there a problem

Noob here so please help

If you look a liitle bit deeply on the related articles you will find out that after the battery pack module is a 3.3V voltage regulator...

It's even posted below, on 19.Apr...

Hello there,

I will be using this charging station in my folowing project of a bluetooth speaker.

I have a question, can you help me with it:) ?

I am looking for some high capacity battery, to buy online (lets say ebay or something). With all those fake batterys on the market (ultrafire).

has anyone experience with good batterys from online sources?

Thank you for your time :)!