Electronic – Arduino nano resetting after solenoid valve fires

arduinodiodesrelayresetsolenoid-valve

I'm trying to control small, plastic 12V solenoid valves with an Arduino nano. I have an Arduino nano hooked up to a Sainsmart 4-Channel 5V Relay Module, and finally connected to the solenoid valves, which are powered externally with an AC to DC converter. The valves are controlling gas flow to tanks of seawater for a marine biology experiment. As such, I need the solenoid valves to open and close very quickly (on the order of tenths to hundredths of a second).

The problem is that after the solenoid valves fire, my Arduino resets and reinitializes, and this messes with the timing of gas flow. I've isolated the problem to the powered solenoid valves (the code, arduino, relays, and solenoids all work perfectly when the solenoids are unpowered. The second I plug them in, the problem resumes). I think that reverse voltage spikes are causing my arduino to reset, but am not entirely sure.

I've looked into adding flyback diodes, but heard that those slow down the relays and again, I need the timing to be very fast. Does anyone know if adding a diode will solve my problem, and if so, how much will it slow down the relays?

My knowledge in electrical physics is limited, so if you could keep your explanations to more basic language, I'd appreciate it. But ANY and all help would be welcome! Thank you!

Best Answer

Using a zener diode should solve your issue while keeping the speed fast enough. Since solenoids have inductivity fast switching causes the solenoid do demagnetize into the circuitry. You should definetly use a flyback diode when working with induction load. Zener should do the trick well.