Introduction: PIR Senor Interfacing With Pic Microocntroller

PIR sensor interfacing with pic microcontroller and step by step guide

Step 1: Motion Detector

Motion Detection Sensor is used to detect the motion it may be human oranything else. The main component of this project is PIR sensor aka Passive Infrared Sensor. It is also known as Pyroelectric or IR motion sensors.

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. In this pic microcontroller tutorial, I have designed a motion detector using pic microcontroller.

Step 2: Components

Components Required:

· PIC 16F887: This MCU is powerful and very easy-to-program. It is CMOS FLASH-based 8-bit microcontroller. It has 40- or 44-pin package. The PIC16F887 features 256 bytes of EEPROM data memory, self programming. Operating Voltage range is between 2v to 5.5v.

It also contains 2 Comparators, 14 channels of 10-bit Analog-to-Digital (A/D) converter, 1 capture/compare/PWM and 1 Enhanced capture/compare/PWM functions. It is very easy to use with LCD and sensors.

· LCD 16x2: LCD is used to show alpha numeric characters. It has total 16 pins. A 10K ohm potentiometer is connected with pin three to set the contrast of the LCD. It also contain a backlight LED. In this project LCD we use is 16x2 which means we can display 16 characters in two lines. In this project LCD is used to show whether the motion is detected or not.

· PIR senor: The brain of this sensor is BISS0001 PIR chip. PIR sensors are small, cheap, low-power consumption and easy to use. It has three pins

1. Vcc: This pin is connected with DC voltages between 3V to 5V.

2. OUTPUT: This pin is connected with the microcontroller. This pin contains the detected signal up to 3 volts.

3. Gnd: This pin is connected to ground.

3. PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range.

Some features of PIR sensor are Dual Element Sensor with Low Noise and High Sensitivity. Its Supply Voltage is 5V. It has Delay Time Adjustable and standard TTL output. The Fresnel lens condenses light, providing a larger range of IR to the sensor.

· Others: Buzzer, LED with suitable resistor, Breadboard, 5v Dc supply and some jumper wires.

Step 3: ​How PIR Works

How PIR works

PIR sensors are more complicated to explain then the other sensors like photocells, tilt switches etc. because there are multiple variables that affect the sensors input and output. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected.

PIR sensors are rather generic and for the most part vary only in price and sensitivity. Most of the real magic happens with the optics. The Fresnel lens condenses light, providing a larger range of IR to the sensor. This is a pretty good idea for manufacturing: the PIR sensor and circuitry is fixed. The lens costs only a few rupees but it change the breadth, range, sensing pattern. There are two variable potentiometer to change the range and sensing pattern. we can also design home security system using PIR sensor.


PIR sensor is very useful device in the modern era. It can be used everywhere from industries to factories, markets to shopping malls and it is also handy device in home automation.

Automatic Door Opening System.

Security Purposes.

Parking Area

Any Counter System.

Used in Vehicles.

Multi Apartment Complexes

Common staircases

Step 5: Circuit Diagram

This is a circuit diagram of PIR sensor interfacing with arduino