# Sending signal over long distance wire

I need to control a remote relay over a 1km (max) distance. Here is a simple block diagram that represents what I'm trying to achieve:

simulate this circuit – Schematic created using CircuitLab

The control signals will generated with a microcontroller. The relay modules needs to be electrically isolated from the controller, and each of them have their, independent 12V supplies. Standard CAT5 cabling will used for connecting modules to controller.

The control signal frequency needs to transmitted is less than 1 Hz (mostly on or off).

What is the best way to reliably transmit the control signal to the relay modules?

• Relay current is 40mA @ 12V

Some thoughts:

• Using an optocoupler in relay module, I can buffer my TTL signal with a darlington array and drive that opto then relay.
• I can use some kind of current loop?

I also assume that EMI will be a problem with long cabling, it can create false triggers or damage control/receiver sides. Is there anything other than using TVS / clamping diodes on each end of wiring?

• Surely a simple opto isolator is the easiest way to go here? Nov 14, 2017 at 13:27
• Can you afford enough logic in the relay modules to just use RS-422 or RS-485? Nov 14, 2017 at 17:08
• What is the coil current of the relay? Nov 14, 2017 at 17:48
• Optoisolators usually have very limited current transfer ratio. Nov 15, 2017 at 9:35

Relays already make great current loop devices. Your issue though is the voltage drop along the wires.

The solution to that is to drive it with a constant current / current limiter circuit and use a larger supply at the relay to cover the voltage drop.

simulate this circuit – Schematic created using CircuitLab

Note, in the schematic above I added a smaller relay on the logic side to provide full isolation.

Alternatively, you could flip all that around.

simulate this circuit

Of course these methods rely on the relay current being small. If need be you could add a smaller, lower current, 5V relay to drive the large 12V one.

• First option seems good to me, but the wiring is not fixed at 1km, it actually between 10m-1km. Using constant current source and a higher supply voltage than relay rating can overload relay coils with a short wire. Also I assume that the double diodes are TVS diodes, if so, I'd like to ask why they are bidirectional rather than unidirectional? Thanks. Nov 15, 2017 at 11:10
• @Sabbath why would a constant current source overload the relay? The relay requires 40mA at 12V, so set the current limiter to 40mA, and you'll get 12V across the relay. Nov 15, 2017 at 11:44
• @SimonB Trevor suggests using voltages higher than relays' rated values for cover voltage drops in long lines (relay coil current passes through the wire). The current source will source more power (less voltage drop = higher voltage) if I use shorter wire. Nov 15, 2017 at 11:53
• @Sabbath Continued: FYI, relays are actually current controlled devices. The coil is rated by volts just because that makes it easier. In truth what happens is the manufacturer designs the coil so at whatever voltage it is intended for, it will take the required current. As such, if you just give it the required current, the voltage will follow. Nov 15, 2017 at 15:12
• OK, for some reason I ignored the current limiter when thinking, even if I mention it in my comments... Thanks for guiding me to the right direction. Nov 15, 2017 at 15:25

In view of the distance involved, I suggest that you need a differential line driver and receiver for each signal - typical examples of the type are MC3487 and MC3486. The optocoupler goes between the microcontroller and the line driver, which means a separate isolated power supply for the driver. Unless it is indoors there is a risk of lightning strikes, so you need suitable protective devices on the lines. You probably also need similar isolation at the receiving end, and it may be necessary to regard the line driver/receiver combo as expendable under extreme conditions.

If there are spare lines, some form of monitoring would be a good idea so you know that signals are getting through. However, in view of the complexity and risk of damage, a radio system is probably more reliable.