Using a shorting switch to frame ground in the blue wire is not a good idea,al sorts of elct.junk on there.This magnetic coupling involves,induction into LOOPS,so anything with frame as the elct. dumping ground thus creating a loop is more susceptible,twisting wires to reduce the mutual coupling helps as does separating circuits,the 5V sensor line from the motor is probably quite vulnerable.Good luck.