Sunday, August 18, 2013

A Better Way To Power The Pi

Generally one powers the Raspberry Pi using a recommended setup of a standard USB Cable (type A to Micro-B), used by many cell phones, connected to a 5V USB wall adapter that is capable of supplying at least a recommended 1000 mA of power, which is then connected to the Micro USB Power port on the Pi.  This works great.  But, are there other ways, that might better fit your particular setup?

USB Cable - Type A to Micro-B
USB Cable - Type A to Micro-B
5V USB Wall Adapter
5V at 1000 mA (or more) USB Wall Adapter

Words of Caution

First, a couple words of caution:

Warning: There is both a Mini and a Micro USB type, and Micro is the one you want. (which is unfortunate because I have a bucket full of Mini USB cables)

Warning: It is not recommended to try and power the Raspberry Pi from a computer's USB port.  The USB spec says that a USB port should supply up to 500 mA of power, which is below the 700 mA requirement for the Raspberry Pi (Type B), and well below the recommended 1 A.  Although, you might be able to get away with it, if you use a Raspberry Pi (Type A) with nothing connected.

USB Powered Hub

As USB devices are connected to the Pi, such as a mouse, keyboard and Wi-Fi adapter (the big consumer), the Pi is eventually no longer able to supply sufficient power and will begin to behave erratically (reboots, power on failure, CPU hangs, CPU stalls).  At this point it is recommended to move the USB devices to a USB Powered Hub.

If you were like me, this initially involved two power adapters connected to the wall, and a mess of wires running to the Pi.  I then found a recommendation that said, if the USB Powered Hub is capable of supplying the appropriate power to each port, you could actually connect the Raspberry Pi to the USB Powered Hub and have only one power adapter connected to the wall.  I immediately tried this, and it worked great!

"It is possible to power the Rpi from a powered USB hub the Rpi controls, but only on 'dumb' devices, that allow the port to supply the full current without waiting for the usb device to ask for it. As the power input of the Rpi doesn't have its data leads connected, there is no chance for a communication loop of some sorts." [source]

GPIO Header

The next trick is you can power the Raspberry Pi directly through the GPIO header.  If you have a project that is not using wall power (like a mobile robot), and is using some type of alternative power supply (like a car battery with regulator), this can be a handy way of powering the Raspberry Pi.  Just make sure you regulate the power to exactly 5V (+/- .25V), and that the power supply can supply the required current.

"As the 5V rail is brought out in the GPIO pins, you can power the Rpi from there too. You should mind however, that those are behind the power protection circuitry, so you should provide your own." [source] 

Checking 5V Power

So how does one tell if you have an adequate power supply?

The Raspberry Pi conveniently includes 2 test points (labeled TP1 and TP2) that you can quickly check the voltage with a voltmeter / multimeter.  Set your multimeter to DC V and touch the red probe to TP1 and the black probe to TP2.  You should see a voltage between 4.75 V and 5.25 V.  If you see negative values just swap your probes around.  Anything outside of this range is bad.  Anything close to the edges of this range may cause problems.

Voltage Test Points
Voltage Test Points

When I test my two Raspberry Pis, I see 4.86 V on one and 4.89 V on the other (both being powered by USB Powered Hubs).

"You should see a voltage between 4.75 and 5.25 volts. Anything outside this range indicates that you have a problem with your power supply or your power cable, or the input polyfuse F3. Anything inside, but close to the limits, of this range may indicate a problem." [source]

1 comment:

J Dennert said...

In a couple of projects where I've had several Pis running in close proximity to each other I've used a powered USB hub like a power strip. I powered 2-4 Pis off this Siig ( and 6 Pis off this Kensington ( I also recently found a 5-port USB power supply (®-Family-Sized-Desktop-Charger-Adapter/dp/B00DVH62J2) that I currently have powering 4 Pis.