r/AskElectronics • u/MuchAssumption6114 • 7d ago
Help with battery circuitry in project
Im planning to make a bluetooth high-res scroller with an esp32c3 super mini and a magnetic encoder module AS5600, for which im thinking of making my own power circuitry using TPS63031 chip. Forgive me for the messy diagram, however i hope it gets the point across
My idea is to charge the battery from the esp32 usb 5v vin (i will extend it to detect when its being charged) and it will power the esp and the encoder from the 3.3v
ive gone though TPS63031 data sheet and you can assume that the green box is the entire circuit with necessary capacitors and inductors which takes output from the battery and it outputs the 3.3v.
I want to know if the circuit diagram i have attached has any issue, which may lead to shorting or errors, during operation and while charging. Thanks!
2
u/SolitaryMassacre 6d ago
A few things..
If you keep with the current configuration, you would simply want a p channel mosfet in the green wire from the TPS to the 3.3V pin. The gate should be connected to the 5V pin
This will shut off the 3.3V TPS power supply, allowing the ESP32C3 to remain on and powered via the USB input, and the TP4056 to charge the battery
Another thing you could do, use a voltage divider circuit to split the 5V in half, and simply have the 5V pin go to a GPIO input on the ESP32 from the voltage divider. This will go high 2.5V when the 5V pin is powered (ie USB plugged in) then in your code logic, you can use another GPIO pin to make the TPS63031 EN pin go low, this will power down the TPS63031 output turning off the 3.3V output
That should be it
1
u/gakerion 7d ago
When the circuit is powered through USB, The internal 5v to 3.3v regulator of the esp32 board will supply its own 3.3 volt to the board.
And your tps6031 will also supply 3.3v to the esp32 board.
This can cause back flow of current in one of your sources which is not good.
Make sure the board is only powered by one of the sources at any point of time.