Please refer to the attached image. I simplified my project to a bare minimum in order to show the problem.
Every time I press the switch (please see the attached image) the interrupt at pin 2 trips unexpectedly
I share a single power supply with Arduino UNO, the relay and the motor.
Even if I exclude the relay completely, any powering of the motor triggers unwanted interrupts at pin 2.
I even connected the pin 2 to ground.
My Code is simple and includes:
... attachInterrupt(0, myfunction, FALLING); ...
I would ask you please if you know something and help me a bit because I am becoming crazy.