I am making an automation device. I am using an atmega8a to control 6 relays. The setup is standard, 220v load, 5v dc coil, flyback diode and an NPN transistor to trigger with atmega pin. The problem is when I turn ON the relay, there is 10-20 MHz noise on the DC side and the atmega restarts. Switching OFF relays doesn't create a problem. i am guessing this is happening because of EMI. Is there a way i can protect my atmega from this and not have it restart everytime I start a relay.
The SMPS is 5v 2A
I have star tracks from SMPS
Is there a way to solve this?
Update: Had to switch from atmega chip to arduino nano. That seems to be working fine.