Blogs
HC-SR501 PIR Motion Sensor Module
HC-SR501 PIR Motion Sensor Module
Passive Infrared Detection for Security and Automation Projects
Introduction
The HC-SR501 PIR Motion Sensor is a pyroelectric infrared sensor that detects movement by measuring changes in infrared radiation. Widely used in security systems, automatic lighting, and energy-saving applications, this module offers adjustable sensitivity and detection range.
Key Features
Human Detection
Detects movement of humans and animals (body heat)
Adjustable Settings
Sensitivity and delay time can be customized
Low Power
Consumes minimal current in operation
Easy Integration
Works with 5V systems like Arduino and Raspberry Pi
Technical Specifications
Detection Range | 3-7 meters (adjustable) |
---|---|
Detection Angle | ≤120° |
Output Type | Digital (High/Low) |
Operating Voltage | 4.5V – 20V DC (5V recommended) |
Current Consumption | <60μA (standby), 1mA (active) |
Output Duration | 5-300 seconds (adjustable) |
Operating Temperature | -15°C to +70°C |
Pin Configuration

Pin | Label | Description | Arduino Connection |
---|---|---|---|
1 | VCC | Power (5V recommended) | 5V |
2 | OUT | Digital Output (High when motion detected) | D2 |
3 | GND | Ground | GND |
Wiring with Arduino
1 2 3 4 5 6 |
// Basic Connections: // VCC → 5V // GND → GND // OUT → D2 (digital input) // For best results, mount sensor 2-3 meters above ground |
Basic Detection Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// HC-SR501 PIR Motion Sensor Basic Example const int pirPin = 2; // OUT pin connected to D2 void setup() { Serial.begin(9600); pinMode(pirPin, INPUT); Serial.println("PIR Sensor Initializing..."); delay(60000); // 60s initialization period Serial.println("Sensor Ready"); } void loop() { if(digitalRead(pirPin) { Serial.println("Motion detected!"); delay(1000); // Prevent multiple detections } } |
Advanced Features
Adjusting Sensitivity
The sensitivity potentiometer (Sx) controls detection range (clockwise increases range)
Setting Delay Time
The time delay potentiometer (Tx) controls how long output stays high after detection (clockwise increases delay)
Trigger Mode Selection
Jumper setting allows single trigger (L) or repeatable trigger (H) modes
Low Power Monitoring
1 2 3 4 5 6 7 8 9 |
// Low-power monitoring with interrupt void setup() { attachInterrupt(digitalPinToInterrupt(2), motionDetected, RISING); set_sleep_mode(SLEEP_MODE_PWR_DOWN); } void motionDetected() { // Wake up and handle motion } |
Troubleshooting
No Detection
- Check power supply (5V recommended)
- Increase sensitivity (turn Sx clockwise)
- Allow 60s initialization period after power on
False Triggers
- Decrease sensitivity (turn Sx counter-clockwise)
- Avoid direct sunlight and heat sources
- Check for moving objects in detection area
Continuous Output
- Check trigger mode jumper setting
- Decrease delay time (turn Tx counter-clockwise)
- Verify no continuous motion in detection area