I'm trying to control small, plastic, 12 V solenoid valves with an Arduino Nano. I have an Arduino Nano hooked up to a Sainsmart 4-channel 5 V 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.
Note that when you use the CircuitLab button on the editor toolbar an editable schematic is saved in your post. That makes it easy for us to copy and edit in our answers. You don't need a CircuitLab account, no screengrabs, no image uploads, no background grid. Add a link to the relay module datasheet too.
– Transistor Jul 09 '19 at 18:41