Drive a shutter makes microcontroller stuck

Hello here,

I try to drive a shutter (230VAC motor).

When no load is connected to the relays, everything works smoothly. But when I connect the load (my shutter), after a random number of relay switch (often just 1), the microcontroller freezes and never comes back to normal. I need to switch power off and on to make it start again.

I was initially thinking of Brown-Out Detection fuse being wrongly set, but after every failing switch, the uc would have reset by itself, nah? Then I found the following threads:

https://forum.arduino.cc/index.php?topic=420681.0
https://forum.arduino.cc/index.php?topic=438174.0
https://forum.arduino.cc/index.php?topic=117438.0

They all mention switching noise in relay driving AC load, that disrupts nearby electronics.
Mentioned solutions are:

  • a MOV installed between NO and COM contacts => would need some explanation
  • a snubber across the AC load => same
  • solid state relay (I try to drive a 230VAC load)
  • opto isolation (would require two separate power)

What solution should I choose in my situation?
Maybe I made something wrong designing my board or choosing my components, can you advice?

You'll find attached my schematic and board.

Thanks in advance for your help,
Nicolas

Yes common enough problem. Keep the wiring for the mains as far away as you can from the low voltage stuff. Add a snubber to the load to try and quench the spark.

Yes a SSR would help but make sure it is a zero crossing one otherwise the interference is worse than a relay.