Arduino Forum

Using Arduino => Motors, Mechanics, and Power => Topic started by: Drew Davis on Jan 18, 2013, 08:38 pm

Title: AC Lamp control
Post by: Drew Davis on Jan 18, 2013, 08:38 pm
Hello,

I'm going to control an AC lamp with the Arduino. I just wanted to make sure i'm doing it right because of the risk of fire when working with high voltages. This is what i'm thinking…

I'm going to take an extension cord and cut it in half and strip the wires. I will then cut the wires coming from the lamp and strip them. I will solder one wire on the lamp to a wire on the extension cord and then put some electrical tape around it. Then i will take the extra wire from the lamp and extension cord and put them into the relay.

Will that work?

http://www.ikea.com/us/en/catalog/products/10175810/
http://www.seeedstudio.com/depot/grove-relay-p-769.html?cPath=156_160


Thanks,
Drew Davis
Title: Re: AC Lamp control
Post by: retrolefty on Jan 18, 2013, 08:43 pm
Electrically yes that would work. If that is the safest way for you is another question. Can the tape ever unravel or snag on something and come loose? Wiring of household AC is a safety item you should take into consideration.

Lefty

Title: Re: AC Lamp control
Post by: Drew Davis on Jan 18, 2013, 09:36 pm
What would you use in place of tape? Heat-shrinking rubber?

Also, the light should draw less then .25 amps so I could put in a .5 amp fuse. I think that would prevent me from being killed.

Thanks,
Drew Davis
Title: Re: AC Lamp control
Post by: JimboZA on Jan 18, 2013, 09:43 pm
Or you could buy one of these (http://adafruit.com/products/268) and save a lot of trouble and risk...
Title: Re: AC Lamp control
Post by: Drew Davis on Jan 18, 2013, 09:54 pm
That looks like it will work better than anything I could make! I will look into buying it.

Also, does it use one or two pins on the Arduino?


Thanks,
Drew Davis
Title: Re: AC Lamp control
Post by: JimboZA on Jan 18, 2013, 10:03 pm
I would imagine 1x i/o pin for control and 1x ground
Title: Re: AC Lamp control
Post by: Drew Davis on Jan 18, 2013, 10:33 pm
Thanks for all the help!!!
Title: Re: AC Lamp control
Post by: 0AlphaOmega on Jan 19, 2013, 12:12 am
Your plan looks okay.
If using heat shrink, ensure that the individual strands of wire lay flat or they may poke through, and you may get erm, a shock!

Remember, it's the volts that jolts and the millies that killies! ;)

0.5A is plenty to kill you....

Once you have your relay working, why not look at optical isolation and zero-voltage-switching, you'll be amazed how long your bulbs last too! (filament type)
Title: Re: AC Lamp control
Post by: zoomkat on Jan 19, 2013, 05:47 am
You might consider the below x10 firecracker kit for $40. The CM17A firecracker is dead simple to connect to an arduino (3 wires). The bottom discussion has info to make it controllable via a web page.

http://www.x10.com/automation/ck18a_s_ps32.html

http://arduino.cc/forum/index.php/topic,126271.0.html
Title: Re: AC Lamp control
Post by: Drew Davis on Jan 29, 2013, 03:48 am
I decided to make something like the power switch tale with my relay and it worked fine at first then I plugged it into a surge protector and it killed the power to my hole house and tripped some fuses.  Anyway, I don't know what when wrong the second time and I need to fix it before trying it again!


The only things that were different was the program, how the relay was wired to the Arduino, and that I plugged it into a surge protecter. As for the wiring I simply just used the sensor pin on the relay not the entire grove setup (5v, ground, pin 6, pin7) but I don't think that mattered. The program should not matter either because the relay can only be off or on.  When I plugged it in the relay was set to be on however I don't think it ever switched on because the power for the Arduino got shut off with the rest of my house which happened instantaneously! Also, a device of lower wattage was plugged into my home-made power cord the second time

The only idea I could come up with was that one of the wires slipped inside my home made power plug and a live wire hit a neutral or ground. If it matters I'm using a three prong cord that is running off a regular USA  outlet (125v).


(http://arduino.cc/Users/Drew/Desktop/IMG_0833.JPG)   (http://arduino.cc/Users/Drew/Desktop/IMG_0834.JPG)



Also, please don't say I should not be doing this because that is not a consideration!


Thanks!


Edit: I can't get the pictures to post. Any certain format?
Title: Re: AC Lamp control
Post by: arduinohabib on Jan 29, 2013, 04:25 am
You can solder screw terminals to your circuit board. Don't forget a flyback diode.
Title: Re: AC Lamp control
Post by: 0AlphaOmega on Jan 29, 2013, 10:09 am
Quote
I decided to make something like the power switch tale with my relay and it worked fine at first then I plugged it into a surge protector and it killed the power to my hole house and tripped some fuses.

Did it trip your RCD? You probably have an earth leakage from live or even neutral. If it was a wired fuse, you probably have a live-neutral short! Maybe you need a battery powered project?

That fuse/RCD is there to protect you.... remember...

Quote
Remember, it's the volts that jolts and the millies that killies! smiley-wink


Take care friend
Title: Re: AC Lamp control
Post by: Drew Davis on Jan 29, 2013, 12:55 pm
If you could tell me how to post a picture I could show you what I built.

Also, I did not put a  flyback diode in. Where would one go?

As for a battery project I would much prefer to use strictly DC, but the project i'm working on requires that The Arduino is able to control and outlet.   


Thanks!
Title: Re: AC Lamp control
Post by: arduinohabib on Jan 29, 2013, 01:05 pm
You need to post the picture somewhere online. This is where you put a flyback diode, I drew a diagram:
http://www.flickr.com/photos/92382393@N06/8425886519/
Title: Re: AC Lamp control
Post by: arduinohabib on Jan 29, 2013, 01:07 pm
Oh an don't put the diode the wrong way, or you will cause a short circuit.