Components / Sensors / PIR Motion Sensor HC-SR501

PIR Motion Sensor HC-SR501

Senses changes in infrared radiation to detect motion.

MeasuresMovement of warm bodies (passive infrared)
RangeUp to about 7 m, 110° cone
AccuracyOn/off output
InterfaceDigital output, 3.3 V HIGH when triggered
SensorsReviewedMPN HC-SR501Used in 27 projects
In short

What is the PIR Motion Sensor HC-SR501 and what is it used for?

Senses changes in infrared radiation to detect motion. Makers use it for activate low-power alarm indicator.

It cannot see through glass, and heat sources like heaters can cause false triggers.
In the real world

Lighting and occupancy detection

How it works

Sensors convert a physical quantity into an electrical signal. Calibrate, verify module supply, interfaces and environmental limits.

Key specifications

Sensor specValue
MeasuresMovement of warm bodies (passive infrared)
RangeUp to about 7 m, 110° cone
AccuracyOn/off output
InterfaceDigital output, 3.3 V HIGH when triggered
Supply voltage5 to 20 V (onboard 3.3 V regulator)
Operating temperature−15 to 70 °C

Pinout

VCC5 V
OUT3.3 V HIGH on motion
GNDGround
Sx trimmerSensitivity (range)
Tx trimmerHold time, about 3 s to 5 min
Jumper H / LH: retrigger while moving; L: single trigger

How to use it

Wait about a minute after power-up while it settles. The 3.3 V output works with both 5 V and 3.3 V boards.

void setup() { Serial.begin(9600); pinMode(2, INPUT); pinMode(13, OUTPUT); }
void loop() { int m = digitalRead(2); digitalWrite(13, m); if (m) Serial.println("motion"); delay(100); }

Applications

Buy at

Common questions

What is the PIR Motion Sensor HC-SR501 used for?

In products: lighting and occupancy detection. In maker projects: activate low-power alarm indicator.

How does the PIR Motion Sensor HC-SR501 work?

Sensors convert a physical quantity into an electrical signal. Calibrate, verify module supply, interfaces and environmental limits.

What voltage does the PIR Motion Sensor HC-SR501 need?

5 to 20 V (onboard 3.3 V regulator).

How do I connect the PIR Motion Sensor HC-SR501 to an Arduino or ESP32?

Digital output, 3.3 V HIGH when triggered. Pins: VCC (5 V), OUT (3.3 V HIGH on motion), GND (Ground), Sx trimmer (Sensitivity (range)), Tx trimmer (Hold time, about 3 s to 5 min), Jumper H / L (H: retrigger while moving; L: single trigger).