PinLab › Components › PIR sensor HC-SR501
VCCOUTGND SxTx

PIR sensor HC-SR501

motion detector

Detects movement of warm bodies (people, animals) up to ~7 m. The white dome is a lens that gathers infrared radiation. For alarms and automatic lights.

Open the course →

How it works

A passive infrared (PIR) sensor has two heat-sensitive elements. When a person passes, one element "sees" more heat than the other → difference → OUT goes HIGH for a set time (adjustable 3 s – 5 min). Then it returns LOW. The Sx potentiometer changes sensitivity (distance), Tx how long OUT stays HIGH.

Pins and wiring

PinWhat it isWhere it connects / why
VCCPower→ VIN (5 V). The module has a 3.3 V regulator inside.
OUTDigital output→ GPIO (e.g. 27). The output is 3.3 V — safe for the ESP32.
GNDGround→ GND.

Specifications

Power4.5 – 20 V
Output3.3 V HIGH / 0 V LOW
Range3 – 7 m, 110°
Hold time3 s – 5 min (Tx pot)
Warm-up~60 s after power-up
JumperH = repeatable trigger, L = single trigger

Tips and typical mistakes

Used in projects