Control AC with Arduino

I am very new to arduino.
Need to control AC through a relay.
Can you send a circuit diagram?

I appreciate any answer

There are lots of ways to do what you want but one of the easiest is to use a solid state relay that can be driven directly from the arduino.
Here is one place you can get them from:

I will try it with this relay.

thanks a lot.

are there any schematics using these solution?

any answer highly appreciated.

a solid state relay (ssr) was used in this project : Arduino Beer Thermostat – uCHobby
you can find a schematic on that page.

p.s. be very careful when wiring up to keep the high voltage AC isolated, You don't want to accidently have it contact any part of you or your arduino :o

I'm controlling an OMRON with nothing more than a 220 ohm resistor and connected the one digital out to it's + and the - to ground. Polarity is important on the DC Side so find a good datasheet or see if the device is marked. A data sheet will tell you what is needed.

I found out that pulsing CCFLs off and on causes them to commit suicide.

Having a whole string of christmas lights controlled by pin 13 is cool.

would you reccomend wearing thick rubber gloves? or will u get electricute any way?

You can if you wish use them but the proper way to work with AC is NOT TO WORK WITH THE POWER applied WHILE THE FINGERS or other appendages ARE IN ANY WAY GOING TO TOUCH IT. Not just a switch or circuit breaker, for this sort of work you unplug it physically and box the plug.

Nice thing about rubber gloves that are not properly cared for is that the AC will find a way to kill you with them on. And the same applies to a wooden pole, a fiberglass pole and to your utility truck. Which can happen if you touch it without carefully walking around it to make sure your now dead buddy didn't DROP A POWER LINE ON IT!!! < why? Two or more people on one project means not just the guilty moron DIES.


Consider NOT using them until you have more than a basic understanding of AC safety. A mistake is too permanent though you will be crunchy and good with ketchup that is not good for you. But you'll be a delicacy to dragons that don't like to cook.

I had a nice spiffy guide, deleted it for incompleteness. There's just too much information you need to be safe. Look at the library for books on this. It's not hard to learn enough to be safe but it does take effort. Ask a librarian about looking up books on basic safety when working with electricity and the basic skills for doing normal home electric work.

would you reccomend wearing thick rubber gloves? or will u get electricute any way?


look this:

And I agree with Mrmeval, since we don't know how much knoeldge has the person that is asking. By the question, it's supposed to be a layperson, and I think all we can give warning about AC is valid.

Hey there,

the circuit is already in function,

Thanks for the invaluable help guys....
I was just very unfamiliar the philosophy of arduino and how it functions...
Things are getting more and more clear the more I read on topics of interest posted in this forum and the arduino playground..
I really apreciate your help mem and adilson...
until the next question....


sounds good :slight_smile: any relays from sparkfun you reccomend? or are the ones you linked better?

Spiros, where are you from (if u don't mind asking you). Your name sounds familiar :slight_smile:

Greece-whos ther?