Electronic – Using TP4056 module to charge battery while load remains connected

battery-chargingesp8266lithium ionloadrelay

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?

circuit

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

Best Answer

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.