relay card controller caution with 220v mains.

Hey i just bought a velleman relay card controller and i am just checking to see if I have understood it right as i am working with mains power and do not want to die.

the arduino should be able to control the circuit with the digital pins going high/low right? they can handle 9V/15mA.

here is a link to the relay card
http://www.velleman.eu/downloads/0/illustrated/illustrated_assembly_manual_k2633_rev1.pdf

So can i connect it directly to the relay card or do i need to put something in between?

Any advice would be great because i have never worked with mains power before.

Thanks so much in advance!

Tim

the arduino should be able to control the circuit with the digital pins going high/low right? they can handle 9V/15mA.

No, the Arduino pins are +5vdc logic level only. That board is expecting open collector transistor outputs to drive the boards input pins. That will require some kind of external switching transistor stage to be compatible with a Arduino I/O pin.

Lefty

WOW that was fast!

so i could use this circuit with a TIP102 transistor

but keep the grounds separated so that the circuits are completely separated?

tim

That transistor stage would work. However there does still have to be a ground connection between your rely board and the Arduino ground pin.

Lefty

You don't need anything as hefty as a tip102, almost any npn transistor such as a 2n2222 should work with your vellemen board. Connect the collector of the transistor shown in the playground link to the input pin of the vellman (and connect the grounds of course) and you should be good to go. You dont need to the diode because you are not switching curren through the relay coils, you are only turning on the transistors on the velleman board

excellent!

to be sure, i have attached an image for the arduino to relay board.

let me know if i understood you right.

oh i got carried away i know.... but is this how i would connect an electrical device to the relays? Ref the new diagram.

And thankyou all so much for your help. I woke up this morning not sure how i would do this! Legends!

According to the velleman documentation, the relays need 9 volts. This means that you can't use the arduino 5v line for the velleman +vdc input. For that you will need an external DC 9 volt power supply.
If you arduino is powered from an external DC supply then you may be able to use that, the voltage on the Vin pin will be around .7 volts lower than the voltage on the external power pin.
The negative side of the supply connects to GND, the positive side connect to the velleman +VDC pin. There is no connection to the Arduino 5v pin.

Your connection to the AC mains should be to the phase and neutral (aka return), its wired just like an ac mains switch.

ok but i will use the C and NO points on the relay board?

and the phase is split and connected to those points (C & NO)?...

and neutral just goes to the device right?

5v means 5v!
The Arduino voltage regulator takes your supply voltage (9v in this case I guess) and lowers it to 5v. You will want to send the unregulated supply voltage, I would call it the right most pin on the power header (sometimes labeled Vin, Vs, or Vcc), and send it to your relay module for powering the relays.

BTW:
I wouldn't ever label AC as +Vcc or Gnd. Generally AC wiring is Hot (black), Neutral (white), and Ground (green or bare). Make sure you don't become ground while working with it!

One more thing...
I don't know if it's really necessary in this case, but while driving motors and LEDs through a 2n2222 like your schematic shows, I've noticed that if the Arduino pin is floating (neither written low or high), then a fair amount of current can flow through the transistor. This can be fixed by adding a 10k pull-down resistor to the transistor base (i.e. connecting base to ground), that way a little random voltage won't turn on the transistor.
As I understand it, once you've initialized your digital out (i.e. digitalWrite(pin,LOW) ), the Arduino MCU has internal pull-down resistors to take care of all this. You probably wouldn't want the relays turning on when power was first applied (before the Arduino has a chance to boot and initialize the output pins).

ok but i will use the C and NO points on the relay board?
yes

and the phase is split and connected to those points (C & NO)?...
Yes - the C and NO act as a switch for phase

and neutral just goes to the device right?
Yes

Be very careful not to let anything touch the velleman board when connected to the mains.

Again, Thanks to everybody for helping me! I can't tell you how helpful it has been!

Thankyou!

Hi all,

So far i have managed to connect and get everything working fine. Unfortunately the relays seem to have stopped clicking. Does this mean they are broken?

I've done something like that, using a cheap relay board bought on Ebay, and a network shield, to make a networkable power switch based on arduino. Additionnaly, ther's an interface for Heyu linux home automation software.

Original article in french : http://www.civade.com/2009/07/25/40-arduino-network-power-switch-telecommander-via-ethernet-des-equipements-basse-tension-220v-relais-28j60-domotique-heyu

Translation via Google Translate : http://translate.google.com/translate?u=http%3A//www.civade.com/2009/07/25/40-arduino-network-power-switch-telecommander-via-ethernet-des-equipements-basse-tension-220v-relais-28j60-domotique-heyu&hl=en&langpair=auto|en&tbb=1&ie=ISO-8859-1

Feel free to comment or improve...

Hey thanks but i solved it with a solid state relay! One piece and it works great!

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1251737273/4#4