Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to be able to have a simple power switch between the RPi and its USB power, such that I don't have to plug and unplug the device to operate it.

Is there a simple switch available that I can buy or build?

share|improve this question

The most naive approach would be to add a switch to an extension cord. You can usually find all necessary components in your local hardware store. If you do not know how to construct and solder something like that together, it might be better to just buy something, that does the trick. I found an switching adapter for the German "Schuko" system on Amazon.de, but you might have a different system in your country and choose a different retailer.

share|improve this answer
It's Schuko (Schutzkontakt). Schoko is short for chocolate ;) – Oliver Salzburg Jun 24 '12 at 11:49
You are of course correct, but please edit my answer, next time. The comments should not be used for discussions of such trivialities, I think. – Bengt Jun 24 '12 at 15:42
I had no plans to discuss it, but I also like to reserve edits of other peoples answers for changes that are more substantial. – Oliver Salzburg Jun 24 '12 at 19:30
I think an edit is much less prominent than a comment and should therefore be used preferably to keep things tidy. – Bengt Jun 24 '12 at 19:33

See this thread on raspberrypi.org and this blog article with images how to create a switch.

share|improve this answer

Try this new product launching on kickstarter - http://kck.st/UVBXTE

share|improve this answer

I am not good with soldering, so I got myself the ready made RemotePi Board, it plugs into the GPIO port. The board enables you to so switch the power with a button or an infrared remote control - the infrared signal is forwarded to the OS as well, so you can remote to it using LIRC. Works well with my Logitech Harmony and OpenElec.

share|improve this answer

If I were going to build an "on/off" switch I would use a simple button acts as a switch, and monitor it through the GPIO pins. See this tutorial for building a button: http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/buttons_and_switches/

Then I would use the button to send a proper shutdown command sudo shutdown -h now so that I didn't corrupt my disk, or cause other damage by shutting down unexpectedly. How do I turn off my Raspberry Pi?

The last step is theoretical, since I don't know a good way to write that script. If someone knows how to write that shell command (and thinks this answer isn't wrong), please feel free to edit this answer!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.