PIR Sensor – Basics & Applications

What is a PIR Sensor?

PIR sensor detects a human being moving around within approximately 10m from the sensor. This is an average value, as the actual detection range is between 5m and 12m.PIR are fundamentally made of a pyro electric sensor, which can detect levels of infrared radiation. For numerous essential projects or items that need to discover when an individual has left or entered the area. PIR sensors are incredible, they are flat control and minimal effort, have a wide lens range, and are simple to interface with.

PIR Sensor

Most PIR sensors have a 3-pin connection at the side or bottom. One pin will be ground, another will be signal and the last pin will be power. Power is usually up to 5V. Sometimes bigger modules don’t have direct output and instead just operate a relay which case there is ground, power and the two switch associations. Interfacing PIR with microcontroller is very easy and simple. The PIR acts as a digital output so all you need to do is listening for the pin to flip high or low. The motion can be detected by checking for a high signal on a single I/O pin. Once the sensor warms up the output will remain low until there is motion, at which time the output will swing high for a couple of seconds, then return low. If motion continues the output will cycle in this manner until the sensors line of sight of still again. The PIR sensor needs a warm-up time with a specific end goal to capacity fittingly. This is because of the settling time included in studying nature’s domain. This could be anyplace from 10-60 seconds.

Throughout this time there ought to be as little movement as could reasonably be expected in the sensors field of perspective.

A video on PIR Sensor

Following is the video on PIR sensor

7 areas of Applications of PIR Sensors

All outdoor Lights

Lift Lobby

Multi Apartment Complexes

Common staircases

For Basement or Covered Parking Area

Shopping Malls

For garden lights

5 Features

Complete with PIR, Motion Detection.

Dual Element Sensor with Low Noise and High Sensitivity.

Supply Voltage – 5V.

Delay Time Adjustable.

Standard TTL Output.

PIR Sensor IC

The PIR sensor IC consists of 3 pins- Vcc, Ground and Output.

In presence of human IR radiations, the sensor detects the radiations and converts it directly to electrical pulses, which is fed to the inverter circuit. The inverter circuit consists of a transistor,which gets into saturation with application of high base current and eventually develops a low collector voltage. Thus the transistor output is low.

This low inverter output is connected to the microcontroller. Based on the input received by the microcontroller, it controls the motor driver , which in turn controls the motion of the motor.

Motion Detection using PIR Sensor

A PIR or a Passive Infrared Sensor can be used to detect presence of human beings in its proximity. The output can be used to control the motion of door.

Basically motion detection use light sensors to detect either the presence of infrared light emitted from a warm object or absence of infrared light when a object interrupts a beam emitted by another part of the device.

A PIR sensor detects the infrared light radiated by a warm object. It consists of pyro electric sensors which introduce changes in their temperature (due to incident infrared radiation) into electric signal. When infrared light strikes a crystal, it generates an electrical charge.

Thus a PIR sensor can be used to detect presence of human beings within a detection area of approximately 14 meters.

Application using PIR Sensor – Automatic Door Opening System

Opening and closing of doors is always a tedious job, especially in places like shopping malls, hotels and theatres where a person is always required to open the door for visitors.

An automatic door opening system consists of a pr sensor which senses the presence of human being and sends pulses to the microcontroller which controls the motor driver by sending appropriate pulses to its input pins and enable pin.

Generally, human body emits infrared energy which is sensed by the PIR sensor from a considerable distance. The output from the PIR sensor i.e., passive infrared detector is amplified to a transistor BC547, the output of which at the collector is connected to pin 1 of the microcontroller. While any moving object is sensed by the PIR it develops logic high at its output which gets inverted by the transistor used to develop a logic low at pin 1 of microcontroller. Thus the microcontroller receives a logic low signal from the pr sensor through the transistor and through proper programming, sends a logic low to pin 2 and logic high to pin 7, making the motor run in forward direction and the door connected to the shaft of the motor opens. The program is so written that it delivers appropriate input to the motor driver IC L293D as explained above, to run the motor in one direction, so as to enable a door open situation. As the door gets fully opened an interrupt signal is received from the motor door from an SPDT leaf switch to stop the motor by placing zero logic once the door reaches to extreme end to enable pin of L293D for disabling the motor.

In other words, the current signal from the spdt switch sends a interrupt signal to the microcontroller and it sends a output of logic low to the enable pin input of the motor ic, thus stopping the motor . After few seconds the microcontroller sends reverse logic to the motor driver IC such that the motor rotates in the opposite direction representing closing of the door. This happens as the microcontroller sends a logic low to pin2 and logic high to pin7and the motor reverses its direction and door gets automatically closed. This happens few seconds after the person crosses the door path. Thus the door can be closed or opened automatically as a person approaches it or leaves through it.