#define OVERHEAD_TANK_SENSOR_PIN 2 // this is the Float switch pin for the overhead tank
#define SUMP_TANK_SENSOR_PIN 4 // this is the Float switch pin for the sump tank
#define GENERAL_MOTOR_PIN 22
#define HP_MOTOR_PIN 23
void setup() {
pinMode(OVERHEAD_TANK_SENSOR_PIN, INPUT);
pinMode(SUMP_TANK_SENSOR_PIN, INPUT);
pinMode(GENERAL_MOTOR_PIN, OUTPUT);
pinMode(HP_MOTOR_PIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
int overheadTankStatus = digitalRead(OVERHEAD_TANK_SENSOR_PIN);
int sumpTankStatus = digitalRead(SUMP_TANK_SENSOR_PIN);
if (overheadTankStatus == HIGH) {
digitalWrite(GENERAL_MOTOR_PIN, LOW);
digitalWrite(HP_MOTOR_PIN, LOW);
Serial.println("General_Motor:OFF");
Serial.println("HP_Motor:OFF");
} else {
if (sumpTankStatus == LOW) {
digitalWrite(GENERAL_MOTOR_PIN, LOW);
digitalWrite(HP_MOTOR_PIN, HIGH);
Serial.println("General_Motor:OFF");
Serial.println("HP_Motor:ON");
} else {
digitalWrite(GENERAL_MOTOR_PIN, HIGH);
digitalWrite(HP_MOTOR_PIN, LOW);
Serial.println("General_Motor:ON");
Serial.println("HP_Motor:OFF");
}
}
Serial.print("Overhead Tank Status: ");
Serial.println(overheadTankStatus == HIGH ? "Full" : "Not Full");
Serial.print("Sump Tank Status: ");
Serial.println(sumpTankStatus == HIGH ? "Full" : "Not Full");
delay(1000);
}