Arduino hang when triggering relay with load

Hi we have a project to connect and cut off electrical outlet or lamp through Relay

Currently when relay is not connected to a load, triggering relay from arduino doesn't have cause any problem. But when a load is connected while not immediate, arduino will hangs up after turning on relay.

After hard resetting arduino everything is back to normal but it will be hang again and the duration is different for each time, sometime after triggering 5 times sometimes more.

At first we suspect that it is because we use ENC ethernet module. We then replace it to W5500 ethernet module. While it is better it still hang after triggering relay multiple time.

So now we suspect it has something to do with EMI and noise through Ground, we already add some protection but to no avail.

Can you guys help ?

I cannot share the sketch at this moment, and when running without load it work flawlessly so I think the problem is more from the electrical part.

I can share roughly our circuit connection, I apologize I can only draw in this format

What kind of protection have used?

See more about snubbers at WEB.

Your 3v3 buck can't work without gnd.
What's your ac load?

Yes we already add snubber in the relay and lc filter before buck converter

See this topic with identical problem

so in summary adding snubber and distancing all the cable that might emit EMI from arduino it should have solve the problem

Our current snubber spec is R 100ohm and C 10nF

You are missing a couple of grounds.

Instead of a mechanical realy I might use a Solid State Relay. I would also use a seperate high quality power supply for the arduino.

Disigning a snubber for a particular inductive load usually involves quite a bit of trial an error, especially if you know nothing about the load. 100 ohms and 100nf is a good starting point. The snubber board I cited in the other thread also has a transient voltage supressor.

Placing the snubber across the load is not always the best solution. Try putting it across the relay contacts.

From the looks of the setup, I'd say they're collaborating.

I agree does look very similar.

Nope but I think this is a go to setup for thing like this. everybody seems to doing it , looks easy at first but got a lot of trouble on the long run

hmm I read that it need to be star connection for ground to reduce emi and noise. So I do this, or am I wrong ?

Yes we thinking of moving to SSR , but the one available here might not enough to power the AC load.

our current load is 100-150 Watt AC, and we have multiple of it. we discover the hang problem even with single AC pilot lamp

Star ground is good.

The two I have are good for 25A at $26CDN for 2 but a new model is 75A at up to 380VAC and only $16CDN. Both on Amazon.ca

You have drawn a relay with opto coupler, but you don't use the opto coupler part.
Because that requires a separate supply for the relays and no shared ground between Mega and relay board.

You could also have these problems because of build quality.
Mains AC wiring must be separated from Arduino wiring and if possible twisted.
Post a picture of the setup.
Leo..

Ok let me try draw more detail, i just want to show that it pass through opto. We build the module ourselves so dont have vcc and jd-vcc jumper part like the one available in the market, it should be separate by default.

Sorry It just my drawing. Actually the real load is preety far from this setup. The snubber is put close to the relay. We try buy the same snubber you mention, our current snubber might lack some component

The closest one is pilot lamp around 10cm above relay.

This is our relay module, I only draw single IN for clear picture.
There is 4 In each In has it's own opto, relay, resistor, transistor, led and diode