HC-SR501 PIR Sensor (Passive Infrared Sensor) + IR Proximity Sensor
1. HC-SR501 PIR Sensor (Motion Detection)
What it does
Detects human/animal movement
Works based on body heat (infrared radiation)
It does NOT detect objects, only motion of warm bodies
Key Specifications
Voltage: 4.5V 20V
Output: Digital HIGH (3.3V) when motion detected
Range: ~3 to 7 meters
Angle: ~110120
Delay time: 5s 300s adjustable
Features
Adjustable sensitivity + delay
Two modes:
Repeatable (keeps detecting)
Non-repeatable
p detection
Pinout
VCC 5V
GND GND
OUT Digital pin
Applications
Security systems
Automatic lights
Smart home automation
Human presence detection
Important Notes
Needs 3060 sec warm-up
Cannot detect stationary person
Sensitive to heat changes
2. IR Proximity Sensor (Obstacle Detection)
What it does
Detects objects (any material)
Works using IR reflection
Key Specifications
Voltage: 3.3V 5V
Range: ~2 cm 3093 comparator
Features
Adjustable detection distance
Fast response
Works for any object (not just humans)
Cheap & simple
Pinout
VCC 3.3V / 5V
GND GND
OUT Digital pin
Applications
Obstacle avoiding robot
Object detection
Line following robot
Smart vehicles
PIR vs IR Sensor (VERY IMPORTANT)
Feature | PIR Sensor | IR Sensor |
Detects | Human motion | Any object |
Range | Long (37m) | Short (230cm) |
Accuracy | Good for motion | Good for distance (short) |
/tr
When to use which
Use PIR if:
You want human detection
Example: automatic light ON when someone enters
Use IR if:
You want object detection
Example: robot avoiding obstacles
Pro Tip (Very Useful)
Combine BOTH sensors:
PIR detect human presence
IR detect distance/obstacle
Used in:
Smart robots
Smart doors
Advanced IoT systems
Common Beginner Mistakes
PIR not working didn't wait warm-up time
IR giving false output not adju/p

