There are thousands of Sensors incorporated with Microcontroller that can sense the environment, one of these sensors is PIR MOTION SENSOR.

PIR sensors are more complicated than many of the other sensors explained in these tutorials (like photocells, FSRs and tilt switches) because there are multiple variables that affect the sensors input and output. To begin explaining how a basic sensor works, we'll use this rather nice diagram

The PIR sensor itself has two slots in it, each slot is made of a special material that is sensitive to IR. The lens used here is not really doing much and so we see that the two slots can 'see' out past some distance (basically the sensitivity of the sensor). When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected.

MATERIALSThere are thousands of Sensors incorporated with Microcontroller that can sense the environment, one of these sensors is PIR MOTION SENSOR.

PIR sensors are more complicated than many of the other sensors explained in these tutorials (like photocells, FSRs and tilt switches) because there are multiple variables that affect the sensors input and output. To begin explaining how a basic sensor works, we'll use this rather nice diagram

The PIR sensor itself has two slots in it, each slot is made of a special material that is sensitive to IR. The lens used here is not really doing much and so we see that the two slots can 'see' out past some distance (basically the sensitivity of the sensor). When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected.





MATERIALS
1. PIR motion sensor
2. Arduino Uno developmental board
3. Jumper wires
4. LED
5. PC with arduino IDE



CODE:

*Arduino motion sensor Tutorial
created by Btech microPro
11th July 2017
*/
int sensor=12;//declear pin 12 of the arduino as the sensor pin
int led=13;//declear pin 13 as the led pin
void setup() {
pinMode(12, INPUT);//initializing pin 12 as an input pin
pinMode(13,OUTPUT); //initilizing pin 13 as an output pin
}

void loop() {
sensor=digitalRead(12);//read the value of pin 12
if(sensor==HIGH)//checking sensor{
  digitalWrite(13,HIGH);//putting on the led
  delay( 3000);//wait for 3 seconds
  digitalWrite(13,LOW);//put the led off
}


Post a Comment

 
Top