Relay Board Connection help

Hi I just bought a arduino duemilanove and a four channel relay board. I have searched many forums and articles but cannot find any basic instructions on how to connect it. here is a picture of the realay board http://cgi.ebay.com.au/Four-4-Relay-Board-24V-AVR-PIC-Arduino-DSP-8051-/120682553460?pt=LH_DefaultDomain_0&hash=item1c193da074#ht_939wt_1001 If anyone can please tell me what wires go where it would be much appreciated. Im just looking to control my 12v garden lights by pressing a key on my keyboard or clicking a on screen switch to turn the lights on and off manually. Thanks

Just looking at the photos I'd say connect any four digital OPs to IN1-4.

Connect the Arduino GND to the GND on the board.

What's not clear though is what VCC means in this context, a board like this shouldn't heed VCC from the Arduino (unless it's for the LEDs, or maybe the relay coils are 5v), and where does the 24v come from. There are two GND/VCC terminals, is one of them for 24v?

I would ask the suppliers for more details, a wiring diagram or a schematic.

Alternatively tell us the relay details (printed on the top) and trace where the GND/VCC signals go and tell us.


Rob

Thanks very much for your help. the terminal screw blocks where the relays are (nc, com, no) how do i go about connecting a extension chord socket to plug in a 240v light?

The PDF document (linked from the eBay page)

I didn't see that despite it being being bright blue and 400 chars long :slight_smile:

Correct, "VCC" is 24v.

the terminal screw blocks where the relays are (nc, com, no) how do i go about connecting a extension chord socket to plug in a 240v light?

NO = Normally open
NC = normally closed

Normally you would place the COM and NO terminals in series with any load.

I know how I'd connect the light, but I won't advise on a forum as you are supposed to be qualified to do such a thing.


Rob

Sorry im a little confused with placing the COM and NO terminals in series with any load. here the electrical wires are: brown = live, blue = ground, green = earth. witch ones do i connect to the terminals?

xavier20:
Sorry im a little confused with placing the COM and NO terminals in series with any load. here the electrical wires are: brown = live, blue = ground, green = earth. witch ones do i connect to the terminals?

Here in the US, we have "black=hot, white=neutral, green or bare copper=ground"; I am not absolutely certain if what you are referring to as "blue=ground" is the same as our "white=neutral"; I know that where you are at that "earth" is what we USains call "ground". So it sounds like blue is your neutral...?

The fact that you are asking this question at all indicates that you aren't anywhere near ready to tackle something like this; this is the kind of thing that can get you sent to an early grave fast. Still, we all have to learn somewhere (just realize that neutral/ground isn't the same as ground/earth, even though it looks real similar when you look inside a break/fuse box).

Ok - so what you do:

  1. Turn off the power - don't even imagine yourself doing any of this with live current!
  2. Your NO and COMMON contacts on the relay are your switch; these need to be inline with the HOT/LIVE line (in your case, the brown line).
  3. So - cut the line, strip a bit of insulation off, and hook each end under the NO and COMMON screws.
  4. Tighten the screws extremely well; any slack here will induce a bit of resistance, and with enough current, that means tripped breakers or blown fuses.
  5. Check your connections and everything else, then double check them.
  6. Triple check them!
  7. Keep your low-power lines (battery, low voltage lines, USB cables, jumper wires, etc) as far away from the mains lines as possible.
  8. Don't handle the relay board after you turn on the power or plug in the wires, or whatnot, into live mains current!
  9. Hook it all back up, turn on the power, and see if the magic smoke comes out.
  10. No? Alls good, try a digital write to the pin to turn the relay on - your lamp or whatever should turn on.
  11. Hopefully, your lamp or motor doesn't take more current than the relay contacts can handle - that could be a bad thing all on its own!

Good luck, and don't kill yourself.

:wink:

thanks heaps mate for your help. i understand the risks an will get a electrician mate to give me a hand. thanks again

Well why didn't you say you have a mate who's a sparkie, go for it :slight_smile:

As Cr0sh says, but I'd add the following.

The board has four mounting holes so mounting it to something non-conductive would be a real good idea, just because no matter how careful you are you always forget, for example with such a light board the mains cable could easily pull it off the bench, and what's your first instinct, to grab the board and stop it falling. And if you grab it in the palm of your hand or between thumb and forefinger you won't be able to let go.

I've had two bad 240v shocks (and many tingles) and been lucky, trust me it's worth a few minutes to screw it to a piece of wood or something.


Rob

US - Europe (not UK) - meaning
Black - Black - "Hot" or phase
White - Blue - Neutral
Green (or bare) - Green and Yellow - Ground.

It is fairly normal to call the neutral, ground and the ground, earth.

In the UK, the phase is Brown.

Here are some similar boards that only require 5V...
[url=http://arduino-direct.com/sunshop/index.php?l=search_list&s[search]=relay&s[title]=Y&s[short_desc]=Y&s[full_desc]=Y&s[sku]=Y&s[match]=all&s[cid]=0]http://arduino-direct.com/sunshop/index.php?l=search_list&s[search]=relay&s[title]=Y&s[short_desc]=Y&s[full_desc]=Y&s[sku]=Y&s[match]=all&s[cid]=0[/url]
(Schematics supplied)...

A nice safe way for and Arduiono to control 110v AC (US style plug connectors)....

http://powerswitchtail.com/default.aspx

$20 per channel.

By the way... if you cause a fire with home-made connections to 110v electricity, you may find that your insurance company won't pay up. And/ or you may be prosecuted for endangering the emergency services personnel. Or for code violations.

prosecuted for ... code violations.

Not even my code is bad enough to be prosecuted for, although I admit some might be pretty close :slight_smile:

Hi, and thanks for the nice synopsis of stuff on the relays..

I am trying to find a source of a similar opto-isolated relay board with 4 relays. Some people don't NEED 8 relays!

Regards, Terry King
...On the Mediterranean in Genoa!
terry@yourduino.com

Assuming you have the relay turning on and off with your arduino microprocessor the question remains......

How do I connect my 120V device to the relay at the terminal blocks?
If you have purchased the 4 or 8 relay board you will notice three terminals for each relay.
They are normally marked as follows:

NO- normally open
COM- common hot wire (always live) from the AC source (black in north america).
NC- normally closed

The center always receives the black or live wire from the AC source (or fuse panel at least in north america).

If you want the device to remain on all the time but turn it off through your microsprocessor then you will connect the other black wire (returning to your device) to the terminal marked NC (normally closed).

If you want to remain off all the time but turn it on through your microprocessor then you will connect the other black wire (returning to your device) to the terminal marked NO (normally open).

In any case one terminal NC or NO will have no wire at all as you do not need a live wire in both terminals.

Still not clear? Then go here to learn about relays:

http://www.kpsec.freeuk.com/components/relay.htm

Want an illustration on how to connect an AC device to the terminal blocks? Then go here:

This step (#8) shows you the hot wire going to the COM terminal (center screw) from the AC source (plug in the wall). They have two relays operating two lights and the center of both terminals is the COM terminal.

This step (#9) shows you the hot wire connected to the NO terminal (right of the COM terminal) and leading to the AC device. They have two relays so the other also has a hot wire connected to the NO terminal leading to a second bulb off to the right of the picture and not in view.

Hope this helps for those trying to connect AC devices.

Warning:
If you are trying to connect 220V devices, then the 10 amp relay spec is not suitable for motors and other devices that are current demanding upon startup. Radiant heat (electrical baseboard heat) on the other hand does not make such demands so you are safer. If you don't know what is demanding upon startup then better be safe and pick up a relay that can handle 30 amps. You don't want a fire in your house.

s

Okay if you have successfully connected your sensor shield to your relays and have been able to turn the relay off and on at will , how about adding a real time clock RTC so that you can have your various AC appliances turn off and on based upon the time of day using the RTC.

First of all you can get your RTC here:

http://arduino-direct.com/sunshop/index.php?l=product_detail&p=48

or here:

And you have instructions on how to set this up here:

http://arduino-info.wikispaces.com/RTC

(Please note the code on this page is missing // after the semi colons ; so you will have to add // if you cut and paste the code.)

Here is a sample code that will turn on a single relay after 1 minute of elapsed time then turn it off after another minute has lapsed. (You can adjust the time for your situation).

#include<WProgram.h>
#include <Wire.h>
#include <DS1307.h>
int Relay_1 = 2; // relay_1 will operate through pin #2
int tmin = 0; // tmin is a variable for storing time in minutes.

void setup()
{
digitalWrite(Relay_1, HIGH); // relay set as inactive at startup
pinMode(Relay_1, OUTPUT); // pin #2 set as output
Serial.begin(9600);

RTC.stop();
RTC.set(DS1307_SEC,1); //set the seconds
RTC.set(DS1307_MIN,0); //set the minutes
RTC.set(DS1307_HR,12); //set the hours
RTC.set(DS1307_DOW,5); //set the day of the week
RTC.set(DS1307_DATE,8); //set the date
RTC.set(DS1307_MTH,9); //set the month
RTC.set(DS1307_YR,11); //set the year
RTC.start();

}

void loop()
{

Serial.print(RTC.get(DS1307_HR,true)); //read and print the hour and also update all the values by pushing in true
Serial.print(":");
Serial.print(RTC.get(DS1307_MIN,false));//read and print minutes without update (false)
tmin = (RTC.get(DS1307_MIN,false));
Serial.print(":");
Serial.print(RTC.get(DS1307_SEC,false));//read and print seconds without update
Serial.print(" "); //some space for a more happy life
Serial.print(RTC.get(DS1307_DATE,false));//read and print date without update
Serial.print("/");
Serial.print(RTC.get(DS1307_MTH,false));//read and print month without update
Serial.print("/");
Serial.print(RTC.get(DS1307_YR,false)); //read and print year without update
Serial.println();
delay(1000);

if (tmin==1){
digitalWrite(Relay_1, LOW); // set the Relay ON after the 1st minute has elapsed
}
else {
}
if (tmin==2){
digitalWrite(Relay_1,HIGH); // set the Relay OFF after the 2nd minute has elapsed
}
else {
}
}

Enjoy,

s

For a very good view of the 4 channel relay and the three terminals marked NO, COM, and NC go here:

http://arduino.cc/forum/index.php/topic,71403.0.html

s

So what type of "relay" do you need for your application? There are 4 types of switching mechanisms to choose from:

  1. electromechanical relays -While the mechanical construction of electromechanical relays allows for much flexibility in switching capability, they have one important limitation: speed. When compared to other relays, electromechanical relays are relatively slow devices -- typical models can switch and settle in 5 to 15 ms. This operating speed may be too slow for some applications. (e.g. you would NOT use this for high speed switching projects.) Many EM relays can be made to handle higher voltages.

  2. reed relays- Because of the smaller, less massive contacts and the different actuating mechanism, a reed relay can switch about 10 times faster than an electromechanical relay with equivalent ratings. The reed relays’s mechanical lifetime is also much higher than an electromechanical relay. The tradeoff, however, is that the smaller contacts on the reed relay make it much more susceptible to damage from arcing when closing a circuit. (good for some high speed switching situations but are limited to lower voltages).

  3. solid state relays- SSRs are a faster alternative to electromechanical relays because their switching time is dependent on the time required to power the LED on and off - approximately 1 ms and 0.5 ms respectively. Because there are no mechanical parts, their life expectancy is higher than an electromechanical or reed relay.
    SSRs are useful for high-voltage applications because the LED actuation does provide a galvanic isolation barrier between the control circuitry and the MOSFET

  4. FET switches- In general, FET switches are the fastest of the switches discussed here. Also, because there are no mechanical parts or LEDs in the packaging, FET switches can be very small. One major drawback of the FET switch, however, is that it lacks a physical isolation barrier and thus may only be used with low-voltage signals.

s

SSRs are useful for high-voltage applications because the LED actuation does provide a galvanic isolation barrier between the control circuitry and the MOSFET

The vast majority of SSR use thyristor devices to do the switching, not MOSFET, either using a Triac or back to back SCRs.

I am trying to find a source of a similar opto-isolated relay board with 4 relays. Some people don't NEED 8 relays!

OK! Found them... http://arduino-direct.com/sunshop/index.php?l=product_detail&p=201

A look at a selection of different relay types: http://goo.gl/8ZEQ8

DISCLAIMER: Mentioned stuff from my own shop...!

@tranquills0 - thanks for your really helpful information on relays here!

So you want to safely control and operate 110V and 220v appliances.

No problem generally with resistive loads- baseboard heaters, filament light bulbs, toasters, and stove top elements. 15Amp mechanical relays can handle most of these.

When it comes to inductive loads- devices with coils in them like motors, selenoids, contactor coils to name a few- you will need a heavy duty relay that can handle the intial demand placed upon the system.

A very safe method for handling these inductive loads is to utilize a heavy duty relay that has an energy coil activated by 110V. The relay in the link below is designed to turn on/off up to 60 Amps of current.

http://www.smarthomeusa.com/ShopByManufacturer/ELK-Products/Item/ELK-9200/relatedItems/

The powerswitch tail can be placed in line with the 110V that activates the energy coil of the heavy duty relay. The powerswitch tail can be activated with a current from 3 to 30 ma of current from your arduino uno. This allows current from your 110v wall outlet to activate the energizing coil of the heavy duty relay that can handle most inductive loads.

http://powerswitchtail.com/default.aspx

Cost to you is $75 for the heavy duty relay and $25.00 for the powerswitch tail. Add shipping of course.
You are not likely to get fried following this route and it will meet code if installed by an electrician.

s