Arduino to Relay Board: distance + external power; practical question

Dear All,

hope you're all great. I am setting up a home automation with the following components:

  • Arduino Uno
  • Ethernet Shield
  • 5V Relay Module With optocoupler for Arduino (negatively activated)

With relay, of course I want to control 220V equipment.

The connections are as following:
Arduino Output Pin -> Relay IN pin
Arduino 5V - > Relay VCC

External +5V - > Relay JD-VCC (without the jumper)
External GND - > Relay GND.

This works, it switches on and off via web server. Now my questions are:

  • How long away can relay be from arduino, given that Im sending Output Pin and VCC? I might need maybe up to 12 meters...?
  • With this connection, have I isolated Arduino from Relay, meaning I can connect many relays to it without causing a problem to my Arduino?

Thanks a lot for your inputs.

All the best,
thelooti

Most relays have a common, NO, NC , plus 2 contacts for the coil.

I'm not exactly sure how you wired it based on your explanation.

Do not have an arduino pin powering the coil directly, it can't handle it. Have the pin turn on a Transistor or mosfet, which will turn on the coil, which will turn on your 220V.

Assuming you wire everything correctly, distance and voltage drop on standard copper wire is almost a non-factor unless your measuring in units of miles/km. If you where transmitting data over the wire that would a different story but its just simple DC on/off, so no worries.

If your not sure how to connect an arduino to a relay, there are a million diagrams on the internet on how to do so. Many will tell you how to make it work, a few will tell you how to do it properly.

Hi,

Attached is the relay board that I am using.
I have removed the jumper, then I have provided +5V external power and GND to JD-VCC and GND respectively, and then from arduino only IN1 and VCC (+5V from arduino)... so is this safe connection?

thanks a lot,

What is the resistance per-unit-length of your wiring and how much current does that
relay take?

Your using a breakout board, refer to the instructions provided with it.

Based on what I see, the IN1, IN2 are almost certainty your arduino pin inputs, which turn on the mosfet chip which turns on the rely coil. The Blue contacts I assume the other side has labels telling you which pins are C, ON, NC for each relay.

If you just want a simple switch like effect you connect one side of the 220VAC to common, the other side to NO. When arduino pin goes HIGH power turns on.

As its clearly labeled on the relays they can handle 10A. Most low voltage wire won't list ohms/unit cause its incredibly low and a non-factor, we are talking about a fraction of a ohm over only 20ft on a AWG that can handle 10A 240V or better. Even at max current of 10A and assuming 1ohm, 10V drop on a 220V is still less then the % error provided to residential housing. If you live near a electrical substation you'll likely see closer to 240V, if your really far you'll see closer to 220V.

How long away can relay be from arduino, given that Im sending Output Pin and VCC? I might need maybe up to 12 meters...?
With this connection, have I isolated Arduino from Relay, meaning I can connect many relays to it without causing a problem to my Arduino?

Two part question:

  1. You shouldn't have a problem running 12 meters, you are only sending 5V to the OptoCoupler that turns on your relay. You described your application as not time-critical. Had you said you wanted to PWM at 12 meters, cabling capacitance would bite you there. Use twisted-pair, shielded wire similar to Belden 8723.

  2. You are powering the COILS of both relays from your Arduino's 5V regulator. An educated guess would say each relay takes no more than 100mA to energize. You will have to add an additional 5V external supply at some point. If you try 10 relays, that's 1A! No way the Arduino's regulator can supply that much current.

Hope that helps.

Hi All,

Thanks a lot for your inputs. It is getting clearer now...

I just want to explain once more my situation:

I have already added 5V external supply to the relay board. However, the arduino uno is some 12m away from the relay. And from arduino uno I am just providing 'the signal' to tell to relay the command (whereas relay has its own 5V as stated above). So the question was, the signal that comes from arduino, will it drop significantly in 12 m...

Once again, thanks for your help.

Br,
thelooti

I have already added 5V external supply to the relay board. However, the arduino uno is some 12m away from the relay. And from arduino uno I am just providing 'the signal' to tell to relay the command (whereas relay has its own 5V as stated above). So the question was, the signal that comes from arduino, will it drop significantly in 12 m...

Unless your relay board is significantly different from others, the Arduino "sees" the input opto-coupler to the relay board. The series resistor of that opto-coupler will determine the pin current. In no case would that be more than 20mA, so the short answer is the voltage drop will be insignificant operating at that current.

If I recall correctly, the relay board is "low true", so you would run the Arduino's 5V to the Anode(s) of the opto-coupler and the Arduino's output to the Cathode. DO NOT, however attempt to power the whole Relay Board off the Arduino. It should have provisions for an external supply.