I need a UPS (Uinterrupted power supply) which I can connect via gpio to read if it is charging, the battery level, etc. Anyone know how I can make one or where to buy one from?

  • Most UPSs these days have a USB interface that will provide status info. APCUPSD is an open source code that works with APC devices, for example.
    – TomG
    Commented Oct 24, 2014 at 17:29

3 Answers 3


The Kickstarter project PiUPS may be the thing you are looking for.


Sorry to answer this with a link, but it's more involved than will fit in a simple Stack Exchange answer. You can use a standard, off-the-shelf UPS, and the Network UPS Tools (NUT) package to allow a Pi to shut itself down when the power goes out. I have just posted an article I wrote with step-by-step instructions for setting it up:


I hope that helps.


I'm using a second-hand UPis "Basic" by PiModules (does not have the additional 7-20 Volt-ish(?) Power Input, external RS232 port, "1-Wire" Serial Port, or NO Relay that the "Advanced" one has) it can be configured to connect it's on-board micro-controller to the RPi GPIO's Serial port (not the default configuration) and then the RPi can interrogate the UPS about these sort of via short text requests over the serial link.

It also uses a dedicated GPIO pin that the Pi has to monitor with a script so that the latter issues a "shutdown" command when the pin goes low - so that the UPS can tell the Pi to shutdown before the UPS cuts the power because the main supply (from the UPS micro USB input - or the external DC power input on the advanced model only) has failed AND the UPS back-up battery has reached a critical level.

This product does seem to no longer be manufactured (it has a 26 Pin rather than a 40 Pin GPIO connector) however the replacement is the UPiS Pico and that seems to have EVEN MORE features but different internals.

Note: the firmware has only just been finalised for the Pico (and the firmware for both has been developed for some time {years} - so it is possible that some functionality was not complete in existing samples, however the firmware is designed to be updatable via the microUSB that is also used as the power input (same style as on the Pi but the data lines are wired up!) The best place to track the developments (and get updates) are the Forum rather than the download link on the main site IMHO.

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.