Hi, I'm kind new in this battery setup and I want to know if there are modules that allow power, for example, an ESP32-01s or an ESP8266 with a lipo battery and at the same time charge it if a micro-USB is connected.
My biggest problem is with the ESP32-01s because it needs 3.3v so probably I'll need a module charger with a step-down.
I saw some random ones in aliexpress but I'm not sure if they are good and safe. I get a little one and for example, the 3.3v output is giving 4.4v, so I don't want to experiment and end with a burn battery/place.
I don't know of any modules that combine a charger, a regulator, and a "load sharing" circuit that safely allows operating the ESP while charging the battery. It's possible that Adafruit or Sparkfun have such modules, but they are a bit expensive for my tastes.
You may have to assemble your own module. You could use a traditional TP4056 charging module, and almost any 3.3V regulator module, either linear or switching, and then you would need to add the load sharing circuit, which is a P-channel mosfet, a diode, and a resistor. The attached circuit shows such a circuit with a boost regulator to 5V, but you would just replace that with a 3.3V regulator. And of course you would need a battery.
The load sharing circuit allows the USB power to run the ESP8266 or ESP32 when it is connected. That allows the battery charging to proceed to termination independently. You don't want the charger to provide power to the ESP.
But remember that your USB power source must provide enough current to both charge the battery and power the ESP device.
I use the TP4056 charge module with a low drop out 3.3 v regulator on the output to power an ESP32. I understand that the charge module is not supposed to supply a load and charge the battery at the same time, when a USB cable is plugged in, but it works.
It can work depending on the current drawn by the load.
The charger terminates charging when charging current drops to 10% of the full charging current. If the load draws more than that, charging will never terminate, and the battery will have 4.2V applied to it for as long as the USB cable is plugged in. There is some dispute about whether that is dangerous. I believe it is. If it were not, chargers would not need to terminate charging at all, and they all do.
On the other hand, if the load is less than the 10% level, then charging will terminate, and the load will then be supplied by the battery even though USB is still plugged in. That's not optimal.
With the load sharing circuit present, the load will be supplied by USB whenever it's plugged in, and charging will terminate as it's supposed to regardless of load current.
But yes, a lot of people use the same setup you do, and get away with it.
This is a unusual request really, so plus points to the OP for asking, most people just use lithium batteries in some sort of naive belief that anything you can buy is 'safe'.
As well as the issues mentioned by @ShermanP, to stay safe (prevent explosions) you need to design in a safe level of battery cutoff. Those TP4056 so called chargers by default have a low battery cutoff of 2.4V, which I take a lot of persuading is a safe level. The TP4056 so called chargers can be modified by changing an IC to have a cutoff of 2.9V, but I am still not convinced.
Its true that Lithium batterries are in common use, but they are built into products such as mobile phones and cameras that have proper battery management which does not rely on a 20p device from the far East for safely manageing a volatile battery.
Notice how your phone shuts down gracefully ? Thats the battery management at work, the processor running the phone detects when the battery is low (circa 3.3V maybe) and decides its had enough, there is little charge left in the battery so it and shuts down, turns off the battery thus reducing the risk of battery damage.
If the likes of Samsung can get this so badly wrong, given the experience of its thousands of engineers, why do hobbyists think that all you need to use a lithium battery safely is a 20p device from the far East ?
srnet, this reminds me of another issue when you don't have a load sharing circuit. It's part of the starting protocol of most charger ICs to see if the battery voltage is high enough that constant current charging at 100% can be initiated. If it isn't, it will charge at the 10% level until the battery reaches such a voltage - around 3V I think - then switch to 100%. But if the charger is also supplying the load, and the load is greater than the 10% level, the charger will never switch into full charging current. So without load sharing, if you take the battery too low, you may not be able to charge it back up again. So you have to build in a switch that lets you turn off the load and recover from this situation.
It's not clear to me why charger modules from the Far East with load sharing built in are not more common. I've seen one which uses the MCP73871 charger IC which itself has load sharing built in, but the module doesn't have a USB connector, so is not all that useful. But I would guess that Adafruit or Sparkfun may have one.
Then the next step would be a single module with charging, load sharing and buck or boost regulator to 3.3V or 5V. But I won't hold my breath.
"Hi, I'm kind new in this battery setup and I want to know if there are modules that allow power, for example, an ESP32-01s or an ESP8266 with a lipo battery and at the same time charge it if a micro-USB is connected."
I have a WeMOS D1 development board (has a micro USB jack) and am currently powering it using the below cell phone charger battery pack. The ESP8266 chip apparently uses sufficient current that the battery pack does not shut down. An UNO would have to have an added current sink to keep the pack supplying power. The current setup is the battery pack is connected to a USB wall charger, and the ESP board is connected to the battery pack. This setup has been working for over a week with no issues.
"Zoomkat, are you sure it shuts off on low current? If you turn it on, with no load connected at all, does it shut itself off in a few seonds? One other question. Can you run your ESP8266 while the powerbank is charging?"
From what I've seen and read, these types of battery packs may need maybe 25ma of current draw to keep from shutting off. I've got a WeMOS ESP8266 board and it stays powered, probably using 35-40ma. An UNO apparently does not draw enough current and the battery pack will shut down after ~90 seconds. I haven't found a way to trick nit to stay on other than adding a dummy load to increase the current draw. Currently my battery pack is being kept fully charged from a USB wall charger while powering the ESP board at the same time.
srnet:
If the likes of Samsung can get this so badly wrong, given the experience of its thousands of engineers, why do hobbyists think that all you need to use a lithium battery safely is a 20p device from the far East ?
Nitpicking a bit, but I understand the root cause of the Samsung Note 7 fiasco was determined to be a battery construction issue, not a charge circuit issue. One interpretation is that even if one gets the charge circuit right, there is still a non-negligible risk exposure with LiPo batteries.
MrMark:
Nitpicking a bit, but I understand the root cause of the Samsung Note 7 fiasco was determined to be a battery construction issue, not a charge circuit issue. One interpretation is that even if one gets the charge circuit right, there is still a non-negligible risk exposure with LiPo batteries.
Sure, but then Sansung engineers did get it fairly badly wrong when they misdiagnosed the intial problem, got people to swap phones out, and they kept exploding.
I wonder where the stocks of all those faulty batteries at the manufacturers ended up ?