Did you read this ?
Can you please post a photo of the relay module and link to its documentation ?
Can you tell us what you have planned with those relays ?
Generally, put the external supply on the Vcc of the board and ground of the board. Connect the ground of the relay board to the Arduino ground. Do not connect the Arduino 5v to the relay board (unless you are using a regulated 5v supply and want to use it to power the Arduino).
weedpharma:
Please supply a link to the relay board.
Generally, put the external supply on the Vcc of the board and ground of the board. Connect the ground of the relay board to the Arduino ground. Do not connect the Arduino 5v to the relay board (unless you are using a regulated 5v supply and want to use it to power the Arduino).
Weedpharma
Connect the GNDs ?
Aren't these "optoisolated" relay boards ?
However,We can't make a statement until he/she posts the link.
Sibi78:
I am working on a project using arduino and 8 channel optocoupler relays.
weedpharma:
Generally, put the external supply on the Vcc of the board and ground of the board. Connect the ground of the relay board to the Arduino ground. Do not connect the Arduino 5v to the relay board (unless you are using a regulated 5v supply and want to use it to power the Arduino).
This is generally WRONG.
By joining grounds you loose opto isolation.
And most 8-channel relay boards have the opto LEDs connected between VCC and relay input.
Connect like this:
Remove JD-VCC jumper.
External supply connected to JD-VCC (relay coil supply) and ground.
VCC (opto LED supply) to Arduino 5volt.
Relay inputs to Arduino outputs.
DO NOT connect Arduino ground to relay board ground.
Inverted logic!
Relay is 'on' when Arduino pin is 'LOW'.
Leo..
Wawa:
This is generally WRONG.
By joining grounds you loose opto isolation.
And most 8-channel relay boards have the opto LEDs connected between VCC and relay input.
Connect like this:
Remove JD-VCC jumper.
External supply connected to JD-VCC (relay coil supply) and ground.
VCC (opto LED supply) to Arduino 5volt.
Relay inputs to Arduino outputs.
DO NOT connect Arduino ground to relay board ground.
480mA maybe? I'm new to this so a little unsure. Thanks in advance
Inverted logic!
Relay is 'on' when Arduino pin is 'LOW'.
Leo..
If driving three of these boards with the inverted logic, would the arduino current draw be too much to set 24 pins high so as to have the relays 'off'? I'm using this setup and all my relays are 'on' at startup due to there being no 'high' set. The relays are powered separately. No current draw on the arduino outputs at this point due to 'low' output states but I would prefer to have the relays off and wonder if driving all 24 outputs high at start-up would be too much.
480mA maybe? I'm new to this so a little unsure. Thanks in advance
jawknee:
If driving three of these boards with the inverted logic, would the arduino current draw be too much to set 24 pins high so as to have the relays 'off'?
I'm using this setup and all my relays are 'on' at startup due to there being no 'high' set.
The relays are powered separately. No current draw on the arduino outputs at this point due to 'low' output states but I would prefer to have the relays off and wonder if driving all 24 outputs high at start-up would be too much.
Inverted logic means that when the pin is 'HIGH', no current is flowing.
Try writing a 'HIGH' to the pin BEFORE you make the pin an output.
A 'LOW' output will SINK ~2mA opto LED current. So 24 relay inputs = ~48mA. Not a big problem.
Current flows from Arduino's 5volt pin, to the relay board's VCC pin, through the opto LEDs and indicator LEDs, back to the Arduino output pins. The Arduino pin switches internally to ground (sinking).
Leo..
Inverted logic means that when the pin is 'HIGH', no current is flowing.
Try writing a 'HIGH' to the pin BEFORE you make the pin an output.
A 'LOW' output will SINK ~2mA opto LED current. So 24 relay inputs = ~48mA. Not a big problem.
Current flows from Arduino's 5volt pin, to the relay board's VCC pin, through the opto LEDs and indicator LEDs, back to the Arduino output pins. The Arduino pin switches internally to ground (sinking).
Leo..
Exactly as I have explained.
Connect the relay supply to JD-VCC(+) and ground(-), after you have removed that jumper.
The pictures and link show a 5volt relay board (5volt is written on the relays).
If so, you need a 5volt/1Amp supply (~80mA/relay).
If you have 12volt relays, you need a 12volt/500mA supply (~40mA/relay).
Use a regulated supply.
Connect Arduino's 5volt pin to VCC (next to input 8), and to the relevant inputs.
Do NOT connect ground to the Arduino. That would defeat opto isolation (extra safety layer).
Leo..
I connected it like that only..It powers the relay, but when I run the code it not activate the solenoids..
My code is correct as I checked it with relay when it powers from the arduino 5v.