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

How to Use PIR Motion Sensor (Wokwi Compatible): Examples, Pinouts, and Specs

Image of PIR Motion Sensor (Wokwi Compatible)Design with PIR Motion Sensor (Wokwi Compatible) in Cirkit Designer

Introduction

The PIR Motion Sensor is a Passive Infrared sensor that detects motion by measuring changes in the infrared levels emitted by objects in its field of view. When a living being, such as a human or animal, enters the sensor's range, it detects the change in infrared radiation and can trigger a response. This sensor is widely used in security systems, automatic lighting control, and various automation projects due to its non-intrusive nature and ease of integration with microcontroller platforms like Arduino.

Explore Projects Built with PIR Motion Sensor (Wokwi Compatible)

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 (Wokwi Compatible) 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

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Name Description
VCC Power supply (5V-12V DC)
OUT Digital output signal (High/Low)
GND Ground

Usage Instructions

Integration with a Circuit

  1. Connect the VCC pin to a 5V power supply.
  2. Connect the GND pin to the ground of the power supply.
  3. Connect the OUT pin to a digital input pin on the Arduino.

Important Considerations and Best Practices

Example Arduino Code

// PIR Motion Sensor Example Code
int pirPin = 2; // Digital pin connected to the PIR sensor's output
int ledPin = 13; // LED connected to digital pin 13

void setup() {
  pinMode(pirPin, INPUT); // Initialize the PIR pin as an input
  pinMode(ledPin, OUTPUT); // Initialize the LED pin as an output
  Serial.begin(9600); // Start serial communication at 9600 baud
}

void loop() {
  int pirValue = digitalRead(pirPin); // Read the value from the PIR sensor
  if (pirValue == HIGH) { // Check if the PIR sensor is detecting motion
    digitalWrite(ledPin, HIGH); // Turn on the LED
    Serial.println("Motion detected!");
  } else {
    digitalWrite(ledPin, LOW); // Turn off the LED
    Serial.println("No motion detected.");
  }
  delay(1000); // Wait for 1 second before reading again
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: How long does the sensor output stay high after detecting motion? A: This can vary based on the sensor model and settings of the time delay potentiometer.

Q: Can the sensor detect motion through walls or glass? A: No, the sensor cannot detect motion through solid objects.

Q: Is the sensor waterproof? A: Most PIR sensors are not waterproof unless specified by the manufacturer. It is recommended to use them indoors or in a waterproof enclosure if used outside.

Q: How can I adjust the range and sensitivity of the sensor? A: Some models come with potentiometers that allow you to adjust the sensitivity and the time the output signal stays high after detection.