Project showcase
Aquarium Automation

Aquarium Automation © GPL3+

The goal of this project is to build an aquarium’s device that is connected to a GSM so that we can control & monitor it through SMS.

  • 17,182 views
  • 9 comments
  • 31 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
Arduino UNO
×1
Shield
SmartThings Shield for Arduino
SIM900 GSM/GPRS Shield
×1
11026 02
Jumper wires (generic)
Jumpers for Arduino (Male-Male & Male-Female)
×1
Tmp107
Texas Instruments Temperature Sensor
Underwater Temperature Sensor DALLAS DS18B20
×1
Water Heater
×1
12002 04
Breadboard (generic)
×1
Sharp s202s02f image
Solid State Relay
2 Relays used
×1
Oxygen Pump for Aquarium
×1
DC motor (generic)
5V DC Stepper Motor with Driver ULN2003
×1
Adafruit industries ada63 image 75px
9V 1A Switching Wall Power Supply
5V-1A & 12V=2A DC Power Adapters
×1
09590 01
LED (generic)
Lighting components are used in which many LEDs are used.
×1

Necessary tools and machines

09507 01
Soldering iron (generic)
Hy gluegun
Hot glue gun (generic)

About this project

BACKGROUND 

It all started when I have to submit my Final Year Project for my Engineering Program. I have given more than 5 project proposals but all were rejected from the supervisor as they were already made or too old. So finally my supervisor gave an idea to work on IoT kind of project. So eventually I found out that inside aquarium there is a small world and this world can be equipped with lot of engineering. I started research on different aquariums.

I found out that people who already worked on aquarium have controlled the Aquarium from Touch Screen or from Internet. So I have chosen a new way to control, automate & monitor the aquarium from anywhere around the world as I was about to connect the aquarium with GSM Network.

INTRODUCTION

So finally my project proposal is accepted in which I'm using Arduino UNO with GSM Shield as main component. The best thing about this project is that it has 3 objectives: 

  • Automation
  • Controlling
  • Monitoring

Turn On & Off of the aquarium's appliances are controlled with SMS commands while the water temperature monitoring report is sent back to the user's phone. Other than this, the feeding system for fish runs on automation, depending on the feeding time programmed by the user in the Arduino. So this is the main idea which I have started to work on.

Working

I bought an aquarium along with my friend. It looks beautiful in contrast of Red & Black.

I have ordered many components from China. And as soon as I got these items, I started to work on them.

Then I have started Arduino programming and one by one I interface every component with the Arduino. 

Video 1: Interfacing 16x2 LCD

Video 2: Arduino UNO interfacing with GSM Shield
Video 3: SMS controlling (Testing)

I used relays 5V relays to control AC appliances from Arduino (through SMS).

The underwater heater & the oxygen pump are AC appliances.

I also used an underwater tube light inside the water but it was not long lasting so I reject the tube light and used LEDs on the roof of the aquarium & LEDs which remain underwater.

Video 4: Controlling LED Lights through SMS

Video 5: LED Lights attached to Aquarium & controlled by SMS
Video 6: Underwater LED Lights

Fish feeding system was the next task to make. As I wanted to make this project more economical and useful, I used 5V DC stepper motor. And from different mechanical ideas I made this by myself.

I made 2 small holes at the bottom as you can see, and placed a wall in the center of the cup. As the feeding time arrives (which must be programmed in the Arduino), the wall will rotate 360° and stops until the next interval.

Video 6: Operations of Fish Feeding System

I have also ordered the plastic box to put my device inside and glue it with the aquarium.

As the plastic box arrived, I placed my device in it. Meanwhile I worked on the program and it was almost done and need testing, so the things were about to start. I tested my program's automation, SMS monitoring & SMS controlling on the breadboard already.

Now, it's time to give a new shape to the Aquarium.

Meanwhile my project report which I was writing till late night was printed and came into my hand. It was a fantastic feeling.

All operations works perfectly.

This Project is honored as one of the best Arduino project by the Engineers of Indus University & right now placed inside Indus University, Karachi.

Result

Every alliance inside the aquarium is now controlled with SMS. The device that can be operated by SMS are:

 Top LEDs

 Underwater LEDs

 Oxygen Pump & Filter

 Water Heater

 Feeding System

The aquarium sends temperature report via SMS after same interval of time. The time interval can be setup from programming. Aquarium sends the temperature in degrees of Celsius & Fahrenheit. We have monitor the temperature successfully.

This project is not a high budget project. Arduino IDE is free of cost. Therefore, no amount is spent on software.

Conclusion

This is a successful controlling and monitoring system which is not just limited to aquarium but can also be applicable to any security, monitoring, controlling and automation system. This project offers fully automated aquarium. As mentioned earlier, we are not only providing automation over devices like LEDs, heater, oxygen pump but also we have process that alert the person regarding the temperature changes in the aquarium.

Future Improvements

There are many more possible future improvements that can be done with this device:

 Keypad to control the LCD navigation

 Controlling and Monitoring using GPRS. GPRS connectivity is also possible as the device is already connected to GSM network.

 Installation of large size Touch Screen

 Use of more sensors such as pH sensor, Salinity sensor and Calcium sensor etc.

 Camera to capture real-time images and video for monitoring

Code

Aquarium Automation ProgramArduino
It is fine & working.
#include <SoftwareSerial.h>
char inchar; // Will hold the incoming character from the GSM shield
#include <OneWire.h>
SoftwareSerial SIM900(7, 8);
OneWire  ds(2);  // on pin 2 (a 4.7K resistor is necessary)

int led1 = 10;
int led2 = 11;
int led3 = 12;
int led4 = 13;

void setup()
{
  Serial.begin(19200);
  // set up the digital pins to control
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  digitalWrite(led3, LOW);
  digitalWrite(led4, LOW);
  
  SIM900.begin(19200);
  SIM900power();  
  delay(20000);  // give time to log on to network. 
  
  SIM900.print("AT+CMGF=1\r");  // set SMS mode to text
  delay(100);
  SIM900.print("AT+CNMI=2,2,0,0,0\r"); 
  // blurt out contents of new SMS upon receipt to the GSM shield's serial out
  delay(100);
  Serial.println("Ready...");
}
 
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
  digitalWrite(9, HIGH);
  delay(1000);
  digitalWrite(9, LOW);
  delay(7000);
}
 
void sendSMS()
{
  SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(100);
  SIM900.println("AT + CMGS = \"+923032810399\"");                                     // recipient's mobile number, in international format
  delay(100);
  SIM900.println(" The Aquarium Automation is ON now. Thanks to Talal Khokhar, Usama Bin Najam & Ghulam Rasool.");        // message to send
  delay(100);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(100); 
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
  SIM900power();                                   // turn off module
}

 
void loop()
{

  //If a character comes in from the cellular module...
  if(SIM900.available() >0)
  {
    inchar=SIM900.read(); 
    if (inchar=='#')
    {
      delay(10);

      inchar=SIM900.read(); 
      if (inchar=='a')
      {
        delay(10);
        inchar=SIM900.read();
        if (inchar=='0')
        {
          digitalWrite(led1, LOW);
        } 
        else if (inchar=='1')
        {
          digitalWrite(led1, HIGH);
        }
        delay(10);
        inchar=SIM900.read(); 
        if (inchar=='b')
        {
          inchar=SIM900.read();
          if (inchar=='0')
          {
            digitalWrite(led2, LOW);
          } 
          else if (inchar=='1')
          {
            digitalWrite(led2, HIGH);
          }
          delay(10);
          inchar=SIM900.read(); 
          if (inchar=='c')
          {
            inchar=SIM900.read();
            if (inchar=='0')
            {
              digitalWrite(led3, LOW);
            } 
            else if (inchar=='1')
            {
              digitalWrite(led3, HIGH);
            }
            delay(10);
            inchar=SIM900.read(); 
            if (inchar=='d')
            {
              delay(10);
              inchar=SIM900.read();
              if (inchar=='0')
              {
                digitalWrite(led4, LOW);
              } 
              else if (inchar=='1')
              {
                digitalWrite(led4, HIGH);
              }
              delay(10);
            }
          }
          SIM900.println("AT+CMGD=1,4"); // delete all SMS
        }
      }
    }
  }
  
 
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
  
   if ( !ds.search(addr)) {
  SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(100);
  SIM900.println("AT + CMGS = \"+923032810399\"");                                     // recipient's mobile number, in international format
  delay(100);
  SIM900.println(" Thank You ");        // message to send
  delay(100);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(100); 
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
  SIM900power();    // turn off module
  
   ds.reset_search();
    delay(10000);
    return;
}
  switch (addr[0]) {
    case 0x28:
      SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(100);
  SIM900.println("AT + CMGS = \"+923032810399\"");                                     // recipient's mobile number, in international format
  delay(100);
  SIM900.println(" The Water Temperature Report by TALAL, USAMA, GHULAM");        // message to send
  delay(100);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(100); 
  SIM900.println();
  delay(5000);                                     // give module time to send SMS
  SIM900power();    // turn off mod
      type_s = 0;
      break;
       return;
  }
ds.reset();
  ds.select(addr);
  ds.write(0x44);        // start conversion, use ds.write(0x44,1) with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE);         // Read Scratchpad

 
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();   
  }
   int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  
 SIM900.print("AT+CMGF=1\r");                                                        // AT command to send SMS message
  delay(100);
  SIM900.println("AT + CMGS = \"+923032810399\"");                                     // recipient's mobile number, in international format
  delay(100);
  SIM900.println(" Temp= ");  // message to send
  SIM900.println(celsius);
   SIM900.println(" Cel, ");  // message to send
  SIM900.println(fahrenheit);
  SIM900.println(" Fah");
  delay(100);
  SIM900.println((char)26);                       // End AT command with a ^Z, ASCII code 26
  delay(100); 
  SIM900.println();
  delay(10000);                                     // give module time to send SMS
  SIM900power();   
  
 }

Schematics

Pin Map of Arduino
Pin Mapping of Arduino UNO used in this project
Wiring diagram
Relay Circuit
Schematic of Relay circuit used for control and switch AC appliances like Heater & Oxygen Pump
Picture1
Block Diagram of the Project
This block diagram shows complete operations take place in this project.
Arduino
Schematic of SIM900 GSM/GPRS Sheid
Schematic of SIM900 GSM/GPRS Sheid
0900 schema

Comments

Similar projects you might like

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,839 views
  • 17 comments
  • 75 respects

Bluetooth Mini Car

Project showcase by Hesham

  • 8,139 views
  • 2 comments
  • 29 respects

Email Home Automation

Project tutorial by Chirila Radu

  • 3,994 views
  • 0 comments
  • 14 respects

Home Automation using Arduino and 1Sheeld

Project tutorial by Ramy ElMallah

  • 4,275 views
  • 2 comments
  • 12 respects

IoT for coins

Project tutorial by Erik Moran

  • 8,372 views
  • 1 comment
  • 42 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 297,267 views
  • 98 comments
  • 706 respects
Add projectSign up / Login