Things used in this project

Hardware components:
Intel.web.720.405
Intel Edison
×1
13285 01
PIR Motion Sensor (generic)
×1
10988 01
Temperature Sensor
×1
1899 00
Adafruit Humidity and Temperature Sensor
×1
Software apps and online services:
Screen%20shot%202015 07 20%20at%206.10.26%20pm
Amazon Web Services AWS Lambda
Ha 2up iot
Amazon Web Services AWS IoT

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

Personal Healthcare Assistant PHA
Intermediate
  • 1,830
  • 116

Full instructions

Wearable for monitoring the health condition of patients who have suffered or are in risk of having a cardiac arrest.

Convo-Care: Alexa-Controlled E-Health App
Intermediate
  • 239
  • 8

Protip

Convo-Care provides a better e-health experience through a conversational UI.

Robot for supercool indoor navigation
Intermediate
  • 663
  • 11

Full instructions

The robot navigates indoor, in a pre-defined path, with high accuracy, and allows its real-time tracking on a phone. No GPS, No WiFi, No Map

OIKOS
Intermediate
  • 239
  • 6

Work in progress

OIKOS is a smart social-connected home for everyone. Our goal is to put the society in connection with homeless through IoT.

OIKOS

OIKOS NGO TEAM

Rocky Rover: Robotic Vision System PixyCam & Arduino 101
Intermediate
  • 4,359
  • 47

Full instructions

Using PixyCam and Intel Arduino 101 to drive this rover. Easy Robotic Vision system using PixyCam, rover reacts to the ball using Pan/Tilt.

Smart and Safe Cabinets
Intermediate
  • 424
  • 8

Full instructions

With 41% of poisonings happening to children under 4, more needs to be done. We use Amazon Alexa and Intel IoT to lock and unlock cabinets.

Smart and Safe Cabinets

Magic Smoke Replacement Team

ProjectsCommunitiesContestsLiveFree StoreBlogAdd projectSign up / Login
Respect project