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.
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.
- 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
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.