I found my self often trying to plug stuff at home with Arduino. So I thought it would be good to have a system that you can just plug your sensor, plug the appliance and code something to see how it goes. I never liked breaking apart an appliance to find the right spot on the electronics, or peel off the wire.
What do you need? A common plug, for example think of a lamp, then you plug it on the wall wart, so how do we get Arduino into the pot? Cutting the wire has being always an option, but then if you want to re use the hardware for something else, the wire would be broken. However sometimes is not an option, the appliance wire can’t be cut. So we interact with the plug. But this is dangerous, so… better not do it. Alternatives? Lets box it all up, the high power and electronics. Using a outlet big enough, lets you put the electronics inside the box and avoid exposing all the high power wires that usually are not coated or protected inside these boxes.
This is plug system with an integrated power supply and an Arduino. Will let you test your coding skills and tests sensors on different scenarios on the go just losing some plugs from the outlet.
|Outlet 6 connectors
|Local store / Radio Shack?
|Arduino Leonardo with Xbee socket
|Power supply for Arduino
|Soldering tools and extra wire borrow it
54$ for a reusable smart Arduino plug. And this is how it looked like before, when it was broken.
Step 1: Unscrew, open the lid and take a peek
This is the time you want to decide the internal layout of the electronics. Main concerns are separating and covering High Power voltage from the rest of the electronics. And leaving enough space for the Arduino pins to keep them exposed. Another note, would be to keep The Arduino connector right next to the border of the outlet so a hole can leave access to programming without opening the hole thing
Each outlet has slightly different setup, Mine was recovered after the fuse failed. However as you can see the fuse is not located in the outlet, but it in the plug.
Step 2: Cleaning up, making room.
The outlet has a button, that will become useless now. I was considering the option of leaving the button on to bypass the relays in case I need the outlet for something else. But if that turns out to be a common case, I can just leave the Relays to always on, and turn off the Arduino.
Step 3: Internal power supply
The power supply for the Arduino can be grabbed out of any common USB charger. Make sure it is powerful enough for whatever you are going to use it. Since I’m always trying to reuse the whole thing, I’m guessing I’ll need quite a bit of power.
I went for this one at first, 300mA. Don’t make the same mistake. At first, I took it for granted that it was at the very least 500mA, but most likely 1A. Turned out it was not enough to even power the Relays. I found another one with 2A and switched it back. I forgot to grab a picture of the Power supply but is just a bit larger and a bit bigger. Had to cut some more plastic out of the outlet.
WARNING, be really careful, when plugging and wiring and powering it. If you are not extremely sure if the polarity of the wires, make sure you are not “nearby” when you plug it! If it breaks, and you have something else powered from the wall wart, everything will go dark. So take all necessary precautions!
Step 4: Layout Draft
With the parts at hand and enough space, I started my first quick draft of the layout.
By the time I did the layout I had already cut the plugs. Would be better to put the Arduino on the right side, and the plugs with the High power all together. Separated and covered.
I’ve grabbed a bit of blue-tack sticky glue thing to hold the parts together. If you have gum and watched a lot of MacGyver then just go ahead. I’ve kept the high power wires from the relays outwards since I believe this is better, hope someone can correct me on this since I’m not entirely sure.
Step 5: Wiring, Soldering and Screwing.
Added a few holes on the back, Arduino form factor. I don’t like the screws going outside, but I wanted this quick and held in place. Then soldered wires for the relay power system and kept it separated from the rest of the electronics. Drilled a hole for the USB.
I do have to say, that after I changed the power supply, I added an extra USB hole, since the new power supply had an USB connector. This way the outlet would be able to charge phones as well.
Note that I went for DFRobot leonardo, since it has 3 sensor connectors and a Xbee socket. This way, I can add the relays+sensor and a wireless module with the bare dfrobot leonardo. The board has 3 pins near the ICSP that are very easy to plug on the sensors. But for now I am using the expansion shield since I am planning to attach several more sensors for my next project. The secondary serial port for the wireless system is also going to be very convenient when It’s Internet enabled.
Read more: Arduino Power outlet with exposed pins