Turn on Relay in 220 V

Good Afternoon,
I've looked in google and also into the forum before to put the topic ... i've seen that is possible connect arduino to the relay using a simple DigitalWrite like did for the led... What I'd like is do that without use Shield - TinkerKit Sensor Shield V.2 ...

What I didn't find is a simple example with the pin to use (probably will be a digitalpin) and which schema to use ...
So I've seen regarding this that the ground of arduino is necessary to be connect to the ground of the relay and the relay need to provide a 5 volt ...

Could you tell me kindly where i can found a simple sketch and schema for start ?

Thanks for the support,
Andrea

If you're asking this kind of question, I'm not sure you should be messing around with mains voltages (this is what you are trying to control, right? 220 VAC?)...that said:

The safest way to control AC mains is with a device called a PowerSwitch tail: http://www.sparkfun.com/products/9842; note that one is for 120VAC, but you should be able to find something similar to switch 220 VAC.

The "next safest" is to use an SSR with a DC input that can handle 5 volts (and doesn't draw more than 20-25 mA) to switch the 220 VAC load; it's biggest issue is the exposed screw terminal heads, as well as the need (sometimes) for a heatsink (depending on the load being controlled); at any rate, you definitely need something to mount it on.

Last would be a regular relay (or contactor - depending on the size of the load again); you need to control one of these with a transistor or mosfet, which is switched by the Arduino. The issue with a relay (assuming you have selected one properly with proper rated contacts, etc) is that they aren't really "safe" by themselves; AC mains and the DC signal control voltages are really close together, unless you construct a PCB (or use some kind of wired socket) or something to keep them properly spaced away from each other. It can be done safely, if you are sure of what you are doing, of course.

While the first two are relatively simple to control (just like controlling an LED, really) - the second requires extra parts to control the coil of the relay (though once built, it can be controlled just as easily). The circuit for this (in general) can be found with these links:

http://arduino.cc/playground/uploads/Main/relays.pdf
http://didier.longueville.free.fr/arduinoos/?p=2308

Note that these circuits are general purpose; they may be describing controlling 12 volts, but with the appropriate relay can switch much higher voltage (also note that you can use one relay to switch another, if needed). Just take care to keep the low voltage control and high voltage mains as "separate" and "isolated" as possible; insulate connections and wires well, provide shielding and other means (and note this even applies to PowerTails and SSRs as well) to keep things safe. Mains isn't something you just "play with"...

:slight_smile:

The powerswitch for 220vac can be found here http://powerswitchtail.com/PSTIIU.aspx