Go Down

Topic: Wiring a Opto-Isolated Relay to Arduino (Read 18288 times) previous topic - next topic

Existence

Hi, I was wondering if someone could help me interpret the instructions to wire up the following Opto-Isolated Relay (http://arduino-direct.com/sunshop/index.php?l=product_detail&p=156)

Quote
NOTES: If you want complete optical isolation, connect "Vcc" to Arduino +5 volts but do NOT connect Arduino Ground.  Remove the Vcc to JD-Vcc jumper. Connect a separate +5 supply to "JD-Vcc" and board Gnd. This will supply power to the transistor drivers and relay coils.


So I understand the first part I connect 5v to the device. The second part has me confused though. I have a 5V wallwart so I connect the +5 to JD-VCC does that mean I connect the neutral off the wallwart to board ground? Or do I just ground that pin to the case?

I'm just a beginner as you can tell so go easy on me if it's a silly question  :)

Thanks

CrossRoads

If you want complete isolation,  you will have seperate 5V supplies, one for the Arduino and one for the relay power.

Then you would connect an arduino output pin to the cathode of the drive LED, with VCC to a current limit resistor to that anode.

On the other side, you have pin 1 of the jumper field goes to the pin that goes to Pin 4 of the optoisolator.

If you  only have 1 wallwart, leave the jumper in. Having an optoisolatar and the relay seems like overkill to me. Most applications just drive the transistor to drive the relay.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Existence

Thanks for the reply, I have two wall-warts but i'm still having a hard time following you. I quickly put this diagram to together to better help me understand (Don't laugh I only had paint).

Grumpy_Mike

Not sure what the optoisolated relay is can you give a link. What you drew is not what anyone was expecting.
You need a ground going from the arduino into that optoisolated relay, I am not sure I understand what the right hand connectors are, and where is the load you are trying to drive with the relay?
Is it a mechanical relay or a solid state one?


Grumpy_Mike

OK that is a rather unusual design you have it right apart from the 5V wall wart the positive output should be connected to the Vcc not the JD-Vcc

CrossRoads

Mike,
Having the seperate 5V go to the JD-Vcc means the Opto-receiver and the Relay are totally isolated from the Arduino Vcc.
Overkill for sure, but the design provides for that.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Existence

Makes sense now, appreciate the help guys.

Existence

Quote
Having the seperate 5V go to the JD-Vcc means the Opto-receiver and the Relay are totally isolated from the Arduino Vcc.
Overkill for sure, but the design provides for that.


I'm just trying to understand this a bit better. Since I'm not tying the grounds together does that mean the second wall wart is acting like ground for the +5v coming from Arduino? Or is it grounding through the Input PINS? I updated the pic as the last one was a bit confusing.

timmorn

If you want complete isolation,  you will have seperate 5V supplies, one for the Arduino and one for the relay power.

Then you would connect an arduino output pin to the cathode of the drive LED, with VCC to a current limit resistor to that anode.

On the other side, you have pin 1 of the jumper field goes to the pin that goes to Pin 4 of the optoisolator.

If you  only have 1 wallwart, leave the jumper in. Having an optoisolatar and the relay seems like overkill to me. Most applications just drive the transistor to drive the relay.
In my case I have a 3,3V Arduino Pro Mini (3,3V should be enough for logical signal if the coils are driven by 5V) and one 5v supply. Would the design be ok that I drive JD-VCC directly with the 5V of the supply and also the Arduino Pro Mini RAW? This way Grounds will be connected. I know optimum would be isolation of GND. But does it work? What can be the potential problems?

outsider

What are you switching with the relay? If mains voltage you need opto isolation, can you post a link to that relay module?

timmorn

#11
Nov 05, 2018, 10:04 am Last Edit: Nov 05, 2018, 10:05 am by timmorn
What are you switching with the relay? If mains voltage you need opto isolation, can you post a link to that relay module?
It seems to be much the same like in the schema drawing of the OP: LINK

My setup: I have a 24V DC Power Supply driven by 230V AC. This 24V from this Supply I switch with the relays. I also drive with this 24V the 5V supply. With this 5V supply I drive the 3.3V Arduino pro mini through the RAW pin and the JD-VCC of the relay module.

This way the GNDs get connected, because the same 5V supply gives GND to Arduino and relay.

Thanks!

Paul__B

#12
Nov 05, 2018, 11:06 am Last Edit: Nov 06, 2018, 01:42 pm by Paul__B Reason: Extra diagram
OK, here's that diagram again:


And the question:  Do you need complete isolation?  Probably not.

However, what isolation is concerned with, is segregating the currents that drive the relays, from the power supply to the Arduino.  So you can use your buck converter module to power both.  Note the diagram:  You must have one pair of wires running from the output terminals of the buck converter to Gnd and JD-VCC on the relay module.  When I say "pair", I mean the wires run together.

You now have a second pair of wires running from the same output terminals of the buck converter to Gnd and Vin/ "Raw" of your 3.3 V Arduino.  That wire from VCC on the relay module travels together with the "IN" wires from the relay module back to the Arduino Vin pin.  This means that you have a quite separate circuit from each part back to the output capacitor on the buck converter, minimising the tendency of impulse currents from one (actually, the relays) to affect the other.

So why a 3.3 V Arduino Pro Mini?  Pro Mini itself is perfect, but 3.3 V an odd choice.  You are clearly not saving power!

Note of course, that the 3.3 V Pro Mini outputs switch between 0 and 3.3 V, while the relay module VCC comes from 5 V.  This is absolutely correct - the relay module has two LEDs in series on its input with a combined voltage drop of 2.6 V or so, so it may not reliably switch from 3.3 V alone and will certainly not conduct at the difference between the 3.3 V HIGH and 5 V, but when the outputs go LOW it will see the full 5 V and operate reliably.

OK, to help you follow this, here is the circuit of the relay board:

timmorn

Thank you. This sounds like I wanted to solve it!

So why a 3.3 V Arduino Pro Mini?  Pro Mini itself is perfect, but 3.3 V an odd choice.  You are clearly not saving power!
Not because of power saving. I need to run a RF24 module which needs 3.3V.
Note of course, that the 3.3 V Pro Mini outputs switch between 0 and 3.3 V, while the relay module VCC comes from 5 V.  This is absolutely correct - the relay module has two LEDs in series on its input with a combined voltage drop of 2.6 V or so, so it may not reliably switch from 3.3 V alone and will certainly not conduct at the difference between the 3.3 V HIGH and 5 V, but when the outputs go LOW it will see the full 5 V and operate reliably.

Sorry. Perhaps my english is not good enough... I can not really conclude from what you are saying if it is a problem to use the 3.3V Arduino for logical input.

timmorn

while the relay module VCC comes from 5 V. 

Oh, to this point: Do you mean relay module VCC or JD-VCC? My plan to set it up like in the schema you postet: VCC gets the Arduino 3.3V, JD-VCC gets the 5V from the buck converter.

Go Up