limit switch triggers when close to motor

Hello!

I'm building a plotter with one of these grbl shields.

All works fine but when I wire up the limit switches they are behaving quite strangely.

When all is connected up they will trigger instantly if close to a powered motor. Things I've tried:

  • Testing the continuity of the switches and their cables with a multimeter - The switches do not appear to be conducting when not engaged.

  • Disconnecting motors - The switches do not trigger undesirably, but do work as expected if I manually press one

  • Disconnecting power to board but connecting motors (keeping usb power) - The switches do not trigger undesirably, but do work as expected if I manually press one

  • Removing switch from assembly and powering everything - The switch does not trigger until I move it close to the motors.

So it seems like proximity to powered motors is triggering the switches. Is this a thing?

Thanks!

arcadeperfect:
So it seems like proximity to powered motors is triggering the switches. Is this a thing?

It can be if the switches are wired to floating inputs. Using INPUT_PULLUP on the switch inputs?

Switch wiring and motor wires run close together, like in the same bundle? This will cause noise on the inputs when the motors run.

To save time post your code ( within code tags </> ) and, if possible, post a clear photo of the setup.

How to: https://forum.arduino.cc/index.php/topic,148850.0.html - Simple guide for inserting images in a post - Website and Forum - Arduino Forum