Interface PIR Sensor with Arduino
Arduino

PIR Sensor


Description

A Passive Infrared (PIR) sensor is a type of electronic sensor that detects motion by measuring changes in infrared radiation levels. It is commonly used in security systems, automatic lighting systems, and other applications where motion detection is required. It's important to note that PIR sensors are sensitive to changes in infrared radiation, but they do not provide any information about the nature or shape of the detected object. They are mainly designed to detect motion and are less effective at detecting stationary objects.

PIR sensors are widely used due to their simplicity, low cost, and energy efficiency. They offer a reliable method for motion detection in various applications, making them popular in both residential and commercial settings.


Sensor Details

The features and specifications of the PIR sensor include the following.

  • The recommended input voltage supply is +5V.
  • The output voltage is 3.3V.
  • It can differentiate between the movement of an object & human.
  • Operating modes are repeatable & Non- Repeatable.
  • The current drain is <60uA.
  • The detection angle is <140°
  • The detection distance is 3 to 7m.
  • Blockade time by default is 2.5s.
  • Working temperature ranges from -20-+80°C.
  • Low power utilization – 65mA.

Wiring Details

Connect the VCC pin of the PIR sensor to the 5V pin on the Arduino.

Connect the GND pin of the PIR sensor to the GND pin on the Arduino.

Connect the OUT pin of the PIR sensor to any digital input pin (pin 2) on the Arduino.


Circuit Image
Circuit Code
                                        
                                            

int pirPin = 2; // Pin connected to the OUT pin of the PIR sensor

 

void setup() {

  Serial.begin(9600); // Initialize the serial communication for debugging

  pinMode(pirPin, INPUT); // Set the pirPin as an input

}

 

void loop() {

  int motionDetected = digitalRead(pirPin); // Read the state of the PIR sensor

 

  if (motionDetected == HIGH) {

    Serial.println("Motion detected!");

    // Add your desired actions here when motion is detected

  }

 

  delay(100); // Delay between readings

}