In general, three things are important.1) Snubber diode across the solenoid, on the solenoid.2) No solenoid wiring near Arduino/relay wiring. No solenoid near the Arduino.3) Use opto isolation if possible, which gives you a second layer of isolation.a) Relays need a separate supplyb) JD-VCC jumper must be removedc) NO ground wire between Arduino and relay board.Leo..
1) Snubber diode across the solenoid, on the solenoid.
Having the diode at the relay limits the region of rapid current change to just the relay contacts...
I am, once again, battling a problem I've battled on every such project, with varying degrees of success. I have an Arduino Nano controlling a set of 8 relays, using 4 of the little widely available Arduino dual-relay boards. Each relay is controlling a pneumatic solenoid valve, with a 12V/5W coil. The problem is, de-energizing ANY solenoid coil causes the Arduino to reset! It all works perfectly with the solenoid coils disconnected, or un-powered. I've tried everything I can think of - snubber diodes, separate power supplies, etc. Right now, I have a separate 120VAC->12VDC/2.5A wall wart connected to the relay contacts to power the solenoid coils. I have a separate 120VAC->12VDC wall wart which powers a 12VDC->5VDC DC-DC converter, which in turn powers the Arduino and the relay boards. There are NO shared connections between the two power supplies, other than the AC line. Even grounds are not connected to each other. Yet, every time I turn ANY solenoid coil OFF, the Arduino resets itself.Any suggestions?Regards,Ray L.Maybe a EMF spike from the collaping coil current (similar to a radio transmitter) - try shielding (ensuring the shield is grounded - (put the controller in a metal box, or wrap the solenoid in tin foil (careful not to short the wiring out).Regards,Rob