give your Arduino a 120 volt kick in the pants!

The Arduino is a great tool for anyone interested in learning microcontroller programming, but after blinking some LEDs, what's next? This project enables your Arduino to control real-world 120 Volt electrical appliances you have in your home.

what can you use a plugduino for?

Well, its great for Halloween prop controller to automate your lasers, fog machines, fans and such in an intelligent way. You can use beam breaks, contact pads, distance sensors, and so on to control up to 4 devices independently or in unison to make a unique experience.

But you can also use in the house to control appliances based on sensors such as temperature, humidity, motion, light, and so on to open curtains, turn on lights, fans based on environmental conditions. You can also use it for more whimsical things like sign marquees, animated Christmas light lights, super sized Simon game, and anything that takes input, runs program logic, and controls 120V devices.

plugduino is a smart relay controller

which means that you can write a program that determines how each of the four electrical outlets are turned on or off, and in addition supply up to 4 inputs into the logic to interface it to the outside world. As a simple example, you can make a sequencer for the lights with a speed control simply by connecting a potentiometer to one of the inputs and using its value to control the sequencing speed.

Step 1: lets pop it open!

Inside the plugduino you'll find just a few basic bits that are wired together to make the magic happen. The real mojo in the plugduino comes from the combination of an Arduino microcontroller and a SeedStudio V2.0 Relay Shield; the rest of the stuff is just wiring and connectors.

warning: working on 120V circuits can be dangerous and potentially lethal
make sure you know what you are doing and proceed carefully!


Because this project involves house wiring, follow the instructions carefully to ensure a safe build and always test and operate the device with a safety fuse. With the proper use of rated terminal strips, shrink tubing, wiring, and safety procedures, you can build this project safely, but always be aware that the risk of electrical shock is present!

The power circuit consists of a 3 prong power plug, fuse, terminal strip, and two dual outlets. The four red wires between each outlet and the control board provide the switching circuit. Note that this circuit is physically isolated from the rest of the wiring.

The control circuit consists of an Arduino Uno, a SeedStudio V2.0 relay shield, and a skinned 12V power wall wart. The program running on the Arduino reads sensor input and controls the status of the relays on the Relay Shield and hence the outlets. The control board is mounted onto a section of perfboard, and fastened to the bottom of the cabinet using nut/bolt/spacers.

The sensor input terminals support four sets of analog inputs to the Arduino to provide for switches, potentiometers, and the like. Depending on your needs, you could connect these terminals to whatever inputs ( analog and/or digital ) as you see fit. You could also use different connectors that might better suit your application, such as terminal posts, ribbon connector, etc.

The I/O status indicators display which outlets have power applied to them, and which inputs are generating an input value. The indicators are separated into two groups of input and output. In this project, white LEDs are used to display output status, and green LEDs are used to display input status.

The cabinet is a standard plastic and aluminum project box with contact paper applied to the front panel for aesthetics.
<p>nice! instead of using that dial can you use a laser break beam sensor like for making a drag stage light? if so i am so making this project lol</p>
Sure. The dial is just a test of any type of sensor you would like to connect; you only need to change the code that reads the sensor to calibrate it to the sensor you are doing. You can find out more by just looking into the Arduino analog/digital input functions - lots of examples.
<p>@svenkatesh3, not as you ask, but you can monitor power usage by plugging the whole thing into a Kill-a-watt or power meter outlet. You can't measure power use using just relays anyways (though you can crudely approximate if you know the power draw of what you plug in, then simply measure &quot;on&quot; time...). There have been folks who modified the Adafruit Tweet-a-watt to use an arduino, so you could combine the two things into one larger enclosure. </p>
<p>can we able to transmit how much watts its consuming by the device through Xbee transmitter and receiver and which should display in LCD and how to connect with Arduino board could u help me ??</p>
<p>I want my Arduino to control 4 power outlets (on\off)..my home electricity is 230v </p><p> so i have to design 4 power outlets which should control hair dyer(400w),200w blub,Lcd tv,(50w)pumps<br>in my project if any fault happens like overvoltage,neutral line fault or overheating happens in any of the outlets that particular outlet should be isolate which should be indicate with LED for this which component should use whether SSR relay or 4 channel Relay shield ??<br><br>Please help me understand these things, and remember I'm very new , so if you think I need to but something else, it will be great if you could explain <br><br>Lots of Thanks !!!!<br><br>shyam</p>
<p>Hi shyam. One advantage of mechanical relays like the one used in this project is that they have a fairly slow response time, which might help if you attempt to trigger a device (such as motor) too quickly. I would suggest that you could put a fuse on each of the outlets in addition to isolate any fault to just that device.</p>
<p>This is a project want to do and submit it i have to control 4 device and i have to show if fault happens means what relay will do whether all the four socket turn off or particular outlet will turned off and i have to measure the each outlet Power and have to transfer the data into LCD thro Xbee whether arduino uno is enough or i go for arduino mega ?</p><p><br>ll upload my schematic diagram soon :) :) <br><br>and guide me help me !!! <br><br>Thanks a lot for response :) :)</p>
<p>In this Control circuit schematic They explained about sensor inputs (the sensor inputs are connected to the analog inputs on the Arduino board ( A0, A1, A2, A3 ). The input voltages on these pins are converted into a 10 bit integer value</p><p>such that the range between 0V and 5V and translated into a value between 0 and 1023 respectively. The ideal connector thus contains 3 inputs per sensor ( 5V, GND, A<br>) resulting in 12 connection points.) I need clear explanation about this and what type of sensors they using and how they connected ??<br><br>Thanks For ur help :) :) </p>
<p>Here are a few more links to get you thinking:</p><p><a href="http://learn.adafruit.com/photocells/using-a-photocell" rel="nofollow">http://learn.adafruit.com/photocells/using-a-photo...</a></p><p><a href="http://playground.arduino.cc/ComponentLib/Thermistor" rel="nofollow">http://playground.arduino.cc/ComponentLib/Thermist...</a></p><p><a href="http://www.trossenrobotics.com/c/arduino-sensors.aspx" rel="nofollow">http://www.trossenrobotics.com/c/arduino-sensors.a...</a></p>
<p>Thanks :) :) </p>
<p>This is essentially a direct input to the Arduino, so there are many examples of analog input - too many to describe here. To get you started, take a look at this article:</p><p><a href="http://arduino.cc/en/Tutorial/AnalogInput" rel="nofollow">http://arduino.cc/en/Tutorial/AnalogInput</a></p><p>Although this is simply a potentiometer, you can use the same method for thermistors, photocells, and the like.</p>
That is really nice work.
dude yes I could control a light or plasma ball or even tesla coil yay! (super exited)
Thanks! Since the Arduino is just turning the pins on/off, the programming possibilities are pretty wide open. One simple example might be to string 4 sets of lights woven around a tree. How you animate them is where the coolness of the project would come in.
Cool project! You could use something like this to make programmable Christmas lights that go with music.
The clicking would drive me insane - why not use solid state relays, or even a discrete set of triac output optocouplers and triacs - then you could even do fading and other cool stuff if you have lights in the outlets. <br>I made a sequencer like that back in the early 90's, but it had 16 outputs, and was not microcontroller programmed - it was all hard wired logic - but it was pretty cool. Even had audio input.
I personally love the clicking. There is something satisfying about it to me.
Nice project! I'm wondering why you chose to switch the neutrals with the relays leaving the hot inputs to the plugs powered as opposed to always providing ground and neutrals to the plugs and switching the hots? I probably would do it the other way around. <br>Best Wishes
Thank you, and excellent question. This is an oversight in my build that I will correct shortly in the instructions. As you probably know, switching neutral still keeps the circuit alive (but off) whereas switching hot disconnects the circuit. Thanks for the catch, and I'll have an update to correct this shortly.
The diagrams and instructions now indicate the modified wiring where the hot connection is used to switch the outlets. Thanks again for the reading through the project and making the catch.
Looking great! <br>Thanks! <br>
This us a cool project! The URL is missing a colon after the http.
Thanks! I think I have corrected the link; I assume you mean the URL on the last page...?

About This Instructable


344 favorites


Bio: I am a multidisciplinary engineer actively interested in new technology and how it can be used to further interest in science, technology, engineering, and mathematics.
More by flashular: babbletron -  an interactive exploration of computer generated speech plugduino - Arduino based 120 Volt outlet controller Raspberry Pi as a DMX light controller
Add instructable to: