Optocoupler relay trouble...wiring?

Hello,
I just got my two new relay boards (Keyes funduino 2x relay board and another one with 4 relays).
Just like this one-> http://www.hobbytronics.co.uk/8-channel-relay-board

I've been trying and searching the web for a couple of hours now, but I simply can't get it to work correctly, I guess I simply don't understand how the wiring, especially the power connection, is done right.

The power LED on the relayboard and the status LED for the specific relay light up according to the sketch, but there's no audible "click", which indicates the relay is switching--- since, well... It' isn't switching :wink:

I wired it this way:
Relayboard -> Arduino

VCC-> Arduino 5v Pin
GND-> Ardnuino GND Pin
IN1-> Arduino Digital Pin 6

I left the jumper on the relay board ( COM + GND ).
I Powered the Arduino with an external 12V power supply.

The relays are SRD-12VDC-SL-C . So I figured, maybe the board needs another 12V power supply since the arduino only delivers 5V. I'm just not sure how to wire it or how the jumper affects all of it. After so many hours, I am totally lost. Found some diagrams but I can't make sense of it.

A detailed wiring instruction would be a great help... thanks in advance.

Here's one of the sketches I tried:

#define RELAY1 6
#define RELAY2 7
#define RELAY3 8
#define RELAY4 9

void setup()
{
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
}

void loop()
{
digitalWrite(RELAY1,LOW);
delay(2000);
digitalWrite(RELAY1,HIGH);

digitalWrite(RELAY2,LOW);
delay(2000);
digitalWrite(RELAY2,HIGH);

digitalWrite(RELAY3,LOW);
delay(2000);
digitalWrite(RELAY3,HIGH);

digitalWrite(RELAY4,LOW);
delay(2000);
digitalWrite(RELAY4,HIGH);

}

The product page clearly states that the relay module requires 8-12 V. Why did you think you could power it with the Arduino 5V?

In general you should never attempt to power relays, motors or solenoids with the Arduino, as you are very likely to destroy the Arduino even if the connected device functions on 5V.

The power for the relay module should not come from the Arduino. Power it from the 12v source you are using to power the Arduino. The signal pins can be switched by the Arduino.

The picture shows it. The VCC is 8-12v and the signal pins are 1-5v.

Edit: Make sure to take Signal GND back to the Arduino ground.

Read the schematic and any documentation very carefully. There are at least three DIFFERENT setups available on market.
On mine the separate ground terminal and the JUMPERED terminals FUNCTIONS vere reversed.
Basically you have three terminals allowing you to operate the relays from separate power supply, but common ground(!) and they have to be connected properly.
Also the relays needs more than common USB provided 500 ma current to operate, mine are 5V variety and I am using 1A power supply. I have not measured the actuall current going thru, but the relays are pretty loud when operating.

Vaclav:
Also the relays needs more than common USB provided 500 ma current to operate,

Can't read the code on the pic, but the max current on the datasheet looks like 150mA per. I agree with vaclav, a 12v 1A power supply would not be a bad idea.

@jremington
when I started, I read the wrong instructions (for a different relay board), which could be powered by the arduino... my bad.

It's working now, thanks to you guys.

I've got a laserprinter power supply providing 12V.

PSU +12V -> VCC
PSU GND -> GND
Arduino GND -> COM (Signal GND)
Arduino digital pins -> In1 etc.

Thanks again, guess I learned something :wink:
vyvyn