Can Arduino control 8 solenoids?

An Arduino can control (at least) 8 devices. Instead of a transistor, it might be much easier to use an 8 way relay controller, something like this:

8 relay module

Just connect all 8 valves to the relays, you power the relay with a separate source for the valves, and connect the pins to the Arduino.

These ones have opto couplers, which give an extra security between the valves and the Arduino.

8 relay module with opto couplers (note I just put the first entry I found, you might find better/cheaper similar items, e.g. at AliExpress for $4).

As Andre said in a comment below, you can use an Arduino Mega if you need more outputs. Or if you want a challenge you can use use a multiplexer IC like 74HC595 (plenty of examples to be found with Arduino).

For controlling one relay with an Arduino enough examples can be found, for 8 it's similar (just use 8 GPIOs), or a multiplexer IC.


Yes, you will need something to drive 24 volt solenoids, because the Arduino cannot do it alone.

My preferred method would be to use a ULN2803 device, which will allow you to drive all those eight solenoids (assuming they take less than 500mA or current) and has inbuilt protection against the voltage spike when the solenoid switches off.

http://www.ti.com/lit/ds/symlink/uln2803a.pdf

These devices are available on eBay.

The software will be quite simple for this application and should be well within the capabilities of anyone who reads an Arduino tutorial.


There are 2 wires to a solenoid, and 2 ways to operate them:

1- Closing a relay sends 24V out, with return wires going to 0 volts.

2- 24V Always goes out, and a relay can short the return wire to 0 volts.

Either way, test 2 by running the wires to a control board, and manually activating solenoids. When that works, add Arduino relay control as other suggest.

Keeping the switches will help, if you want to operate a solenoid manually OR you suspect you have a broken relay / solenoid.

Tags:

Arduino Uno