2

I need to control an LED (SSR) at a someway-long distance of about 20 meters (60 feet) from a microcontroller.

A simple LED on/off control type where I could keep it on for a long period of time. The cable is running inside the walls in a house.

I don't have a good experience with such things and have little knowledge on how to make it properly protected from ESD, noise and other things.

Generally, I have the following idea:

  • Run CAT5/CAT6 cable and use a pair out of it.
  • Put LVDS driver and receiver on tx/rx sides. The LVDS is expected to be TIA-644 compliant (100 Ohms impedance due to CAT5/CAT6)
  • I was thinking to use parts like SN65LVDS179, SN65LVDS050 or similar. Maybe some other differential solution with 100 Ohms impedance.

Is that a right approach or am I over-engineering things or maybe missing some other important key points?

Some background: It's actually a thermostat in the living room controlling an SSR on mains located in the basement. I don't have a space to install a relay behind the thermostat so it needs to be located in the basement where it's properly mounted on DIN rail with a proper heatsink.

nochkin
  • 340
  • 1
  • 9
  • Define "control". Simply on/off, or brightness, colour etc. ? – Finbarr Jun 23 '23 at 14:44
  • The LED is in a Solid State Relay? How tolerant is the SSR to glitches? Unless this is a critical application, you don't need to convert to another voltage level. – Mattman944 Jun 23 '23 at 14:49
  • I would not use LVDS to send a simple on/off signal. – user1850479 Jun 23 '23 at 15:05
  • 1
    I'd worry more about attaching long wire(s) to a microcontroller GPIO. It likely needs lightning protection more than the IR LED that it drives. – glen_geek Jun 23 '23 at 15:44
  • @Finbarr, yes a simple on/off kind of control. – nochkin Jun 23 '23 at 16:53
  • @Mattman944, yes, it's an LED on SSR. Not sure about the tolerance and what glitches you are referring to, but the SSR does accept a pretty wide voltage range for driving its LED. So I would say it's tolerant enough. No need to convert levels in this case. My LVDS parts are 3.3V and the SSR will take that. – nochkin Jun 23 '23 at 16:55
  • @glen_geek, this is the point why I asked that question in the first place. My idea is to attach GPIO to LVDS driver instead of making it feeding the long cable directly. – nochkin Jun 23 '23 at 16:56
  • @user1850479 please elaborate on why LVDS is bad for this purpose. – nochkin Jun 23 '23 at 16:58
  • 1
    Current loop on twisted pair with grounded shield. – user263983 Jun 23 '23 at 17:00
  • How much current does the LED need for reliable operation? Is there a permanently-on DC voltage supply available at the location of the SSR? What DC voltages are available at the microcontroller end? – Andrew Morton Jun 23 '23 at 17:01
  • 1
    LVDS is a relatively high bandwidth signaling protocol designed for relatively short distances. You're trying to send a low bandwidth signal a long distance. You can make it work but it will be harder than necessary since parts aren't made to do what you want. – user1850479 Jun 23 '23 at 17:06
  • Presumably the SSR is to switch mains. Could you run a mains wire and use a relay at the microcontroller end? That way you also have the option to bypass the microcontroller control with a simple mains switch, if desired, to avoid any “I'm sorry Dave, I'm afraid I can't do that." problems. – Andrew Morton Jun 23 '23 at 17:12
  • @AndrewMorton the LED's current is a matter of like 10mA or so. I'm planning to add a simple DC voltage to power up the LVDS receiver there, it's not a problem. The MCU side is TTL (3.3V in my case, but that can be adjusted as I have a full control over it). – nochkin Jun 23 '23 at 17:26
  • @AndrewMorton I currently do run mains and have a local relay, but I actually want to avoid it and have my relay installed remotely due to a very limited space near my MCU source. – nochkin Jun 23 '23 at 17:29
  • @user1850479 are you saying LVDS is not good for low bandwidth signal like keeping LED on for a long period of time? Is there like a "ready to use" part which can simplify the current loop if that's the case? I'm more like a digital guy and try to avoid analog by using existing components and ICs specifically designed for this. – nochkin Jun 23 '23 at 17:32
  • @nochkin Maybe you should have said in the question that there is not enough space for a relay at the microcontroller end. How much space is there? Enough for a little PCB with a couple of transistors on it perhaps? What is the problem with the relay you have already - could some cosmetic arrangement hide it? Could the microcontroller be relocated? – Andrew Morton Jun 23 '23 at 18:20
  • @AndrewMorton there are could be many reasons why I need to have SSR remote, just did not realize it may be important for this task. Anyway, I have enough space for a mechanical relay, but I need to put SSR instead. For the load I have I will need to have SSR with a heatsink which would make it larger than a regular mechanical relay. This is one of the main reasons why I want to have a remote SSR with a proper heatsink installed on a DIN rail somewhere in a basement. The "microcontroller" part is a thermostat which is mounted on the wall. Let me know if you need any additional information. – nochkin Jun 23 '23 at 18:49
  • Is this standard North American 24 volt thermostat? Just send 24V down there and actuate a UL-listed relay certified for that use. HVAC relays that control up to 30A are like $13, and they're Code and they'll pass inspection. If all else fails, RiB. – Harper - Reinstate Monica Jun 23 '23 at 23:41
  • @Harper-ReinstateMonica as mentioned above, I'm using SSR, not a mechanical relay. Since this is a semiconductor, I'd like to find out if I need to protect it one way or another. Just a simple thing like ESD and noise protection since from any possible damage due to lightning and other nasty things. – nochkin Jun 24 '23 at 03:29

2 Answers2

3

I would use a differential driver (Rs422/RS485) with just the LED (and reverse blocking diode) at the receiving end. The driver will be more robust than an MCU GPIO.

If you live in an area prone to lightning, you may want to add additional protection. Ask another question, that is not my specialty.

As others have said, LVDS is not a good choice for long runs.

enter image description here

Mattman944
  • 13,638
  • 1
  • 19
  • 43
  • Thank you for the input and example. I never wanted to use GPIO directly, this is why I was thinking about LVDS. But would RS422/RS485 is suitable for very low bandwidth like keeping the LED on for long period of time like hours? – nochkin Jun 23 '23 at 17:34
  • 1
    Yes, all drivers should be rated for continous operation. You will need to check the datasheet for the current rating. All the RS422 drivers that I used in the past are obsolete now, so I can't recommend an exact part. – Mattman944 Jun 23 '23 at 17:43
  • Thanks for the info. I found some currently available parts like MAX490 which does RS-422/485. Also widely available as a ready-to-use modules which makes things easier to prototype. The only difference from your approach is it needed to be installed on both sides, but I was expecting that anyway. – nochkin Jun 23 '23 at 19:22
3

enter image description here

I'd just use a simple transistor.

If the wires get some kind of ESD, Zener D3 will protect the transistor. The supply wire is connected to decoupling caps on 3V3, these will shunt ESD to ground. On the LED side, maybe a reverse diode to protect it.

I put two resistors, this way if the wires are shorted to ground, supply, or together, all that will happen is a bit of extra supply current being drawn. Without R1, a short to ground of the positive wire would bring down the power supply. Without R3, a short to supply of the negative wire would burn the transistor.

bobflux
  • 70,433
  • 3
  • 83
  • 203
  • Thanks for your suggestion. But will it survive a possible surge during lightning storms and things like that? I'm not really worried about having the twisted pair shorted. – nochkin Jun 23 '23 at 18:50
  • About as much as the rest of the stuff in your house like ethernet wiring etc. In some areas they recommend a surge protector at the electrical panel, especially if wires are on poles and not buried. – bobflux Jun 23 '23 at 18:59