I have an arduino hooked to a 2 relay board. Each relay is opto-isolated. The arduino and board each have their own 5V power feed. The relays are switching 12V to controll a motor and a solenoid valve.
Sometimes when the solenoid turns off, the arduino resets. From what I've read, it's likely an EMI problem caused by the solenoid. If I disconnect the solenoid, I don't see the problem.
I've seen various suggestions about using a varistor or a diode, but I don't know which is better or what values to try. Any recommendations?
I'm assuming that the varistor or diode should be as close to the solenoid as possible, shorting the power and ground lines, is this correct?
Thanks,
Chris