Kshitij MinhasAlbert SchweitzerKay AnarEzra Erani
Published

Greenhouse Plant Monitoring

Device that gives you a flash briefing of the health of your plants

IntermediateWork in progress2,226
Greenhouse Plant Monitoring

Things used in this project

Hardware components

PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Temperature Sensor
Temperature Sensor
×1
Humidity and Temperature Sensor
Adafruit Humidity and Temperature Sensor
×1

Software apps and online services

AWS Lambda
Amazon Web Services AWS Lambda
AWS IoT
Amazon Web Services AWS IoT

Story

Read more

Schematics

Arduino Setup

Interfaces

Code

Arduino Code

Arduino
//#include <TH02_dev.h>
#include "Arduino.h"
#include "Wire.h"
#define PIR_MOTION_SENSOR 7 //Use pin 7 to receive the signal from the module
const int analogInPin0 = A0;  // light
const int analogInPin1 = A1;  // UV
const int analogInPin2 = A2;  //humidity

int lightValue = 0;        
int uvValue = 0;
int moistureValue = 0;

void setup()
{
      Serial.begin(9600);
      TH02.begin();
      pinMode(PIR_MOTION_SENSOR, INPUT);
}

void loop()
{
    if(isPeopleDetected())//if it detects the moving people?
        {
          system("/home/root/x.sh \"Welcome to Obama Care for Plants\"");
          lightValue = analogRead(analogInPin0);
          uvValue = analogRead(analogInPin1);
          moistureValue = analogRead(analogInPin2);
          float temperValue = TH02.ReadTemperature();
          float humidityValue = TH02.ReadHumidity();

          system("/home/root/x.sh \"Your Light exposure is\"");
          if(lightValue>=300){
          system("/home/root/x.sh \" good\"");
          }
          else system("/home/root/x.sh \" bad\"");
          
          system("/home/root/x.sh \" UV exposure is\"");
          if(uvValue<=30){
          system("/home/root/x.sh \" good\"");
          }
          else system("/home/root/x.sh \" bad\"");
          
          system("/home/root/x.sh \" Soil Moisture is \"");
          if(moistureValue>=30){
          system("/home/root/x.sh \" good\"");
          }
          else system("/home/root/x.sh \" bad\"");
   
          system("/home/root/x.sh \" Temperature is \"");
          if(temperValue>=10){
          system("/home/root/x.sh \" comfy\"");
          }
          else system("/home/root/x.sh \" not comfy\"");
       
          system("/home/root/x.sh \" Air Humidity is\"");
          if(humidityValue>=15){
          system("/home/root/x.sh \" good\"");
          }
          else system("/home/root/x.sh \" bad\"");

          system("/home/root/x.sh \" Thank you for visiting obama care's green house\"");
          
        }
        else
        {
          lightValue = analogRead(analogInPin0);
          uvValue = analogRead(analogInPin1);
          moistureValue = analogRead(analogInPin2);
          float temperValue = TH02.ReadTemperature();
          float humidityValue = TH02.ReadHumidity();
          String command = "/home/root/y.sh";

          command += " " + (int)humidityValue;
          command += " " + uvValue;
          command += " " + moistureValue;
          command += " " + lightValue;
          command += " " + (int)temperValue;
           
          system(command.buffer);
          sleep(10000);
        }
    }

boolean isPeopleDetected()
{
    int sensorValue = digitalRead(PIR_MOTION_SENSOR);
    if(sensorValue == HIGH)//if the sensor value is HIGH?
    {
        return true;//yes,return true
    }
    else
    {
        return false;//no,return false
    }
}

Credits

Kshitij Minhas

Kshitij Minhas

1 project • 4 followers
Albert Schweitzer

Albert Schweitzer

6 projects • 6 followers
Kay Anar

Kay Anar

2 projects • 4 followers
Ezra Erani

Ezra Erani

2 projects • 3 followers

Comments