Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use PIR motion sensor: Examples, Pinouts, and Specs

Image of PIR motion sensorDesign with PIR motion sensor in Cirkit Designer

Introduction

A Passive Infrared (PIR) motion sensor detects motion by measuring changes in infrared radiation, typically emitted by warm bodies. It is a low-cost, low-power device widely used in motion detection applications. PIR sensors are commonly found in security systems, automatic lighting, and energy-saving devices. They are ideal for detecting human or animal movement within a specific range.

Explore Projects Built with PIR motion sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of PIR Motion-Activated LED Light: A project utilizing PIR motion sensor in a practical application
PIR Motion-Activated LED Light

This circuit is a simple motion-activated LED light system. The HC-SR505 Mini PIR Motion Sensing Module is powered by a 9V battery and detects motion, upon which it sends an output signal to turn on the red LED. The LED and the PIR sensor share a common ground with the battery, completing the circuit.

Open Project in Cirkit Designer
Image of Arduino UNO with PIR Sensor and Bluetooth Connectivity: A project utilizing PIR motion sensor in a practical application
Arduino UNO with PIR Sensor and Bluetooth Connectivity

This circuit features an Arduino UNO connected to a PIR (Passive Infrared) sensor and an HC-05 Bluetooth module. The PIR sensor detects motion and sends a signal to the Arduino, which then communicates via Bluetooth using the HC-05 module. The embedded code on the Arduino is configured to send a specific message over serial when motion is detected by the PIR sensor.

Open Project in Cirkit Designer

Technical Specifications

Pin Configuration and Descriptions

Pin Name Description
VCC Power supply input (4.5V to 20V DC)
GND Ground connection
OUT Digital output signal

Usage Instructions

How to Use the PIR Motion Sensor in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V or 12V power source and the GND pin to the ground.
  2. Connect the Output: Attach the OUT pin to a microcontroller's digital input pin or directly to a device (e.g., an LED or buzzer) for simple applications.
  3. Adjust Sensitivity and Delay (if applicable):
    • Use the onboard potentiometers to adjust the detection range and the delay time for the output signal.
  4. Wait for Warm-up: Allow the sensor to stabilize for ~30 seconds after powering it on.

Important Considerations and Best Practices

Example: Connecting a PIR Sensor to an Arduino UNO

Below is an example of how to connect and use a PIR motion sensor with an Arduino UNO to control an LED.

Circuit Connections

Arduino Code

// PIR Motion Sensor with Arduino Example
// This code turns on an LED when motion is detected by the PIR sensor.

#define PIR_PIN 2       // Define the pin connected to the PIR sensor's OUT pin
#define LED_PIN 13      // Define the pin connected to the LED

void setup() {
  pinMode(PIR_PIN, INPUT);  // Set PIR sensor pin as input
  pinMode(LED_PIN, OUTPUT); // Set LED pin as output
  Serial.begin(9600);       // Initialize serial communication for debugging
}

void loop() {
  int motionDetected = digitalRead(PIR_PIN); // Read the PIR sensor output

  if (motionDetected == HIGH) { // If motion is detected
    digitalWrite(LED_PIN, HIGH); // Turn on the LED
    Serial.println("Motion detected!"); // Print message to serial monitor
  } else {
    digitalWrite(LED_PIN, LOW);  // Turn off the LED
    Serial.println("No motion."); // Print message to serial monitor
  }

  delay(100); // Small delay to stabilize readings
}

Troubleshooting and FAQs

Common Issues

  1. False Triggers:

    • Cause: Electrical noise, vibrations, or heat sources near the sensor.
    • Solution: Relocate the sensor to a stable environment away from heat sources and vibrations.
  2. No Detection:

    • Cause: Incorrect wiring or insufficient power supply.
    • Solution: Double-check the wiring and ensure the power supply matches the sensor's requirements.
  3. Output Signal Stuck High/Low:

    • Cause: Sensor not warmed up or faulty.
    • Solution: Wait for the warm-up period (~30 seconds) or replace the sensor if it remains unresponsive.

FAQs