tp4056 module

I need a circuit that utilizes the tp4056 breakout board to power a NodeMCU ESP like so:

  • tp4056 USB port connected: 18650 battery charging and NodeMCU running of USB
  • tp4056 USB port not connected: NodeMCU running of 18650 battery

The problem is that the load of the tp4056 should be disconnected while charging, otherwise it can mess with the overcharge protection of the tp4056 (see here).

I have designed the following circuit hoping it will achieve my goal. My reasoning is that when no USB is connected the relay will let the boost module run off the battery and when USB is connected the relay will close and power the boost module over USB while letting the battery charge as usual.

Does the circuit achieve my goal? Are there any other issues with the setup?


Please note that there will be more components connected to the NodeMCU, so the exact current draw remains unknown (<500ma though).


2 Answers 2


Looking at the schematic of your TP4056 board

enter image description here

you can simply add a pair of diodes of low forward voltage diodes to achieve what you want. SS14 are common and very cheap. Add one diode between the TP4056 IN+ and MT3608 VIN+ and one more between TP4056 OUT+ and MT3608 VIN+.

Your MT3608 will then pull power from USB when there is USB as 5V will always be larger than the 18650 battery voltage.

  • \$\begingroup\$ that makes sense to me thanks. I have a stack of A7 diodes with a forward voltage of 1.3V @1A. These should work aswell I assume? \$\endgroup\$
    – WhiteSpin
    Commented Jan 10, 2019 at 20:37
  • \$\begingroup\$ 1.3V is a bit high, at the low end of your battery's range (3.7V) - you'll get 2.4V into the MT3608, and you'll be dumping a significant part of your battery power into heat in the diode. Ideally you'd want a schottky diode (the SS14 has Vf of < 0.5V @ 1A ) \$\endgroup\$
    – james
    Commented Jan 10, 2019 at 21:26
  • \$\begingroup\$ ok then i will get those \$\endgroup\$
    – WhiteSpin
    Commented Jan 10, 2019 at 23:16
  • \$\begingroup\$ If you're wiring up modules you might find a non-smd diode like the 1N5817 (Vf=0.45V @ 1.0A) more convenient as you could heat shrink them into the wiring. \$\endgroup\$
    – james
    Commented Jan 10, 2019 at 23:47
  • 1
    \$\begingroup\$ I originally went with @james approach, but even the 0.5v posed too significant of a voltage drop for my application so I used my original approach and that worked well (even though it is kind of overkill) If you do this though be sure to add a flyback diode for the relay. \$\endgroup\$
    – WhiteSpin
    Commented Jul 25, 2019 at 14:11

From datasheet
"TP4056 automatically terminates the charge cycle when the charge current drops to 1/10th the programmed value after the final float voltage is reached."

It is rated for 1000 mA max charge rate using Rp=1k2.

Thus cutoff of C/10 of the charge rate is 100mA. Thus if you use an external load during the CV mode it lowers the effective threshold for the battery saturation charge to complete and also increases the risk of lithium release that may cause life degradation or shorts.

Any external load > C/10 will prevent the TP4056 from cutoff and unwisely increase safety risks to battery lifespan and surroundings.

However any external load during CC mode is safe up <= 4.0V but I would limit it to 3.8V.

Users Beware.

Li-ion cannot absorb overcharge. When fully charged, the charge current must be cut off. A continuous trickle charge would cause plating of metallic lithium and compromise safety. To minimize stress, keep the lithium-ion battery at the peak cut-off as short as possible. REF: https://batteryuniversity.com/learn/article/charging_lithium_ion_batteries


  • \$\begingroup\$ If you're driving a load continuously, say more than 10%, won't the TP4056 power it? How can it overcharge the battery? You mentioned "TP4056 automatically terminates the charge cycle when the charge current drops to 1/10th the programmed value after the final float voltage is reached.", so looks like it works on voltage level of 4.2V. If you connect a load, the load will take some energy from battery (and from the charging adapter through the TP4056) and when battery has < 4.2V, it will be charged. I don't see a way it can overcharge a Li-ion. \$\endgroup\$
    – 15 Volts
    Commented May 3, 2023 at 10:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.