Motion
Interfacing HC SR501 Motion with Arduino Uno
What is the HC SR501?
The HC-SR501 is a passive infrared (PIR) motion sensor that detects the change in infrared radiation as a warm body moves across its Fresnel-lensed sensing cone. It outputs a simple digital HIGH when motion is detected and LOW otherwise — no library, no bus protocol, just a digital read.
It's the standard part for motion-activated lighting, security alarms, and occupancy sensing. The catch that trips people up is the two onboard trim pots and one jumper: the sensitivity pot sets detection range (up to ~7m), the delay pot sets how long the output stays HIGH after triggering (5s to 300s, defaulting to a very long ~5min-ish setting out of the box that makes the sensor look "stuck" on first test), and the jumper selects single-trigger (L, output resets during the delay window) vs repeatable-trigger (H, output stays high as long as motion continues). It also needs a 30–60 second warm-up period after power-on to stabilize — false or missed triggers in that window are normal.
Specifications
| Operating voltage | 4.5–20V DC (onboard regulator, commonly powered at 5V) |
| Output | Digital HIGH/LOW, 3.3V logic level |
| Sensing range | Up to 7m, adjustable via sensitivity trim pot |
| Sensing angle | <100° detection cone (Fresnel lens) |
| Delay time | 5s–300s, adjustable via delay trim pot |
| Trigger mode | Jumper-selectable: L (single trigger) / H (repeatable trigger) |
| Warm-up time | 30–60s after power-on before stable operation |
| Current draw | <60µA standby |
HC SR501 Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power, 4.5–20V DC (typically 5V) |
| 2 | OUT | Digital output — HIGH when motion detected, LOW otherwise |
| 3 | GND | Ground |
Three pins only — no library or bus needed, just a digitalRead() on OUT. The two trim pots (sensitivity, delay) and trigger-mode jumper (H/L) are set by hand on the board, not via code.
Setting Up HC SR501 with Arduino Uno
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| VCC | 5V | — |
| GND | GND | — |
| OUT | D7 | — |
Example code
No library needed. Allow 30-60s after power-up for the sensor to stabilize before trusting readings.
Related Components
Related Guides & Projects

Arduino Uno R3 Pinout: Every Pin Explained (Digital, Analog, PWM, Power)
Complete Arduino Uno R3 pinout reference: all 14 digital pins, 6 analog inputs, PWM, UART, SPI, I2C, AREF, and power rails explained with wiring tips and common mistakes.

Ultimate Arduino Mega 2560 Pinout Guide: Complete Power & I/O Reference
Master the Arduino Mega 2560 pinout. Detailed reference for all 54 digital pins, 16 analog inputs, PWM, UARTs, SPI, I2C, interrupts, and power. Includes a printable table and practical wiring tips.

Interfacing HC-SR04 Ultrasonic Sensor with Arduino
Measure distance accurately using ultrasonic sound waves and an Arduino Uno — no complex math, no expensive hardware.
HC‑SR04 Ultrasound Distance Measurement with Arduino – Parking Alert (LCD & Buzzer)
Learn HC‑SR04 ultrasound distance measurement with Arduino Uno. Build a parking alert system with 16x2 LCD and buzzer – shows distance and beeps faster as you approach.