Relay question

Hi, I'm planning to use an arduino or make a pcb with atmega328 to control a boiler (time based with an rtc).
I thought to use a relay for the switching of the power supply, do someone have already done this, if yes, what relay have you used? (italian AC power lines 230V, 60Hz)
I think I can have a maximum power of 3KW

Yes, controlling relays has been done many times, it's pretty standard. You just need a transistor to drive your relay, a protection diode to protect the transistor from the coil in the relay and two current limiting resistors. Plus a relay that conforms can switch the desired load and to the necessary safety standards.

The magic incantation for more details in this case is Arduino Relay in your favourite search engine. You get on the first page links like these:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1153189420
http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads

Korman

Rather than a conventional relay you would be better going with a solid state relay. This is controlled directly from the arduino output port and provides complete galvanic isolation between your mains operated device and the arduino.
jack

Thank you all very much, solid state relays looks more expesive than conventional ones..

I use an arduino to control my boiler, it runs with an electrical load of about 100 watts. I use a home brew solid state relay, its based on a K3020P opto-isolator and a Z0103MA Triac on a small piece of stripboard. It was pretty cheap to make. Its a 1 amp Triac so could switch up to 230 watts ish. Its been running reliably for the better part of a year. Only slighty more complex than the circuit required to drive and snub a mechanical relay.

It's necessary to add a snub circuit after the triac because of the capacitive load?
As I understand it's not necessary with mechanical relays, because it's like a switch, it's correct?

You need a snubber on either circuit, completely different. Its a reverse polarity diode across the coil on the mechanical to prevent the inductive kickback generating harmful voltages (to the arduino) when the coil is switched off, its a R-C circuit (a high voltage capacitor and a resistor) on the Triac to get it to switch off if its not a perfect resistive load (Voltage and current out of phase).

Mechanical :
Relay
Transistor
2 resistors
1 diode

Home brew SSR :
1 opto-isolator chip
1 Triac
3 resistors
1 high voltage capacitor

Ok, that's clear, I didn't know the protection diode for backwards current during turn off it's called snubber.
So in case of the ssr the series of R and C has to be connected in parallel to the triac?

Ok, that's clear, I didn't know the protection diode for backwards current during turn off it's called snubber.

Snubbing diode is one of its names, it can be called several things.

So in case of the ssr the series of R and C has to be connected in parallel to the triac?

Yes

If you were switching high AC currents with a mechanical relay, an R-C circuit across its output will keep arcing across the contacts when they open to a minimum..

Sorry for the delay, thank you for your response, so the schematics for the selfmade ssr should be something like this (I followed the moc30x datasheet example)..

I have some questions.
U1, should be a moc304x (400VAC Rated)..
Then the datasheet says that the led power should be 3v, so should I use a voltage divider instead of just r1 for 5V?
It connects the triad to the phototriad because it's better to switch it on just for small periods then driving the gate always on?
Can you find anything wrong on this schematic?

Thats pretty much like I have except I have no R3. I have R1 at 180 ohms, r2 and r4 are both 1K. Capacitor is .01uF 2kV. Its fed directly from 5v from the arduino. It could be fired from any voltage if you adjusted R1 to suit.

I based my circuit on the right hand side of this :

Yes, it's pretty much the same..
It's ok if the power section resistors are 1/5W ones or should I put power ones there?
And it's sure better if I put a fuse like you do in yours too!

It's ok if the power section resistors are 1/5W ones

To be on the safe side I would use a 1W resistor for R7.

Yes thanks, it's better to be safe! I mean 1/2W anyway, it was a typo..
R6 on pluggy schematics should be 1W too or the power on the optotriac it's ok for half a W?

R6 on pluggy schematics should be 1W too

No R6 has very little power running through it. As soon as it starts conducting current the triac turns on and there is no more current through it.

Mine are 1/4 W except for R4/R7 which is 1/2 W. I think GM is working on the bigger capacitor in my picture. Mine isn't showing any heat discolouration after 12 months use with a 0.01 uF capacitor. My picture shows a much more powerful triac than I have in my circuit.

Thank you very much!
I've already managed to talk to the RTC via TWI, so I just need to get a display and the components needed to control the power before mounting anything up and get going!

Except 0.01uF is 10nF and its a smaller one in my schematic. ::slight_smile:

Its still running so it can't be all bad :slight_smile:

I have a Seagate Dockstar running Linux with an internet connection keeping time. The arduino doesn't know what time it is, it just maintains a temperature relayed to it from the Linux box.

It also plots pretty graphs from the other stuff the arduino does :

http://pluggy.is-a-geek.com/

Its still running so it can't be all bad

I think so :slight_smile: Better be safe ahah!

It also plots pretty graphs from the other stuff the arduino does :

http://pluggy.is-a-geek.com/

Wow it's pretty damn cool!

Uhm.. The forum changes bad words, nice of it!