Things used in this project

Schematics

Arduino Setup
B8wanslyj8njtbhjbuja
Interfaces
F8snr9zijocbv079imxw

Code

Arduino CodeArduino
//#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

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Developing a Low-Cost Microcentrifuge Using E-Waste
Intermediate
  • 109
  • 3

Work in progress

Quality microcentrifuges are generally too expensive for most people to afford. This project aims to provide a low-cost alternative.

Solar Smart Greenhouse Using Vertical Aquaponic Towers
Intermediate
  • 2,847
  • 42

Work in progress

Feed your family with 22 sqm greenhousing by combining permaculture, aquaponic vertical towers and IoT.

Flightduino 101
Intermediate
  • 353
  • 7

Full instructions

A drone project that uses the Neural Pattern Recognition Module and other aspects of the Curie Module to advantage for creating a cool drone

DIY Smart Lamp - controlled by toggle switch and Alexa
Intermediate
  • 277
  • 5

Full instructions

Build a smart lamp that can be controlled by flipping a switch and Alexa, for only $35.

Arduino 101 BLE App
Intermediate
  • 1,826
  • 23

Work in progress

I want to show you how to make an application and connect it with the Arduino 101 platform for Internet of things applications.

Drop of Life
Intermediate
  • 658
  • 17

Full instructions

A display to remind me when I can donate blood and save lives, powered by the Red Cross API and Particle.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback