Arduilay is an 8 channel AC relay box for use with Arduino, Max/MSP, Processing, etc.  I designed this system as an alternative to the USB>DMX 4 channel relay option.  While DMX gives you dimming control, the setup is easily 5 times as expensive as this simple relay box.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Get All the Parts

To make this relay box you will need:

- An Arduino
- 4 standard wall outlets
- A four bay plastic outlet box for old construction
- An 8 channel relay board
- A three prong appliance cord
- A four bay outlet face plate, or the laser cut version attached (Red cut, Blue etch)
- 8 half inch #6 machine screws, 4 matching nuts
- 4 one and a half inch #4 machine screws with nuts and one inch nylon stand-offs
- Some wire, 10 female and male header pins, solder, etc.

Tools needed:
- A soldering iron
- A multimeter
- A drill
- A screwdriver
- Wire cutters

I got all the materials from Home Depot and Amazon.  In total, it cost about $50.00 for all the parts.

This is a really simple project, but it does require experiences with drills and soldering.  There are great tutorials on instructables for these tools if you do not already have these skills.

PLEASE NOTE:  Working with AC power is dangerous.  Don't hurt yourself, and don't blame me if you do.

Step 2: Snip the Outlets

I wanted individual control of each outlet, versus both outlets being powered on at once.  To do this, you have to cut the tab between the GOLD screws on all the outlet pairs.  The GOLD screws are on the hot side, the SILVER screws are on the neutral side.  It should say this on the bottom of the outlet pair.Use your wire cutters to snip this tab.  You can use a multimeter to make sure the connection is broken.  The cold side tab can remain intact as we will be wiring them all together anyway.

Step 3: Wire the Grounds and Colds

Cut yourself six 3inch lengths of wire.  I used 18 gauge wire, but 14 gauge would probably be better. Use at least 14gauge wire - I went back and rewired mine based on feedback in the comments.  Strip and bend each end into a C shape.  Use three of these wires to connect all the GREEN ground screw terminals, and the other three to Connect the SILVER neutral terminals.  Since we left the cold side tabs in tact, we only have to use one screw per outlet pair.  Use your multimeter to ensure that all the GREEN screws are connected and all the SILVER screws are connected (even the ones without wires).

Step 4: Add the Relay

Now, cut 8 lengths of wire (about 4-6 inches depending on the outlet's position), strip the ends, and C shape one of them.  One C end goes to each of the 8 GOLD screws, so that each GOLD screw has its own wire.  The other strait end of the wire goes into the really array.  PLEASE NOTE:  In the photo I have it wired up wrong!  The wires should go into the MIDDLE terminal of each relay's 3 terminals, NOT the LEFT terminal.

Step 5: Mount Some Stuff

You can now mount the outlets to the faceplate with the #6 screws, and the relay array to the faceplate with the #4 screws.  Check to make sure you've got outlet one going to relay one and outlet two going to relay two, etc.

Step 6: Add the Relay Powers

Cut 7 one inch lengths of wire and strip the ends.  Make them into staple shapes and connect all the RIGHT relay terminals together.  They should all have two staple lets going into them except the first and last ones.  PLEASE NOTE:  I still have the GOLD screw wires wired wrong in these photos!  They should be going to the middle relay terminals.

Step 7: Put the Arduino in the Box

Line up the Arduino in the bottom of the outlet box.  Drill and 5/8 inch hole for the USB port and a 3/8 inch hold for the power jack in the side of the box.  I just did this by eye.  I ended up using 2 #2 machine screws to hold the Arduino in place, bit now the box is kind of wobbly due to the screw heads, so there may be a better solution, like using countersunk flat heads, or tape.

Step 8: Make This Funny Cable

Now you need a cable to connect the 10 relay pins to the Arduino.  This is a weird one.  We've got the 10 female headers all nice in a row, but the male headers split the first and last off and those get connected together.  This is the power and ground.  This cable gets plugged into pins 2-9 of the Arduino.  I use these pins because pins 0-1 are used for serial communication with Max/MSP.  Pay attention to how the cable connects to each device as it may need a twist to get 1 to 1 etc.  I use hot glue and tape to cover the exposed solder connections to prevent crossed wires.

Step 9: Add the Power Cable

The power cable should be routed through the outlet box first.  The old construction boxes have built in strain relief ports on the bottom, you just jam the wire through.  Use one of the ports on the end of the box where the Arduino is NOT located.  This will give you some wiggle room when accessing the box internals.  Connect the GREEN wire to one of the GREEN outlet screws, the neutral wire to one of the SILVER screws and the hot wire to one of the power (staples) relay terminals.  If your hot / neutral cables are not labeled, the neutral wire connects to the larger of the two flat plug prongs.  Use your multimeter.

Step 10: UPDATE: Add a Fuse!

So after receiving so much excellent feedback from everyone I've made a few additions.  Get yourself a little fuse holder and and a fuse.  I'm using a 20amp 110v one because it's the only 110v variety my local hardware store had, though as people have noted a 10amp one may be better.  Wire this in on the hot (GOLD) side of the power cord before it gets to the relay board.  You can also see in this photo the upgrade to 14g wires and the splitting of each relay power wire to its own lead (versus the "staples" series used before).

Step 11: Close It Up

Use the remaining #6 screws and nuts to close up the box.

Step 12: Connecting to MAX

Before you test out the AC get your Max and Arduino code set up.  

The Arduino code comes from the ArduinoMax_InOut_forDummies from the Arduino playground.  Just upload the included sketch from there.

Then you can connect whatever AC stuff you want.  

Max code is in the text file.

UP! Contest

Participated in the
UP! Contest

Instructables Design Competition

Participated in the
Instructables Design Competition



    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    78 Discussions


    1 year ago

    Awsome ! Thank you! I did this wtih an esp8266 12e so i can control it with Alexa


    6 years ago on Step 12

    While appreciating all the efforts you have taken to assemble this system, one must say that, additional explanations are lacking and errors are evident. You have also have not provided schematics, no information as to what you are trying to control, lacks info on Laser cut face plate and the video clip is not explanatory.
    You must remember, we are dealing with high tension wiring.
    Thanks anyway, nice thought.

    2 replies

    Reply 4 years ago on Step 12

    How is this high tension? You are getting home relay controls mixed up with the powerlines that go from Portland to San Francisco...


    Reply 1 year ago

    In many places "high tension" refers to anything over 24vac.


    3 years ago

    Did anyone actually try to build this with 14 AWG wire? I can't see any possible way to wire the "staple" jumpers with 14AWG. One wire barely fits in the socket, but two does not seem to be possible. Am I doing something wrong?

    1 reply

    Reply 1 year ago

    Hello - I know that you posted this question quite a while ago, but in case you are still looking for an answer, I thought that I would post one. If you look at the rear of the outlets, you will see four small round holes. These are places that you can push in 14 ga. solid wires to make connections to the outlet, instead of, or in your case, in addition to using the screws. You can hook up one of the 14 ga. wires to the screw, and just push the other one into the hole (it won't let go unless you push a small screwdriver into the small rectangular hole right next to the round hole.



    2 years ago

    Would I be able to use this with Christmas lights and the Vixen software instead of MAX? :)


    3 years ago

    FYI: There are three wires used in a 120Vac AC Circuit such as you would control. Ground, Neutral, and Hot (Power).

    The color coding for the connecting wires is Green, White and Black. (In a 220VAC Circuit, power is also supplied via a Red wire and, often the Neutral is not present,

    While the Neutral and Ground and not described as "Hot," neither is described as 'Cold.' If you were, indeed wiring all the SILVER connections together, these would be the Neutral connections and should be connected (joined, linked, etc) with a White insulated wire.

    If you check the power cord you used, you may find there is a color-coded wire insulation for each of the three wires. On some power cords, one of the connectors is 'ribbed' linearly to define the Neutral conductor (or is it the Hot connector - got a meter handy?).

    All in all an ambitious project and worth saving for future reference. I was impressed by the cover plate you made as well.


    3 years ago

    Thanx for this great posting. I plan on doing the same thing but with a raspberry pi. If I run into trouble I will hit you back.


    3 years ago on Introduction

    Thanks, great instructable. I'm adapting some of what you did here for my own solution and have one question. What material are you using for the faceplate?

    1 reply

    4 years ago on Step 12

    Great project! Would like to know more about the coding of it if you could elaborate...

    1 reply

    hi . can you help me how we can load MAX . cn you show me please . thanks you Sir


    4 years ago on Introduction

    Why are you connecting the fuse leads to the right terminal, shouldn't it be the left terminal? If you connect it to the right then when the relay is off it will turn on the light and when the relay is on it will turn of the light. Is this correct?

    Thanks for this! I'm an old guy fussing around with an Arduino. I took several years of electronics but had a brain fart when it came to hooking mains A/C into a relay.

    You also unwittingly supported US veterans (not that I am one). I've already got a circuit built up for Xmas lights on a helicopter in front of the American Legion Post 127, Buford, GA. Just to show them what can be done, each rotor has separate strings of lights. In an hour or two I'll be making them alternately flash like they're moving. The vets will LOVE this.


    4 years ago on Introduction

    the hot wire to one of the power (staples) relay terminals.

    where is it?




    4 years ago on Step 8

    you missed the step where you add the ribon cable to the relay. I got this far and now I'm stuck.


    5 years ago on Introduction

    More technical information about this type relay board, and pointer to schematics
    on the ArduinoInfo.Info WIKI HERE: