User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Tue Aug 09, 2011 5:59 pm

At this point in time, we know that the r-pi is not planned to have a traditional "ON/OFF" switch or button, so I was thinking why not just make one ourselves? Now it would certainly be easy enough to throw an actual toggle switch inside an enclosure and wire it up, but I was thinking even more basic than that.

Now it would certainly be easy enough to go this route



But that just doesn't look fun enough for me!

I would rather go with a floor switch



or an inline switch



Both use the same concept to wire.

Skills needed to do this:
Ability to cut wires, strip wires, screw wires to screw terminal

Tools needed
Scissors / Wire cutter
Wire Stripper
Flat or Phillips head screw driver (depending on type of screws that come with your switch)

Step 1: Gather your parts
Tools
1 - power supply (6-20V)
1 - switch according to your preference

Here's a picture of the final product for you reference as you read these steps.



Step 2: Strip the wire
Take your power supply and strip back enough of the wire your switch. If you look at the photo above you'll see that you do not actually cut the wire in half (at least not for the switches I've used)! The idea is that you strip off about 2 inches (or however much the instructions that come with your switch tell you to) of the power cord then cut 1 of the wires.

Step 3: Cut the hot wire!
In the photo above I was adding a switch to a set of fluorescent lights above my workbench so for me, dealing with AC power, the hot wire was black. Technically speaking, it doesn't matter if you cut the neutral or hot wire in a AC (or DC for that matter) wire. Putting a switch on either one will break the circuit, but it's good practice to cut the "hot" or "Positive" wire. This does not apply to the green ground wire!!! Cutting the green wire (ground) will not break the circuit and depending on the application may even be dangerous (another reason it is good practice to only use the hot or positive wires)! With DC power, the Positive wire will either be red, or the wire that does not have a white stripe running down it from end to end.

Step 4: Strip the cut wire and attach to terminal
Now that you've cut the hot wire, go ahead and strip it back a little bit and then attach it to the terminals (take a look at the photo if you need the reference). Take the one wire (or two wires if your cord is grounded) that you did not cut and tuck them to the side.

Step 5: Close it up!
With your hot wire attached to the terminals, and your spare wires tucked to the side, close the switch up and test it out! If done correctly you've just created a simple power switch for your r-pi!
Dear forum: Play nice ;-)

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Wed Aug 10, 2011 5:06 am

Any of those should work just fine. Any thoughts about a possible surge?
When I saw that second picture I thought you were going to wire it into a touchlight! ROFL
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Wed Aug 10, 2011 5:32 am

Ultimately, I figured surge would be handled at whatever point you physically plugged the device into. The point of this was just to give a beginner level instruction for adding a switch... but I like the idea of a more advanced design where you actually build a surge protector into the line and use a regular style switch. Theoretically, all you would need is a fuse for a basic surge protection, but there are more impressive things you could do with it!
Dear forum: Play nice ;-)

AmyS3
Posts: 173
Joined: Tue Aug 02, 2011 4:12 am
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Wed Aug 10, 2011 5:40 pm

Quote from Lob0426 on August 10, 2011, 06:06
Any of those should work just fine. Any thoughts about a possible surge?
When I saw that second picture I thought you were going to wire it into a touchlight! ROFL
i was thinking exactly the same!
would be a nice idea to put a raspi in one of those and use them as power switch with light feature if its on :-)
you could bring all the needed connectors out on the side of the light..

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Wed Aug 10, 2011 10:48 pm

AmyS3: a touch light, a Ras.Pi and a motion sensor from spark fun.

Abishur: you forgot the "Clapper" clap on, clap off. The clapper!

Seriously any switch that can handle like 2 amps will work. As a device meant also for the third world, surge protection could be very important. Mine and probably abishur's will probably be plugged into protected power strips or battery backups. AmyS3's use will be off of batteries and hopefully will have a self reset breaker.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Wed Aug 10, 2011 11:25 pm

Hey abishur do you have a link or info on that inline switch?

I sure have to do a lot of editing when I use that iPad2.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Wed Oct 05, 2011 7:34 pm

Wow, I can't believe I missed this question, but 2 months later... and the answer is no :P I grabbed it at my local hardware store, for me the switches were in the same aisle as the the circuit breakers, electrical outlets, and light switches
Dear forum: Play nice ;-)

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Thu Oct 06, 2011 2:24 am

I looked in my local hardware stores and could not find them. They would work great for an Inline switch between the RasPi and the wall wart.

Only two months!
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Thu Oct 06, 2011 12:50 pm

I think I missed it at first too and actually ended up finding it at walmart. I found a link to the one I got at walmart, but it's not available on-line (I found it by searching for "in-line switch) but I was able to find a similar one at Lowe's. Here's the link
Dear forum: Play nice ;-)

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

Re: Adding a Powerswitch (Difficulty: Beginner)

Fri Oct 07, 2011 3:28 am

Growing up 45+ years ago, my Grandmother had those type of switches wired to her table lamps for easy to reach on/off of the lamps. It is a good starter hardware project.

I prefer a 6 to 8 plug power buss strip with a built in on/off switch, cost is $9.00ish USD.
Then one switch kills power to CPU, printer, monitor, speakers, scanner, USB port expander.
Removes all those phantom power suckers with one click.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Adding a Powerswitch (Difficulty: Beginner)

Fri Oct 07, 2011 4:04 am

I still have those on most of my desktop-size lamps . Have I missed a switch revolution ?

akjssdk
Posts: 3
Joined: Sun Aug 21, 2011 1:23 pm

Re: Adding a Powerswitch (Difficulty: Beginner)

Sun Oct 09, 2011 2:52 pm

I was actually thinking of one of these: http://www.altronics.com.au/in.....8;id=S1040

Wouldn't it just be awesome if you could turn your raspberry on with that? And if you'd have more pi's, you would just flick on those switches :D

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Adding a Powerswitch (Difficulty: Beginner)

Sun Oct 09, 2011 4:31 pm

Yeah, that switch will work just as easily. I listed the one I did because a) I put this project on an absolute beginner level) and b) it's an all inclusive deal. That's the absolute only piece you need to make it work and it costs less than 2 bucks. With using a rocker switch or a Push button switch, or even a dial switch, you have to buy an additional enclosure for it to go in. Not saying there's anything wrong with that route, and if you had a lot of these near one another you could do some fun things with a panel of r-pi power switches, I'm just aiming to keep it simple ;)
Dear forum: Play nice ;-)

Return to “Other projects”