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.

  • Add a snubber circuit. – Majenko Jul 24 '20 at 16:36
  • @Majenko where? acrross contacts? or across load? – Ujjwal Syal Jul 24 '20 at 17:06
  • Across the contacts of the relay. – Majenko Jul 24 '20 at 17:27
  • @Majenko any recommended values? – Ujjwal Syal Jul 24 '20 at 19:03
  • Nope, no clue. Take an example from a similar situation and try it. – Majenko Jul 24 '20 at 19:11

This can also be a power shortage as there will be a drop when the relays turn on, depending on you psu it might not respond quick enough, so you get a brown out. I added a bit 4700uF cap on the psu power line to the arduino.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.