problem: multiple relays for solenoid valves

Hi everyone,

I'm really new to programming and decided to use my very basic skills to program an automated herb garden.
I'm having an issue and I would really appreciate some help- even if that means just pointing me toward some information so i can figure it out myself.

Arduino Mega2560
8 Channel 5V relay module
LCD Shield
Soil moisture sensors

I've attached a basic drawing of how i have it set up also attached the code.
I'm not sure if I've done it correctly, but I tried to scale the analog input to use as a percentage.
The readings from the sensors are displayed on the LCD screen.

PROBLEM:
When the moisture reading from the sensor drops below the threshold value, I want to energize both the correct solenoid valve and the water pump.
This works great for 1 ifstatement alone, but the waterpump relay (pin44) only energizes in parallel with 1 solenoid.
The other 4 ifstatements will energise the solenoid relay, but not the waterpump relay.

Where am I going wrong??

Many Thanks

herb_mk2.ino (2.67 KB)

Herb.pdf (15.3 KB)

I guess you need another If statement and remove the pump control from the individual if statements

if ( coriander < 20 || mint < 20 || . . .  ) {
    digitalWrite(44, HIGH);
}
else {
    digitalWrite(44, LOW);
}