Electronic – arduino – Problem using Relays at 220V with 595

74hc595arduinorelay

I'm having some complications when I'm trying to control 16 Relays using 2 595, these relays control loads connected to 5V, 12V and 220V. There are 8 loads at 220V using the 8 LSB from my SPI communication with the 595.

Everything works great as long i have connected 5V and 12V to the relays, when i connect 220V relays turn on and off randomly, sometimes they work just right, as I change the registers. Using an oscilloscope I've seen some noise in VCC (5V), but I've been unable to eliminate it.

I've tried:
-Connecting different power supplies to my arduino and to the relay module. I'm using a pc power source for 5V and 12V.
-Changing Serial freq.
-Using a low pass filter at latch. To avoid a noise induced data storage.

I'm using there relays:
SainSmart 8-Channel Relay Module

I'm completely out of ideas, so any kind of insight will be appreciated.

Regards


Edit

Here is my circuit schematic, i've checked that everything works except when i connect my relays to 220V

595 and relay connection schematic


Edit2

This is the schematic i've found:

Relay board schematic

As you can see and I had forgot to mention relays are drive by pulling 595 pins to ground.

Best Answer

If your AC loads are inductive and/or the wire runs to them are long, there's a good chance that when you switch the loads off they'll generate electromagnetic pulses which can wreak havoc on the rest of the system.

One solution is to dissipate that energy with a snubber located close to the load and to shield or, perhaps, use twisted pair for the control wiring.