Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use HC-SR501 PIR: Examples, Pinouts, and Specs

Image of HC-SR501 PIR
Cirkit Designer LogoDesign with HC-SR501 PIR in Cirkit Designer

Introduction

The HC-SR501 is a passive infrared (PIR) motion sensor designed to detect motion by sensing changes in infrared radiation emitted by objects within its detection range. This component is widely used in security systems, home automation, and DIY electronics projects. It is particularly popular for triggering alarms, lights, or other devices when motion is detected.

Explore Projects Built with HC-SR501 PIR

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
PIR Motion-Activated LED Light
Image of 0: A project utilizing HC-SR501 PIR in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 CAM-Based Wi-Fi Motion-Activated Smart Light
Image of ESP32 CAM: A project utilizing HC-SR501 PIR in a practical application
This circuit features an ESP32 CAM microcontroller connected to an HC-SR501 PIR motion sensor and a 2-channel relay module. The PIR sensor output is connected to a GPIO pin on the ESP32, allowing it to detect motion and signal the microcontroller. The ESP32 controls the relay, which in turn switches an AC bulb on or off, effectively creating a motion-activated light system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi Motion-Activated LED System with PIR Sensor
Image of Detection project: A project utilizing HC-SR501 PIR in a practical application
This circuit uses a Raspberry Pi 5 to control an LED based on input from an HC-SR501 PIR motion sensor. The motion sensor is powered by the Raspberry Pi and its output is connected to a GPIO pin, which the Raspberry Pi monitors to detect motion. When motion is detected, the Raspberry Pi can turn on the LED through another GPIO pin, with a current-limiting resistor in series with the LED.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Security System with PIR Motion Detection and Bluetooth Connectivity
Image of 아두이노 캡스톤 : A project utilizing HC-SR501 PIR in a practical application
This circuit features an Arduino UNO microcontroller interfaced with a PIR motion sensor (HC-SR501), a Bluetooth module (HC-06), a buzzer (FIT0449), and a soil moisture sensor (SEN040129). The Arduino is programmed to interact with these sensors and actuators, likely to monitor environmental conditions and provide alerts or communication via Bluetooth. Additionally, there are two LED components (JLED-START and JLED-ARROW-9) daisy-chained together, which could be used for visual signaling or status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with HC-SR501 PIR

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 0: A project utilizing HC-SR501 PIR 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP32 CAM: A project utilizing HC-SR501 PIR in a practical application
ESP32 CAM-Based Wi-Fi Motion-Activated Smart Light
This circuit features an ESP32 CAM microcontroller connected to an HC-SR501 PIR motion sensor and a 2-channel relay module. The PIR sensor output is connected to a GPIO pin on the ESP32, allowing it to detect motion and signal the microcontroller. The ESP32 controls the relay, which in turn switches an AC bulb on or off, effectively creating a motion-activated light system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Detection project: A project utilizing HC-SR501 PIR in a practical application
Raspberry Pi Motion-Activated LED System with PIR Sensor
This circuit uses a Raspberry Pi 5 to control an LED based on input from an HC-SR501 PIR motion sensor. The motion sensor is powered by the Raspberry Pi and its output is connected to a GPIO pin, which the Raspberry Pi monitors to detect motion. When motion is detected, the Raspberry Pi can turn on the LED through another GPIO pin, with a current-limiting resistor in series with the LED.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 아두이노 캡스톤 : A project utilizing HC-SR501 PIR in a practical application
Arduino UNO-Based Security System with PIR Motion Detection and Bluetooth Connectivity
This circuit features an Arduino UNO microcontroller interfaced with a PIR motion sensor (HC-SR501), a Bluetooth module (HC-06), a buzzer (FIT0449), and a soil moisture sensor (SEN040129). The Arduino is programmed to interact with these sensors and actuators, likely to monitor environmental conditions and provide alerts or communication via Bluetooth. Additionally, there are two LED components (JLED-START and JLED-ARROW-9) daisy-chained together, which could be used for visual signaling or status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Security systems for detecting intruders
  • Automatic lighting systems
  • Motion-activated cameras
  • Home automation projects
  • Robotics and interactive installations

Technical Specifications

The HC-SR501 PIR sensor is a versatile and adjustable module with the following key specifications:

Parameter Value
Operating Voltage 4.5V to 20V DC
Quiescent Current < 50 µA
Detection Range Up to 7 meters (adjustable)
Detection Angle Approximately 120°
Trigger Modes Repeatable (default) and non-repeatable
Output Voltage High: 3.3V, Low: 0V
Output Duration Adjustable (0.3s to 5 minutes)
Operating Temperature -15°C to +70°C
Dimensions 32mm x 24mm x 25mm

Pin Configuration

The HC-SR501 PIR sensor has three pins for interfacing:

Pin Name Description
1 VCC Power supply input (4.5V to 20V DC)
2 OUT Digital output pin (High when motion is detected)
3 GND Ground connection

Usage Instructions

Connecting the HC-SR501 to a Circuit

  1. Power Supply: Connect the VCC pin to a DC power source (4.5V to 20V) and the GND pin to ground.
  2. Output Signal: Connect the OUT pin to a microcontroller (e.g., Arduino) or directly to a device (e.g., an LED or buzzer) to receive the motion detection signal.
  3. Adjustments:
    • Use the sensitivity potentiometer to adjust the detection range (clockwise to increase).
    • Use the time delay potentiometer to set the duration for which the output remains HIGH after motion is detected.

Example: Using HC-SR501 with Arduino UNO

Below is an example of how to connect and program the HC-SR501 PIR sensor with an Arduino UNO to control an LED:

Circuit Diagram

  • Connect the VCC pin of the HC-SR501 to the Arduino's 5V pin.
  • Connect the GND pin of the HC-SR501 to the Arduino's GND pin.
  • Connect the OUT pin of the HC-SR501 to digital pin 2 on the Arduino.
  • Connect an LED to digital pin 13 on the Arduino with a 220-ohm resistor.

Arduino Code

// HC-SR501 PIR Motion Sensor Example with Arduino UNO
// This code turns on an LED when motion is detected.

#define PIR_PIN 2       // HC-SR501 OUT pin connected to digital pin 2
#define LED_PIN 13      // LED connected to digital pin 13

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 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
  }

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

Important Considerations

  • Warm-Up Time: The HC-SR501 requires a warm-up period of approximately 30 to 60 seconds after powering on to stabilize its readings.
  • Avoid Direct Sunlight: The sensor may not function correctly in direct sunlight or near heat sources.
  • Trigger Modes:
    • Repeatable Mode (default): The output remains HIGH as long as motion is detected.
    • Non-Repeatable Mode: The output goes LOW after the set time delay, even if motion is still present. This mode can be configured by adjusting the onboard jumper.

Troubleshooting and FAQs

Common Issues

  1. No Motion Detected:

    • Ensure the sensor is properly powered (4.5V to 20V DC).
    • Verify that the warm-up period has completed.
    • Check the sensitivity potentiometer and adjust if necessary.
  2. False Triggers:

    • Avoid placing the sensor near heat sources, reflective surfaces, or moving objects like fans.
    • Ensure stable power supply voltage.
  3. Output Stays HIGH:

    • Check if the time delay potentiometer is set too high.
    • Verify the trigger mode jumper setting.
  4. Short Detection Range:

    • Adjust the sensitivity potentiometer clockwise to increase the range.
    • Ensure there are no obstructions in the sensor's field of view.

FAQs

Q1: Can the HC-SR501 detect motion through glass?
A1: No, the HC-SR501 cannot detect motion through glass as infrared radiation does not pass through it effectively.

Q2: What is the maximum detection range of the HC-SR501?
A2: The maximum detection range is approximately 7 meters, depending on the sensitivity setting and environmental conditions.

Q3: Can I power the HC-SR501 with a 3.3V supply?
A3: No, the minimum operating voltage is 4.5V. Use a power supply within the 4.5V to 20V range.

Q4: How do I switch between trigger modes?
A4: Use the onboard jumper to toggle between repeatable and non-repeatable modes. Refer to the module's markings for guidance.

By following this documentation, you can effectively integrate the HC-SR501 PIR sensor into your projects and troubleshoot common issues with ease.