ADVICE ON SETTING UP ARDUINO TO CONTROL 20 SOLENOID VALVES

Hi All,

I need to know what arduino product i should use and if this idea is workable. I am new to Arduino. My project is to control our farm irrigation with Arduino using the internet. Our irrigation pump has pump start with 20 solenoids for each different fruit block. Previously there were manual valves in the farm that we had to turn on manually in the paddock. As i am getting smarter i wish to automate everything. I have brought all the 24volt solenoids into the pump shed by changing valves from manual to hydraulic valves and connecting them with hydraulic tubing. This way i no longer have to go out into the farm to change valves only to the pump shed where all the solenoids are now.

I need to know if i can do this with Arduino? There will be upto 4 solenoids going at the same time. If so what Arduino products what i need to do this.

Thanks in advance.

How is a solenoid valve turned on ?

IT NOT HARD AND THEY ARE NOT SO LOUD THAT YOU HAVE TO SHOUT.

you will need to have a relay for each solenoid.
a power supply that is designed to operate the solenoid
a power supply that can power the relays . (relays are often 5 volt or 12 volt)

you do not say how you want to know when to turn on on.
if you need to have a clock, then you need to add that to the list.

you could start by getting one relay for every solenoid and then turn on one switch and from that point the program you write could run each solenoid for 5 minutes, turn it off, then turn on the next, and so on for each solenoid.

you could have sensors or timers or switches.

the Arduino UNO has 20 available I/O pins, that means you have some choices.
one is to get 2 Arduino boards and split the load.
get one arduino and shift register, that uses 4 pins but can control all your solenoids.

to help you, we need to know how you want to decide when to turn them on.
to know if you will ever have two on at the same times always (can share one relay)
how many switches
if you will want to alter time of watering because or rain
if you want to monitor soil moisture and water when the soil is dry.

to get started, I would offer that a couple switches, 10 relays and one UNO would get you up and running.
and then for the other 10, you get another UNO and copy the first.

I'd suggest you use a mega2560, and an eithernet shield. You'll also need some relay boards. these come in 2, 4 or 8 relay forms. so maybe three 8 relay boards (to have 4 spare relays available for redundancy).

The relay boards themselves will also need a separate power supply. (most of these boards use 5v but some are 12v).

If you get this kit together it shouldn't take too long to get it up an running.

My project is to control our farm irrigation with Arduino using the internet.

The most likely to do that is setting up an arduino web server that receives control request from a client, such as a web page in a browser. On the mechanical end you most likely would use relays controlled from the arduino to switch the 24v solenoids on/off. A place to start might be an arduino or mega, a 5100 ethernet shield, and relays for your solenoid valves . All are available on ebay.

Turn off the Caps Lock, it looks like you're shouting.

hydraulic valves and connecting them with hydraulic tubing.

So you need to control the air flow to each valve? Pressurizer air turns them on, lack of pressure lets them shut off?

If the solenoids are 24VDC (not AC) then I would use mosfets or possibly Darlington power transistors to drive them, not relays. That way, you don't need a power supply for a relay board. However, if you want to use pre-built boards as far as possible, then you will find a relay board easier to use. Get as 12V relay board, not a 5V one, because the power requirements are simpler. You can use a single 12V supply to power both the relay board and the Arduino. I suggest an Arduino Mega so that you have enough pins to drive 20 solenoids with some to spare.

@crossroads: Bob, would your 32 channel MOSFET board run ok on 24V?

PaulRB:
@crossroads: Bob, would your 32 channel MOSFET board run ok on 24V?

POST A LINK TO YOUR VALVE. MANY ARE 24 VAC.
YOU NEED TO SUPPLY THE INFORMATION SO OTHERS CAN FORMULATE ANSWERS BASED ON FACTS.

C’mom guys, enough with the Caps Lock already.

Yes, the transistors I used have a VDS of 30V.

If you need relays, then a stack of my relay cards would also work.
Here’s the Mega version, I’m assembling an Uno version today, which uses a shift register driven by 3 user selected pins, so up to 6 boards could be controlled by one Arduino.
(while the Mega relays are driven by D22 to D29).
These particular relays have 5V coil, and 5A SPST contacts.

Got the Uno board shield done. 8 relays, controlled from TPIC6C595 shift register.
Relays are too tall tho, relay shields will not stack.
Still, 8 relays controlled from 3 pins.

#include <SPI.h>
byte ssPin = 10;
byte relayArray[] = {
  0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
/*
0b11111111, 
0b11111110, 
0b11111101, 
0b11111011,
0b11110111, 
0b11101111,
0b11011111, 
0b10111111, 
0b01111111,
*/
};
byte x;
void setup(){
  pinMode (ssPin, OUTPUT);
  SPI.begin();
  digitalWrite (ssPin, LOW);
  SPI.transfer(0);
  digitalWrite (ssPin, HIGH);
  Serial.begin(9600);
  
}
void loop(){
  for (x=0; x<9; x=x+1){
    digitalWrite (ssPin, LOW);
    SPI.transfer(relayArray[x]);
    digitalWrite (ssPin, HIGH);
    Serial.print (relayArray[x], HEX);
    delay (500);
    digitalWrite (ssPin, LOW);
    SPI.transfer(0);
    digitalWrite (ssPin, HIGH);
    delay(500);
  }
}