URGENT!! Aquaponics System w/ monitoring using Time.h and BlinkWithoutDelay

HI. I’m a stressed out 17 year who is trying to make an aquaponic garden and control the lights and pump of my group’s system. The issue I am running into is that I cannot turn on the lights and pump at the same time without using the delay() function. Independttly everything works but when i put it all together, nothing works. I am also attempting to do all of this on a timed loop as I have a RTC (DS1307). I need to turn on the lights at various times and the pump at seperate times. if anyone could look at my code and tell me what is wrong or what I should do that would be greatly appreciated

/* Blink without Delay
 
 Turns on and off a light emitting diode(LED) connected to a digital  
 pin, without using the delay() function.  This means that other code
 can run at the same time without being interrupted by the LED code.
 
 The circuit:
 * LED attached from pin 13 to ground.
 * Note: on most Arduinos, there is already an LED on the board
 that's attached to pin 13, so no hardware is needed for this example.
 
 
 created 2005
 by David A. Mellis
 modified 8 Feb 2010
 by Paul Stoffregen
 
 This example code is in the public domain.

 
 http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
 */
//libraries to include
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h>
#include <TimeAlarms.h>
#include <DS1307RTC.h>

//pins used in LCD screen
LiquidCrystal lcd(8,9,4,5,6,7); 
//sensors& readings
int lightsensorpin = A2; //analog pin #0. Defines light sensing diode
int lightReading;  //defined later as reading of light sensor
int watersensorpin = A0; // analong pin #3. Defines water sensing (fsr)
int waterReading;  //defined later as reading of water sensor
// constants won't change. Used here to 
// set pin numbers:
const int lightPin =  2;      // the number of the LED pin
const int pumpPin= 12;
// Variables will change:
int ledState = LOW;
int pumpState= LOW;
// ledState used to set the LED
long previousMillis = 0;        // will store last time LED was updated

// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long lightinterval = 32400000;           // interval at which to blink (milliseconds)
long pumpinterval = 179999;

void setup() {
  // set the digital pin as output:
  pinMode(lightPin, OUTPUT); 
  pinMode(pumpPin, OUTPUT);
  digitalWrite(lightPin,LOW);
  digitalWrite(pumpPin,LOW);


//sync clock
setSyncProvider(RTC.get); //function to get the time from the RTC
if(timeStatus()!=timeSet){
Serial.println("Unable to sync with the RTC");
lcd.print("TIME NOT SET");
}
else{
Serial.println("RTC has set the system time");
lcd.print("TIME SET");
}

//WATER SCHEDULE
Alarm.alarmRepeat(8,00,00 , PumpAlarm) ; //8 AM TO 8:03AM
Alarm.alarmRepeat(11,00,0 , PumpAlarm) ; //11AM TO 11:03AM
Alarm.alarmRepeat(14,00,0 , PumpAlarm) ; //2 PM TO 2:03PM
Alarm.alarmRepeat(17,00,0 , PumpAlarm ) ; //5 PM TO 5:03PM
Alarm.alarmRepeat(20,00,0 , PumpAlarm) ; //8 PM TO 8:03PM
Alarm.alarmRepeat(23,00,0 , PumpAlarm) ; //11 PM TO 11:03PM
Alarm.alarmRepeat(2,00,0 , PumpAlarm) ; //2 AM TO 2:03AM
Alarm.alarmRepeat(5,00,0 , PumpAlarm) ; //5 AM TO 5:03AM
  
//LIGHT SCHEDULE
Alarm.alarmRepeat(8,00,00 , LightAlarm ); //8AM TO 5PM
}


void loop()
{    digitalClockDisplay();
  // here is where you'd put code that needs to be running all the time.

  
  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
   if(lightReading >= 700){    //if light value is greater than or equal to 700
   lcd.print(Serial.println("LIGHT IS ON"));
   }
   else{
   lcd.print(Serial.println("LIGHT IS OFF"));
   }

/*--- ( WATER PORTION OF THE SKETCH )---*/

waterReading = analogRead(watersensorpin); // defines waterReading variable
  Serial.print("Water reading = ");
  Serial.println(waterReading);  //Print value of water to serial monitor
   if(waterReading >=30 ){
     lcd.print(Serial.println("WATER IS ON"));
   }
   else{
     lcd.print(Serial.println("WATER IS OFF"));
   }

}
  // check to see if it's time to blink the LED; that is, if the 
  // difference between the current time and last time you blinked 
  // the LED is bigger than the interval at which you want to 
  // blink the LED.
  unsigned long currentMillis = millis();


void LightAlarm(){   
   if(currentMillis - previousMillis > lightinterval) {
    // save the last time you blinked the LED 
    previousMillis = currentMillis;   

    // if the LED is off turn it on and vice-versa:
    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;

    // set the LED with the ledState of the variable:
    digitalWrite(lightPin, ledState);
  }
}


void PumpAlarm(){ 
  if(currentMillis - previousMillis > pumpinterval) {
    // save the last time you blinked the LED 
    previousMillis = currentMillis;   

    // if the LED is off turn it on and vice-versa:
    if (pumpState == LOW)
      pumpState = HIGH;
    else
      pumpState = LOW;

    // set the LED with the ledState of the variable:
    digitalWrite(pumpPin, pumpState);
  }
}


void digitalClockDisplay(){
// digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 
}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
  lcd.print(digits);
}

any reply would be greatly appreciated. Im running out of ideas and the project is due Tuesday

int lightsensorpin = A2; //analog pin #0. Defines light sensing diode
int lightReading;  //defined later as reading of light sensor
int watersensorpin = A0; // analong pin #3. Defines water sensing (fsr)

Useless comments are bad. Incorrect comments are worse than no comments.

long lightinterval = 32400000;           // interval at which to blink (milliseconds)
long pumpinterval = 179999;

Literal constants are treated as ints. How big a shoehorn do you think you’ll need to squeeze 32400000 into an int? Append UL to values to have them treated as unsigned long.

While we’re on the subject of time, have you figured out a way to make time run backwards? If not, use unsigned longs, not longs.

Curly braces need to be separatedfromthestatementtheygowith, toimprovereadability.

Ideally, they’d go on the next line. NOTHING goes on the line after the {. Period.

Tools + Auto format
would
correct
the
problem
with
all
your
code
being
jammed
against
the
left
margin.

The issue I am running into is that I cannot turn on the lights and pump at the same time without using the delay() function.

I don’t see where you are trying to, nor have you provided any clue as to why you can’t.

The LightAlarm() and PumpAlarm() methods are called by the timer callbacks. There is nothing that makes them run for any defined period of time, in spite of what the comments say.

In those methods, you need to turn the appropriate pin on, set the appropriate “I came on at” variable, to the appropriate value, and set a flag that indicates that the pump or lights are on.

On each iteration through loop, see if the pump or lights are on. If so, and if they’ve been on long enough, turn them off, clear the appropriate flag, and clear the “I came on at” time variable.

Sorry about all the bad syntax, I'm self taught in Arduino and quite frankly pretty shitty. As for the bad comment I was in a rush and whilst changing things i did not mend the comments.

As for the LightAlarm() and PumpAlarm(), are you saying that i am approaching this the wrong way to turn on the pump and lights at specific times from my DS1307? I figured that if i set specific actions during the alarms like digitalWrite() to turn the pump/lights on/off and then used a delay(), I could control the length of time it was on or off, but the delay() didn't allow me to multitask. Then I tried to use the example BlinkWithoutDelay inside of the LightAlarm() and PumpAlarm() but to no avail.

I guess what I'm trying to say is, is it feasible for me to use time alarms to set actions to run at specific times for varied durations or is there another way of doing so that doesn't involve delay()?

As for the LightAlarm() and PumpAlarm(), are you saying that i am approaching this the wrong way to turn on the pump and lights at specific times from my DS1307?

First, there is no relation to the time that triggers the alarms and the DS1307, as far as the library is concerned.

Second, there is nothing wrong with the way that LightAlarm() and PumpAlarm() are called. They get called at the appropriate times, and do the appropriate things to turn the light or pump on.

The problem is with the way that you expect them to stay running to turn the devices off later. They don't. At the end of the function, they return, ending the interrupt, returning control to loop(), which never does anything about turning the light or pump off.

I guess what I'm trying to say is, is it feasible for me to use time alarms to set actions to run at specific times

Yes.

for varied durations

No.

You need to do one of two things. Either loop() needs to be responsible for managing the duration, observing when it has passed, and turning the appropriate devices off, OR you need to rename the LightAlarm() and PumpAlarm() functions to LightAlarmOn() and PumpAlarmOn(), and set other alarms, to call LightAlarmOff() and PumpAlarmOff() at the appropriate times.

so I attempted to re do my code to incorporate both the LightAlarm() , LightAlarmOff(), PumpAlarm(), PumpAlarmOff(). And here was my attempt.

/*
CODE FOR AUTOMATED AQUAPONICS SYSTEM
 goals:  
 -control a pump for the tank that will be a timed loop (proposed fail-safe to prevent overflow) NOT CLOSED
 -monitor growbed water levels to ensure water is flowing through system(encorporated in proposed fail safe)
 +use filament strip water level sensor (fswls) to ensure that water is indeed in the growbed
 POSSIBLE:+relay information from the (fswls) in conjuction with the pump control code to act as fail-safe against overflow
 -control lights for plants on a closed loop system
 +check whether on or off with a photo sensor
 -display serial information on LCD
 
 possible additions:
 -measure water quality/pH to ensure stable environment for fish
 -add resevoir of water that refills resevior tank
 -flow rate
 -temperture monitoring
 -controls for fish feeding
 */



//libraries to include
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h>
#include <TimeAlarms.h>
#include <DS1307RTC.h>

//pins used in LCD screen
LiquidCrystal lcd(8,9,4,5,6,7); 
//sensors& readings
int lightsensorpin = A2; //analog pin #0. Defines light sensing diode
int lightReading;  //defined later as reading of light sensor
int watersensorpin = A0; // analong pin #3. Defines water sensing (fsr)
int waterReading;  //defined later as reading of water sensor
//relays
int lightsRelay = 2; // digital pin #2. Defines lights relay
int pumpRelay = 12; // digital pin #12. Defines pump relay



void setup() {

  lcd.begin(16,2);
  Serial.begin(9600);

  //sync clock
  setSyncProvider(RTC.get); //function to get the time from the RTC
  if(timeStatus()!=timeSet){
    Serial.println("Unable to sync with the RTC");
    lcd.print("TIME NOT SET");
  }
  else{
    Serial.println("RTC has set the system time");
    lcd.print("TIME SET");
  }

  pinMode(lightsRelay,OUTPUT);
  pinMode(pumpRelay,OUTPUT);
  digitalWrite(pumpRelay,LOW);
  digitalWrite(lightsRelay,LOW);
  //WATER SCHEDULE

  Alarm.alarmRepeat(8,0,0 , PumpAlarm) ; //8 AM TO 8:03AM
  Alarm.alarmRepeat(8,00,0 , PumpAlarmOff);
  Alarm.alarmRepeat(11,00,0, PumpAlarm) ; //11AM TO 11:03AM
  Alarm.alarmRepeat(11,03,0, PumpAlarmOff) ;
  Alarm.alarmRepeat(14,00,0, PumpAlarm) ; //2 PM TO 2:03PM
  Alarm.alarmRepeat(14,03,0, PumpAlarmOff) ;
  Alarm.alarmRepeat(17,00,0, PumpAlarm ) ; //5 PM TO 5:03PM
  Alarm.alarmRepeat(17,03,0, PumpAlarmOff) ;
  Alarm.alarmRepeat(20,00,0, PumpAlarm) ; //8 PM TO 8:03PM
  Alarm.alarmRepeat(20,03,0, PumpAlarmOff) ;
  Alarm.alarmRepeat(23,00,0, PumpAlarm); //11PM to 11:03PM
  Alarm.alarmRepeat(23,03,0, PumpAlarmOff);
  Alarm.alarmRepeat(2,00,0 , PumpAlarm);  //2 AM to 2:03AM
  Alarm.alarmRepeat(2,03,0 , PumpAlarmOff);
  Alarm.alarmRepeat(5,00,0 , PumpAlarm);  //5AM to 5:03AM
  Alarm.alarmRepeat(5,03,0 , PumpAlarmOff);


  //LIGHT SCHEDULE
  Alarm.alarmRepeat(8,00,0 , LightAlarm ); //8AM TO 5PM
  Alarm.alarmRepeat(17,00,0 , LightAlarmOff) ;
}

void loop(){

  digitalClockDisplay();

  /*---( LIGHT PORTION OF THE SKETCH )---*/



  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
  if(lightReading >= 700){    //if light value is greater than or equal to 700
    lcd.print(Serial.println("LIGHT IS ON"));
  }
  else{
    lcd.print(Serial.println("LIGHT IS OFF"));
  }

  /*--- ( WATER PORTION OF THE SKETCH )---*/

  waterReading = analogRead(watersensorpin); // defines waterReading variable
  Serial.print("Water reading = ");
  Serial.println(waterReading);  //Print value of water to serial monitor
  if(waterReading >=30 ){
    lcd.print(Serial.println("WATER IS ON"));
  }
  else{
    lcd.print(Serial.println("WATER IS OFF"));
  }
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 

}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
  lcd.print(digits);
}

void PumpAlarm(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running."); 
  lcd.print("PUMP ACTIVE");  

}

void PumpAlarmOff(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.print("PUMP INACTIVE");
}

void LightAlarm(){
  digitalWrite(lightsRelay, HIGH); //turn lights on
  Serial.println("Lights turning on.");
  lcd.print("LIGHTS ACTIVE");

}

void LightAlarmOff(){
  digitalWrite(lightsRelay, LOW); //turn lights off
  Serial.println("Lights are off.");
  lcd.print("LIGHTS INACTIVE"); 
}

After attempting to run the code it was not able to trigger at the appropriate times to no avail.
Is there any thing wrong with my code?

  Alarm.alarmRepeat(8,0,0 , PumpAlarm) ; //8 AM TO 8:03AM
  Alarm.alarmRepeat(8,00,0 , PumpAlarmOff);

Trigger the PumpAlarm() and the PumpAlarmOff() method at the same time. How's that working?

After attempting to run the code it was not able to trigger at the appropriate times to no avail.

What do your serial print statements tell you is happening?

My serial statements don't say pump is running or anything. The digital clock display() and the waterreading and lightreading sections of the loop() are the only things that print to the Serial

If you comment out the LightAlarmOff and PumpAlarmOff timers, do the others then work?

savtitan21: so I attempted to re do my code to incorporate both the LightAlarm() , LightAlarmOff(), PumpAlarm(), PumpAlarmOff(). And here was my attempt.

Hi Savtitan, your code is looking better, but the things I noticed were: 1) There is a typo , at 8am you are turning on AND turning OFF 2) I have not used the TimeAlarm library but I found this statement regarding it: "Failing to regularly call Alarm.delay will result in the alarms not being triggered" So at the bottom of your loop() function you should probably add something like Alarm.delay(1000);

When you test your code do you have to sit around and wait for the next "turn-on" time?

John

Think I figured it out

/*
CODE FOR AUTOMATED AQUAPONICS SYSTEM
 goals:  
 -control a pump for the tank that will be a timed loop (proposed fail-safe to prevent overflow) NOT CLOSED
 -monitor growbed water levels to ensure water is flowing through system(encorporated in proposed fail safe)
 +use filament strip water level sensor (fswls) to ensure that water is indeed in the growbed
 POSSIBLE:+relay information from the (fswls) in conjuction with the pump control code to act as fail-safe against overflow
 -control lights for plants on a closed loop system
 +check whether on or off with a photo sensor
 -display serial information on LCD
 
 possible additions:
 -measure water quality/pH to ensure stable environment for fish
 -add resevoir of water that refills resevior tank
 -flow rate
 -temperture monitoring
 -controls for fish feeding
 */



//libraries to include
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h>
#include <TimeAlarms.h>
#include <DS1307RTC.h>

//pins used in LCD screen
LiquidCrystal lcd(8,9,4,5,6,7); 
//sensors& readings
int lightsensorpin = A2; //analog pin #0. Defines light sensing diode
int lightReading;  //defined later as reading of light sensor
int watersensorpin = A0; // analong pin #3. Defines water sensing (fsr)
int waterReading;  //defined later as reading of water sensor
//relays
int lightsRelay = 2; // digital pin #2. Defines lights relay
int pumpRelay = 12; // digital pin #12. Defines pump relay



void setup() {

  lcd.begin(16,2);
  Serial.begin(9600);

  //sync clock
  setSyncProvider(RTC.get); //function to get the time from the RTC
  if(timeStatus()!=timeSet){
    Serial.println("Unable to sync with the RTC");
    lcd.print("TIME NOT SET");
  }
  else{
    Serial.println("RTC has set the system time");
    lcd.print("TIME SET");
    lcd.clear();//add this to clear display
  }

  pinMode(lightsRelay,OUTPUT);
  pinMode(pumpRelay,OUTPUT);
  digitalWrite(pumpRelay,LOW); //tried to uncomment here to get alarm turn on/off to work no luck
  digitalWrite(lightsRelay,LOW);
  
  //WATER SCHEDULE

  Alarm.alarmRepeat(8,00,0 , PumpAlarm) ; //8 AM TO 8:03AM
  Alarm.alarmRepeat(8,03,0 , PumpAlarmOff);
  Alarm.alarmRepeat(11,00,0, PumpAlarm1) ; //11AM TO 11:03AM
  Alarm.alarmRepeat(11,03,0, PumpAlarm1Off) ;
  Alarm.alarmRepeat(14,00,0, PumpAlarm2) ; //2 PM TO 2:03PM
  Alarm.alarmRepeat(14,03,0, PumpAlarm2Off) ;
  Alarm.alarmRepeat(17,00,0, PumpAlarm3) ; //5 PM TO 5:03PM
  Alarm.alarmRepeat(17,03,0, PumpAlarm3Off) ;
  Alarm.alarmRepeat(20,00,0, PumpAlarm4) ; //8 PM TO 8:03PM
  Alarm.alarmRepeat(20,03,0, PumpAlarm4Off) ;
  Alarm.alarmRepeat(23,00,0, PumpAlarm5); //11PM to 11:03PM
  Alarm.alarmRepeat(23,03,0, PumpAlarm5Off);
  Alarm.alarmRepeat(2,00,0 , PumpAlarm6);  //2 AM to 2:03AM
  Alarm.alarmRepeat(2,03,0 , PumpAlarm6Off);
  Alarm.alarmRepeat(5,00,0 , PumpAlarm7);  //5AM to 5:03AM
  Alarm.alarmRepeat(5,03,0 , PumpAlarm7Off);


  //LIGHT SCHEDULE
  Alarm.alarmRepeat(21,05,0 , LightAlarm ); //8AM TO 5PM
  Alarm.alarmRepeat(21,21,0 , LightAlarmOff) ;
}

void loop(){

  digitalClockDisplay();
  Alarm.delay(1000);
  lcd.setCursor(0, 1); 

  /*---( LIGHT PORTION OF THE SKETCH )---*/



  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
  if(lightReading >= 700){    //if light value is greater than or equal to 700
    lcd.print(Serial.println("LIGHT IS ON"));
  }
  else{
    lcd.print(Serial.println("LIGHT IS OFF"));
}

  

  /*--- ( WATER PORTION OF THE SKETCH )---*/
  Alarm.delay(1000);
  waterReading = analogRead(watersensorpin); // defines waterReading variable
  Serial.print("Water reading = ");
  lcd.clear();
  lcd.setCursor(0, 1);
  Serial.println(waterReading);  //Print value of water to serial monitor
  if(waterReading >=30 ){
    lcd.print(Serial.println("WATER IS ON"));
  }
  else{
    lcd.print(Serial.println("WATER IS OFF"));
  }
}

void digitalClockDisplay(){
  // digital clock display of the time
  Alarm.delay(1000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(hour());
  Serial.print(hour());
  printDigits(minute());
  //printDigits(second());
  lcd.print("");
  Serial.print(" ");
  lcd.print(month());
  Serial.print(month());
  lcd.print("/");
  Serial.print("/");
  lcd.print(day());
  Serial.print(day());
  lcd.print("/");
  Serial.print("/");
  lcd.print(year());
  Serial.print(year()); 
  Serial.println(); 

}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  lcd.print(":");
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
  lcd.print(digits); 
}

void PumpAlarm(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarmOff(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}
void PumpAlarm1(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm1Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm2(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm2Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm3(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm3Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm4(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm4Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm5(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm5Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm6(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm6Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm7(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm7Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void LightAlarm(){
  digitalWrite(lightsRelay, HIGH); //turn lights on
  Serial.println("Lights turning on.");
  lcd.setCursor(0, 1);
  lcd.print("LIGHTS ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();

}

void LightAlarmOff(){
  digitalWrite(lightsRelay, LOW); //turn lights off
  Serial.println("Lights are off.");
  lcd.setCursor(0, 1);
  lcd.print("LIGHTS INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
 
}

after getting pissed off today at people on forum I pick at your code till I got the alarms working cant have alarms with same name ie has to be pumpalarm1 pumpalarm2 etc.... it in your code I edited and posted it all hope this helps you as much as it has help me been working and testing for 3 hrs enjoy Thanks dyslexic

btw you will still need to change some of the lcd code to display right I edited some

after more test is is problems with sensor code alarms work with sensor code but not with this code for sure works timealarms

de:

/*
CODE FOR AUTOMATED AQUAPONICS SYSTEM
 goals:  
 -control a pump for the tank that will be a timed loop (proposed fail-safe to prevent overflow) NOT CLOSED
 -monitor growbed water levels to ensure water is flowing through system(encorporated in proposed fail safe)
 +use filament strip water level sensor (fswls) to ensure that water is indeed in the growbed
 POSSIBLE:+relay information from the (fswls) in conjuction with the pump control code to act as fail-safe against overflow
 -control lights for plants on a closed loop system
 +check whether on or off with a photo sensor
 -display serial information on LCD
 
 possible additions:
 -measure water quality/pH to ensure stable environment for fish
 -add resevoir of water that refills resevior tank
 -flow rate
 -temperture monitoring
 -controls for fish feeding
 */



//libraries to include
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h>
#include <TimeAlarms.h>
#include <DS1307RTC.h>

//pins used in LCD screen
LiquidCrystal lcd(8,9,4,5,6,7); 
//sensors& readings
//int lightsensorpin = A2; //analog pin #0. Defines light sensing diode
//int lightReading;  //defined later as reading of light sensor
//int watersensorpin = A0; // analong pin #3. Defines water sensing (fsr)
//int waterReading;  //defined later as reading of water sensor
//relays
int lightsRelay = 2; // digital pin #2. Defines lights relay
int pumpRelay = 12; // digital pin #12. Defines pump relay



void setup() {

  lcd.begin(16,2);
  Serial.begin(9600);

  //sync clock
  setSyncProvider(RTC.get); //function to get the time from the RTC
  if(timeStatus()!=timeSet){
    Serial.println("Unable to sync with the RTC");
    lcd.print("TIME NOT SET");
  }
  else{
    Serial.println("RTC has set the system time");
    lcd.print("TIME SET");
    lcd.clear();//add this to clear display
  }

  pinMode(lightsRelay,OUTPUT);
  pinMode(pumpRelay,OUTPUT);
  digitalWrite(pumpRelay,LOW); //tried to uncomment here to get alarm turn on/off to work no luck
  digitalWrite(lightsRelay,LOW);
  
  //WATER SCHEDULE

  Alarm.alarmRepeat(8,00,0 , PumpAlarm) ; //8 AM TO 8:03AM
  Alarm.alarmRepeat(8,03,0 , PumpAlarmOff);
  Alarm.alarmRepeat(11,00,0, PumpAlarm1) ; //11AM TO 11:03AM
  Alarm.alarmRepeat(11,03,0, PumpAlarm1Off) ;
  Alarm.alarmRepeat(14,00,0, PumpAlarm2) ; //2 PM TO 2:03PM
  Alarm.alarmRepeat(14,03,0, PumpAlarm2Off) ;
  Alarm.alarmRepeat(17,00,0, PumpAlarm3) ; //5 PM TO 5:03PM
  Alarm.alarmRepeat(17,03,0, PumpAlarm3Off) ;
  Alarm.alarmRepeat(20,00,0, PumpAlarm4) ; //8 PM TO 8:03PM
  Alarm.alarmRepeat(20,03,0, PumpAlarm4Off) ;
  Alarm.alarmRepeat(23,00,0, PumpAlarm5); //11PM to 11:03PM
  Alarm.alarmRepeat(23,03,0, PumpAlarm5Off);
  Alarm.alarmRepeat(2,00,0 , PumpAlarm6);  //2 AM to 2:03AM
  Alarm.alarmRepeat(2,03,0 , PumpAlarm6Off);
  Alarm.alarmRepeat(5,00,0 , PumpAlarm7);  //5AM to 5:03AM
  Alarm.alarmRepeat(5,03,0 , PumpAlarm7Off);


  //LIGHT SCHEDULE
  Alarm.alarmRepeat(21,05,0 , LightAlarm ); //8AM TO 5PM
  Alarm.alarmRepeat(21,21,0 , LightAlarmOff) ;
}

void loop(){

  digitalClockDisplay();
  Alarm.delay(1000);
  lcd.setCursor(0, 1); 

  /*---( LIGHT PORTION OF THE SKETCH )---*/



  //lightReading = analogRead(lightsensorpin); // defines lightReading variable
  //Serial.print("Light reading = "); //
  //Serial.println(lightReading);  //Print value of light to serial monitor
  //if(lightReading >= 700){    //if light value is greater than or equal to 700
   // lcd.print(Serial.println("LIGHT IS ON"));
  //}
  //else{
    //lcd.print(Serial.println("LIGHT IS OFF"));
//}

  

  /*--- ( WATER PORTION OF THE SKETCH )---*/
  //Alarm.delay(1000);
  //waterReading = analogRead(watersensorpin); // defines waterReading variable
  //Serial.print("Water reading = ");
 // lcd.clear();
  //lcd.setCursor(0, 1);
  //Serial.println(waterReading);  //Print value of water to serial monitor
  //if(waterReading >=30 ){
    //lcd.print(Serial.println("WATER IS ON"));
  //}
 // else{
    //lcd.print(Serial.println("WATER IS OFF"));
 // }
//}

void digitalClockDisplay(){
  // digital clock display of the time
  Alarm.delay(1000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(hour());
  Serial.print(hour());
  printDigits(minute());
  //printDigits(second());
  lcd.print("");
  Serial.print(" ");
  lcd.print(month());
  Serial.print(month());
  lcd.print("/");
  Serial.print("/");
  lcd.print(day());
  Serial.print(day());
  lcd.print("/");
  Serial.print("/");
  lcd.print(year());
  Serial.print(year()); 
  Serial.println(); 

}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  lcd.print(":");
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
  lcd.print(digits); 
}

void PumpAlarm(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarmOff(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}
void PumpAlarm1(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm1Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm2(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm2Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm3(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm3Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm4(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm4Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm5(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm5Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm6(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm6Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm7(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm7Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void LightAlarm(){
  digitalWrite(lightsRelay, HIGH); //turn lights on
  Serial.println("Lights turning on.");
  lcd.setCursor(0, 1);
  lcd.print("LIGHTS ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();

}

void LightAlarmOff(){
  digitalWrite(lightsRelay, LOW); //turn lights off
  Serial.println("Lights are off.");
  lcd.setCursor(0, 1);
  lcd.print("LIGHTS INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
 
}

You are a lifesaver Dyslexic. I have to take my project and present it in front of the school board when I get back to school on the 8th. I will be testing it then, but if it worked for you then it'll probably solve my problems

problem here your not telling it to turn on just serial printing thats why not action is taken

  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
  if(lightReading >= 700){    //if light value is greater than or equal to 700
    lcd.print(Serial.println("LIGHT IS ON"));
  }
  else{
    lcd.print(Serial.println("LIGHT IS OFF"));
}

you need digitalWrite for sensors

ok now sersors turn lights and pumps on and off just get lcd display code done and your set

/*
CODE FOR AUTOMATED AQUAPONICS SYSTEM
 goals:  
 -control a pump for the tank that will be a timed loop (proposed fail-safe to prevent overflow) NOT CLOSED
 -monitor growbed water levels to ensure water is flowing through system(encorporated in proposed fail safe)
 +use filament strip water level sensor (fswls) to ensure that water is indeed in the growbed
 POSSIBLE:+relay information from the (fswls) in conjuction with the pump control code to act as fail-safe against overflow
 -control lights for plants on a closed loop system
 +check whether on or off with a photo sensor
 -display serial information on LCD
 
 possible additions:
 -measure water quality/pH to ensure stable environment for fish
 -add resevoir of water that refills resevior tank
 -flow rate
 -temperture monitoring
 -controls for fish feeding
 */



//libraries to include
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h>
#include <TimeAlarms.h>
#include <DS1307RTC.h>

//pins used in LCD screen
LiquidCrystal lcd(8,9,4,5,6,7); 
//sensors& readings
int lightsensorpin = A2; //analog pin #0. Defines light sensing diode
int lightReading;  //defined later as reading of light sensor
int watersensorpin = A0; // analong pin #3. Defines water sensing (fsr)
int waterReading;  //defined later as reading of water sensor
//relays
int lightsRelay = 2; // digital pin #2. Defines lights relay
int pumpRelay = 12; // digital pin #12. Defines pump relay



void setup() {

  lcd.begin(16,2);
  Serial.begin(9600);

  //sync clock
  setSyncProvider(RTC.get); //function to get the time from the RTC
  if(timeStatus()!=timeSet){
    Serial.println("Unable to sync with the RTC");
    lcd.print("TIME NOT SET");
  }
  else{
    Serial.println("RTC has set the system time");
    lcd.print("TIME SET");
    lcd.clear();//add this to clear display
  }

  pinMode(lightsRelay,OUTPUT);
  pinMode(pumpRelay,OUTPUT);
  digitalWrite(pumpRelay,LOW); //tried to uncomment here to get alarm turn on/off to work no luck
  digitalWrite(lightsRelay,LOW);
  
  //WATER SCHEDULE

  Alarm.alarmRepeat(8,00,0 , PumpAlarm) ; //8 AM TO 8:03AM
  Alarm.alarmRepeat(8,03,0 , PumpAlarmOff);
  Alarm.alarmRepeat(11,00,0, PumpAlarm1) ; //11AM TO 11:03AM
  Alarm.alarmRepeat(11,03,0, PumpAlarm1Off) ;
  Alarm.alarmRepeat(14,00,0, PumpAlarm2) ; //2 PM TO 2:03PM
  Alarm.alarmRepeat(14,03,0, PumpAlarm2Off) ;
  Alarm.alarmRepeat(17,00,0, PumpAlarm3) ; //5 PM TO 5:03PM
  Alarm.alarmRepeat(17,03,0, PumpAlarm3Off) ;
  Alarm.alarmRepeat(20,00,0, PumpAlarm4) ; //8 PM TO 8:03PM
  Alarm.alarmRepeat(20,03,0, PumpAlarm4Off) ;
  Alarm.alarmRepeat(23,00,0, PumpAlarm5); //11PM to 11:03PM
  Alarm.alarmRepeat(23,03,0, PumpAlarm5Off);
  Alarm.alarmRepeat(2,00,0 , PumpAlarm6);  //2 AM to 2:03AM
  Alarm.alarmRepeat(2,03,0 , PumpAlarm6Off);
  Alarm.alarmRepeat(5,00,0 , PumpAlarm7);  //5AM to 5:03AM
  Alarm.alarmRepeat(5,03,0 , PumpAlarm7Off);


  //LIGHT SCHEDULE
  Alarm.alarmRepeat(21,05,0 , LightAlarm ); //8AM TO 5PM
  Alarm.alarmRepeat(21,21,0 , LightAlarmOff) ;
}

void loop(){

  digitalClockDisplay();
  Alarm.delay(1000);
  lcd.setCursor(0, 1); 

  /*---( LIGHT PORTION OF THE SKETCH )---*/



  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
  if(lightReading >= 700){    //if light value is greater than or equal to 700
    digitalWrite(lightsRelay, HIGH);
    lcd.print(Serial.println("LIGHT IS ON"));
  }
  else{
    digitalWrite(lightsRelay, LOW);
    lcd.print(Serial.println("LIGHT IS OFF"));
    
}

  

  /*--- ( WATER PORTION OF THE SKETCH )---*/
  Alarm.delay(1000);
  waterReading = analogRead(watersensorpin); // defines waterReading variable
  Serial.print("Water reading = ");
  lcd.clear();
  lcd.setCursor(0, 1);
  Serial.println(waterReading);  //Print value of water to serial monitor
  if(waterReading >=30 ){
    digitalWrite(pumpRelay,HIGH);
    lcd.print(Serial.println("WATER IS ON"));
  }
  else{
    digitalWrite(pumpRelay,LOW);
    lcd.print(Serial.println("WATER IS OFF"));
  }
}

void digitalClockDisplay(){
  // digital clock display of the time
  Alarm.delay(1000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(hour());
  Serial.print(hour());
  printDigits(minute());
  //printDigits(second());
  lcd.print("");
  Serial.print(" ");
  lcd.print(month());
  Serial.print(month());
  lcd.print("/");
  Serial.print("/");
  lcd.print(day());
  Serial.print(day());
  lcd.print("/");
  Serial.print("/");
  lcd.print(year());
  Serial.print(year()); 
  Serial.println(); 

}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  lcd.print(":");
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
  lcd.print(digits); 
}

void PumpAlarm(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarmOff(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}
void PumpAlarm1(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm1Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm2(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm2Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm3(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm3Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm4(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm4Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm5(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm5Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm6(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm6Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void PumpAlarm7(){
  digitalWrite(pumpRelay, HIGH); //turn pump on
  Serial.println("Pump is running.");
  lcd.setCursor(0, 1); 
  lcd.print("PUMP ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();  

}

void PumpAlarm7Off(){
  digitalWrite(pumpRelay, LOW); //turn pump off
  Serial.println("Pump is not running.");
  lcd.setCursor(0, 1);
  lcd.print("PUMP INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
}

void LightAlarm(){
  digitalWrite(lightsRelay, HIGH); //turn lights on
  Serial.println("Lights turning on.");
  lcd.setCursor(0, 1);
  lcd.print("LIGHTS ACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();

}

void LightAlarmOff(){
  digitalWrite(lightsRelay, LOW); //turn lights off
  Serial.println("Lights are off.");
  lcd.setCursor(0, 1);
  lcd.print("LIGHTS INACTIVE");
  Alarm.delay(1000);
  lcd.setCursor(0, 1);
  lcd.clear();
 
}

Wait, do the alarms switch the relays on and off or do the sensors? Cuz I was thinking that the sensors just interpret what's happening and the alarms control relays?

the sensors was just priting to serial lights on lights off when light level is low same for pumpI add write to sensor to turn on lights when light level is low from you code that looks like what you want the sensors do also turns on and off with alarms if you do want sersors to do anything them edit out digialwrite in sensors area

you had this which only serial prints and lcd prints but you need to setCursor and alarm.delay so you can see on display

  /*---( LIGHT PORTION OF THE SKETCH )---*/



  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
  if(lightReading >= 700){    //if light value is greater than or equal to 700
    lcd.print(Serial.println("LIGHT IS ON"));
  }
  else{
    lcd.print(Serial.println("LIGHT IS OFF"));
    
}

  

  /*--- ( WATER PORTION OF THE SKETCH )---*/
  Alarm.delay(1000);
  waterReading = analogRead(watersensorpin); // defines waterReading variable
  Serial.print("Water reading = ");
  lcd.clear();
  lcd.setCursor(0, 1);
  Serial.println(waterReading);  //Print value of water to serial monitor
  if(waterReading >=30 ){
    lcd.print(Serial.println("WATER IS ON"));
  }
  else{
    lcd.print(Serial.println("WATER IS OFF"));
  }
}

I was thinking you was trying to do this with sensors

  /*---( LIGHT PORTION OF THE SKETCH )---*/



  lightReading = analogRead(lightsensorpin); // defines lightReading variable
  Serial.print("Light reading = "); //
  Serial.println(lightReading);  //Print value of light to serial monitor
  if(lightReading >= 700){    //if light value is greater than or equal to 700
    digitalWrite(lightsRelay, HIGH);
    lcd.print(Serial.println("LIGHT IS ON"));
  }
  else{
    digitalWrite(lightsRelay, LOW);
    lcd.print(Serial.println("LIGHT IS OFF"));
    
}

  

  /*--- ( WATER PORTION OF THE SKETCH )---*/
  Alarm.delay(1000);
  waterReading = analogRead(watersensorpin); // defines waterReading variable
  Serial.print("Water reading = ");
  lcd.clear();
  lcd.setCursor(0, 1);
  Serial.println(waterReading);  //Print value of water to serial monitor
  if(waterReading >=30 ){
    digitalWrite(pumpRelay,HIGH);
    lcd.print(Serial.println("WATER IS ON"));
  }
  else{
    digitalWrite(pumpRelay,LOW);
    lcd.print(Serial.println("WATER IS OFF"));
  }
}