You are on page 1of 580

("

}
cx: you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");

lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitoRGERGEr

serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);

lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Read temperature as Fahrenheit


float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}

");

bx: if(b > 900 ) // b= soil mois


{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");

delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!

// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}

");

else if(a<30 || q<500 )


{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");

lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();

int sensorValue = analogRead(mostureSensor);b=sensorValue;


// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);

");

Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}

Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);

pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.

Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor

serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{

}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)

{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);

");

Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);

lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{

");

digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);

lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);

Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);

");

// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");

Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);

");

lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);

lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);

lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);

");

//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");

");

// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}

if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);

lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);

Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);

lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

");

}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index


// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);

lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).

if (isnan(h) || isnan(t) || isnan(f)) {


Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{
lcd.clear();

// b= soil mois

");

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);

Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digi
#include "DHT.h"serial monitoRGERGEr
serial out
delay(100);
lcd.beDFGgin(16, 2); pinGDAFGADFGADFGADFGADFGADFGADFGMode(ledPin, OUTPUT);pin
Mode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");

delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;

}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);

");

lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;

// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 )
{

// b= soil mois

");

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");

lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius

float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);

");

}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);

lcd.print("Mon & Auto


delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();

");

lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");

// Reading temperature or humidity takes about 250 milliseconds!


// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);

");

}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);

if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);

Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{

ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");

");

digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);

}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le

dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {

xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();

");

lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.

Serial.print(incoming_char); //Print the incoming character to the terminal.


Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}

#include "DHT.h"serial monitor


serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()

{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);

");

if(a > 29 || q>500 ) // a = temp


{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{

if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);

}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{

delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);

");

q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}

}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");

digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();

}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);

lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )

");

{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);

lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");

delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");

Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");

");

digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);

Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();

");

lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");

digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");

lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);

lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);

");

Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");

delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);

Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");

");

Serial.print("pump off: ");


// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);

}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();

lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);

lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{

");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");

lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index
// Must send in temp in Fahrenheit!

float hi = dht.computeHeatIndex(f, h);


Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");

");

delay(2000);
}
else if(b < 900 )
{

// b= soil mois

digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='b')
{ Serial.println(incoming_char);

lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
#include "DHT.h"serial monitor
serial out
delay(100);
lcd.begin(16, 2); pinMode(ledPin, OUTPUT);pinMode(ledPin1, OUTPUT);pinMode(le
dPin2, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(gas, INPUT);
pinMode(xxc, INPUT);
Serial.println("DHTxx test!");
lcd.setCursor(1, 0);
lcd.print("uC Green House");
lcd.setCursor(1, 1);
lcd.print("Mon & Auto
");
delay(2000);lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Made By");
lcd.setCursor(1, 1);
lcd.print(" ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mahesh");
lcd.setCursor(1, 1);
lcd.print("120610109008 ");

delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Kartik");
lcd.setCursor(1, 1);
lcd.print("120610109040 ");
delay(5000); lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Mihir");
lcd.setCursor(1, 1);
lcd.print("130613109006 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Siddharth");
lcd.setCursor(1, 1);
lcd.print("130613109008 ");
delay(5000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Guided By");
lcd.setCursor(1, 1);
lcd.print("Prof. MD Patel");
delay(5000);
lcd.clear();
dht.begin();
}
void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
delay(700);
}
void hh()
{
}
void loop() {
xc=analogRead(xxc);
if(xc==0)
{
ax: lcd.clear();
int sensorValue = analogRead(mostureSensor);b=sensorValue;
// print out the value you read:
Serial.println(sensorValue);Serial.print(" %\t");
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();
// Read temperature as Fahrenheit
float f = dht.readTemperature(true);
a=t;
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;

}
// Compute heat index
// Must send in temp in Fahrenheit!
float hi = dht.computeHeatIndex(f, h);
Serial.print("Humidity: ");
Serial.print(h);
lcd.setCursor(0, 0);
lcd.print("Hum:");
lcd.setCursor(4, 0);
lcd.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
lcd.setCursor(10, 0);
lcd.print("Tmp:");
lcd.setCursor(14, 0);
lcd.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hi);
Serial.println(" *F");
lcd.setCursor(1, 1);
lcd.print(b);
lcd.setCursor(5, 1);
lcd.print("
delay(2000);
q=analogRead(gas);
Serial.print(" \t");
Serial.print("gas: ");
Serial.print(q);
if(a > 29 || q>500 ) // a = temp
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Low Temp");
lcd.setCursor(1, 1);
lcd.print("Exhaust on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("Fan on");
delay(2000);
}
else if(a<30 || q<500 )
{
digitalWrite(ledPin, LOW);
}
bx: if(b > 900 ) // b= soil mois
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);

");

lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(b < 900 ) // b= soil mois
{
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
// delay(2000);
}
cx: int c = digitalRead(BUTTON);
Serial.print(c);
//delay(5000);
if(c==HIGH )
{lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Day Light");
lcd.setCursor(1, 1);
lcd.print("Off");
digitalWrite(ledPin2, HIGH);
// delay(2000);
}
else if(c==LOW )
{
digitalWrite(ledPin2, LOW);
// delay(2000);
}
}
else
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial po
rt.
Serial.print(incoming_char); //Print the incoming character to the terminal.
Serial.print(" \t");
Serial.print("sms detect ");
Serial.println(incoming_char);
}
Serial.println(incoming_char, DEC);
// Wait a few seconds between measurements.
// delay(2000);
if(incoming_char=='a')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);

}
else if(incoming_char=='b')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin1, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
if(incoming_char=='c')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Dry Soil");
lcd.setCursor(1, 1);
lcd.print("Pump on");
digitalWrite(ledPin, HIGH);
Serial.print(" %\t");
Serial.print("pump on: ");
delay(2000);
}
else if(incoming_char=='d')
{ Serial.println(incoming_char);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("PumGAERGAERGAERGp ERGAERGAEon");
digitalWrite(ledPin, LOW);
AERGAERGAERG
Serial.print(" %\t");
SeriDRFGDFGDZARFGal.print("pump off: ");
delay(2000);
}
}
}
talWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
.print("Pump on");
digitalWrite(ledPin, LOW);
Serial.print(" %\t");
Serial.print("pump off: ");
delay(2000);
}
}
}
}