Arduino Restarting when switching Relay

I am using Arduino mega to control 4 AC appliances like bulbs. When the arduino switching the relays from ON to OFF state the arduino is getting restarting. I came to know that it is because of back emf or relay coil. But the relay module is provided with flyback diode as well as opto isolated. Can anyone help me to overcome this issue....

Have you tried to shield the Arduino (or better: the relays) with grounded aluminium foil?

Relays with opto-isolators are only isolated if you use a separate power supply for Vcc and JD-Vcc with the jumper removed. Is that how yours is?

See schematic here.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Both of these requirements will make answering you question sooo much easier.

What are you using to power the relay and what power are the AC loads?

Can you post a picture of your project so we can see your component layout?

Thanks.. Tom.. :slight_smile:

Yes, relay modules will have back emf diodes installed, but I haven't seen any that have contact arc suppression (unless its an industrial ruggedized relay board).

The problem with contact arcing is decreased life expectancy of the relay, relay failure due to welded contacts and emissive RFI/EMI that causes havoc with nearby electronics.

Contact arcing is worse when the contacts open (switching the relays from ON to OFF) because the only thing opening the contacts is the mechanical force of the spring. This is much weaker than the electro-mechanicial force when energizing the relay coil. Also, the flyback diode that re-circulates the back emf through the coil resolves the spike when de-energizing the coil, but it increases the release time of the contacts, creating even more arcing.

When switching low voltage / low power loads, contact arc suppression (snubber or MOV) isn't usually required. But switching higher voltage inductive AC loads, arc suppression becomes a prime consideration.

For a solution, consider using using 150VAC rated MOVs for switching 120VAC loads, 300VAC rated MOVs for switching 220-240VAC loads.

  • Opto isolation may also be required.
  • Keep AC wiring separate and away from the DC wiring.
  • You may need to increase the distance from the relay board to the sensitive electronics.
  • Suggest configuring all unused inputs with INPUT_PULLUP.