How to use an 18650 in a project - Page 1
Forum section: electronics / projects

author: foxr
author_rank: Newbie
timestamp: June 30, 2023, 08:21:08 pm
content: I am trying to develop the power supply part of an electronics project.I want to use one 18650 cell and a USB-C cable to charge the battery/power the device and output 3.3V for an ESP32 microcontroller.I've heard about the TP4056, but I don't know if I still need a battery protection circuit. Also, do I need a step-up converter for when the battery voltage is below 3.3V? And will the TP4056 work both on battery power and when connected to USB-C? And do I need a USB power delivery circuit?

author: ataradov
author_rank: Super Contributor
timestamp: June 30, 2023, 08:57:39 pm
content: TP4056 will only provide changing side and it has all the necessary protections for that. You will need protection against excessive discharge, since when the charging cable is not connected, you just have the straight battery output, TP4056 is not involved in that at all.And you would need a boost circuit if you expect the battery to drop below 3.3 V. But it might be a good idea to consider voltages below 3.3 V to be fully discharged and not bother with a boost circuit.

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 01, 2023, 05:05:54 am
content: Quote from: foxr on June 30, 2023, 08:21:08 pmTP4056 will inherently regulate charging voltage to 4.2V so unless there's other sources that can potentially charge the battery it should give reasonable overcharge protection. It is most commonly paired with DW01A to provide standalone OVP and UVP. Beware when using it though since DW01A UVP cutoff is 2.5V. Depends on your situation, you probably don't want to discharge that deep.Quote from: foxr on June 30, 2023, 08:21:08 pmMaybe? Do you need that extra ~20% capacity you lost when you simply cutoff at 3.3V instead of 3.0-3.2V? Weigh the cost and complexity of using buck-boost instead of "simple" buck.Quote from: foxr on June 30, 2023, 08:21:08 pmYes, although maybe you want to implement some bypass/OR-ing mechanism so your device can be directly powered by USB when connected instead of having to pass thru TP4056.Quote from: foxr on June 30, 2023, 08:21:08 pmNot really? It is a linear charger. You don't want it to get any more than 5V.Maybe do it if you intend to power it from smarter devices, but if it only ever see wall charger they usually don't even check before giving 5V/0.5A output, or even 5V/3A.

author: Peabody
author_rank: Super Contributor
timestamp: July 01, 2023, 04:05:36 pm
content: TP4056 modules come in two typical forms - one with DW01 battery protection included, and one without. You could use a protected module with an unprotected battery, or an unprotected module with a protected battery.And I'm going to suggest that you use a 3.3V linear regulator with very low dropout voltage, one that will work down to about 3.5V. I think a buck converter would need more headroom, and wouldn't save that much power, particularly if your circuit spends a lot of time sleeping.But the other issue is that if you power the regulator directly from the battery, then the charger's termination algorithm may be confused by the presence of load current during charging. The TP4056 terminates charging based on charge current dropping below a certain point, and if there's load current, that point may never be reached. Also, even if it does terminate correctly, that means your circuit will then draw power from the battery even though USB is still plugged in and active. The battery will cycle between 4.1V and 4.2V when USB could have been powering the whole time.The solution to that is called a "load sharing" circuit (aka "power path"), which consists of a P-channel mosfet, a schottky diode, and a resistor. When 5V power is available, it will power both the battery charging, if needed, and the ESP32, directly. The battery will be switched in only when the 5V supply is absent. See below.