I just wanted to know the maximum distance of a pushbutton.
To be more specific, are 1.5 meters possible without any problems?
If I would use more buttons, would there be any reduction?
PS: I found the same question already on this forum but it isn't satisfying to me.
That entirely depends on the quality of the shielding, the RFI suppression and the amount of electrical noise in the environs.
In general logic-speed signals should be kept short (inches), but a switch is a mechanical device so speed isn't an issue but cross-talk, RFI pickup, signal reflection, ground loops and so forth are.
Protect the Arduino from RFI with a small ceramic capacitor on the input (220pF to gound?), use a lowish value pull-up resistor (2k2?), and shield the cable and you should be fairly safe, perhaps up to many 10's of metres. Ideally a coax cable with the shield as ground (but not connected to anything but the switch terminals at the switch end). For further protection a 50 ohm resistor in series with the input pin will guard against reflections. The RFI capacitor connects direct to the input pin and ground.
If the switch wiring runs parallel to high-current wiring, you are more likely to have issues. If there's no source of interference you might not need any precautions than shielding the cable. The input must of course be debounced as usual.
for a simple push-button 1.5 meters is no real issue. If one needs more than that distance, I would recommend twisting the sense and common wires together or to use a 2 conductor cable, twisted about 3 turns/meter.
All of course depends on the environment, if it is a noisy industrial environment, one might require a small bypass capacitor from sense to ground... at the Processor, about 1Nf would by useful. In a home environment I would say that most anything goes except twisting the wires together with inductive loads; motors, relays or solenoids and of course any coil used for control should by protected with a diode for 'back emf' or a 10 ohm resistor and a 100 Nf capacitor in series (A Snubber) and placed across the coil connections directly on the coil.
I hope this helps.
Thank you for the replies!
Answered my questions and also learned something! top