Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
danushi13
Published © GPL3+

The PIR Sensor

The PIR is the shorten form of Passive Infared Sensor. It detects movement. You can make anything start to work when someone is moving.

BeginnerProtip2,115
The PIR Sensor

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

PIR Schematic

Connect the jumper wires as shown

Code

Code for PIR Sensor

Arduino
Paste it in the Arduino IDE or Download the file and open it with tsoftware
void setup() {
  pinMode (2,INPUT); // The PIR Sensor
  pinMode (13,OUTPUT); // The LED

}

void loop() {
  int val=digitalRead(2);
if (val==1){ //When object passed
  digitalWrite(13,HIGH);//ON
  delay(10000);         //Wait
  digitalWrite(13,LOW); //Off
}else{      // When No Object Passed
  digitalWrite(13,LOW); //off
}
}

Credits

danushi13
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.