Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

PIR SENSOR

1. Identify the parts of the PIR


sensor
Objectives: 2.Determine the technical
specifications of PIR sensor
3. Apply the PIR sensor in
detecting motion using the
Arduino platform
What does PIR mean?
• Infrared radiation (IR), sometimes
referred to simply as infrared, is a
region of the electromagnetic
What is radiation spectrum where
wavelengths range from about 700
infrared? nanometers (nm) to 1 millimeter
(mm). Infrared waves are longer than
visible light waves but shorter than
radio waves.
PIR Sensor
• Pyroelectric/Passive Infrared Sensor
• The passive infrared (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.
PIR Sensor
Fresnel Lenses
How PIR sensor detect motion
Changing Sensitivity and Delay time
• There are two potentiometers on PIR
motion sensors board: Sensitivity Adjust
and Time delay adjust.
• It is possible to make PIR more sensitive
or Non-Sensitive Enough. The maximum
sensitivity can be achieved up to 6 meters.
• Time Delay Adjust potentiometer is used sensivity
to adjust the time shown in above timing
Time delay
diagrams.
• Clockwise Movement makes PIR more
Sensitive.
Program code:
const int PIR_SENSOR_PIN = 2; /* PIR sensor O/P pin */
const int redLED= 3;
const int blueLED= 5;
const int greenLED= 6;
int warm_up;

void setup(){
pinMode(PIR_SENSOR_PIN, INPUT);
Serial.begin(9600); /* Define baud rate for serial communication */
delay(2000); /* Power On Warm Up Delay */
}
Program code:
void loop(){
int sensor_output;
sensor_output = digitalRead(PIR_SENSOR_PIN);
if( sensor_output == LOW )
{
if( warm_up == 1 )
{
Serial.print("Warming Up\n\n");
warm_up = 0;
analogWrite(redLED, 0);
analogWrite(blueLED, 255);
analogWrite(greenLED, 0);
delay(2000);
Program code:
Serial.print("No object in sight\n\n");
analogWrite(redLED, 0);
analogWrite(blueLED, 0);
analogWrite(greenLED, 255);
delay(1000);
} else {
Serial.print("Object detected\n\n");
analogWrite(redLED, 255);
analogWrite(blueLED, 0);
analogWrite(greenLED, 0);
warm_up = 1;
delay(1000); }
}

You might also like