ESP32 Thing - On/Off Switch

Hi All,

I have a great little device based on the Sparkfun ESP32 Thing, with the Motion Shield, a GPS and an LiPo battery.

When plugged into USB, the battery is charged. When disconnecting the USB, the device runs from the battery.

What’s the best way to hookup an On/Off switch, so that I can turn the device off/on when no USB is connected?

I was going to just put a simple switch in the + LiPo Battery wire, however that would bean that when connecting via USB, the device would turn on, but the battery would not be charged, unless the switch gets turned back on.

Any ideas?

Thanks,

Nathan

Hi Nathan.

Sadly, there isn’t an easy way to add a switch to the board. You could add the switch in series with the battery, but like you mentioned, the battery won’t charge unless the switch is turned on. This is probably the easiest / least expensive way to do this but you’d need to remember to turn it on.

Another option would be to use an external battery charger like [PRT-10217 to charge the battery and then connect the charger board to the ESP32 with a switch. That would allow charging the battery with the power off.

](https://www.sparkfun.com/products/10217)