Electronic – Relay noise problem although flyback diode is used

flybackrelay

I've this relay (5V) with 1N4148 as flyback diode across the relay's coil but there's still noise problem. When I switch on/off the relay, the PIC MCU will occasionally reset and false triggered the interrupt-on-change pin (a switch with pull-up resistor) all the time. The problem doesn't happens when the load (an electric lock) is not connected to the relay.

So my question is:

  1. What is the cause of the problem?, I have a flyback diode but the problem still exists. Did I do something wrong?
  2. Does position of the flyback diode in PCB layout matters and where should I place it.

Best Answer

While rerouting wiring to avoid noise coupling is definitely a good idea, I would also recommend adding a RC (for AC loads) or diode (for DC loads) snubber at your load, i.e. putting it across the terminals of the electric lock itself -- cleaning up the load's inductive spike at its source also avoids radiating noise from the wiring that could interfere with other devices.