Advise for long wiring runs to switches

Posted on
  • Hello - I'm looking to wire up my Pico to monitor and react to the status of several window and door alarm style switches which on average run 60-150 feet in length. Can anyone provide advise on issues I could encounter over such long runs and what I might do to best make this work? Thanks so much!

  • Are you wiring them close to mains?

    Anyways... For that long stretches I think a twisted differential pair is the way to go, shielded wire at minimum. With some RF filtering and probably some ferrite bead common mode choke on the wire.

    Found this when googling "arduino long cable switch":

    And it seems about right in my beginner's eyes.

    One other thing that would probably help is to raise the 0-5 volt space to something that's a bit harder for the surroundings to make noisy for you. You could mimic the RS-422 which is a standard for this type of thing (from a signal integrity standpoint at least).

    EDIT: Disclaimer; I'm new to electronics theory.

  • I've got a run of cable in my house (probably only 2 metres) that I'm running at 3.3v from a switch, and even that does pick up some interference.

    I'd definitely say to use twisted pair or coaxial cable (so not straight like speaker wire). It might be worth looking at using an 'optoisolator'. They're dead simple - basically a LED and light sensor in one tiny chip, and they cut out interference that you might get from the wire by converting the signal to light first.

    Maybe use one of those, with 12v signals down the wire, going into the optoisolator via a suitable resistor (and maybe a 0.1uF capacitor across the optoisolator just to help with interference). On the other side of the optoisolator you can just go right into Espruino, and use the 'input_pullup' pin mode to take advantage of Espruino's built-in resistor.

      __
     |  |--------------- 12v
     |  |                            ______
     |__|---------/\/\/\------------|      |------- Espruino ('input_pullup' mode)
               1k resistor   |      |      |
    Switch                  _|_     |      |
                      0.1uF ___     |      |
                             |      |      |
                      GND____|______|      |_______ GND
                                    |______|
                                   Optoisolator
    
  • Thanks so much for both your answers. I'll use this as a starting point for testing and hopefully report back with some positive news!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Advise for long wiring runs to switches

Posted by Avatar for RooperGee @RooperGee

Actions