Aruino UNO + enc28j60 + web server + 8 relay problem

Hi guys,
I develop an home automation for my house with arduino uno using enc28j60 eth bord and 8 relay with optocoupler. I write same .ino script using EtherCard.h library and same HTML.
I attach a picture with the lighting schematics and how I made the wiring.
I also attach the .ino file so you can see how I’ve done the script.

OK, everything looks normal and you will believe that should works.

I make this schematic and wiring because I want to have the lightning network and arduino separated, so I can start a light from push button and stop from arduino. And if I have a problem with arduino or my network I can use the lights.

The problem is that when I start a relay that is wired to 220V impulse relay my arduino stuck, I lose the ETH connection with it and after reset the problem persist.(after I upload the file it response to ping and I can access the web server) If the 220V AC is off I can start and stop the relay without problem.

What is the logical explanation, what I’ve done wrong?

rbbb_server.ino (3.93 KB)

arduino.jpg

If you share relay ground with Arduino ground, and didn't remove the JD-VCC jumper, and are supplying the relay board from Arduino's 5volt rail (unwise), then you don't have opto isolation.

Opto isolation requires a dedicated relay supply, connected to JD-VCC (jumper removed) and relay ground.

With Arduino's 5volt connected to VCC (not JD-VCC) and the relay inputs.
Do NOT connect relay ground to Arduino ground.

Keep 220volt wiring away from Arduino wiring.
Use VDRs or snubber circuits across the relay contacts if problems persist.
Leo..

I test it with different power supply connected to JD-VCC and GND and remove the arduino GND, the problem persist… I also put a snubber circuits (100ohm + 100nF) to relay + and - and after several relay on/off arduino stuck.

fory23:
I also put a snubber circuits (100ohm + 100nF) to relay + and -

  • and - ?
    Post a picture of the setup.
    Leo…

First I put the snubber circuit on relay C and NO(1) but the impulse relay stay ON after first use, and then to relay +/- on small relay.(2)