Introduction
There are lots of things in life that are a mystery. One of the big mysteries is what happens to all those odd socks, buttons and tea spoons.
What has any of this to do with the Raspberry PI or power? Well this article is about the ways that you can provide power to your Raspberry PI.
Now you may think that it is obvious. Connect a power cable to the PI and turn it on. Whilst this certainly works there are issues that the makers of the Raspberry PI have missed and which I intend to cover in this blog post.
I think there is a modern spin to be taken on the whole lost sock and tea spoon problem and that is with USB cables. I can never find the correct USB cable that is used to charge my mobile phone and sure enough no two mobile phones seem to use a USB cable with the same connection at the end.
It isn't just mobile phones that use USB cables however. The Kindle uses a USB cable as does every digital camera, MP3 player and even games consoles such as the Blaze ultimate. Keeping track of the USB cable that goes with my mobile phone is a constant battle.
Anyway on with the article.
Powering the Raspberry PI from a standard mobile phone charger
The most common way to set up the Raspberry PI is to use a standard mobile phone charger with a micro USB connector.
To make your Raspberry PI work simply plug the power cable of the charger into a plug socket and hey presto it starts to boot up.
If you have connected your Raspberry PI using a HDMI cable to the television and you have forgotten to turn the television on first it is highly likely that when you do turn the television on you won't see anything happening. On top of this issue you cannot tell how far through the boot sequence the Raspberry PI is.
There is no on and off switch for the Raspberry PI which means the only way to restart the PI, if the operating system hangs for any reason, is to pull the USB cable out of the PI and plug it back in or to press the switch on the wall.
The lack of a reset switch on the Raspberry PI is for me a design flaw.
Power the Raspberry PI from the television
Modern televisions quite often come with USB ports. If you plan to connect to your Raspberry PI and use a television as the main output then it makes sense to power it via the USB port on the television especially if you are using your Raspberry PI as a media centre.
Powering your Raspberry PI via the USB cable connected to the television means that it doesn't come on until you turn your television on.
As soon as the television is turned on you will see the Raspberry PI boot up.
Life rarely provides us perfect solutions however. If you now turn the television off your Raspberry PI will also lose power and if you haven't shut down your operating system first then there is a risk that you corrupt it and so subsequent boots may fail.
Power the Raspberry PI from a powered USB hub
For me powering the Raspberry PI using a powered USB hub is the best solution there is. You will almost certainly need a powered hub to run your Raspberry PI as although the Raspberry PI itself can absorb enough power to run itself it will begin to struggle when you have a mouse, keyboard and wireless dongle plugged in. Every device added saps a little more power.
If you intend to use your Raspberry PI as a retro games machine you will certainly feel the benefit of a powered hub.
If you are going to use a powered hub get one with an on/off switch.
The only real issue with using a hub to power your Raspberry PI is that it uses up one of the USB ports on your hub but there is nothing stopping you daisy chaining hubs.
Battery powered Raspberry PI
The Raspberry PI doesn't have to use power cables. You can actually power a Raspberry PI using a portable mobile phone charger.
If you search on Google there are various do it yourself guides showing you how to power the Raspberry PI with 6 AA batteries but it takes some skill to get it to work which is why the portable phone charger is the simpler solution.
Here is a Youtube video showing exactly how to power your Raspberry PI using batteries.
Solar powered Raspberry PI
There are various solutions provided on the internet for powering the Raspberry PI by sunlight but I think the guide provided on CNET is a good one because instead of sending direct power to your Raspberry PI it actually charges batteries which then powers the Raspberry PI. This ensures that only the right amount of power goes to the Raspberry PI.
This video on Youtube also shows how to run the Raspberry PI from sunlight.
Summary
When you first bought your Raspberry PI I bet the last thought in your mind was how am I going to power this thing.
As you can see the lack of an on/off switch does cause issues but these can be overcome by using the power of your television or a powered hub.
The main issue is that when you log out from Raspbian the display for the Raspberry PI stops and so you have no idea when the shutdown process is complete.
In another of my articles I showed how to connect to the Raspberry PI using a Google Nexus 7. Using this method you could actually place the Raspberry PI anywhere as long as it has a WIFI connection.
Power the Raspberry PI from your loft, your garden or even the cupboard under the stairs.
Thankyou for reading
Nice article. However, about the no reset button design flaw, I would agree with you if the raspberry pi was sold as a complete computer solution, but since it is sold as a project learning printed circuit board, I have to disagree. http://raspi.tv/tag/reset-button-raspberry-pi In the recent models there are now two holes / contacts for installation of a header to which to connect a reset button for those who find that important. It is also possible to add a real time clock for those who might deem that a design flaw as well. Anyway, overall good write up.
ReplyDeleteThis article was interesting to read but to add a bit more info....
ReplyDeleteAdding a power switch/usb power to the Pi may be helpful regarding logistics of turning the device on/off as needed, however, that does NOT resolve the shutdown issue.
Disconnecting the power randomly to any electrical device in general is not a good idea. What is really needed is a SHUTDOWN process/device. When power is disconnected randomly, the device could be in the middle of any one of a number of processes and shutting off power in the middle of those processes may create problems, corruption, etc. The shutdown feature, waits for critical processes to complete, shuts down the processes AND THEN removes power from the Pi. No harm done. The shutdown process can be either software/hardware or a combination of the two but just installing a reset button or pulling the power cord does nothing to preserve integrity of the system. I am not a Linux expert (newbie at best) but given that people are seeing image corruption on their SD cards, I think it's safe to say these results are a good indicator that a shutdown process as well as an actual switch to power on/off the device is needed.
I too must disagree with the statements of missing a power or reset switch as a design flaw.
ReplyDeleteThe raspberry pi is not made to be a complete computer solution. It is for education and projects. So the beauty is that if you want a power switch, then you make one and install it. If you want a reset then do the same. Create your own soft power switch and connect it to the GPIO to run a shutdown now -h command.
It is all there for you to do... That is the beauty of it. It doesn't force you to do it their way, you can do it how ever you want.
i also disagree with that statement. am right behind you flattery
ReplyDeleteThanks for visiting my blog
ReplyDelete