I have a standalone RPi3 inside a case where I've designed room for a couple servos and a battery pack of some kind. The mini USB port is accessible thru the case wall, and I could also make the 4 standard USB ports available thru it.

Q: Is there any configuration I can set up so that the Pi and its servos (2 sg90s) can run on the batts, AND to have the ability to charge the batts w/o opening the case? For example, could I run a charge thru one of the USBs on the Pi?

2 Answers 2


Use a TP4056 IC with a DW01A chip. It will have a microusb port and power input, a battery charge output, and a battery output. It will protect against overcharging and overdischarging. It even has current limiting.

IIRC the SG90s use 450mA loaded, which is no problem for this IC.


My alternative would be to purchase a chip/module that lets you run from battery and charge without unplugging anything. Then run the Pi from that and design your case to expose the charging plug on the module.

What kind of batteries do you have, and how do they normally charge?

  • I'm leaning away from lithium technologhy because it seems a little demanding and I can't take any chances with fire. But I know so little about battery options for Pi's and servos, etc... Now looking into NiMh AA batts. Any suggestions?
    – mbewley59
    Commented Oct 7, 2017 at 1:19
  • The Pi isn't going to charge it directly. Do you already have a charging circuit? LiPo is nice in one sense because there are lots of available recharging boards available. Alkaline/NiMh are great for other reasons, but recharging in a live circuit is not common.
    – BowlOfRed
    Commented Oct 7, 2017 at 2:10
  • Yeah, I'm finding out how available LiPo chargers are, and it seems like one of Adafruit's chargers with power sharing may work. If I got power sharing right, it can continue to run the Pi while it applies a charge to the LiPo. This would solve my problem. I'm pretty happy with Adafruit's other stuff, so I suppose I should trust them to kn ow how to charge and maintain a LiPo.
    – mbewley59
    Commented Oct 7, 2017 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.