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


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 Jan 10 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 Jan 10 at 21:26
  • \$\begingroup\$ ok then i will get those \$\endgroup\$ – WhiteSpin Jan 10 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 Jan 10 at 23:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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