Pages

Sunday, 4 March 2018

Automatic Green House Controlling and Monitoring System

Automatic Green House Controlling and Monitoring System over GSM module using Arduino:


In today’s greenhouses, many parameter measurements are required to monitor and control for the good quality and productivity of plants. But to get the desired results there are some very important factors which come into play like Temperature, Humidity, Light and Water, which are necessary for a better plant growth. Keeping these parameters in mind I have built an Automatic Green House Controlling and Monitoring System over GSM module using Arduino. This system is very efficient for growing good quality plants. The other important part of this project is that it is fully automatic. Arduino automatically turns on and turns off the appliances.


These days GSM Module is widely used in Green House Monitoring. Here in this project by using GSM Module we can keep information about the  effects of climate on plants.  The system shall also demonstrate climatic changes which affect the plant in its productivity and quality etc. The main purpose of coming up with this project is to build an Automatic Green House Monitoring in which GSM module sends the information about Temperature, Humidity, Light intensity, Soil moisture and status of appliances (Fan, Sprays, Artificial Lights and Water pump) that are connected with circuit for controlling Green House effects or Green House parameters (Temperature, Humidity, Light intensity and Water supply for plants).


Block Diagram of Green House Monitoring and Controlling System


The four parameters that we are going to discuss are:

Temperature

The temperature sensor is used for sensing temperature. When temperature exceeds from a defined level or critical level, the system automatically turns on the fan and a message is also sent to the owner or the operator with information of all parameters (Temperature, Humidity, Light intensity and Electrical appliance on off status). And when the temperature comes in normal range or comes below the defined level the fan turns off automatically.

 
Humidity

Humidity is measured by using the humidity sensor. If the humidity of the environment is below the defined levels, sprays are automatically turned on and if the humidity level exceeds from the defined level sprays are automatically turned off. But here in this project instead of a spray I have used CFL light to denote the spray.   A status or notification message is also sent to the owner by the system using GSM Module.

Light Intensity

Light intensity is an important factor for the plant growth. If the light intensity is low then it affects the growth of the plants.  To resolve the problem of low light, artificial lights are used. Here in this project 100 watt bulb is used for demonstration. When light intensity is lower than a defined level, the artificial lights turns on, and when the light intensity comes in normal range artificial lights automatically turns off and a notification message is also sent to the owner.

Light Intensity Sensor Circuit Diagram

For detecting light intensity LDR is used. Generally light intensity is measured in LUX and therefore for demonstration 100 LUX light is used as defined or threshold level. If light intensity exceeds from 100 LUX, the artificial lights automatically turns on.

For more detail about light intensity circuit and measurements, please read “Solar Power Measurement System using Arduino”.

Soil Moisture

Water supply for plants is very important for good growth. So here in this demonstration I have used a water pump and a soil moisture sensor, for detecting soil moisture. Two probes of soil-moisture-sensors are used and placed in soil. When  the sensor does not sense moisture in soil then the system turns on the water pump until  it reaches the required level. A notification is also sent to the owner with status of water pump like Motor On or Motor Off. Here for sensing soil moisture a transistor is used as a switch.

Circuit diagram of the Soil Moisture Sensor

HARDWARE REQUIRED:

1. Aurduino board 
2. LDR
3. Moister sensor
4. Humidity sensor
5.Temperature sensor
6. PCB  board
7. Tools (soldering iron, lead, connecting wire , wire stripper)
8.Passive elements as per circuit diagram.
9. USB Cable Type B
10. GSM Module.

SOFTWARE REQUIRED :

1. Aurduino IDE (you can download it below )


CIRCUIT DIAGRAM:



CODE:

#include<LiquidCrystal.h>
#include<dht.h>

#define dht_dpin A1
#define LUX A0
LiquidCrystal lcd(2,3,4,5,6,7);

dht DHT;

#define light 10
#define fan 8
#define spray 11
#define motor 12
#define soil 9

int temperature, humidity, temp,Temp;
int check;
int test,test1,test2,test3;
float volt,lux,value;

byte degree[8] =
              {
                0b00011,
                0b00011,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000
              };

void setup()
{
  Serial.begin(9600);
  lcd.begin(16,2);

  pinMode(soil, INPUT);
  pinMode(light, OUTPUT);
  pinMode(fan, OUTPUT);
  pinMode(spray, OUTPUT);
  pinMode(motor, OUTPUT);

  lcd.createChar(1, degree);
  lcd.setCursor(0,0);
  lcd.print("Green House   ");
  lcd.setCursor(0,1);
  lcd.print("  Monitering");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("By Saddam Khan");
  lcd.setCursor(0,1);
  lcd.print("ENGINEERS GARAGE");
  delay(2000);
  lcd.clear();
}

void loop()
{
  /*-----Light Intensity------*/

  DHT.read11(dht_dpin);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(" humidity=");
  lcd.print(humidity=DHT.humidity);
  lcd.print(" % ");
// lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("temperature=");
  lcd.print(temperature=DHT.temperature);
  lcd.write(1);
  lcd.print("C ");
  delay(2000);
  lcd.clear();

   value=analogRead(LUX);
   volt=(value/1023.0)*5;
   lux=((2500/volt)-500)/3.3;
   delay(10);
  
   if(lux<100)
   {
     digitalWrite(light, HIGH);
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.println("LOW LIGHT ");
     Serial.println("LIGHT TURNED ON");
     Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" Degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
     Serial.write(26);
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Low light ");
     lcd.print(lux);
     lcd.print(" LUX");
     lcd.setCursor(0,1);
     lcd.print("Lights turned ON");
     check=1;
     test=1;
     delay(2000);
   }
   else
   {
    if(check==1)
    {
    
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.print("LIGHT TURNED OFF");
     Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
     Serial.write(26);
     check=0;
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("light int: ");
     lcd.print(lux);
     lcd.print(" LUX");
     lcd.setCursor(0,1);
     lcd.print("Lights turned OFF");
    }
     digitalWrite(light, LOW);
     test=0;
     delay(2000);
   }
  


  if(temperature > 40)
  {
    digitalWrite(fan, HIGH);
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.println("TEMPERATURE INCREASES FROM CRITICAL LEVEL");
     Serial.println("FAN TURNED ON");
     Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
  
     Serial.write(26);
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Temp increases ");
     lcd.setCursor(0,1);
     lcd.print("Fan Turned ON  ");
     delay(2000);
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Temperature");
     lcd.setCursor(0,1);
     lcd.print(temperature);
     lcd.write(1);
     lcd.print("C");
     check=2;
     test2=1;
     delay(2000);
   }
   else
   {
    if(check==2)
    {
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.println("FAN TURNED OFF");
      Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
    
     Serial.write(26);
     check=0;
     test1=0;
    }
   digitalWrite(fan, LOW);
   delay(1000);
   }

  if(humidity < 30)
  {
     digitalWrite(spray, HIGH);
     digitalWrite(13, HIGH);
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.println("HUNIDITY INCREASES FROM DEFINED LEVEL ");
     Serial.println("SPRAY TURNED ON");
      Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");  
    
     Serial.write(26);
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Humidity increas");
     lcd.setCursor(0,1);
     lcd.print("Spray Turned ON  ");
     delay(2000);
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Humidity");
     lcd.setCursor(0,1);
     lcd.print(humidity);
     lcd.print(" %");
     check=3;
     test2=1;
     delay(2000);
   }
   else
   {
    if(check==3)
    {
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.println("SPRAY TURNED OFF");
      Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
     Serial.write(26);
     check=0;
    }
     digitalWrite(13, LOW);
     digitalWrite(spray, LOW);
     test2=0;
     delay(2000);
  }
  
   if(digitalRead(soil)==1)
   {
    digitalWrite(motor, HIGH);
    Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
     Serial.println("WATER REQUIRED ");
     Serial.println("MOTOR TURNED ON ");
     Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
     Serial.write(26);
    check=4;
    test3=1;
    lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Water Required ");
     lcd.setCursor(0,1);
     lcd.print("Motor turned ON");
     delay(2000);
   }
    
  else
  {
    if(check==4)
    {
     Serial.println("AT+CMGF=1");\
     Serial.println("AT+CMGS=\"9784398922\"");
      Serial.println("WATER REQUIRED ");
     Serial.println("MOTOR TURNED OFF ");
      Serial.print("Light Intensity: ");
     Serial.print(lux);
     Serial.println(" LUX");
     Serial.print("Temperature: ");
     Serial.print(temperature);
     Serial.println(" degree Celsius");
     Serial.print("Humidity: ");
     Serial.print(humidity);
     Serial.println(" %");
     Serial.write(26);
     check=0;
    }
   digitalWrite(motor, LOW);
   test3=0;
  }
  delay(100);
}


Implemented by : P.Narmada & Team
                             Ph: 
                             whatsapp:9908414658
                             Bharat institute of engineering and Technology
                             Batch : 2014-18