Coil causing spike and circuit reset?
Use Twisted pairs for inductive current loop including diode Vcc and FET to Gnd then route these at right angles to sensitive inputs.


Keep the area of yellow paths tight and twisted pairs with shortest leads and away from green.

Solid ground connections and Vcc connections with decoupling caps are needed too.