Want to build a project that detects motion like a pro? Whether it's for home automation, intruder alerts, or automatic lighting, the HC-SR501 PIR Sensor is your go-to solution. In this Arduino Tutorial, we will learn how to interface HC-SR501 PIR Sensor with the Arduino Board for detecting motion.
What is a PIR Sensor?PIR stands for Passive Infrared Sensor, also known as pyroelectric sensors. These detect motion by sensing infrared (IR) radiation — the kind emitted by humans and animals due to body heat.
Unlike ultrasonic or active IR sensors, PIR sensors don't emit signals; instead, they passively monitor the IR heat signature of their environment.
Every object above absolute zero emits some infrared radiation. The pyroelectric sensor in a PIR module detects changes in this IR energy.
A PIR sensor has:
- A Pyroelectric Sensor to detect IR changes
- A Fresnel Lens to focus and expand its detection field
The sensor has two slots with opposing outputs. When there’s no motion, both sense equal IR and cancel out. But when someone moves in the field of view, the IR pattern changes — one slot detects more or less radiation than the other, resulting in a voltage differential — this change signals motion detected!
This is one of the most popular, beginner-friendly PIR sensors in the Arduino ecosystem.
Pinout:- VCC: Power (5V–20V)
- OUT: Digital signal output (HIGH on motion)
- GND: Ground
Operating Voltage: 5V–20V
Output Level: HIGH 3.3V / LOW 0V
Detection Distance: 3–7 meters
Detection Angle: < 110°
Time Delay: 3–300 seconds
Blocking Time: ~2.5 seconds
Trigger Mode: Single/Repeatable
Operating Temp: -15 to +70 °C
Hardware RequiredArduino UNO R3- 1
HC-SR501 PIR Sensor- 1
16x2 LCD Display- 1
10k Potentiometer- 1
220Ω Resistor- 1
Breadboard & Jumper Wires- As needed
Circuit ConnectionsThe wiring diagram below shows just how simple it is to connect the PIR sensor to the Arduino. The sensor’s output pin is connected to digital pin 2 on the Arduino. Additionally, a 16×2 LCD display is used to visually indicate whether motion is detected or not, displaying messages like “Motion Detected” or “No Motion”.
PIR Sensor to Arduino:- VCC → 5V
- GND → GND
- OUT → Digital Pin 2
Comments