Arduino resetting after solenoid valve fires

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!

1 Like

The quickest and easiest solution is to move the wires going to the solenoids far away from all the Arduino wiring.

Paul

Paul_KD7HB:
The quickest and easiest solution is to move the wires going to the solenoids far away from all the Arduino wiring.

Paul

May I ask why? Thanks for your suggestion!

keeganmclean:
May I ask why? Thanks for your suggestion!

Because the current needed to move the solenoids also creates a magnetic pulse in wires connecting the solenoids. That magnetic pulse is also induced into the Arduino wires and will produce unwanted results.

Paul

If speed is important, then you shouldn't have used relays for the solenoids.
The relays might add a delay of 10-50ms, and kickback diodes across the solenoids might add another 5ms to that.
Must use some form of kickback protection to the solenoids though, and a diode is not the only solution.
Need to know the specs of the valves to advise.

If the solenoids only draw 150mA or so, then a TPIC6B595 shift register (instead of the relays) might be a solution.
The active kickback of these chips (no diode needed) could make the solenoid very fast.
Leo..

Wawa:
If speed is important, then you shouldn't have used relays for the solenoids.
The relays might add a delay of 10-50ms, and kickback diodes across the solenoids might add another 5ms to that.
Must use some form of kickback protection to the solenoids though, and a diode is not the only solution.
Need to know the specs of the valves to advise.

If the solenoids only draw 150mA or so, then a TPIC6B595 shift register (instead of the relays) might be a solution.
The active kickback of these chips (no diode needed) could make the solenoid very fast.
Leo..

Here's the link to the solenoid valves: 1/4" Electric Solenoid Valve 12-volt Air, Water

Looks to me like the current draw at 12 vdc is 420ma.

Paul

Agreed, and 420mA is too much for a TPIC6x chip.
I would have used logic level mosfets if speed (and accurate timing) was important.
Relays in between add more delay to the delay of the valves.
Must use a kickback diode across the valve (on the valve),
but a resistor in series with the diode can be used to reduce 'off' times.
Use <= 100 ohms for a 60volt mosfet (100ohm will raise kickback voltage to ~55volt).
Leo..

Try just adding 100uF to 470uF filter caps on solenoid control signal.
You could also try adding 0.1 uF decoupling caps as well.
This has solved a similar problem that others have had.