Human Detection using PIR Sensor

Human Detection using PIR Sensor

Just Arduino Things | TW TechieTube

Detect a Human or an Animal and Make an Alarm system.



Principle:

Passive Infrared rays passing through Fresnel Lens and thus an interruption in the ray by a warm animal or human detects a signal. There are two slots in the sensor and the signal is the same through the slots, where the output value is the same by magnitude but opposite by graph.

Components Required:

  • Arduino UNO                 (1)                        
  • PIR Sensor                      (1)
  • Breadboard                     (As per Requirement)
  • Jumper Cables                (As per Requirement)
  • Arduino Bus Cable         (1)

Construction:

A Simple project to detect Human or Animal Interaction using the Passive IR Sensor.




Now connect the Sensors pins with the order given,

Vcc  - Arduino 5v/3.3v Pin
Gnd  - Arduino Gnd Pin
Data - Any Digital Pins except D1/D2 on UNO.
Incl.  an LED in D13 and Gnd for external value. 

As explained in the Video, the Code is written as Follows.

Code:


int led = 13;
int sensor = 2;

void setup() {
  pinMode(led, OUTPUT);
  pinMode(sensor, INPUT);
  Serial.begin(9600);
}

void loop() {
  int sensorval = digitalRead(sensor);
  Serial.println(sensorval);
  
  if (sensorval == HIGH) {
    digitalWrite(led, HIGH);
  }
  else {
    digitalWrite(led, LOW);
  }
}

Do make the Project, Take a Snap and Tag us @techwiz_india

Comments

Popular posts from this blog

Buzzer Alarm using Touch Sensor

Obstacle Detection using IR Sensor