• 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.

About