Controlling 120VAC

Hi all,

What method would you guys recommend for switching 120VAC devices on and off with Arduino? I know there are various solutions out there. I was hoping someone could point out one of the simplest ways.

Basically I am wondering if there is a solution where only 1 part is needed per device you are switching. The last place I looked was calling for transistors and diodes in addition to the relay, which is not very appealing to someone of my laziness.

Thanks for any comments!

Transistor and diodes are used on DC.

For 120V ac it suits better a relay, or a solid state relay, or a triac.

The Powertail is simple, reliable and more importantly, safe: Powerswitch tail 2 : ID 268 : $25.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Thanks jremington but I was hoping for something not so pricey.

So does a relay exist where I can plug in 0 or 5V from arduino and switch 120VAC with no other components required?

Yes. It's called a SOLID STATE RELAY. You must be careful when ordering them from ebay because they also sell DC solid state relays as well as the AC SSRs we are talking about . They have two screw terminals for the 3 -36V dc input voltage and two screw terminals for the AC SPST contacts. (technically , "contacts" is not an appropriate name for these terminals but since you are unfamiliar with them it would be best if you just think of it as an SPST relay, used for switching the line (hot) lead of an ac device.
This is a high current version:

this is a low current version:

Note that both of them show the output terminals as rated for 240VAC. That's what you are looking for.

Ok great thanks dude. Could you just confirm I am understanding how to hook this up? (for the 10A option)

Arduino GND to - input
Arduino digital pin to + input
cut one wire in my 120V line and hook up each side to remaining two pins

then output 5V from arduino to close switch and enable power on 120VAC?

thanks again cool guy 8)

Also if it's not too much trouble could someone link me to an equivalent product on I can't seem to find something similar...

Arduino GND to - input
Arduino digital pin to + input
cut one wire in my 120V line and hook up each side to remaining two pins

then output 5V from arduino to close switch and enable power on 120VAC?

That's all there is to it. Couldn't be simpler.
FYI, just so you know, not that it matters in your application, but SSRs have a built in zero crossing detector circuit to enable the switching of the triac when the ac waveform is at the 0 V crossing point. What this means is that no matter what you do on the input terminals,
the shortest time between any ON or OFF command on the input pins is one half cycle because that's the duration between zero crossings. This means that if you try to use a SSR to dim incandescent lights you will observe a flickering effect. The light will either be off or flickering ot it will be on. The same is true for ac fans. A fan will either be on full or on 70% or 100 %, so an SSR cannot be used as an AC motor speed control either. The period of a 60 hz ac wveform is 1/ 60 hz. = 16.6 mS, so the duration between zero crossings is 8.3 mS.
As long as you just want to use it to turn something on or off and aren't planning on dimming any lights or speed controlling any motors then you are ok.

I know CoolGuy likes the SSR, but many of us like relays.

Relays will arc when you turn turn them off.
This can be prevented using a snubber circuit.

This is the best way I found to control AC from 5VDC

That schematic is useful to dimm AC but op just want to switch on and off (right?). So this solution can toggle too but is an overkill.

I’m not so sure that is any different than an SSR schematic. It has the zero crossing detector and Triacs can only be turned off when there is no current . (or so I have been told).

Yep, triacs can be turned off only when current is 0. For some aplications this is not important because the ac current crosses zero each 10 ms (50 hz semicicle) and at that speed switching off a bulb doesnt matter a 10 ms delay.

SSR is much easier to use than this for just toggling on and off.

The circuit shown is equal to the internal diagram of an SSR, and in a way cheaper.

The circuit shown is equal to the internal diagram of an SSR, and in a way cheaper.

The two main components (triac, opto) are cheap, but Mouser wanted $5 for shipping and Newark wanted $10 so the catch is if you can find these components locally (like in a Fry's Electronics) then yes, it might be cheaper but the triac would probably need a TO-220 heatsink . The parts could cost over $5 , and the SSR, has free shipping, so the SSR & ebay wins

the OP requested

1 part

that would lead one to a pre-manufactured part.

the power tail fits the bill, but is too expensive.

the e-bay relay is cheapest. you can buy from suppliers locally, but pay a mark-up.

the SSR is cleaner in many ways.

questions should have been how often do you switch ? more than a couple times and hour, SSR most definitely.
less than a couple times a day ? relay wins.

ok , but beware of arcing on turn off as the contacts separate. The electrons will jump the gap and start an arc which will continue until the contacts have separated beyond the air ionization distance for the given voltage where distance d= 1000000 V/meter. =>1000V/mm
=>100V/0.1 mm.
Any way you do the math, there is some arcing. It is only a matter of degree.
To test for arcing, use the Blink example to cycle the relay at 1 sec intervals and turn out the lights with a load connected to the relay.
No load, no arcing. If you see flashes of light coming from inside the plastic case in a completely dark room, it can only be arcing.
However, it is fairly easy to add a zero crossing detector and use a digital input to read the detector and do the ANDing in software so when the detector is HIGH , the AND offFlag is true, turn relay off. The cost is basically the cost of an opto, which are cheap.

Allright bros thanks for all the input on this!!

Also big thanks to JohnLincoln for linking me to digikey, never thought to just search for SSR...

unfortunately they are 4x the price on digikey, worth it for me though because they will arrive very fast compared to ebay. I need to get this project done before classes start up again :grin: