PIR Sensor Introduction and How PIR Motion Sensor works with Arduino and Raspberry Pi

PIR Sensor is short for passive infrared sensor, which applies for projects that need to detect human or particle movement in a certain range, and it can also be referred as PIR(motion) sensor, or IR sensor. Since its powerful function and low-cost advantages, it has been adopted in tons of projects and widely accepted by the open-source hardware community for projects related to Arduino and raspberry pi. All this can help the beginners learn about PIR sensor more easily.

Image: PIR Motion Sensor – Large Lens version

In this article, I will introduce PIR Sensor with the following 7 sections and compare different PIR sensors that you can find at our online store. Hope it can help you understand PIRs better and pick the suitable PIR sensor for your projects.

1. What is PIR Sensor?

A passive infrared sensor is an electronic sensor that measures infrared light radiating from objects in its field of view. They are most often used in PIR-based motion detectors. PIR sensors are commonly used in security alarms and automatic lighting applications.

Technically, PIR is made of a pyroelectric sensor, which is able to detect different levels of infrared radiation. For example, Everything emits varied level radiation and the level of radiation will increase with the increase of the object’s temperature. Actually, the motion detector is separated by two parts since motion change is what we want, rather than IR level. The output will swing high or low if one half see different IR radiation than the other.

2. What does a PIR sensor detect?

As we all know that PIR sensors can be also refer to PID, which is short for passive infrared detectors. As you have learned about the technical term in the first part, PIR sensor can detect infrared radiation which is emitted by particles.

Generally, PIR can detect animal/human movement in a requirement range, which is determined by the spec of the specific sensor. The detector itself does not emit any energy but passively receives it, detects infrared radiation from the environment. Once there is infrared radiation from the human body/ particle with temperature, focusing on the optical system causes the pyroelectric device to generate a sudden electrical signal and an alarm is issued.

3. How does PIRs work?

The passive infrared alarm does not radiate energy to space but relies on receiving infrared radiation from the human body to make an alarm. Any object with temperature is constantly radiating infrared rays to the outside world. The surface temperature of the human body is 36-27 ° C, and most of its radiant energy is concentrated in the wavelength range of 8-12 um.

Passive infrared alarms can be classified into infrared detectors (infrared probes) and alarm control sections. The most widely used infrared detector is a pyroelectric detector, which is used as a sensor for converting human infrared radiation into electricity. If the human infrared radiation is directly irradiated on the detector, it will, of course, cause a temperature change to output a signal, but in doing so, the detection distance will not be far. In order to lengthen the detection distance of the detector, an optical system must be added to collect the infrared radiation, usually using a plastic optical reflection system or a Fresnel lens made of plastic as a focusing system for infrared radiation.

In the detection area, the infrared radiation energy of the human body through the clothing is received by the lens of the detector and focused on the pyroelectric sensor. When the human body (intruder) moves in this surveillance mode, it enters a certain field of view in sequence and then walks out of the field of view. The pyroelectric sensor sees the moving human body for a while and then does not see it, so the human body The infrared radiation constantly changes the temperature of the pyroelectric material so that it outputs a corresponding signal, which is the alarm signal.

4. The Range of PIR Sensor?

Indoor passive infrared: Detection distances range from 25 cm to 20 m.

Indoor curtain type: The detection distance ranges from 25 cm to 20 m.

Outdoor passive infrared: The detection distance ranges from 10 meters to 150 meters.

Outdoor passive infrared curtain detector: distance from 10 meters to 150 meters

5. What is the difference between PIR sensor and motion sensor?

The motion sensor is a device that can detect the movement of people or objects. In most applications, these sensors are mainly used to detect human activities in a specific area.

As it is capable of converting the motion it senses into electrical signals, the sensor either emits stimuli and monitors any changes reflected back, or acquires signals from the moving object itself. Some motion sensors will alarm when people or other objects invade and break the normal state, while others will alarm when they return to normal state after the invasion. Security systems all over the world rely on motion sensors to trigger alarms and/or automatic lighting switches, which are usually placed in relatively easy access to buildings, such as windows and gates.

PIR is only one of the technical methods to detect motion, so we will say PIR sensor is a subset of motion sensor. Because of PIR sensor are small in size, cheap in price, low-power and very easy to understand, which makes in quite popular. A lot of merchant will add “motion” between PIR sensor for the convenience of beginners.

6. Does PIR sensor work in daylight?

If you can understand the above introduction, I think you will know the answer to this question. Of course yes, they work fine in daylight.

7. How does PIRs work with Arduino and Raspberry Pi?

Since there are many projects using PIR with Arduino and also a lot of tutorials, I will not introduce the very basic one, but I will introduce the easiest one for you to get your hand on.

At Seeed Studio, we will recommend the following six PIR motion sensors. They are very easy to use. I will take Grove – PIR Motion Sensor as an example and compare with other PIR sensors to illustrate how does PIRs work with Arduino. For the detailed step by step tutorial, please refer to Seeed Studio’s PIR sensor wiki page.

Grove – PIR Motion Sensor

This Grove – PIR Motion Sensor(Passive Infrared Sensor) can detect infrared signal caused by motion. If the PIR sensor notices the infrared energy, the motion detector is triggered and the sensor outputs HIGH on its SIG pin. The detecting range and response speed can be adjusted by 2 potentiometers soldered on its circuit board, The response speed is from 0.3s – 25s, and max 6 meters of detecting range.

This is easy to use a motion sensor with Grove compatible interface. By Simply connecting it to Base Shield and programming it, it can be used as a suitable motion detector for Arduino projects.

The PIR Motion Sensor Series includes several products that will meet your different needs:

ProductMeasuring range
(theoretical value)
Grove – PIR Motion Sensor Max Distance:3-6m(3m by default)
Angle:< 120°
Measuring distance and holding time adjustable
response speed:0.3s – 25s
Grove-Adjustable PIR Motion Sensor Max Distance:3-6m
Angle:X=110° Y=90°
Measuring distance and holding time adjustable
Grove – mini PIR motion sensor Max Distance:2-5m(2m by default)
Angle:X=110° Y=90°
Sensitivity adjustable
PIR Motion Sensor – Large Lens version Max Distance:9m
Angle:< 120°
Large lens which can support long range and wide angle
2.54mm standard connector
PIR Motion sensor module Max Distance:3-7m
Angle:< 120°
Measuring distance adjustable
Mini PIR Motion Sensor Module Max Distance:7m
Angle:< 100°

Use PIR motion sensor with Arduino and Raspberry Pi

Connect PIR Sensor with Seeeduino
Connect PIR Sensor with Raspberry Pi

We prepared detailed tutorial and libraries in our wiki page help you use PIR sensor with Arduino and Raspberry Pi. With Grove, you can just plug and play to get started PIRs projects.

Arduino Projects Using PIR sensor

Burglar Alarm with PIR Motion Sensor

Image: Hackster.io
Burglar Alarm with PIR Motion Sensor

This project explains how to make a Burglar Alarm System using, a PIR Sensor, a Buzzer and an LED. It will detect an intrusion or any fire outbreak in your home.

Halloween Candy Machine using Grove – PIR Motion Sensor

When the PIR sensor detects someone nearby, the fingerprint sensor will start to blink one time per second, then you could place your finger on it. If you have stored your fingerprint before, the servo will work and give you candy. And if you don’t, you can’t get anything.

Wiring of Candy Machine

Christmas Tree using Grove – Adjustable PIR Motion Sensor

Grove – Adjustable PIR Motion Sensor is an easy to use Passive Infrared motion sensor, which can detect infrared object motion up to 3 meters. Any infrared object moves in its detecting range, the sensor outputs HIGH on its SIG pin. And you can adjust the SIG HIGH time up to 130s via the potentiometer, moreover, you can adjust the detect range via the other potentiometer.

Raspberry Pi projects using PIR Sensor

Image: Maker Pro

This tutorial will show you how to interface a PIR motion sensor with the Raspberry Pi and how to use the GPIO pins on it. The GPIO pins on the Raspberry Pi are critical when it comes to making a hardware project, whether it’s a robot or home automation system. In any case, you will have to use the GPIO (general purpose input/output) pins on the Raspberry Pi.

8. Other Related Sensors

Does the PIR sensor not suit your project needs? Here is an alternative motion sensor you can consider:

Microwave Sensor

Microwave sensors also known as Radar, RF or doppler sensors are electronic devices capable of detecting motion from walking, running to crawling in an outdoor environment by using electro-magnetic radiation.

It is able to detect motion by applying the Doppler effect and project microwaves which will bounce off surfaces and return to the sensor. It is able to measure and detect the amount of time for the signal to be reflected to the sensor which is known as echo time.

What is Echo time?

Echo time helps calculate the distances from any stationary object within the detection zone and establishes a baseline for the motion detector to work from.

With echo time, the sensor is able to detect if there is any movement in the detection zone as if a person is moving within the zone as the waves will be altered which changes the echo time. With the microwave sensor, it is able to do all this within less than a microsecond.

With the microwave sensor, it is more suitable in certain scenarios compared to the PIR sensor. For example, it is not affected by ambient temperature compared to the PIR sensor.
A microwave sensor is able to offer stable performance at temperatures as low as -20°C and as high as 45°C!

Want to find out more about the Microwave sensor and its comparison between the PIR sensor? You can check out our other blog on Which Arduino Motion Sensor to Use – Microwave or PIR Sensor!

Hope this blog post has helped you better understand how PIRs and motion sensors work and choose the most suitable one for your next project 🙂

Please follow and like us:

1 thought on “PIR Sensor Introduction and How PIR Motion Sensor works with Arduino and Raspberry Pi

Comments are closed.

Wordpress Social Share Plugin powered by Ultimatelysocial