Instructables
loading
loading
Picture of Web Controlled 8-Channel Powerstrip
Greetings, fellow Raspberry Pi enthusiasts.  We are about to create a multi-purpose gadget that is sure to impress!  My primary reason for building this to to control my Christmas lights, but that is only one of many possible uses.  Basically you can plug in up to 8 appliance and turn them on and off independantly from your smart phone!  If you want to setup port-forwarding on your wireless router, you can control your appliances from anywhere in the world.  (Although why you would want to turn on your blender from over-seas is a bit of a mystery.) Please leave me a comment letting me know how you use your Web Controlled Powerstrip!

Before we get started, I want to give credit where credit is due: TheFreeElectron wrote an excellent instructable on controlling the Raspberry Pi GPIO pins from a web-browser. In fact, in-order to complete this instructable, you will need to follow almost all of the steps from his instructable including using his awesome web application for controlling your power-strip.

Secondly a reminder that working with mains power can be extremely dangerous. Please be very careful. Those of us that have had the experience of touching a live 120 volt wire do not EVER want to repeat the experience.

Assuming you already have your raspberry pi with the adapter and SD card, you should be able to round up the rest of the ingredients with $40-$50 dollars.

Here's what you're gonna need for this project:
  • Raspberry Pi with SD Card
  • Micro USB Power supply (Make sure your power supply can supply a full 1 amp)
  • Project Box - Available at you local Target ($14.99) - Hurry these are seasonal!
  • 8-Channel 5V Relay board - EBay (About $10 shipped, I found mine here.)
  • 4 (qty) 15-Amp Power Receptacles (Lowe's or Home-Depot, get the cheap ones about 80 cents each)
  • 18AWG Solid Hookup Wire (3 colors) - Radio Shack (About $8.50)
  • Short length of 14-Gauge wire. (Only need about 15 inches of white, I found some scrap)
  • Large wire-nuts (Red or bigger)
  • Colored jumper wires - Female to Female buy them on EBay here.
  • Power cord (I used an old computer power cord)
  • Scrap wood pieces
  • Double Stik tape
  • 1/4" wood screws
  • Optional (but handy):  A female end of an extension cord or broken holiday-light set.

Tools
 

  • Trim or plunge-type router with 1/8" straight cutting bit.
  • Wire strippers
  • Drill & drill bits (various sizes)
  • Screwdrivers (various sizes)
  • Multi-meter (for testing circuitry)
  • Utility knife


 
Remove these adsRemove these ads by Signing Up
1-40 of 113Next »
nrune made it!1 month ago
Okay it's done I made it!

Couple of changes I made to the original design. I added a 20 amp fuse just to be safe. I also upgraded the wire to 14 gauge. Instead of using the web page to control the power strip, I set up openhab to control it over SSH from a server. The Raspberry Pi primarily acts as a media center with Kodi.

Thanks for the instructable.
temp_-920663747.jpg
rleddington (author)  nrune1 month ago
Congratulations! Looks great!
nrune1 month ago

OK i need help. I can not get the relay magnets to close at all. I have purchased two different relay's and both of them seam to have the same issue. I have tried different RPI power supplies but nothing seems to work. The LED's on the relays are all lit, but the relay never closes.

nrune nrune1 month ago

Fixed - Both of my relay boards required 5V to pin 10 of the relay with vcc and jd-vcc jumpered. Works like a champ with the extra voltage nice solid clicks.

rleddington (author)  nrune1 month ago
Good job! I was wondering if you only has 3.3 volts going to the coils. They need 5. Sounds like you figured it out on your own. Well done.
amiller110 made it!2 months ago
I had a lot of fun doing this. I built mine into the lid of the project box so i can easily wall mount it some day.
20150521_231927.png20150519_234841.jpg20150519_210749.jpg

I have a power conditioner set up for my recording equipment. I've been looking at power sequencers with conditioners built in, and the price point doesn't justify the functionality for me. Does anyone know if I can safely plug this project into a power conditioner? Should there be any concerns with the 'cleanliness' or stability of the power coming out of the relay-controlled outlets?

yashrg3 months ago

Can I link this up with IFTTT to control individual power outlet based on recipes?

kelly.s.wilson.355 made it!4 months ago

I loved this project. I only put 2 outlets the pi could control. The third is to plug in the pi. I also didn't separate the sockets individually. The cord I used was from a surge protector so I brought the surge switch along with it. All three outlets are connected to the serge protector. The pi is not built into it so I have the connectors coming out the side.

WIN_20150327_194605.JPG
S J SrikarN4 months ago

hi rleddington,

Thank you for posting this. I am trying to do this as well using my raspi2.

I am relatively a newbie w.r.t to anything electrical, so I have a rather simple question.

Is the white wire (14 gauge) you talk about solid or stranded? I have a stranded one and it doesn't seem to fit the hole on power receptacle. Pretty sure am doing something wrong.

Thank you

Srikar

fatlard1993 made it!5 months ago

Just finished up with one! Mine is however powered by an arduino mini acting as an I2c slave. Thanks for the idea!

IMG_20150223_190004.jpg
rleddington (author)  fatlard19935 months ago

Looks good. Thanks for sharing.

ckalla5 months ago
PLEAse CAN i have more feedback ? ck7up@yandex.ru thank you and please can I use more than 8 channels on one raspberry?

Thank you for all.

Hello ive been trying to do this for so long, i love your GUI interface! is there any chance you could point me in the direction of the code for this please? And also the pin outs for the Raspberry PI Model B - "Rev 1" i think :/ not sure how to check.

Thank You

ppeters05026 months ago

I love this project! Super simple and to the point, and not a ton of resources to drain (I love using the raspberry pi as a web server to host the controls for this too, great idea!)

rleddington (author)  ppeters05026 months ago
Thanks! I wish I could take credit for the web-server idea - That was done by "TheFreeElectron" . I just put it to good use. :-)

Can you do this with a 50 amp (normal australian mains socket) instead? what modifications would i need to make?

Yes, but a standard AU mains socket is 10 amps, not 50.

Thought about making a LAN PDU for some time... I like the tutorial, but the relays appear to be rated for 10A, But the outlets are 15A ... might want to reconsider or use two relays per outlet.
tstapert8 months ago
Thanks for the great instructable. I had a lot of fun making this to work our Christmas lights. The only problem I'm having is that everything turns on when I start it even though the power buttons show off (red). I have to turn each one to green (which should be on) to turn the switch off. It's just backwards. It all worked fine when I just used LEDs as in the instructable you based this off. Any ideas why it's working the opposite with the relay board?
temp_1083350872.jpg
The-Dude tstapert7 months ago

The issue is that in the examples / pictures in the article the "wrong" relay board receptacles are used. Each relay has 3 receptacles, left one middle one and right one.

In the pictures the left and middle receptacles are used, if one uses de right one and the middle receptacles the board / Raspberry will behave exactly like the website (green for on red for off)

I personaly find this safer and more practical as by default now all outlets are in the off position by default.
But there is no right or wrong here.

You can check this yourself by REMOVING THE POWER to the relays / outlets (really important) only power your raspberry and use a multimeter and check the receptacles with the continuity test. (If your multi-meter doen't have a continuity test, just put it on one of the resistance settings.)

Did I mention to remove the main power first :D ?

By the way Thanks rleddington for writing this article I found it verry usefull !

tstapert tstapert8 months ago
I just edited the code and basically switched high and low output and everything works great. Thanks again!
tstapert tstapert8 months ago
I should have read to the end of your instructable and I wouldn't have had that question.

But thanks for bringing it up for those of us who had the same issue. ^^

Martin AP7 months ago

Hi

To fix the problem, you need to use transistors. Take a look on this link:

https://docs.google.com/file/d/0B5-HND9HJkXWSTQtYlFTZ3VyODA/edit?usp=sharing

I followed the instructions and it works fine for me.

Best regards

BobB87 months ago

does it matter what type raspberry pi I use?

I made this, but cannot figure out how to switch the relays from active-low to normal. How do I do that?

Zycro8 months ago

Hello! I am ordering all of the parts I need to do this next week. What were the final dimensions for the box you used? That is the last piece I need to order. Thank you!

natebman9 months ago

I was just wondering if you had had any problems with the raspberry pi controlling and powering the relay board? I found a schematic that says the relay board is active low and the raspberry pi is active high so you have to short the relay board to ground to active the relay.

rleddington (author)  natebman9 months ago
It worked fine except that the web-site displays green when its off and red when it's on. I tweaked the code a little bit so that I could reverse that and show green for on and red for off.
HenryA19 months ago

hi. i'm newbie , so how can i control /monitor the lamps from my smartphone,Are there any sripts or coding ?? i would like to learn that, thanks

hello sir I want to control our electrical home applinces through my mobile using raspbery and monitor that how much power is consumption at hat time....

the data must show graph bw power consumption over time..

help me.....

joesewer10 months ago

Hi, for some strange reason my setup shows for Red button (which normally would be off) the on state. Can you guess what might be wrong?

SandeepS211 months ago

How I know that my device is ON / OFF when I am at long distance ... Any acknowledgement ?

rleddington (author)  SandeepS211 months ago
Yes, when you visit the web-page served by your raspberry pi, you get to see if the devices are on or off just. (Red for OFF, green for ON)
And if any one device is not starting then how we get the feedback that it is not starting ?
bandicoot_1 year ago
EW!!! Who wants your phone???
rleddington (author)  bandicoot_1 year ago
No kidding. The Motorola Triumph is a LEMON! Can't wait to get a new phone. This thing crashes so often my standard procedure has become - remove battery - put it back in - use phone - repeat. :-(

hi there,

i have some doubt, since your wiring system is differ from ours in India, and i identify that green wire is ground, yet i can't find that black wire you used is positive or negative charge. can you plz answer for that. thank you

rleddington (author)  dragons.n.s1 year ago

I'm not sure I understand you question but I will try to answer just the same. The power cord has white, black, and green. Since this is A/C there is no such concept as positive/negative wires. Instead you have a ground (green), hot (black) and neutral (white). All of the energy (both positive and negative) come from the black wire. Does that help?

1-40 of 113Next »