What is the HC-SR501 PIR Motion Sensor?
The HC-SR501 is a low-cost, easy-to-use PIR motion sensor module that detects the presence of moving objects by detecting changes in infrared radiation emitted by the objects. When an object, such as a person or animal, moves within the sensor’s detection range, it triggers an output signal that can be used to activate various devices or systems.
Key Features of the HC-SR501
- Passive Infrared (PIR) motion detection
- Adjustable sensitivity and delay time
- Low power consumption
- Wide operating voltage range (5V to 20V)
- Compact size and easy integration
- Suitable for indoor and outdoor applications
HC-SR501 Specifications
Parameter | Value |
---|---|
Operating Voltage | 5V to 20V DC |
Quiescent Current | 50μA |
Level Output | 3.3V, 0V |
Delay Time | Adjustable (0.3s to 18s) |
Lock Time | 0.2 seconds |
Trigger | L – disable, H – enable |
Sensing Range | Less than 120 degrees, within 7 meters |
Operating Temperature | -15°C to +70°C |
Dimensions | 32mm x 24mm x 24mm |
HC-SR501 Pin Configuration
The HC-SR501 module has three pins for easy connection to a microcontroller or other electronic devices:
Pin | Description |
---|---|
VCC | Power supply input (5V to 20V DC) |
OUT | Digital output signal (HIGH when motion detected) |
GND | Ground connection |
How the HC-SR501 Works
The HC-SR501 PIR motion sensor works by detecting changes in infrared radiation emitted by objects within its detection range. It consists of a pyroelectric sensor that generates an electric charge when exposed to heat energy in the form of infrared radiation.
When an object with a different temperature than the background environment moves within the sensor’s detection range, it causes a change in the infrared radiation pattern. The pyroelectric sensor detects this change and generates a small electric charge. The charge is then amplified and processed by the onboard circuitry, triggering a digital output signal.
The HC-SR501 module has two potentiometers that allow users to adjust the sensitivity and delay time of the sensor:
- Sensitivity Adjustment:
- The sensitivity potentiometer controls the detection range of the sensor.
- Turning the potentiometer clockwise increases the sensitivity, allowing the sensor to detect motion at greater distances.
-
Turning the potentiometer counterclockwise decreases the sensitivity, reducing the detection range.
-
Delay Time Adjustment:
- The delay time potentiometer determines how long the output signal remains active after motion is detected.
- Turning the potentiometer clockwise increases the delay time, keeping the output signal active for a longer duration.
- Turning the potentiometer counterclockwise decreases the delay time, shortening the duration of the active output signal.
Applications of the HC-SR501
The HC-SR501 PIR motion sensor finds applications in a wide range of projects and systems, including:
- Security Systems:
- The HC-SR501 can be used in home security systems to detect unauthorized entry or movement.
-
When motion is detected, the sensor can trigger an alarm, send notifications, or activate cameras.
-
Lighting Control:
- The sensor can be used to automatically turn on lights when a person enters a room and turn them off when no motion is detected for a specified period.
-
This application is useful for energy-saving purposes in homes, offices, and public spaces.
-
Automated Doors:
- The HC-SR501 can be integrated into automated door systems to open doors when a person approaches and close them after a certain delay time.
-
This application is commonly found in elevators, supermarkets, and public buildings.
-
Wildlife Monitoring:
- The motion sensor can be used in wildlife monitoring systems to detect the presence of animals in a particular area.
-
Researchers can use the sensor to trigger cameras or record data when animals pass by, enabling non-invasive monitoring of wildlife behavior.
-
Robotics and Automation:
- The HC-SR501 can be used in robotics projects to detect the presence of objects or people.
- The sensor can trigger specific actions or behaviors in robots based on the detected motion, such as obstacle avoidance or human-robot interaction.
Interfacing the HC-SR501 with Arduino
Interfacing the HC-SR501 PIR motion sensor with an Arduino board is straightforward. Follow these steps to set up the connection:
- Connect the VCC pin of the HC-SR501 to the 5V pin of the Arduino.
- Connect the GND pin of the HC-SR501 to the GND pin of the Arduino.
- Connect the OUT pin of the HC-SR501 to a digital input pin of the Arduino (e.g., pin 2).
Here’s a sample Arduino sketch that demonstrates how to read the output signal from the HC-SR501 and turn on an LED when motion is detected:
const int pirPin = 2; // PIR Sensor connected to digital pin 2
const int ledPin = 13; // LED connected to digital pin 13
void setup() {
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int pirValue = digitalRead(pirPin);
if (pirValue == HIGH) {
digitalWrite(ledPin, HIGH);
Serial.println("Motion detected!");
} else {
digitalWrite(ledPin, LOW);
Serial.println("No motion.");
}
delay(500);
}
In this sketch, the HC-SR501 output signal is read using the digitalRead()
function. When motion is detected, the PIR sensor’s output goes HIGH, and the Arduino turns on the LED connected to pin 13. When no motion is detected, the LED remains off.
Frequently Asked Questions (FAQ)
- What is the detection range of the HC-SR501?
-
The HC-SR501 has a detection range of up to 7 meters and a detection angle of less than 120 degrees.
-
Can the HC-SR501 detect motion through walls or glass?
-
No, the HC-SR501 cannot detect motion through solid objects like walls or glass. It requires a direct line of sight to detect changes in infrared radiation.
-
How can I adjust the sensitivity and delay time of the HC-SR501?
-
The HC-SR501 has two potentiometers on the module labeled “Sensitivity” and “Time.” Turn the sensitivity potentiometer clockwise to increase sensitivity and counterclockwise to decrease it. Turn the time potentiometer clockwise to increase the delay time and counterclockwise to decrease it.
-
What is the quiescent current of the HC-SR501?
-
The quiescent current of the HC-SR501 is approximately 50μA, making it suitable for low-power applications.
-
Can the HC-SR501 be used outdoors?
- Yes, the HC-SR501 can be used outdoors, but it is recommended to protect the sensor from direct sunlight, rain, and extreme temperatures to ensure accurate motion detection and prolong its lifespan.
Conclusion
The HC-SR501 PIR motion sensor is a versatile and widely used module for detecting motion in various electronic projects. With its adjustable sensitivity and delay time, compact size, and easy integration, the HC-SR501 offers a reliable and cost-effective solution for applications ranging from security systems to lighting control and robotics.
By understanding the HC-SR501 Datasheet and its specifications, you can effectively utilize this sensor in your projects and harness its capabilities to create innovative and practical applications. Whether you are a beginner or an experienced electronics enthusiast, the HC-SR501 PIR motion sensor is a valuable component to have in your toolkit.
No responses yet