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

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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

1 Person Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

22 Discussions

Tahreem Khan

Question 1 year ago on Introduction

Hello! It would really help if you answer my questions:

Is this solution efficient for an esp constantly connected to WiFi?

How to connect this solution to esp8266? since you have shown us the picture but I really need the procedure.

Eagerly waiting for your response.

Tahreem Khan

Question 1 year ago

Hi! As a newbie I have a question. How do I connect the Li-ion rechargable battery solution to my ESP8266?

Eagerly waiting for your response.


1 year ago

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


1 year ago

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


1 year ago

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.!!!!!


4 years ago on Step 4

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?)

1 reply

Reply 4 years ago on Step 4

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


4 years ago on Introduction

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...


4 years ago on Introduction

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 :)!

2 replies

Reply 4 years ago

Hi, sorry for the late reply.
Thanks for the tip, I will not be falling for the fake Ultrafire batteries on ebay. I think of buying 2 panasonic 18650, costing around 7,50 € each.
those are quality batteries, used in e-cigarettes :)


Reply 4 years ago on Introduction

What kind of "high capacity" are you expecting to use? 6x18650 cells are running a laptop for 6-8 hours.
I haven't bought the batteries online so cannot help you in that direction. I think you should avoid Ebay ones and try to find a more trustable source. Preferable a local distributor, a good thing for warranty.

On the forum below you can find a lot of batteries specialists that maybe can help you:


Reply 4 years ago on Introduction

I bought them from Internet, You can find them all over the place, Ebay included.

Quality might vary


4 years ago

The battery you used, LG DB3 is an 18650 not 318650 and can handle 26000mA draw not 2600mA. Those are common batteries used in vaporizers.

2 replies

Reply 4 years ago on Introduction

LGDB318650 is a 2600mAh Li-ion Cell. The one used above are salvaged from a HP Service center as been HP Laptop battery cells. I really want to see a conventional battery in 18.6 x 65.2 mm shape at 26Ah!


Reply 4 years ago

You misstated mA in your instructable instead of mAh ;) don't mess those two up.