- تكلفه فاتورة الكهرباء
- Electrical Energy Consumption
- Parallel and Series Resistor Calculator
- LED Resistor Calculator
- UPS Battery Backup Calculator
- Voltage Divider Calculator
- Resistor Color Code Calculator
- Ohm’s Law Calculator
- Current Divider Calculator
- Number System Conversion Calculator
- Boost Converter Calculator
- MOSFET Threshold Voltage Calculator
- Apparent Power Calculator (kVA & VA)
- 555 Timer Calculator
- Buck Converter Calculator
- Capacitors in Series or Parallel Calculator
- Low Pass Filter Calculator
- RMS Voltage Calculator
- Universal Data Converter
- RMS Voltage Calculator
- Capacitor Code Converter
- Series Inductors Calculator
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 |
Note: The module has two potentiometers for adjusting sensitivity and delay time
Wiring with Arduino
// Basic Connections: // VCC → 5V // GND → GND // OUT → D2 (digital input) // For best results, mount sensor 2-3 meters above ground
Important: Allow 30-60 seconds for sensor to stabilize after power on
Basic Detection Example
// 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
// 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