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
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.
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.