This is the startup program used for 10 to 11 days to establish the nitifying bacteria in the system i discussed in a previous post.
[code]
/* This sketch controls an Ebb and Flow Aquaponic system utilizing three relays and led lights for visualization
of currant stage and upcoming stage. relay 1 water pump pin 2, relay 2 gravity feed solenoid valve pin 3 and
relay 3 grow bed drain solenoid valve pin 4.
1-5 led's indicate stage complete pin's 5-9, led 6 is upcoming stage indicator pin 13.
stage 1 pump, stage 2 flood, stage 3 soak, stage 4 drain and stage 5 aerate.
Relays power to opto's are all tied together so the low pin connected to the Arduino has to go low
before the relay will turn on. high means off, low means on so in setup declare them high before running loop.
created on 11-15-2017
Marathonman
*/
int RELAY1 = 2; // assigning pin 2 of the Arduino for relay 1
int RELAY2 = 3; // assigning pin 3 of the Arduino for relay 2
int RELAY3 = 4; // assigning pin 4 of the Arduino for relay 3
int led = 13; // assinging pin 13 as led stage indication
int led2 = 5; // assigning first stage led to pin 5
int led3 = 6; // assigning second stage led to pin 6
int led4 = 7; // assigning third stage led to pin 7
int led5 = 8; // assigning fourth stage led to pin 8
int led6 = 9; // assigning fifth stage led to pin 9
void setup()
{
pinMode(RELAY1, OUTPUT); // initialize pin 2 of the Arduino as output
pinMode(RELAY2, OUTPUT); // initialize pin 3 of the Arduino as output
pinMode(RELAY3, OUTPUT); // initialize pin 4 of the Arduino as output
pinMode(led, OUTPUT); // initialize LED pin 13 as an output
pinMode(led2, OUTPUT); // initialize first stage led as output
pinMode(led3, OUTPUT); // initialize second stage led as output
pinMode(led4, OUTPUT); // initialize third stage led as output
pinMode(led5, OUTPUT); // initialize fourth stage led as output
pinMode(led6, OUTPUT); // initialize fifth stage led as output
digitalWrite(RELAY1, HIGH); // This will Turn Relay 1 Off
digitalWrite(RELAY2, HIGH); // This will Turn Relay 2 Off
digitalWrite(RELAY3, HIGH); // This will Turn Relay 3 Off
}
void loop()
{
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off (LOW is the voltage level)
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(RELAY1, LOW); // This will Turn relay 1 on
delay(300000); // Wait for 300 seconds
digitalWrite(RELAY1, HIGH); // This will Turn Relay 1 Off
delay(250); // wait for a quarter second
digitalWrite(led2, HIGH); // This will indicate stage 1 complete
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(RELAY2, LOW); // This will Turn relay 2 on
delay(900000); // Wait for 900 seconds
digitalWrite(RELAY2, HIGH); // This will Turn Relay 2 Off
delay(250); // wait for a quarter second
digitalWrite(led3, HIGH); // This will indicate stage 2 complete
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quater second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a Quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(600000); // Wait for 600 seconds
digitalWrite(led4, HIGH); // This will indicate stage 3 complete
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quater second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
digitalWrite(RELAY3, LOW); // This will Turn relay 3 on
delay(900000); // Wait for 900 seconds
digitalWrite(RELAY3, HIGH); // This will Turn Relay 3 Off
delay(250); // wait for a quarter second
digitalWrite(led5, HIGH); // This will indicate stage 4 complete
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quater second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quater second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quater second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quater second
digitalWrite(led, LOW); // turn the LED off
delay(2000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(250); // wait for a quarter second
digitalWrite(led, HIGH); // turn the LED on
delay(250); // wait for a quarter second
digitalWrite(led, LOW); // turn the LED off
delay(600000); // Wait for 600 seconds
digitalWrite(led6, HIGH); // This will indicate stage 5 complete
delay(1000); // wait for two seconds
digitalWrite(led, HIGH); // turn the LED on
delay(500); // wait for half second
digitalWrite(led, LOW); // turn the LED off
delay(500); // wait for half second
digitalWrite(led, HIGH); // turn the LED on
delay(500); // wait for half second
digitalWrite(led, LOW); // turn the LED off
delay(500); // wait for half second
digitalWrite(led, HIGH); // turn the LED on
delay(500); // wait for half second
digitalWrite(led, LOW); // turn the LED off
delay(500); // wait for half second
digitalWrite(led, HIGH); // turn the LED on
delay(500); // wait for half second
digitalWrite(led, LOW); // turn the LED off
delay(500); // wait for half second
digitalWrite(led, HIGH); // turn the LED on
delay(500); // wait for half second
digitalWrite(led, LOW); // turn the LED off
delay(500); // wait for half second
digitalWrite(led6, LOW); // turns led 6 off
delay(250); // wait for quarter second
digitalWrite(led5, LOW); // turns led 5 off
delay(250); // wait for quarter second
digitalWrite(led4, LOW); // turns led 4 off
delay(250); // wait for quarter second
digitalWrite(led3, LOW); // turns led 3 off
delay(250); // wait for quarter second
digitalWrite(led2, LOW); // turns led 2 off
delay(1000); // wait a second
}
[/code]