Go Down

Topic: Relay Board Connection help (Read 14979 times) previous topic - next topic

xavier20

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

Graynomad

#1
Mar 18, 2011, 05:03 am Last Edit: Mar 18, 2011, 05:06 am by Graynomad Reason: 1
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

Rob Gray aka the GRAYnomad www.robgray.com

xavier20

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?

Graynomad

Quote
The PDF document (linked from the eBay page)

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

Correct, "VCC" is 24v.

Quote
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


Rob Gray aka the GRAYnomad www.robgray.com

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?

cr0sh


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.

;)
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

xavier20

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

Graynomad

#7
Mar 18, 2011, 08:31 am Last Edit: Mar 18, 2011, 08:33 am by Graynomad Reason: 1
Well why didn't you say you have a mate who's a sparkie, go for it :)

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

Rob Gray aka the GRAYnomad www.robgray.com

bubulindo

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.
Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Terry King

Regards, Terry King  ..On the Red Sea at KAUST.edu.sa
terry@yourduino.com  LEARN! DO! (Arduino Boards, Sensors, Parts @ http://yourduino.com

tkbyd

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.

Graynomad

Quote
prosecuted for ... code violations.

Not even my code is bad enough to be prosecuted for, although I admit some might be pretty close :)
Rob Gray aka the GRAYnomad www.robgray.com

terryking228

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
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

tranquills0

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:

http://www.instructables.com/id/Computer-control-of-AC-devices/

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.

http://www.instructables.com/id/Computer-control-of-AC-devices/step8/Hot-wire-connection-to-the-U451/

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.

http://www.instructables.com/id/Computer-control-of-AC-devices/step9/Connections-to-lamp/

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


tranquills0

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:

http://www.sparkfun.com/products/99


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



Go Up