Control 68 solenoid valves with 68 relay but it fails when they connected with valves

I want to create a digital water curtain. Currently, I am using an Arduino Mega (D0-D53, A0-A13) to control 68 relays. Each relay is connected to one solenoid valve, making a total of 68 solenoid valves. The relay model is 5V low-level trigger. The working voltage of each solenoid valve is 12V,0.13A.

circuit diagram: I am powering the Arduino via USB, providing power to the solenoid valves with a bench power supply (30V/10A), and using an external power supply of 5V/10A for 7 multi-channel relays.


Current issue: When I control all relays separately with the Arduino Mega (without connecting the solenoid valves), there is no problem. However, when I try to power the solenoid valves in the circuit, it often causes the Arduino to reset while it is working. I have observed the current from the bench power supply, and it does not exceed its calculated maximum current. Currently, I am not sure if this is the problem that I need to add a transistor to each Digital pin of the Arduino Mega to prevent kick-back of the current.

Please help me, thank you!

Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.

Topic moved.

No flyback diodes?

Capacitors to reduce interference might also help.

Do you mean that I need to add 68 flyback diodes or capacitor between each relay and digital pin.

Yes, each solenoid valve needs to have it's own flyback diode.

The flyback diodes go across the solenoid with the cathode connected to the positive side.
Cleaning up that ratsnest of wires would also help. Keep the wires from the relays to the solenoids away from all other wires

Thankyou I will try it

Can I ask what type of flyback diode would be suitable for a solenoid which is drawing 0.13A on a 12V supply? I am not sure about the specification because the relays switch every second to turn off and turn on the valves.

1N4001, 1N4002, 1N4003 ... 1N4007
Any would do

ok thankyou!

You have a lot of soldering to do.

Sorry, I have a little stupid question about the circuit :rofl: Is that what you mean in the picture?

Ahhh thanks

Yes, the flyback diodes will, ideally, be connected directly to the solenoid terminals, or as close to them as possible. If the flyback diodes are a long distance from the solenoid, the wires can act as antennae, sending out radio interference or inducing interference in other wiring.

The flyback diodes are important, but I'm still not sure if that is what is causing the problem here. The 30V supply for the solenoids appears to be completely isolated from the 5V supply for the Arduino and relays. I don't see a common ground.

Yes, the valves is not grounded. because there's only two cables from the valve itself. Is that could be the problem?

And I also find that for the relay itself it has diodes; do I need to add another one by myself?

They are for the relay coil, not for the solenoids.

Can you post a link to the exact relay boards you are using?
How do you have the relay boards wired to the Arduino? If the board has a jumper labeled "JD-VCC" then typically there would be no ground connection between the Arduino and the relay board, only +5V and the signal lines.

I connect 'JD-VCC 'and 'GND' to the ''+''&"-" of the power supply and Vcc to Arduino(5V). The 'GND' pin of Arduino is not used.

That sounds correct.