ModulesNovember 2, 2026

PIR Motion Sensor Detector Module HC-SR501: Working, Pinout, Specifications and Applications

Learn how the HC-SR501 PIR motion sensor works, its pinout, specifications, adjustable settings, Arduino wiring, applications, and setup tips.

waf

Imagine walking into a room and having the lights turn on automatically without touching a switch. Or imagine a security system that detects movement and activates an alarm whenever someone enters a restricted area. These kinds of automation projects are possible with a simple electronic component called a PIR motion sensor.

The PIR Motion Sensor Detector Module HC-SR501 is a popular and affordable sensor used in electronics, robotics, home automation, and security projects. It detects movement by sensing changes in infrared radiation emitted by people and other warm objects.

Thanks to its adjustable sensitivity, configurable detection time, and simple three-pin connection, the HC-SR501 is a convenient choice for beginners, students, hobbyists, and electronics developers.

In this guide, we will explore how the HC-SR501 PIR motion sensor works, its pin configuration, technical specifications, adjustable settings, Arduino connections, and practical applications.

What Is the HC-SR501 PIR Motion Sensor?

The HC-SR501 is a Passive Infrared (PIR) motion detector module designed to detect movement within its sensing area.

Unlike cameras, it does not capture images or identify individuals. Instead, it detects changes in infrared radiation caused by moving objects, particularly people and animals.

The module comes with a white dome-shaped Fresnel lens that helps collect and focus infrared radiation onto the sensor element. Its onboard electronic circuitry processes the detected changes and generates a digital output signal.

When the sensor detects movement, its OUT pin switches to a HIGH signal. When the detection period ends, the output returns to LOW.

One of the biggest advantages of this module is that it does not require complicated programming or additional signal-processing circuits to perform basic motion detection.

It can be connected directly to popular development boards such as Arduino, ESP32, and compatible microcontrollers.

How Does the HC-SR501 PIR Motion Sensor Work?

To understand how the HC-SR501 works, it is helpful to know a little about infrared radiation.

All objects emit some level of infrared radiation depending on their temperature. The human body also emits infrared energy, which allows PIR sensors to detect changes when a person moves through their detection area.

The HC-SR501 uses a pyroelectric sensor with two sensing elements. These elements monitor infrared changes in their surroundings.

Here is how the detection process works:

  1. Infrared sensing: The sensor continuously monitors infrared radiation in its detection area.
  2. Movement detection: When a person or another warm object moves across the sensing area, the infrared energy received by the two sensing elements changes.
  3. Signal processing: The onboard control circuit processes this change and determines whether it represents movement.
  4. Output activation: The OUT pin generates a HIGH signal when motion is detected.
  5. Automatic reset: After the configured delay, the output returns to LOW if no further triggering occurs.

The module uses passive infrared technology, meaning it detects naturally emitted infrared radiation rather than transmitting its own signal.

This is why the HC-SR501 is useful in applications where detecting movement is more important than measuring distance.

HC-SR501 PIR Motion Sensor Specifications

Before integrating the HC-SR501 into an electronics project, it is important to understand its main technical specifications.

The following table covers commonly specified HC-SR501 module characteristics. Exact values can vary between manufacturers and board versions.

Parameter

Specification

Model

HC-SR501

Sensor Type

Passive Infrared (PIR)

Operating Voltage

DC 4.5V–20V (variant dependent)

Output Signal

Digital HIGH / LOW

HIGH Output Voltage

Approximately 3.3V

LOW Output Voltage

Approximately 0V

Detection Distance

Approximately 3–7 metres

Detection Angle

Typically around 110°–120°

Time Delay

Adjustable; approximately 5–200 seconds on common versions

Trigger Modes

Single and Repeatable

Output Interface

Digital

Board Dimensions

Approximately 32 × 24 mm

Compatible Platforms

Arduino, ESP32, Raspberry Pi and other microcontrollers

Important: Detection angle, time delay, and operating specifications may differ across HC-SR501 variants. Always check the specifications of the particular module before designing your circuit.

HC-SR501 Pin Configuration

One reason why the HC-SR501 is popular among electronics enthusiasts is its simple three-pin interface.

The module has three main pins:

1. VCC – Power Supply

The VCC pin provides power to the sensor module.

The commonly specified operating range is approximately 4.5V to 20V DC, depending on the module version. A regulated 5V supply is a convenient option for many Arduino-based projects.

2. OUT – Digital Output

The OUT pin sends the motion detection signal to a microcontroller or another compatible digital input.

  • HIGH (approximately 3.3V): Motion detected.
  • LOW (approximately 0V): No active detection signal.

The output can be used to activate an LED, trigger an alarm, or send a signal to an automation controller.

3. GND – Ground

The GND pin connects to the ground of the power supply and the connected control board.

For a microcontroller project, the sensor and controller should share a common ground.

Always check the pin labels printed on your particular module instead of assuming the physical pin order.

Adjustable Settings of the HC-SR501 Sensor

The HC-SR501 comes with onboard adjustment controls that make it more flexible for different applications.

There are two potentiometers and a trigger selection jumper.

1. Sensitivity Adjustment

The sensitivity potentiometer controls how far the sensor can detect movement.

On common versions, the adjustable detection distance is approximately 3 to 7 metres.

For example, a shorter detection range may be suitable for a small room, while a longer range may be useful for a larger indoor area.

Adjust the potentiometer gradually and test the sensor after each change to find the appropriate detection distance.

2. Time Delay Adjustment

The time delay potentiometer controls how long the output remains HIGH after motion is detected.

Depending on the module version, this delay may be adjustable from approximately 5 seconds to 200 seconds, with some versions supporting longer delays.

Consider an automatic lighting project. When someone enters a room, the sensor detects movement and activates the light. The light can remain active for the configured period before switching off.

This setting helps developers customize the sensor according to the requirements of their projects.

3. Trigger Mode Selection

The HC-SR501 generally supports two trigger modes selected using an onboard jumper.

H Mode – Repeatable Trigger

In repeatable trigger mode, the output delay is restarted whenever additional movement is detected.

For example, if someone continues walking around a room, the sensor can keep its output HIGH by extending the delay after each new detection.

This mode is useful for automatic lighting and motion-based automation.

L Mode – Non-Repeatable Trigger

In non-repeatable trigger mode, the output timer starts when the initial movement is detected.

Further movement during the active timing period does not restart that timer.

This mode is useful when an application requires a fixed output period after the initial detection.

How to Connect HC-SR501 with Arduino UNO

The HC-SR501 can easily be connected to an Arduino UNO for basic motion detection.

For this experiment, you will need:

  • HC-SR501 PIR Motion Sensor Module
  • Arduino UNO
  • USB cable
  • Jumper wires

Wiring Connections

Connect the sensor to the Arduino UNO using the following pin configuration:

HC-SR501 Pin

Arduino UNO Pin

VCC

5V

OUT

Digital Pin 2

GND

GND

Once the connections are complete, upload the following Arduino program.

Arduino Code for HC-SR501 Motion Detection

const int pirPin = 2;
const int ledPin = 13;

int previousState = LOW;

void setup() {
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);

Serial.begin(9600);

// Allow the PIR sensor to stabilize
delay(60000);

Serial.println("PIR Sensor Ready");
}

void loop() {
int motionState = digitalRead(pirPin);

digitalWrite(ledPin, motionState);

if (motionState != previousState) {

if (motionState == HIGH) {
Serial.println("Motion Detected!");
} else {
Serial.println("No Motion");
}

previousState = motionState;
}
}

Understanding the Code

The program reads the digital output from the HC-SR501 through Arduino digital pin 2.

When the sensor detects movement, it sends a HIGH signal. Arduino then turns on its built-in LED connected to pin 13 and displays a motion detection message in the Serial Monitor.

When the output returns to LOW, the LED switches off.

The initial 60-second delay gives the sensor time to stabilize after receiving power.

This is a simple example that can be expanded into more advanced projects such as automatic lighting, motion alarms, and smart home systems.

Practical Applications of the HC-SR501 PIR Motion Sensor

The HC-SR501 is used in several types of electronic and automation projects. Its ability to detect movement without requiring physical contact makes it useful in different environments.

Here are some common applications.

1. Automatic Lighting Systems

One of the most common applications is motion-activated lighting.

The sensor can detect someone entering a room, corridor, staircase, or storage area. A connected controller can then activate the lights automatically.

This can help reduce unnecessary electricity usage when lighting is not required.

2. Home Security Systems

The HC-SR501 can be integrated into basic security systems to detect movement inside a monitored area.

When movement is detected, an Arduino or other controller can activate a buzzer, alarm, indicator, or notification system.

For larger security installations, the sensor may be combined with additional detection devices.

3. Smart Home Automation

The sensor can be connected to an ESP32 or another IoT development board to create smart home automation projects.

For example, detected movement can trigger lighting, ventilation, or other connected devices.

With suitable programming and communication modules, the sensor can also become part of a Wi-Fi-based automation system.

4. Robotics Projects

Robotics enthusiasts can use the HC-SR501 to detect nearby human or animal movement.

A robot can respond to detected motion by activating an LED, changing its operating state, or triggering another programmed action.

It can also be used in interactive robotics demonstrations and student projects.

5. Automatic Door and Entry Systems

The HC-SR501 can be used as a motion input in basic automatic entry systems.

When movement is detected near an entrance, a connected controller can activate a door mechanism or provide an entry signal.

However, a PIR sensor should not be the only safety or presence-detection device used in a real automatic door system.

6. Energy-Saving Automation

In offices, storage rooms, corridors, and other indoor spaces, the sensor can help automate electrical devices.

For example, a motion detection system can activate lights when someone enters an area and switch them off after a selected period without further motion detection.

This can make basic energy management systems more convenient.

Advantages of the HC-SR501 PIR Motion Sensor

The HC-SR501 is a practical option for many electronics projects because of its straightforward design.

Some of its main advantages include:

  • Simple connectivity: Its three-pin interface makes it easy to connect to microcontrollers.
  • Adjustable sensitivity: The detection distance can be adjusted to suit the project.
  • Configurable delay: Users can control how long the output stays active.
  • Low standby power: It is suitable for applications where low standby consumption is important.
  • Wide applications: It can be used in lighting, security, robotics, and home automation.
  • Affordable module: It offers a convenient starting point for students and electronics enthusiasts.
  • Microcontroller compatibility: It works with popular platforms such as Arduino and ESP32.

Important Tips for Using the HC-SR501

Although the module is easy to use, a few practical points can help improve its performance.

Allow initialization time: After switching on the power supply, give the sensor approximately 30–60 seconds to stabilize before evaluating its detection behaviour.

Choose the mounting position carefully: Install the sensor where movement is likely to cross its detection zones. PIR sensors often detect side-to-side movement more effectively than movement directly towards them.

Avoid unnecessary interference: Direct sunlight, rapidly changing heat sources, strong airflow, and moving curtains can sometimes cause unwanted triggering.

Adjust sensitivity gradually: Start with a lower detection range and increase it until the sensor covers the required area.

Check the output voltage: The HIGH output is approximately 3.3V, not a guaranteed 5V signal. Check the input requirements of your microcontroller before connecting it.

Use a suitable driver for larger loads: The OUT pin is a logic signal. Do not connect high-power devices or mains-powered equipment directly to it. Use an appropriate transistor, relay module, or isolated driver circuit with proper electrical safety precautions.

Understand its limitations: PIR sensors detect changes in infrared radiation. A stationary person may not continuously trigger the sensor, so it should not be treated as a reliable device for detecting continuous human presence.

Frequently Asked Questions About the HC-SR501

1. What is the HC-SR501 PIR motion sensor used for?

The HC-SR501 is used to detect movement by sensing changes in infrared radiation. Common applications include automatic lighting, security alarms, smart home automation, robotics, and motion detection systems.

2. What is the maximum detection distance of the HC-SR501?

The commonly specified detection distance is approximately 3 to 7 metres. The actual distance depends on sensitivity settings, installation position, environmental conditions, and the particular module version.

3. Can I connect the HC-SR501 directly to Arduino?

Yes. The HC-SR501 can be connected directly to compatible Arduino digital input pins. Connect VCC to a suitable power supply, OUT to a digital input, and GND to the Arduino ground.

4. Does the HC-SR501 work with ESP32?

Yes. The module can work with ESP32 development boards. Its approximately 3.3V HIGH output is suitable for typical ESP32 digital inputs. Make sure the supply voltage and wiring are correct.

5. What is the difference between H and L trigger modes?

H mode is repeatable trigger mode, where additional movement restarts the output timer. L mode is non-repeatable trigger mode, where the timer starts with the initial movement and does not restart with further movement during that period.

6. Does the HC-SR501 detect stationary objects?

No. The HC-SR501 is primarily designed to detect changes in infrared radiation caused by movement. A stationary person may stop generating a detectable change, so the module is not designed for reliable continuous presence detection.

7. Does the HC-SR501 need programming?

The sensor can operate as a basic motion detector without complex programming, but a microcontroller such as Arduino or ESP32 is required when you want to control external devices or implement customized automation.

8. Is the HC-SR501 suitable for beginners?

Yes. Its simple pin configuration, adjustable controls, and compatibility with popular development boards make it a useful component for beginners learning electronics, robotics, and automation.

Conclusion

The PIR Motion Sensor Detector Module HC-SR501 is a versatile component for anyone interested in building motion-based electronic systems. With its simple interface, adjustable detection sensitivity, configurable time delay, and compatibility with Arduino and ESP32, it provides a convenient way to introduce motion detection into DIY and professional prototypes.

Whether you are developing an automatic lighting system, experimenting with home automation, building a security alarm, or working on a robotics project, the HC-SR501 can be a useful addition to your electronics toolkit.

Looking to add motion detection to your next project?

Explore the HC-SR501 PIR Motion Sensor Module at Componentwala and find the right electronic components for your next build.

Related products

Components that pair well with this guide.