PIR Sensor


PIR - passive infra-red - or PID - passive infrared detector - sensors are frequently used in instruder alert systems but can also be useful as a creative tool. Warm bodies give off infrared radiation and this is used to detect human movement within the range of a PIR sensor.
The PIR works by taking a snapshot of a room and then creating an alert if a sudden change in the infrared contour of the room occurs - i.e. if an intrusion has occured. This way static warm objects such as heaters and radiators can be ignored. There will be a threshold of change beneath which no alert will be given so that very slow movement or movement of small objects (such as pets) will not trigger the alarm.
PIRs can be obtained either as unhoused modules (as in fig. 1) or as encased units ready for installation in a burgular alarm system.
fig. 1
fig. 2 In this example I am using a PIR module from Cool Components UK. The red cable connects to 5 volts, brown to ground and black to an analog or digital input. A 'pull up' resistor should be connected between the input and 5 volts (black and red).

Rather than switching cleanly on and off when an intrusion is detected, this PIR's output switches from high to low when motion is detected but if no further motion is detected it jitters between high and low for just over a second before returning to its normal resting state of 'high'. In the context of a burgular alarm system this jittering is irrelevant as the alarm is already triggered and won't be 'un-triggered' but in a creative context we may want the intrusion alert to switch off when no further motion is detected. This jitter will have to be dealt with in the software. Typically the software you create should ignore further triggerings after the initial trigger for a period of time corresponding to the duration of this jitter period.
Fig. 3 provides an illustration of this jittering characteristic. Please bare in mind that the issues discussed here are in reference to the particular sensor I am using. Other PIR sensors may or may not exhibit these characteristics.

fig. 3



The video opposite provides audible evidence of how this jitter manifests after an intrusion has been detected.

I have built an adjustable wooden hinge to which I have attached the PIR. This hinge is attached to a microphone stand. Microphone stand adapters can be obtained from most music and electronics shops.

In this example on/off jitter has been filtered out in a more musical application. Motion will be detected within the entire room in front of the sensor. For the sake of clarity in this video motion takes immediately in front of the sensor.

PIRs are normally designed to detect movement within a wide field of view, typically 120 degrees. This high sensitivity will of course be useful in a burgular alarm system. This field of sensitivity can be narrowed by introducing some sort of baffle around the sensor as demonstrated in the video opposite.