I had a Raspberry Pi project that needed constant power. After doing a little digging around I found there are a couple of ways to set up a UPS for a Raspberry Pi.
What are the best UPS options for Raspberry Pi? There are 3 configurations that can are recommended. The first is using an expansion board specifically designed for the Raspberry Pi. Your second option is to purchase a standard UPS. The third option is building your own UPS with parts you can pick up at any good electronics store.
Option 1: UPS Expansion Board
One of the great features of Raspberry Pi’s is the number of inexpensive expansion boards that can be purchased to add functionality. This is true for our UPS scenario as well. In fact, there are 2 types of boards that can meet the UPS requirements that you may have for your Pi project.
The first variation is a HAT.
A Raspberry Pi HAT is a development board that is specifically designed to sit on top of a Pi and connect into the GPIO. The advantages of using a HAT is that the UPS can send additional signals to the Pi such as the battery’s current level. This board on Amazon is a great example of a UPS HAT.
The second variation is a standard expansion board like this one by Miuzei. The reason that you may choose a standard expansion board against a HAT includes price, battery size, and physical space. The non-HAT expansion boards tend to be about 20% cheaper, about 50% more battery life, and are more flexible in how you arrange them in respect to your Raspberry Pi.
Option 2: Purchase A Standard UPS
If you are looking for something with a higher power capacity and output, you might be better off with purchasing a standard UPS. A standard external UPS often has a much higher battery capacity as it is designed for running multiple electronic devices at the same time.
While it’s great that it might have a bigger battery capacity, that also means it is physically bigger as well. Most UPS products are in the 250 square inch range. If your Raspberry Pi doesn’t move around much and you have room for it, this option on Amazon has fairly good reviews.
Option 3: Build Your Own UPS
This solution is by far the most difficult to pull off. Instead of relying on a prebuilt UPS, you will build your own from a list of components. To build your own UPS you’ll need the following:
Once you have all of your parts, you can simply connect each of the components as described by raspberrypi-tutorials.com here.
This option used to be the most economical but recently UPS expansion boards have significantly come down in price, often making them the preferred option. I would only recommend this method to someone who is very familiar with circuitry and enjoys the challenge of the extra wiring.
Why You Would Want A UPS For Your Raspberry Pi
There are a few different reasons why you might want to prevent your Raspberry Pi from losing power.
The first and most important is that it protects your device. When power outages occur, they can cause your SD card to become corrupted if your Raspberry Pi was in the middle of writing something. The only remedy for a corrupted SD card is a complete reformat. So you can say goodbye to all of the hard work you had put into your project.
Another reason you might want to maintain continuous power to your Raspberry Pi may be related to its use. Some projects need to be continuously running. Examples of this include sensors that are counting how many times an event happens or projects that include time-sensitive programming.
How much power does my Raspberry Pi need?
The answer to this question depends on which Raspberry Pi model you have. Each Raspberry Pi is designed to work on 5 Volts but has a different amperage requirement. See the table below to determine the power needs for your Raspberry Pi.
Can I give my Raspberry Pi too much power?
Yes! If you put too high of a voltage into your Raspberry Pi, you will most likely damage the circuitry. You should never connect a power supply that is not within the recommended 4.75-5.25V. Supplying less that 4.75V may prevent your Pi from turning on; supplying more than 5.25V can severely damage your device.
What happens if my SD card gets corrupted?
If your SD card becomes corrupted, you will need to reformat it. There isn’t an easy way to extract data from a corrupted SD card, this is why there is a lot of value in setting up a UPS for your Raspberry Pi. You can reformat your SD card with almost any computer, just be sure to set it up with the FAT32 file system.