PIR Sensor Working Principle

Are you curious about how motion sensors work? If the answer is Yes! then check out this blog post which talks everything about PIR sensors like the workings of a PIR sensor, and exploring its working principle and range of detection. We also cover how to connect it with an Arduino and what exactly a PIR sensor detects. Join us as we explore the fascinating world of PIR sensors!

PIR sensors are used in a wide variety of applications such as lighting control, smart home, and IoT applications, Automatic door opening system, Security alarms based on PIR sensors, and Human detection robots in search and rescue operations in disasters, multifunction printers, etc. So let's understand what is a PIR sensor and how it works so we can use it in our projects.

Β 

PIR Sensor Working

What is a PIR Sensor?

PIR sensor is a small low-priced Passive infrared motion detector sensor. As the name suggests it doesn’t emit radiation (unlike an Infrared (IR) sensor which emits infrared radiation) but it detects the changes in infrared radiation of the source. It's very facile to use and hence used in diverse applications.

Β 

PIR sensor

PIR Sensor Working Principle

It works on the principle that whenever it detects a change in infrared radiation, it generates a digital output signal.

PIR Sensor Working Principle

Β 

PIR sensor consists of a fresnel lens, pyroelectric material (metal can and a rectangular crystal). A Fresnel lens which is made of high-density polythene concentrates the incoming infrared radiations so that they fall on the pyroelectric material. Metal can help to make the sensor more immune to temperature, humidity, and noise. Pyroelectric material detects the changes in infrared radiation and generates an output signal.

Β 

Β 

It is made up of 2 slots of special material sensitive to IR. When a person comes in the range of the sensor, the first slot creates a positive differential voltage and when the person leaves the second slot creates a negative differential voltage. These changes are detected.

Β 

This output signal is further processed by the external circuitry and converted to digital output.

What does the PIR sensor do?

In a nutshell, the PIR sensor detects motion and gives a corresponding digital output.

How to connect the PIR sensor with Arduino?

PIR Sensor has 3 pins: VCC or 5V, Gnd, and a digital output pin. This digital pin is used to communicate with the microcontroller.

Connection diagram

Β 

How to connect the PIR sensor with Arduino

Β 

As shown in the image, Vcc goes to 5V, Gnd goes to Gnd, and Output is connected to digital input pin 2 of Arduino.Β 

Whenever there is motion detected output pin of the PIR motion sensor goes high. So based on this result we can read the digital input pin 2 of the Arduino and take the action such as glowing LED.

Β 

Β 

You can put the PIR sensor in two modes as shown in the above image the jumper is used to connect it in H mode repeatable trigger and L mode non-repeatable trigger. In retriggering or H mode, the LED stays on while the person is moving in the PIR sensor range. Whereas in non-retriggering or L mode, LED blinks or turns on and off every 1 second when a person is moving in the PIR range.

Also, there are two potentiometers of 1M ohm resistance available for adjusting sensitivity and time delay as shown in the image.Β 

The sensitivity pot is used to adjust the distance from 2-5m and the time delay pot is used to adjust the

time for which the output pin should remain high when the motion is detected.

You can set the range from 5 seconds to 5 minutes. Turn it fully anti-clock so

that you can decide the time delay from Arduino.

Below is the Arduino code to detect motion using the PIR sensor:

Arduino code for PIR Sensor


 int led = 13;    // led is connected to pin 13

int sensor = 2;  // output pin of the sensor is connected to digital pin 2

int val = 0;     // variable to store the sensor status (value)

void setup()

{

    pinMode(led, OUTPUT);   // initialise LED as an output

    pinMode(sensor, INPUT); // initialise sensor as an input

    Serial.begin(9600);     // initialise serial

}

void loop()

{

    val = digitalRead(sensor); // read sensor value

    if (val == HIGH)

    {                            // check if the sensor is HIGH

        digitalWrite(led, HIGH); // turn LED ON

        delay(1000);             // delay 1000 milliseconds

        Serial.println("Motion detected!");

    }

    else

    {

        digitalWrite(led, LOW); // if val is low , led pin set to low

        delay(1000);            // delay for 1000 second

        Serial.println("Motion stopped!");

    }

}

What does a PIR sensor detect?

Β PIR sensors can detect human or animal motion. Humans emit infrared radiation. When a human comes into the sensing range of the PIR sensor, these changes in radiations are detected by the PIR sensor which causes the output of the sensor to go high.

What does a PIR sensor detect

PIR Sensor Range

PIR sensors are available in a wide range of options:

Indoor curtain-type PIR sensor: Range is between 25 cm to 20 m

Indoor passive infrared: The range is between 25 cm to 20 m

Outdoor passive infrared: The range is between 10 m to 150 m,

Outdoor passive infrared curtain detector: Range is between 10 m to 150 m.

Β 

Conclusion

In this blog post, we have learned the PIR sensor is a highly versatile and reliable device that is perfect for motion detection applications. With its simple working principle and easy-to-use interface, it can detect motion and presence with great accuracy. Whether you want to detect intruders, automate lighting, or trigger alarms, a PIR sensor is a must-have in your toolkit. By following the steps outlined in this guide, you can easily connect your PIR sensor to an Arduino and start detecting motion right away. So, what are you waiting for? Get your PIR sensor today and experience the power of motion detection for yourself!

Β 

Β 

If you appreciate our work don't forget to share this post and leave your opinion in the comment box.

Β 

Please do check out otherΒ blog postsΒ aboutΒ Types of Sensors in IoTΒ ,Β Interfacing Proximity Sensors with ArduinoΒ andΒ How DHT11 and DHT22 Sensors Work and interfacing it with a MCU on Proteus

Β 

Make sure you check out our wide range ofΒ products and collectionsΒ (we offer some excitingΒ deals!)

Product Showcase

See more

Frequently Asked Questions

1. What does an PIR sensor do?

The PIR sensor is a device that detects motion by measuring the infrared radiation emanating from the object. It employs a pyroelectric sensor that transforms the infrared radiation into voltage, which is then processed to identify the movement. Once the object enters its radius, it recognizes the alteration in infrared radiation and emits an output signal, which triggers various devices such as alarms, lights, and occupancy sensors. These sensors are highly utilized in the security, lighting, and occupancy sensing industries.

2. Does PIR sensor work in sunlight?

PIR (Passive Infrared) sensors detect changes in heat emitted by objects within their range and are not affected by visible light. However, direct sunlight hitting the sensor may cause it to generate false readings since sunlight emits heat and can trigger the sensor. Therefore, PIR sensors should be shielded or placed in a location where they are not exposed to direct sunlight in order to function correctly.

3. Does PIR work in the dark?

Passive Infrared (PIR) sensors detect infrared radiation emitted by warm bodies and can operate in complete darkness. PIR sensors do not rely on visible light to detect motion or heat signatures, making them an effective solution for detecting intruders or movement in low-light or dark environments. PIR sensors are commonly used in security systems, lighting controls, and other applications where motion detection is necessary in the absence of visible light.

Components and Supplies

Related Products

You May Also Like To Read:

Frequently Asked Questions

1. What does an PIR sensor do?

The PIR sensor is a device that detects motion by measuring the infrared radiation emanating from the object. It employs a pyroelectric sensor that transforms the infrared radiation into voltage, which is then processed to identify the movement. Once the object enters its radius, it recognizes the alteration in infrared radiation and emits an output signal, which triggers various devices such as alarms, lights, and occupancy sensors. These sensors are highly utilized in the security, lighting, and occupancy sensing industries.

2. Does PIR sensor work in sunlight?

PIR (Passive Infrared) sensors detect changes in heat emitted by objects within their range and are not affected by visible light. However, direct sunlight hitting the sensor may cause it to generate false readings since sunlight emits heat and can trigger the sensor. Therefore, PIR sensors should be shielded or placed in a location where they are not exposed to direct sunlight in order to function correctly.

3. Does PIR work in the dark?

Passive Infrared (PIR) sensors detect infrared radiation emitted by warm bodies and can operate in complete darkness. PIR sensors do not rely on visible light to detect motion or heat signatures, making them an effective solution for detecting intruders or movement in low-light or dark environments. PIR sensors are commonly used in security systems, lighting controls, and other applications where motion detection is necessary in the absence of visible light.

Leave a comment

Please note, comments must be approved before they are published