guides
DIY Motion-Activated Security Floodlight & Alarm Using PIR Sensor HC-SR501
Design an energy-saving motion-sensing security lighting system with ambient daylight override and adjustable delay timing using the HC-SR501 PIR sensor.
Kunal (Founder & Owner) 1 min read7 Oct 2026

DIY Motion-Activated Security Floodlight & Alarm Using PIR Sensor HC-SR501
Passive Infrared (PIR) sensors detect changes in thermal blackbody radiation emitted by moving warm bodies (humans and animals). In this project, we combine an HC-SR501 sensor with an ESP32 and optocoupled relay to automate exterior floodlights, firing push notifications to your phone upon unauthorized perimeter breach.
1. Tuning the HC-SR501 Potentiometers
The HC-SR501 features two onboard trimpots:
- Sensitivity (Distance): Clockwise increases detection range up to 7 meters.
- Time Delay: Clockwise increases latch duration from 3 seconds up to 5 minutes.
Parts used in this tutorial
Buy them in one click — ships from Pune across India.
- PIR Motion Sensor Detector Module HC-SR501Sensors₹59.00+ GST
- ESP32 Development Board with WiFi & Bluetooth – CH340C USB Type-CMicrocontrollers₹419.00+ GST
- Relay Module 5V 10A (1-channel)Power & Components₹45.53+ GST
Approx. total ₹523.53 (before GST)Add all to cart
#security#esp32#motion-detector
Found this useful? Tell us what you'd like to read next via our RFQ form.