And then I try to use a magnetic proximity sensor and everything is working fine when the motor is not power on, even if I power up only the stepper driver but not the motor.
If I power up the motor then the sensor is starting to give random values when I read, or if I use attachInterrupt on the digital pin that is connected.
And there are lots of high current transients on the wiring to the motor. How are things wired? Are each
windings' leads individual twisted pairs? Does the stepper motor wiring have a shield? Does your sensor
wiring have a shield?