What is a PIR sensor? Passive infrared sensors are common in many types of security systems. Our article will elucidate infrared radiation in motion detection, among other critical insights of PIR sensors.
What is a PIR sensor?
Fig 1:Motion detector keypad infrared alarm
They are infrared motion sensors that detect movement in the device’s detection range. Hence, these types of motion sensors are common in security alarms. Also, they are helpful in the common types of automatic lighting applications.
Among the primary advantages of the sensor, types include the following:
- They are easy to use and don’t easily wear out.
- Also, most have a wide lens range and consume low power.
- Thirdly, they are inexpensive and easy to interface with.
- Lastly, they are small in size and thus portable.
How PIRs Work?
Fig 2: Motion sensor on an open protected area.
PIRs are pyroelectric sensors capable of detecting a particular amount of infrared radiation. Note that almost all objects emit some radiation. Thus, PIRs use this property to identify the presence of an object.
A PIR sensor in motion sensors has two opposite slots. When in inactive mode, the two slots detect the same heat energy. Usually, this is the ambient temperature of the walls/surrounding room. However, the two slots experience a positive differential change when an animal passes, thus detecting the object’s presence.
What is a PIR sensor: Range of Different PIR Sensors
Fig 3: Motion infrared detector connected to the main alarm board.
- Indoor passive infrared and indoor curtain-type
These detect an object from 25cm to 20m.
- Outdoor passive infrared and outdoor passive infrared curtain detectors
Are motion detectors for objects from 10m to 150m.
How do PIRs work with Arduino and Raspberry Pi?
Fig 4: Adjustable infrared pyroelectric, PIR module Motion Sensor.
PIR-based motion detectors are compatible with Arduino and Rasberry Pi. The following is the procedure for setting up a simple passive motion sensor project with Arduino.
- You’ll need to connect terminal 2 of the Arduino UNO to the V(output pin) terminal of the PIR Sensor. Also, make sure you connect a 5V voltage source to the PIR sensor and ground the GND port.
- Next, open the Arduino IDE software and create a new sketch file by choosing ‘New.’
- Thirdly, enter the following code:
Figure 5: Arduino Code.
- Also, if necessary, adjust the sensor sensitivity and delay time using the two resistors on the sensor board.
- Next, make some motion near the sensor. If it detects some movement, the Arduino will respond by sending a signal via the serial port indicating the presence of motion.
- In this instance, the PIR sensor will delay for a short period. Essentially, this is to identify if there’s a new motion. If there isn’t, the Arduino indicates that the motion has ended.
Comparison of PIR Motion Sensor Series
As you have seen, the PIR sensor works similarly to microwave in motion detection applications. Also, in a nutshell, above are the insights of an active motion sensor. However, if you still have questions about the working of this electronic sensor, talk to us anytime.