Hi All. First post here but I've used the resources here many times to help me out.
I'm building an ESP32 Firebeetle powered "safe" for my 11 yo kid. It's a simple combination of a rotary encoder (to enter the code) and a 5V solenoid powered "latch" (6 ohms) that allows the door to open. To work without having to plug it in, I'm using 2 x 3.7v Li-ion batteries. One powers the Firebeetle, a piezo beeper and the encoder. The second battery is wired in series with the first to provide a higher voltage supply (via two MOSFETS) to drive the latch.
I use a double-throw, double pole switch on the battery pack and Firebeetle's built-in Li-ion battery charger so that with the switch in one position, the batteries are in parallel and can be charged from the Firebeetle's USB port. In the other position the batteries are wired in series and the second provides the additional voltage required to power the Latch via a MOSFET switch.
It works well. I use interrupts to wake up the ESP when the batteries are switched to series ("In Use" mode) and go to sleep when the batteries are switched to parallel ("Charge Mode").
However, it's not without its design faults...
There's no actual "Off" switch. Just sleep or operate.
You have to remember to switch from "On Mode" to "Off/charge Mode" after using it. That's probably not going to happen... If not, one battery will slowly discharge over time and/or only one battery will be charged by the built-in Firebeetle charger.
If the two batteries end up with one a lot more charged than the other, and you flick the switch from series to parallel, there could be a lot of current and a possible BANG! As the box is made of (rather nice oak) wood, I'd rather not start a fire in my kid's bedroom...
I'm trying to keep the external controls (switches, inputs, outputs etc.) as simple, minimal and elegant as possible.
Has anyone had experience of using a single 5v supply to charge two Li-ion batteries yet used them in the same project in series? Any ideas for how to improve my design would be welcome.