How to connect 5V 8 channel relay using external supply

I am working on a project using arduino and 8 channel optocoupler relays.

Everything working perfectly when I use arduino to power the relay.

I want to power the relays using 5V external supply (battery), I tried this, but not working.

please help me to sort out this problem??

I connected the Jd-Vcc pin to +5V supply & the ground pin to supply ground. 5V pin of the arduino to the Relay Vcc.

please guide me if I am wrong.. .

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 ?

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

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.

1) Inverted logic means that when the pin is 'HIGH', no current is flowing.

2) Try writing a 'HIGH' to the pin BEFORE you make the pin an output.

3) 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..

Wawa: 1) Inverted logic means that when the pin is 'HIGH', no current is flowing.

2) Try writing a 'HIGH' to the pin BEFORE you make the pin an output.

3) 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..

Ah, yes makes sense. Thank you :)

Mea culpa

I missed "opto coupler" when reading the OP.

Weedpharma

Thanks for your reply…I couldn’t be online since after my first post…sorry for that…

attaching the link to the relay image & documentation.

Relay Module is for controlling the 12V solenoids.

Project idea is to make an automated tinwhistle

Relay Image.pdf (124 KB)

Relay Image.pdf (124 KB)

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.

Inverted logic.

If you want the realy ‘ON’, you write a LOW to the pin.
If you want the realy ‘OFF’, you write a HIGH to the pin.

Post the code (inside code tags) and a picture of your setup if you’re having problems.
Leo…