Wednesday 11 June 2014

Powering The RaspberryPi

For the majority of RaspberryPi users, powering their Pi from a standard 5 Volt USB supply is the best and safest option.


The power supply is of fundamental importance, and if this does not do its job properly, your Pi powered project may be unreliable, or simply not run at all.


Most of the time, almost any 5 Volt USB power supply will be OK to power the Raspberry Pi when running with just mouse, keyboard & display, providing it is powerful enough.


What could possibly go wrong?


The RaspberryPi requires a nominal supply of 5Volts d.c., with an acceptable range of 4.75 to 5.25Volts. However, even if that little black power supply that you plug into the wall socket produces exactly 5.000Volts, the voltage across the critical 5V components in the Pi circuit may be less for several reasons.

Your USB supply probably came with a 1m USB cable with a micro USB connector on one end and a standard USB connector on the other. Both the cable and any connectors will introduce circuit resistance between the supply and the RaspberryPi.

And before the juice reaches the important part of the RaspberryPi circuit, it has an active "fuse" to negotiate (F3), which also introduces resistance.



The relevance of this is that the power supply voltage is effectively reduced each time it encounters resistance.



So your system may start out with an adequate supply voltage, but due to resistive losses, may fail to deliver the minimum requirement of 4.75V to the critical RaspberryPi components.

Meet Little Georgie


According to Mr. Georg Simon Ohm (...what a guy!) the voltage across a resistance is equal to its resistance times the current flowing through it.

So using Ohms law, if our RaspberryPi draws a current of 600mA (0.6A), and our supply connector+cable+fuse resistance is 0.5 Ohms, we are going to lose:-
0.5 x 0.6A = 0.3Volts

...and if our supply produces an output of 5.0V, the RaspberryPi circuit will only be presented with:-
5.0V - 0.3V = 4.70Volts
...which is not enough! However, this is just a made-up example to illustrate the maths.

Let me now present some real figures using a RaspberryPi model B.

I did a test using a Hauwei 5Volt 1Amp USB phone supply, and measured the RaspberryPi Voltage at TP1 wrt (with respect to) TP2.

I deliberately loaded the RaspberryPi with SD card, USB combi keyboard/mouse, HDMI monitor, Edimax wifi dongle and ethernet connection.

Hauwei Test

TP1 wrt TP2 minimum during boot: 4.75Volts (...Uh-Oh!)
TP1 wrt TP2 while just displaying LXDE desktop: 4.81Volts

So this configuration is dangerously close to falling over.

Then I repeated the test with another supply. This is a no-name Chinese travel charger with a rated output of 5Volts up to 2Amps.

No-Name Test

TP1 wrt TP2 minimum during boot: 4.95V
TP1 wrt TP2 while just displaying LXDE desktop: 5.00Volts

Wow! that should be great, just what I need. But why the difference?

Its tempting to say that the Huawei supply is crap, or that we obviously need a 2A supply rather than a 1A version. But that would be to disregard little Georgie Ohm and his law covering Voltage, current & resistance.

So I did another test on both power supplies, this time with all USB and network cables disconnected. I also removed the SD card before powering the RaspberryPi (i.e. the Pi is not doing a lot) so hopefully the load on the supply is much reduced.

Hauwei: TP1 wrt TP2: 4.99V
No-Name: TP1 wrt TP2: 5.21V

So, No-Name is cheating! Its not a 5V supply, its a 5.2V supply.

Now consider the difference in voltage between the lightly loaded and the heavily loaded supplies.

Hauwei: 4.99V - 4.75V = 0.24V
No-Name: 5.21V - 4.95V = 0.26V

These results are very similar (note: since the No-Name supply voltage is higher, we would expect the difference to also be larger, because the RaspberryPi current will be slightly larger).

So the Hauwei power supply is perfectly OK, in that it provides 5Volts up to 1Amp. But with the RaspberryPi running power hungry devices, the resistive losses result in a near under-voltage supply between TP1 & 2. However, for less demanding RaspberryPi applications (e.g. those not using a wifi dongle) this power supply is fine.

Conclusion


The RaspberryPi works great in a basic configuration (e.g. with just mouse, keyboard, monitor & ethernet connections)  with most true 5Volt power supplies, so long as they have an adequate current rating (say, at least 1Amp).

However, the RaspberryPi on-board fuse and other sources of resistance can lower the incoming supply voltage. This may result in operational problems if the volt drop exceeds 0.25Volts.

Using a power supply with a nominal output voltage that is close to the maximum rated voltage of the RaspberryPi (i.e. 5.25V) is a good strategy. Unfortunately I have not noticed any units advertised as such.

Maybe there is a market opportunity for a RaspberryPi power supply with a quoted output voltage of 5.2Volts at 1Amp?

2 comments:

  1. How about 5 volts at 2 amps?

    Pi Power is a board that has a GPIO stacking header and a 2.1mm barrel connector. It will take anything from 6 to 15 volts DC in - regulated or not - and will make up to 2A @ 5V.

    http://www.tindie.com/products/nsayer/pi-power/

    ReplyDelete
    Replies
    1. Although I normally delete 'marketing comments' this one is actually relevant to the post, and I see you have published your design details...good man!

      For the vast majority of users, and for the target market (i.e. Education, which I suspect accounts for a small minority of sales) using an off-the-shelf supply will be fine. There are a lot of stupid comments on the forums surrounding supply problems, which I wanted to address in my post. However there are many users that are pushing the Pi, and they need to recognise potential power supply issues.

      I really like the look of PiPower, and at $15 its a great solution for battery powered or power hungry Pi projects in North America. Not quite so good for us chickens in England at $25+. (Maybe you need a distributor in the UK).

      For my battery operated camera projects I've used a 78B5 (circuit here: http://captainbodgit.blogspot.co.uk/2014/05/my-portable-pi-cam.html & a controlled version: http://captainbodgit.blogspot.co.uk/2014/01/birdboxpicam-2014-2b-activity-based.html) but your design looks lower cost, and just plugs straight into the header.

      For those interested in Nick's Pi Power design details, take a look at his interesting blog: http://www.geppettoelectronics.com/search/label/Raspberry%20Pi

      Delete