Hi,
I made a project which uses 4 stepper motors controlled by A4988 driver connected to arduino. For each stepper, I used one limitswitch.
The wires of the steppers and the limitswitchs are grouped together, which I think is affecting an electromagnetic field affecting the signal of the limitswitchs that false trigger.
I tried a 10uf capacitor over the limitswitchs but it solved 75% of the problem, one of the limitswitchs still false trigger.
What is the best way to stop the problem?
Best regards,,
Its best not to run the switch wires alongside the motor wires. If you have to, then use shielded cables for
the switches, and connect the shield to ground only at the Arduino end to avoid a ground-loop.
The motor windings wires ought to be twisted pair, one pair for each winding, to reduce induced voltages
in the vicinity.
Definitely go with low-valued pull-up resistors like 1k, add 1µF or so to ground at the Arduino inputs for the switches. The internal pullups are way too weak for this amount of electrical noise.
Thank you too much, actually I'm using the same endstop used in the 3D-Printers which already contains a pull-up resistor.
I will try to twist the wires as you mentioned