Ruth RufinaJayasudh RAyeshaAnju soman T
Created June 30, 2018

Greenhouse farming connected to IoT

The feature of this project includes monitoring temperature, humidity, motion, rain water harvesting, indicating water level, ph of plant.

48
Greenhouse farming connected to IoT

Things used in this project

Hardware components

WIZ750SR
WIZnet WIZ750SR
Used as a gateway
×1
Arduino UNO
Arduino UNO
Sensor datas
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
Monitoring Temperature
×1
SparkFun Soil Moisture Sensor (with Screw Terminals)
SparkFun Soil Moisture Sensor (with Screw Terminals)
For measuring moisture content of the soil
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
For sensing motion of animals near fields
×1
Breadboard (generic)
Breadboard (generic)
×1
DC motor (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

hercules
ISP tool
mbed
Arm mbed

Story

Read more

Schematics

precision-farming-1080x380_DofgTNYU9V.png

Code

Arduino Code

Arduino
This is the Arduino code . Connect all the sensors as per the circuit diagram and burn the code using Arduino UNO software.
#include<SoftwareSerial.h>
#include<dht.h>
#include"DHT.h"
#definedht_apin A2
dht DHT;
intPIR_output=5;
int led=13;
intbuzzer=12;
SoftwareSerialmySerial(10, 11); // RX, TX
intnRainIn=A1;
intnRainDigitalOut = 2;
intnRainVal;
booleanbIsRaining = false;
StringstrRaining;
const intVAL_PROBE = 0; //Analog pin 0
const intMOISTURE_LEVEL = 500; // the value after the LED goes on
void setup(){
// Open serial communications and wait forport to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect.Needed for native USB port only
}
// set the data rate for the SoftwareSerialport
mySerial.begin(9600);
pinMode(2,OUTPUT);
pinMode(PIR_output,INPUT);
pinMode(led,OUTPUT);
pinMode(buzzer,OUTPUT);
pinMode(8,OUTPUT);//motor
pinMode(7,INPUT);//moisture
}
void loop(){
motor();
rain();
temp();
pir();
}
void rain()
{
nRainVal = analogRead(A1);
bIsRaining = !(digitalRead(nRainDigitalOut));//Checks Digital Pin 2, Output D0
if(nRainVal<450){ //Checks Digital Pin 2, Output D0
strRaining = "yes";
}
else
{
strRaining = "no";
}
mySerial.print("Raining: ");
mySerial.print(strRaining); 
mySerial.print(" Moisture Level:");
mySerial.println(nRainVal); 
delay(2000);
}
void temp(){
DHT.read11(dht_apin);
mySerial.print("Current humidity=");
mySerial.print(DHT.humidity);
mySerial.print("% ");
mySerial.print("Temperature= ");
mySerial.print(DHT.temperature);
mySerial.print("C ");
delay(5000);
}
void pir(){
if(digitalRead(5) ==HIGH)
{
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
mySerial.println("motiondetected");
}
else{
digitalWrite(13,LOW);
digitalWrite(12,LOW);
mySerial.println(" no motiondetected");
}
}
void motor()
{
int moisture= analogRead(VAL_PROBE);
mySerial.print("Moisture= ");
mySerial.println(moisture);
if(moisture< MOISTURE_LEVEL)
{
digitalWrite(8,LOW);
}
else
{
digitalWrite(8,HIGH);
}
}
MBED COMPILER CODE
#include ”mbed.h”
DigitalOut myled(LED1);
Serialpc(USBTX,USBRX);
Serialdevice(D1,D0);
intmain() {
while(1) {
while(device.readable())
pc.putc(device.getc());
while(pc.readable())
 device.putc(pc.getc());
}
}

Credits

Ruth Rufina

Ruth Rufina

1 project • 2 followers
Jayasudh R

Jayasudh R

0 projects • 2 followers
Ayesha

Ayesha

0 projects • 1 follower
Anju soman T

Anju soman T

0 projects • 2 followers

Comments