Surilli
Published © LGPL

Detect Motion using PIR Motion Sensor and Surilli GSM

PIR motion detector is used to sense movement. They are commonly used in burglar alarms and automatically-activated lightning systems.

BeginnerFull instructions provided15 minutes1,200
Detect Motion using PIR Motion Sensor and Surilli GSM

Things used in this project

Hardware components

Surilli GSM
Surilli GSM
×1
Jumper wires (generic)
Jumper wires (generic)
×3
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Detect Motion in Your Surrounding Using PIR Motion Sensor

Code

MotionSensor

C/C++
int motion_Sensor_Pin = 10;//Motion sensor output pin is connected to pin 10 of surilli.
int Led_Pin = 13;//built-in LED pin is on pin number 13.
void setup()
{
    pinMode (motion_Sensor_Pin,INPUT);//output from motion sensor is declared as input for surilli.
    pinMode (Led_Pin, OUTPUT);//built-in LED is declared as output
    Serial.begin(9600);
    digitalWrite (Led_Pin,LOW);//initially built-in LED is set LOW.
}

void loop ()
{
      delay(1000); //this delay is to let the sensor settle down before taking a reading
      int sensor_value = digitalRead(motion_Sensor_Pin);//read the value from motion sensor and stores in variable "sensor-Value"
  if(sensor_value == 1)
    {
      digitalWrite(Led_Pin,HIGH);//if sensor value is 1 then built-in LED will turn OFF.(LED inverted)
      Serial.println("Motion Detected");
      Serial.println(sensor_value);//prints digital value from sensor.
     // delay(100);
    }
else if (sensor_value == 0)
    {
      digitalWrite(Led_Pin,LOW);//if sensor value is 0 then built-in LED will turn ON.
      Serial.println("Searching For Motion");
      Serial.println(sensor_value);//prints digital value from sensor.
      //delay(100);
    }
}

Credits

Surilli

Surilli

196 projects • 62 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments