Skip navigation

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.

Advertisements

2 Comments

  1. Good job dude! In case you haven’t figured it out yet on your own, the trick is to do all the connection testing with 5V and an LED, then close it all up and *then* apply the 120V. Shocking yourself just isn’t a good thing…

    • that’s what I did(when testing the relay). But when testing the outlet, the 12v wallwart that powered it was connected to the same 120v, so if power wasn’t going to the relay’s contacts it wasn’t going to power the relay. I was debugging my messy soldering, and got shocked. No damage, and better I learned this lesson for myself now than when I visit 220v england this summer. next time, I will either use a 5v relay or have the wallwart powered when none is flowing to the contacts.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: