The other picture is of a cheap charger available from Sainsbury's (£4.99 when I bought mine) and is copyright by me. Other than the label, I have no idea whether this charger works with a Raspberry Pi, since I didn't have a Raspberry Pi when I bought it, and it has since wandered away.

Two novels for the price of one. The second may be a little weaker than the first, but Larry Niven does not produce any bad writing. In common with the rest of his work, these contain rock hard science. Take a neutron star, put a planet round it and you have the recipe for a gas torus — a vast volume of micro-gravity with breathable air. These books bring orbital mechanics to life, if you notice it amidst the riveting story.

By far the most traffic coming to this part of the site is looking for information on power supplies for the Raspberry Pi. I thought it was about time I actually said something about them.

The power socket on a Raspberry Pi is a "micro B USB socket". this means that many mobile-phone chargers will work to power the Raspberry Pi. Such chargers come in two varieties; they either have a normal USB A socket on the body of the charger or they have a cable with a micro B USB plug on the end. See the picture to the right. If the charger does not come with a cable, you will need to get one. This will be a standard A USB plug to micro B USB plug cable of course. It is important to note however that there seem to be many examples of both chargers and cables on the market which are not only incapable of powering the Raspberry Pi, but may actually be dangerous (in a catch-fire sort of way.)

The best way to ensure that the power supply and cable you are buying is sufficient and safe is to buy it through a reputable dealer in your own country. You may see some great deals on eBay from Chinese companies, but there have been several examples where such products are incorrectly marked, badly designed and incapable of meeting the claimed specification. One charger I bought from an independent phone shop here in the UK burned out in service with a sparking noise and smoke. Caveat Emptor.

Any cable that is sold to charge a mobile phone should be good enough to power a Raspberry Pi. However there are some cables out there that are obviously sold only for data purposes and their wires are too thin to supply power. If you need a cable, then you should probably have a branded mobile phone charging cable available for test purposes at least.

Once you have decided where to buy your power supply, you need to check that it will supply enough power for the Raspberry Pi. See the picture to the left. Any charger you will find will have a data label like this one. The top line is the power it takes from the mains. You can ignore this, (so long as you are sure it was made for your country.). The bottom line is the power it provides (outputs) to the device it's charging. There are two numbers listed, and you can be fairly certain that the first one of them is going to be "5V" (V means volts). Occasionally a power supply might supply a bit more, and anything up to 5.25V is safe. The second number is the important one.

Electric current is measured in amperes, abbreviated to amps or just A. Just like there are a thousand millimetres (mm) in a metre, so there are a thousand milliamps (mA) in an amp.1 You need a power supply that can provide at least 0.7A (or 700mA), but it is probably a good idea to get one that is a little over-specified, say 1A (1000mA).

The voltage must be exactly right (4.75V to 5.25V), but the current only has to be large enough. You could use a 2A or 3A charger if such was available and the Raspberry Pi would take just its 700mA. If you are considering using a power supply that is much bigger — 10A or more — then there is another effect that you will have to understand. It is possible to draw such a small current that the power supply is no longer regulated — its voltage will rise — but this is not a problem with mobile phone chargers and such.

The straight lines, one dotted, between the two numbers tells you that the power is DC. If it was a wavy line it would mean AC, which is not what you want. If it says "unregulated" then do not buy it; while it might be able to power a particular phone, it would not supply an accurate enough voltage to keep the Raspberry Pi and its USB peripherals happy.

Every now and then someone asks if they can use a USB hub or a computer USB port to power the Raspberry Pi. The answer is a firm "maybe". The USB specification says that hubs and computers must supply at least 100mA to any device, and must supply at least 500mA following negotiation with the device. The Raspberry Pi power socket does not do negotiation — its data lines are not even connected to anything — so it can only depend on getting 100mA, which is nowhere near enough. On the other hand, many hubs and laptops do not limit the amount of power they supply, so it is very likely that a Raspberry Pi could be powered in this way. The only way to find out is to try it, (or to have the right test equipment.)

Phone chargers can supply any amount of power they like, so there is no way other than the label to find whether they will be able to power the Raspberry Pi. If they can supply more than 500mA then they are supposed to short their data lines, but the Raspberry Pi cannot check that. If one had enough equipment to test that, it would be easier and less error-prone to test the current directly.

The fuses on the Raspberry Pi, and probably those on a laptop, are solid-state polyswitches. If you manage to draw too much current and blow them, then don't panic. Just switch everything off for a few hours and they will reset. It does take hours though; a quick off and on will not reset them.

For further detailed information on power supplies for the Raspberry Pi, see the Raspberry Pi Wiki.

Recommendations

I use the following and they work well:

HTC Legend charger

HTC Legend charger cable

Samsung Galaxy SIII charger

Nokia Charger cable (I've forgotten the model)

(The Samsung cable is in the office to charge my phone, but I imagine it would work well too.)

I have found that the length and quality of the cable matters if you expect to plug anything into the USB ports of the Raspberry Pi. I have lots of cables but the only ones that work reliably are of the three-foot variety.

I don't really know why, but when I use cables that are longer than three feet, they only work if plugged into a computer's USB hub and not a USB power supply such as the Nook Color charger. But, using the same charger and a shorter cable usually works. It's weird but not unexpected.

1. If you are taking this information to publish it elsewhere, please note the capitalisation of "mA"; it is important. "MA" would be megamp — a billion times larger. "ma" would be a milliare, a unit of area equal to 0.1 square metres. (Compare "hectare" which is a hundred "are".)