Today, my mom had to return something at Home Depot. She sent me inside, saying I could use the refund to get some stuff. I remembered an instruction at http://kennethfinnegan.blogspot.com/2010/01/switching-120vac-with-5v-digital-logic.html and got most of the parts. I could not find the terminal block, but that can wait. MY main problem is that I do not have a 5v relay, I have a 12v one. If I had to feed in 12v, I would also need to keep my wall wart handy, and then I wouldn’t be doing anything but following instructions. So I decided to make a 12v wall wart part of the project. I just have to hook up 5v and ground to control it.
I decided to do this because my relay is 12v and I therefore would need to always use the 12v wall wart for it. I put both in a gang box, added a transistor and a resistor, wired them to the outlets and power cord and was done. I followed the original instructions, but where they said +5v I put in the 12v, and added wires to connect the wall wart to power. This has the advantage of only needing to connect 2 wires to the arduino as well as only drawing the power needed to control a transistor. The disadvantage is that it has to be plugged in to test the relay. I only got shocked two or three times while making this. Total cost under $15, I had most of the parts on hand.
this is three main parts: the relay board, the power outlet, and the wall wart. power cord from an old computer.