Fig. 1: Prototype of Arduino based Greenhouse Monitoring System
Fig. 2: Block Diagram of Arduino based Greenhouse Monitoring 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.
Fig. 3: Circuit Diagram of Light Sensing Voltage Divider Network
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.
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 sensor 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.
Fig. 4: Circuit Diagram of Soil Moisture Sensor
Circuit Description & Programming
Circuit Description
In this system a 16×2 LCD is used for displaying status for all operations like Motor turned on or off, temperature, humidity and light status. The LCD’s data pins are connected in 4-bit mode (data pin d5, d6, d7, d8 pin of LCD is directly connected with pin no. 4, 5, 6, 7 of Arduino and command pin of LCD’s Rs and En is connected with pin no. 2, 3 of Arduino). LDR is used for sensing light intensity and its output is connected to Analog pin A0 of Arduino while the artificial light is connected using relay. The relay is operated by using ULN2003 and controlled using pin number 10 of arduino. Humidity and temperature sensors are used for sensing humidity and temperature that are connected directly with Analog pin A1 of Arduino. Fan is directly connected with pin 8 of Arduino and CFL light (in place of Sprays) is connected with pin 11 of arduino by using Relay. Water pump is also connected by using relay and is controlled by Arduino’s pin number 12 and the sensor for measuring the soil moisture, pin number 9 is used.
GSM module is also connected with this circuit for sensing message alert of the status to be sent to the owner. GSM module’s Rx pin is directly connected with Tx pin of Arduino. For detailed information of sending message using GSM please have a look on our previous projects related to Sending Messages using GSM module and Arduino.
Programming
Programming part of this project is very easy. In this program DHT library is used for reading the Humidity and Temperature from the humidity and temperature sensor (DHT11 basic), which is displayed on LCD and sent to the owner by using GSM module. Here for sending message, 9600 baud rate is used by using class “Serial.begin(9600)”.
Circuit Diagram
For circuit kindly refer to the Circuit Diagram Tab of Green House Monitoring and Controlling System
Components Used
1. Arduino Pro Mini
Project Source 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); }###
Circuit Diagrams
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.