This project is designed to help you construct some relay boxes for controlling power from your wall socket using an arduino or microcontroller.  The inspiration for writing an instructable came when I decided to build some relay boxes for my personal Garduino project.  For safety concerns I started designing my own relay circuit and outlet until I came across SparkFun's article "Controlling Big, Mean Devices".

I decided to abandon my own plans mainly due to time and cost and ordered the parts from SparkFun.  What follows is essentially the same information you'll find on their guide but with a few of my own notes.  I hope that you find my insights helpful and it will get your project off the ground without a hitch.

Step 1: Parts and Safety

The great thing about this project is that there aren't a lot of parts that you need to get started. You probably have most of the parts lying around your junk box and the rest you can order directly from SparkFun or your favorite supplier. I've made a list of parts available on my wiki. SparkFun can supply the relay and PCB and your local hardware store will have your GFCI Outlet and electrical housing.

Now a brief note about safety. Every time you work with electrical lines you may be risking your life if you don't use the right precautions. In general you should always employ a certified electrician but you can do this project on your own if you're careful. Absolutely ensure the plug is not connected to a live electrical socket when working on the relay, the outlet, or the extension cord at any point. Also, it's probably good practice to enclose any wires before testing. With that you should probably do just fine.
<p>Thank you mate, this was my first real life scenario with Arduino</p>
Hi. Im trying doing my project but i was confused about the connection between arduino uno, CT sensor, Relay , AC- AC adapter and socket outlet. The project that I was doing is monitoring power appliances.
Hi. I'm trying to use this with a Refloleo ( on Kickstarter) He has 2 inputs to control the relay, this has 3 wires. I guess I need to get some power to this relay for it to operate.
Does this control both outlets? or just one?
Yes, it controls both outlets at the same time.
Hey, I'm going to build one of these as soon as I receive the parts. I was wondering if there was a way to place a relay for each plug, or would you have to use a non-GFCI plug? If so, is it really unsafe to do so? <br> <br>I have a broader idea in mind and this is the first step in pulling it together. Thanks
You'll definitely need a different circuit for each plug you wish to automate. It's probably unsafe to use non-GFCI for projects, but you can do it. Play around with it and see how you like it with the setup I describe and decide what you want to do from there. Good luck with your project!
This is cool! If you want to switch high power faster, use a solid state relay. The advantages of a solid state relay are that it can switch faster because it is not electro-mechanical. Great ible!
Hi there,<br /> <br /> I really appreciate you posting this instructable, and enjoyed the SparkFun tutorial as well. &nbsp;I have been in the planning/prototyping stages of putting together a homebrew home automation system for the past year, and this tutorial will certainly come in handy. &nbsp;You see, because I will have some relatively important things being controlled by the system I'm planning, I do not want to use pre-constructed systems like X10, for fear of mixed signals from my neighbors. &nbsp;<br /> <br /> One thing I have been trying to find is a solution to a switch-controlled device (eg. front porch light), but I have not been able to find anything. &nbsp;Have you seen a product or homemade solution to this issue? &nbsp;Your instructable has given me the idea of maybe setting up a &quot;2-way&quot; switch layout, but with the 2nd switch being a relay, and housing it within the existing light switch box. &nbsp;That way, you could switch the load manually, or by automatic control. &nbsp;Adding a sensing element to the load pair would enable you to make the switch smart enough for the system to actually turn the load on/off, rather than just send a switching signal.<br /> <br /> I would love to hear what you think, and if you have heard of a device (homemade or not) that could make this work!<br /> <br /> Thanks,<br /> Mike<br />
Hi Mike... <br> <br>I don't work for only program but you might want to look in to a Crestron control system... It will run your house and more. <br> <br>Good luck. <br> <br>Leo <br>
Also, any outlet you buy nowdays has the Black/Hot/Brass screw and the White/Neutral/Silver screw, and it's been that way for a long time. A regular outlet costs ~$0.50, and a GFCI is maybe $15, so there's almost no reason not to buy new.
i was wondering if you could replace the relay from a 120v AC and use a 12V DC. I want to use an old computer fan and have a tempature control for it.
you dont need a relay for that, simply a transistor would do<br>check the specs of ur fan and find a transistor that can handle the current, add a nice heatsink and ur practically done!
Hi, Lots of information about power control with Arduino here:<br><br>http://arduino-info.wikispaces.com/ArduinoPower<br><br>Several kinds of relays here:<br><br>http://➡.ws/relays<br><br>Regards, Terry King<br><br>terry@yourduino.com
Sorry. Bad link. Try this:<br><br>http://arduino-direct.com/sunshop/index.php?l=search_list&amp;s[search]=relay&amp;s[title]=Y&amp;s[short_desc]=Y&amp;s[full_desc]=Y&amp;s[sku]=Y&amp;s[match]=all&amp;s[cid]=0
QUOTE:...&quot;The GFCI&nbsp;outlet is the most important part of this entire apparatus. &nbsp;The reason you're using this instead of a different outlet is that it may protect your life in the case of an over-voltage event.&quot;<br /> <br /> ACTUALLY, the reason for using a <strong>G</strong> round <strong>F</strong> ault <strong>C</strong> ircuit <strong>I</strong> nterrupter is because it will trip (and possibly save your life)&nbsp;during GROUND FAULT conditions.<br /> <br /> More info at &quot;How Stuff Works&quot;&nbsp;<a href="http://home.howstuffworks.com/question117.htm" rel="nofollow">http://home.howstuffworks.com/question117.htm</a>
Hello,<br /> Your instructable is really nice and easy to follow. I stumbled upon this from the name Arduino and well...<br /> <br /> What is a relay box? How will it help me with my Arduino projects?<br /> <br /> I just got my Arduino today and been looking for guides and&nbsp;tutorials on how to program the arduino.<br />
Glad you liked the instructable!&nbsp; Wish I could take credit for most of the work here, but I&nbsp;followed directions from the people at SparkFun.<br /> <br /> A relay is a kind of switch.&nbsp; It allows you to turn on and off this switch without being directly connected to the thing you're turning on or off.&nbsp; In this case I&nbsp;wanted to turn on and off power to a light and a pump in one of my projects.&nbsp; I&nbsp;used the relay to turn on and off the 120V power using the 5V signal from my arduino.<br /> <br /> If you've got projects where you need to control power to something that normally plugs into the wall this is a good way to do it. &nbsp;I&nbsp;think these things are dead useful when combined with the arduino so I've actually built a few.<br /> <br /> Hope this helps and good luck building!<br />

About This Instructable




Bio: I'm a software and aerospace engineer. When I've got free time I like to work on robot projects and love to play with ... More »
More by natantus:Childhood Laser: Building a HeNe Laser Kit Construct Your Own Menorah Garduino Upgrade, Now with more Twitter! 
Add instructable to: