Help reliably reading switch on long wire

Bob101:
Hey MarkT.

This sounds pretty convincing to me. I will try to get hold of some shielded twisted-pair cable and add the 100pF capacitor.

You can make twisted pair easily with a hand-drill and a bench-vice. Shielding or twisting both reduce the pickup, you're unlikely to need both - just moving the wires away from the source of interference will be the biggest win.

Do you think my idea to reduce the resistor value in order to make the problem more reproducible is a good idea? Basically I will swap the 1k for 10k, check that the cap and cable fixes the issue still then switch back to 1k.

I'd be worried the existing pulses are risking the input pin - adding a 10k series resistor at the Arduino end would be a wise precaution if using the same cable.

Now I just need to get hold of ~2m of this cable here in the UK! I'll get back to you guys once I manage to do so and install it.

Any cable that's not run parallel to the motor wiring will likely solve the problem - worth testing before spending money on anything fancy.

Thanks again!