So I guess you probably won’t buy my app if you don’t have anything to control . . .
I guess that’s fair.
So let’s fix that, even though hooking up the Raspberry Pi to the garage door opener is by far the easiest and least dangerous thing you can do.
Speaking of DANGEROUS, I AM NOT AN ELECTRICIAN! I AM NOT AN ELECTRICIAN! I AM NOT AN ELECTRICIAN!
There I said it 3 times so that makes it so.
Not that this one is much more complicated than changing out a outlet in a house, but I didn’t burn down my house, and I didn’t come to yours and burn it down either. If it does burn down that would be your fault.
With that out of the way . . .
First, before starting this project, make sure your Raspberry Pi is configured and you can hear the relay click when you send the Raspberry Pi commands. It royaly stinks to get this thing all screwed together and then find out you have to take everything apart to find out how you wired it wrong.
Here is what the final product looks like:
You have probably seen my first version of the Smart Power Strip and I tried to figure out a way to enclose the relay in something so it would be a little less dangerous and look a little better. I wanted to try to tuck it in the power strip itself, but there just isn’t quite enough room (at least at my skill level) to do that. I did find that the relay will fit into a golf ball plastic display case with some modification, but I still didn’t like having to mount it with double sided tape or something like that.
So I started to think, what was the coolest thing you could have sitting around to hide a Raspberry Pi along with a relay in, and the best thing I can think of is a subwoofer.
So I searched Amazon for the smallest, cheapest subwoofer I could find. And that would be refurbished computer speakers with a sub. $20. For once I was happy to buy refurbished because I was going to throw all the stuff that could possibly be broke away.
So when I got the speakers I instantly gutted the sub box and threw all the electronics in the trash.
I then took a store bought power strip I already had and WHILE IT WAS UNPLUGGED I took it apart and cut the power cord on the inside ( I suppose I could have just cut it on the outside and stripped the wires too)
I then went to Home Depot and bought a Double Gang Wall Outlet Box (the blue plastic box), 2 Wall outlets, and an extra 25′ of wiring like they use in the walls of your house, and wire nuts.
This is how it is wired without being in the box
Here is the side with the “HOT” wires.
Notice that I am pointing at a tab with a screwdriver on the left and there is no tab on the outlet on the right when you remove the tab with a screw driver or pair of pointed nose pliers you are able to turn them on and off individually. That is what I will be doing with the relay.
I left the tab on the other one, because for this implementation I want 2 outlets to always be on as long as the power strip is plugged in, and those are the outlets I will plug the Raspberry Pi into.
There is no reason why you couldn’t break the tab and add another relay and control all four. In fact they make relay’s with 8 switches and you could control 8 outlets (in theory, I have NOT tested that configuration yet).
And here is the common wire side.
I accidentally broke the wrong tab off of the outlet, that’s why you see that ugly little jumper wire on the right.
Looking at the HOT side again you will notices I made the wires going from the outlet to the relay VERY short. I did this so I would have enough room to get the relay to fit in the Gang Box vertically. The wire in the left coming out of the first connection from the left goes straight in the outlet, the other HOT wire coming out of the fourth connection from the left on the relay had to jog to the right to go into the outlet.
On your first try I would recommend just using one outlet, break off the tab so you can control both outlets, but use the other half of the Gang Box to put all your connections in and then just plug the Raspberry Pi into a wall outlet, then come back later and reconfigure for two outlets. You want to make sure all your connections are solid to avoid sparks and possible fires so it’s nice to have enough wire to do that.
Then the second and fifth connections from the left on the relay you use some of the extra wire you bought to run a couple connections that you will connect to the Black/HOT wire on the power cord you got from a real power strip.
Looking at the Common side again, as long as you leave the tabs in tact (there really isn’t a reason not to) you can just run one wire back (with the extra wire you bought) for each outlet.
In the pictures you will see the green “ground” wire hooked up, this will be the first wire we connect when we assemble everything, but don’t do that until you get the power cord fed through the little hole in the back and bring it out the big hole where the blue box goes.
Now I fed the wires through the back of the Gang Box, but I bet all the electrician’s reading this post probably just had 3 – 4 cows. You definitely want to make as many connections as you can INSIDE the box (THAT’S WHAT THE HECK THEY ARE FOR!) but I didn’t SO YOU HAVE BEEN WARNED! If your house burns down I TOLD YOU NOT TO DO IT THIS WAY!
Connect only the Common wires together and mount them SECURELY (to avoid sparks and fire) with a wire nut. Make sure the wires are not loose in the wire nut.
Connect all the HOT wires together and mount them SECURELY (to avoid sparks and fire) with a wire nut. Make sure the wires are not loose in the wire nut.
Finally mount the box.
And tuck the Raspberry Pi in the bottom.
I love the IDEA of wireless, but since I have to replace my Access Points about every 6 months, I prefer the reliability of using CAT5, so you can use a WIPI adapter if you like, but I also make a second whole in the back (3 all together, one other one for the Raspberry Pi power cord) and run CAT5 to the Raspberry Pi. I saved the little plugs from the back when I gutted the original electronics, you can re-use them to hold the CAT5 and run it through the original power cord hole.
Now for testing, AGAIN, I AM NOT AN ELECTRICIAN. But I would suggest taking it outside, hooking it up to a really long extension cord and then plug the extension cord to the wall and make sure it doesn’t explode. Also it would be best if the plug you plug it into would happen to be a GFI so it pops the little breaker if any of your connections are wrong.
Then if all goes well you would try it inside, again hooking it up to a GFI in case of problems. Then test it out for a weekend. Don’t take it to your summer home and test it out by leaving it there for a month unattended, that would not be very smart.
There you go! Now you have NO EXCUSE not to buy my app. (Except for the known fact that Android people don’t pay for things)