PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to provide the detailed discussion on PIR Sensor Arduino Interfacing. PIR basically stands for Passive Infrared Sensor. Basically PIR is an electronic equipment which is often used to measure the infrared light radiating from the different objects in their field of view. It detects the infrared energy released from animals as well as from human beings, when this energy is higher than the certain threshold level PIR sensor shows an indication correspondingly. The energy detected by PIR sensor is usually in the form of heat i.e. emitted by humans as well as from animals. We can also test and verify our results in Proteus using PIR sensor. I have already shared PIR Sensor Library for Proteus. PIR sensor is most of the time used for sensing the motion of the different objects. It can sense the different objects up to 10 meters. It has three different pins. Each pin is assigned with the different task to be performed when the sensor is in working condition. PIR sensor has several different features like wide voltage supply ranges, automated induction, photosensitive control, low micro-power consumption, high output signal and many more. PIR (Passive Infra Red) sensor is most of the time used in security systems. Moreover, it can be used in OEM applications, automatic illuminating devices, building detection, building automation, alarm & security systems and at a lot more places in real life. The further detail about PIR Sensor Arduino Interfacing will be given later in this tutorial.

PIR Sensor Arduino Interfacing

PIR sensor stands for Passive Infra Red sensors. As it is clear from its name that PIR is an electronic device or sensor used to measure the infrared energy emitted by animals and human beings. This energy is emitted in the form of heat. When this energy is above the certain level, there is algorithm to show an an indication that the desired level has be reached. This tutorial is based on PIR interfacing with Arduino. PIR sensor is shown in the figure below along all of its pin names.
PIR Sensor Arduino Interfacing, PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
1. PIR Sensor Pins
  • PIR sensor has three pins voltage, output and ground respectively.
  • All of the pins are provided in the table shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
2. PIR Sensor Pins Description
  • Each pin has different task to perform while the sensor is in working condition.
  • PIR sensor pin descriptions are listed in the table shown in the figure below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
3. PIR Working Principle
  • PIR sensor has two different slot which are sensitive to infrared light/energy.
  • When the sensor is in normal condition, both of the slots measure the same amount of infrared energy radiated by walls etc.
  • When a warm body e.g animals and human beings crosses its coverage area, they first cross PIR sensors's first slot, which produces positive differential change between two slots.
  • When an animal or human being leave from the sensing area, a corresponding negative differential change is produced.
  • By detecting these types of changes PIR sensor can detect the motion of different objects which radiates infrared energy.
  • I have tried to elaborate the PIR working principle through some visuals shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
  • I have also provided the visuals about how PIR sensor generates an output signal after sensing different objects/
  • PIR sensor object sensing is given in the figure shown below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
4. PIR Sensor Schematic Diagram
  • To understand the internal structure of any electronic device, we must have a look at its schematic diagram.
  • PIR sensor schematic diagram is shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
5. Apparatus Required
A list of apparatus required for PIR interfacing with Arduino is given below.
  • PIR (Passive Infra Red) Sensor
  • Arduino (Microcontroller)
  • Jumper wires
6. PIR Interfacing with Arduino Wiring Diagram
  • I have already shared a brief article on Interfacing PIR sensor with Arduino.
  • Now, this is a detailed article about the similar topic.
  • I have provided wiring diagram for PIR interfacing with Arduino.
  • You can make the similar wiring diagram and can test and verify your results as well.
  • PIR Sensor Arduino Interfacing wiring diagram is shown in the figure given below.
PIR Sensor Arduino Interfacing,PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino
7. PIR Sensor Arduino Interfacing Source Code and Description
  • If you have never use Arduino software for programming then you should first go through How to Write Arduino Code.
  • I have provided the complete source code for PIR interfacing with Arduino.
  • You just need to copy and paste the entire code and upload it to your Arduino board and observe the results.
  • You can also made the same simulation on Proteus as well and can verify the results.
  • In case of Proteus simulation you must need to know about How to get Hex File from Arduino.
int LED = 13;                
int inputPin = 2;               
int PIR_STATE = LOW;             
int VALUE = 0;                   
 
void setup() {
  pinMode(LED, OUTPUT);      
 
  Serial.begin(9600);
}
 
void loop(){
  VALUE = digitalRead(inputPin); 
  if (VALUE == HIGH) {           
    digitalWrite(LED, HIGH); 
    if (PIR_STATE == LOW) {
      // we have just turned on
      Serial.println("Motion has been detected!");
      PIR_STATE = HIGH;
    }
  } else {
    digitalWrite(LED, LOW); 
    if (PIR_STATE == HIGH){
      // we have just turned of
      Serial.println("Motion has been stopped!");
      PIR_STATE = LOW;
    }
  }
}
  • I have initialized the LED pin, PIR state pin and the pin and a variable for reading sensor's data.
  • Then I have checked whether the detected value from the sensor is above or below the certain level.
  • Then I have decide to be print the certain values on Serial Monitor.
  • If it is above the certain level a message "Motion has been detected" will be displayed on the serial monitor through Serial Communication.
  • If the detected value is below the certain level then the message "Motion has been stopped" will be displayed on the serial monitor in Arduino software.
  • So, that was the brief description of the source code designed for PIR interfacing with Arduino.
  • You can download the complete wiring diagram along with the complete Arduino source code here by clicking on the button below.

8. PIR Sensor Interfacing with Arduino Actual Circuit Diagram
  • I have also provided the actual circuit diagram for PIR interfacing with Arduino.
  • Actual circuit diagram is shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
9. PIR Sensor Ratings
  • To know the power, current and voltage requirements of an electronic device can be known through its ratings.
  • PIR sensor ratings are listed in the table given in the figure shown below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
10. PIR Sensor Features
  • A device can be popular on the basis of its amazing and unique features, which make it different from other devices.
  • PIR sensor some of the main features are listed in the table given in the figure shown below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
11. PIR Sensor Applications
  • PIR sensor has several different real applications.
  • Some of common applications associated with PIR sensor are provided in the table shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
  • I have provided a circuit designed for security alarm system, which is its most common application.
  • The complete circuit design for security alarm system is given in the figure shown below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
  • PIR sensor's another application is making a timer circuit using PIR.
  • I have provided timer circuit using PIR sensor, shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
  • Another most common application of PIR sensor is the motion detection.
  • Motion detection circuit diagram using PIR sensor is shown in the figure given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
12. PIR Sensor Advantages
  • There are a lot of advantages associated with Passive Infrared Sensor, few of them are given below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
13. PIR Sensor Disadvantages
  • Infrared sensors also have some disadvantages but they are in a very small as compared to its disadvantage.
  • Infrared sensor disadvantage are listed in the table given in the figure shown below.
PIR interfacing with Arduino, Interfacing of PIR with arduino, PIR Arduino interfacing, how to interface PIR with Arduino, PIR Arduino interfacing, PIR attached with Arduino, Interfacing PIR sensor with Arduino
The tutorial PIR Sensor Arduino Interfacing has provided the detailed discussion about the interfacing of PIR sensor with Arduino. If you feel any problem in PIR Sensor Arduino Interfacing, you can ask me in comments anytime. I will try me level best to entertain you and to solve your problems. I will share further informative topic in my later tutorials. Till then take care and bye :)