SALES INQUIRIES: 1 (888) 767-9864

Arduino Controlled Aquaponics Garden :: Student Project

Dimitris , Dimitris , quite ingenious,
How does your garden grow?
With Arduinos, and relay modules,
And pretty tanks all in a row.

Project purpose:

Dimitris has an aquaponics garden at his home, but often has to leave for several days at a time. He needed his garden to be tended while he was away because an aquaponics garden is a system that needs a few processes to happen to maintain it.

He turned to an Arduino solution even though he had no experience with it to begin with.

What Even Is Aquaponics?

Aquaponics combines hydroponics (growing plants in water without soil), and aquaculture (raising fish in a tank or pool). This type of system has inputs of light, oxygen, and fish food; and outputs fish and veggies.

The fish eat fish food, which is turned in nutrients for the plants, the plants and helpful bacteria filter the water by using the nutrients in the water, which is then ready for the fish again.

In between, light comes in for the plants, and sometimes plants and fish can be removed for consumption.

This particular Aquaponics system consists of three tanks:

  • The main fish tank (65L) is occupied by four Comet Goldfish
  • The second (45L) full of expanded clay (where the most of the bacteria lives) and to support the roots of the plants.
  • Third comes the last tank (45L) with a floating raft for the plants, a small floating seed starter, a smaller nursery tank for young fish (one week old) and four guppies.

Processes the Arduino takes care of:

While Dimitris is away several processes need to happen to keep his garden healthy:

  • Feeding the fish from a hopper
  • Turning the grow lights on and off for the plants
  • Pumping water through filters
  • Filling the plant tanks with the water

The main materials for this project:

  • Arduino Uno
  • A water level sensor to detect whether pumping between tanks is necessary
  • 4-channel relay module, the Arduino uses it to control the pumps, servo, and grow lights
  • Hobby servo modified to just run on DC voltage to open and close a fish feeder hopper
  • Small immersible pump moves water from tank to tank

“AND I MADE my first working sketch.”

Like any proud father, Dimitris is very happy with his project that he put together in just 6 weeks! It’s fantastic that Dimitris jumped into Arduino and not only made his first sketch, but used it to solve a problem in his life and make it better.

He reports that the project fulfills its purpose, and he enjoyed overcoming the normal development challenges for any project.

Dimitris looks forward to other projects and expanding his command of programming in the future.  Nice work!

Arduino Code:

//the relays connect to
int IN1 = 11;//light
int IN2 = 10;//feed goldfish
int IN3 = 9;//water filter with air
int IN4 = 8;//water pump
int W_L_S = A0;//water level sensor
int val;
#define ON   0
#define OFF  1
void setup()
{
  relay_init();//initialize the relay
}

void loop() {

  relay_SetStatus(ON, OFF, OFF, OFF); //turn on RELAY_1
  delay(600000);//delay 10min
  relay_SetStatus(ON, ON, OFF, OFF); //turn on RELAY_1_2
  delay(2000);//delay 2s
  relay_SetStatus(ON, OFF, ON, OFF); //turn on RELAY_1_3
  delay(43200000);//delay 12h
  relay_SetStatus(ON, ON, OFF, OFF); //turn on RELAY_1_2
  delay(2000);//delay 2s
  relay_SetStatus(ON, OFF, OFF, OFF); //turn on RELAY_1
  delay(600000);//delay 10min
  relay_SetStatus(OFF, OFF, OFF, OFF); //turn off all RELAY
  delay(2400000);//delay 40min
  val = analogRead(W_L_S); //Here the analog pin decides to whitch state ON or OFF she is
  if (val < 100) {        //and keeps it until the end of the loop
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);//delay 15s
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  val = analogRead(W_L_S);
  if (val < 100) {
    digitalWrite(IN4, ON);
  }
  else if (val > 100) {
    digitalWrite(IN4, OFF);
  }
  delay(15000);
  relay_SetStatus(OFF, OFF, OFF, OFF); //turn off all RELAY
  delay(39600000);//delay 11h

}
void relay_init(void)//initialize the relay
{
  //set all the relays OUTPUT
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
  relay_SetStatus(OFF, OFF, OFF, OFF); //turn off all the relay
}
//set the status of relays
void relay_SetStatus( unsigned char status_1,  unsigned char status_2, unsigned char status_3, unsigned char status_4)
{
  digitalWrite(IN1, status_1);
  digitalWrite(IN2, status_2);
  digitalWrite(IN3, status_3);
  digitalWrite(IN4, status_4);


}

 

1 Comment

  1. […] has a three tank aquaponics garden that he wanted to […]

Leave a Comment