Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use HC-SR501 Motion sensor: Examples, Pinouts, and Specs

Image of HC-SR501 Motion sensor
Cirkit Designer LogoDesign with HC-SR501 Motion sensor in Cirkit Designer

Introduction

The HC-SR501 is a passive infrared (PIR) sensor module designed for motion detection in a range of applications such as security systems, automatic lighting, and home automation. It detects the infrared radiation emitted by objects in its field of view, especially warm moving objects like humans and animals.

Explore Projects Built with HC-SR501 Motion sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
PIR Motion-Activated LED Light
Image of 0: A project utilizing HC-SR501 Motion sensor in a practical application
This circuit is a simple motion-activated LED light system. The HC-SR505 Mini PIR Motion Sensing Module is powered by a 9V battery and detects motion, upon which it sends an output signal to turn on the red LED. The LED and the PIR sensor share a common ground with the battery, completing the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 5 Motion Detection System with HC-SR501 Sensor
Image of PIR: A project utilizing HC-SR501 Motion sensor in a practical application
This circuit connects a Raspberry Pi 5 to an HC-SR501 motion sensor. The Raspberry Pi provides power to the motion sensor and reads its output signal through GPIO 17, allowing the Raspberry Pi to detect motion events.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Motion-Activated Smart Light with Relay Control
Image of Human Motion-Activated Lamp: A project utilizing HC-SR501 Motion sensor in a practical application
This circuit is a motion-activated lighting system. An HC-SR501 motion sensor detects movement and sends a signal to an Arduino UNO, which then activates a 5V relay to turn on an AC-powered bulb. The Arduino controls the relay based on the input from the motion sensor, enabling the bulb to light up when motion is detected.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Motion-Activated Light with HC-SR501 and NPN Transistor
Image of motion detector: A project utilizing HC-SR501 Motion sensor in a practical application
This circuit uses an HC-SR501 motion sensor to control a bulb via an NPN transistor. The motion sensor's output triggers the transistor, which in turn allows current to flow from a battery through a rocker switch and a 7805 voltage regulator to power the bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with HC-SR501 Motion sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of 0: A project utilizing HC-SR501 Motion sensor in a practical application
PIR Motion-Activated LED Light
This circuit is a simple motion-activated LED light system. The HC-SR505 Mini PIR Motion Sensing Module is powered by a 9V battery and detects motion, upon which it sends an output signal to turn on the red LED. The LED and the PIR sensor share a common ground with the battery, completing the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of PIR: A project utilizing HC-SR501 Motion sensor in a practical application
Raspberry Pi 5 Motion Detection System with HC-SR501 Sensor
This circuit connects a Raspberry Pi 5 to an HC-SR501 motion sensor. The Raspberry Pi provides power to the motion sensor and reads its output signal through GPIO 17, allowing the Raspberry Pi to detect motion events.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Human Motion-Activated Lamp: A project utilizing HC-SR501 Motion sensor in a practical application
Arduino UNO Motion-Activated Smart Light with Relay Control
This circuit is a motion-activated lighting system. An HC-SR501 motion sensor detects movement and sends a signal to an Arduino UNO, which then activates a 5V relay to turn on an AC-powered bulb. The Arduino controls the relay based on the input from the motion sensor, enabling the bulb to light up when motion is detected.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of motion detector: A project utilizing HC-SR501 Motion sensor in a practical application
Battery-Powered Motion-Activated Light with HC-SR501 and NPN Transistor
This circuit uses an HC-SR501 motion sensor to control a bulb via an NPN transistor. The motion sensor's output triggers the transistor, which in turn allows current to flow from a battery through a rocker switch and a 7805 voltage regulator to power the bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Voltage: 4.5V to 20V
  • Current: Idle ~50uA, Working ~65mA
  • Sensing Angle: < 100 degrees
  • Sensing Distance: Up to 7 meters (adjustable)
  • Output Voltage: High 3.3V (motion detected), Low 0V (no motion)
  • Output Delay: 5 seconds to 200 seconds (adjustable)
  • Operating Temperature: -20°C to +80°C

Pin Configuration and Descriptions

Pin Number Name Description
1 VCC Power supply input (4.5V to 20V)
2 OUT Output signal (High/Low)
3 GND Ground connection

Usage Instructions

Connecting to a Circuit

  1. Connect the VCC pin to a power supply within the range of 4.5V to 20V.
  2. Connect the OUT pin to a digital input on a microcontroller like an Arduino UNO.
  3. Connect the GND pin to the ground of the power supply and the microcontroller.

Important Considerations and Best Practices

  • Ensure that the power supply voltage does not exceed the maximum rating of 20V.
  • Avoid placing the sensor in an environment with rapid temperature changes to prevent false triggers.
  • The sensor requires a warm-up time of approximately 20-60 seconds to calibrate to the infrared level of the room.
  • Adjust the sensitivity and time delay potentiometers according to the application needs.
  • Use a pull-up resistor if the microcontroller input pin is not internally pulled up.

Example Arduino Code

// Define the motion sensor pin
const int motionSensorPin = 2; // Connect HC-SR501 OUT pin to Arduino pin 2

void setup() {
  pinMode(motionSensorPin, INPUT); // Set the motion sensor pin as an input
  Serial.begin(9600); // Start serial communication at 9600 baud rate
}

void loop() {
  int motionStatus = digitalRead(motionSensorPin); // Read the sensor value
  if (motionStatus == HIGH) {
    // Motion detected
    Serial.println("Motion detected!");
    // Add your code here to handle motion detection event
  } else {
    // No motion detected
    Serial.println("No motion.");
  }
  delay(1000); // Wait for 1 second before reading again
}

Troubleshooting and FAQs

Common Issues

  • Sensor always outputs HIGH: Check if the time delay is set too long or the sensor is in a continuous trigger mode.
  • Sensor does not detect motion: Ensure the sensor is properly powered and the sensitivity is correctly adjusted.
  • False triggers: Adjust the sensor's location or sensitivity to avoid false detections.

Solutions and Tips for Troubleshooting

  • Warm-up Time: Allow the sensor to warm up for 1-2 minutes after powering up.
  • Adjustments: Use the onboard potentiometers to fine-tune the delay time and sensitivity.
  • Interference: Keep the sensor away from heat sources and objects that can cause rapid temperature changes.

FAQs

Q: Can the HC-SR501 sensor work outdoors? A: The HC-SR501 can work outdoors but it's not weatherproof. It should be placed in a protective enclosure to prevent damage from the elements.

Q: How can I extend the output signal duration? A: Turn the time delay potentiometer clockwise to increase the duration of the output signal.

Q: What is the range of detection of the HC-SR501? A: The detection range can be up to 7 meters, but it's adjustable via the sensitivity potentiometer.

Q: Is it possible to power the HC-SR501 with a 3.3V supply? A: No, the minimum supply voltage is 4.5V. Using a voltage lower than this may result in unreliable or no operation.