PIR HC-SR501

Passive infrared motion detector that outputs a simple 3.3V digital HIGH when a warm body moves across its field of view.

PIR HC-SR501: Passive infrared motion

What is the PIR HC-SR501?

The HC-SR501 is a self-contained passive infrared (PIR) motion sensor module built around the BISS0001 controller and a dual-element pyroelectric sensor sitting under a white Fresnel lens. It does not emit anything: it watches for changes in the infrared radiation given off by a warm body (a person or animal) crossing its field of view, and reports that change as a single digital output. No microcontroller math is required to read it, since the module does all of the detection and timing on board.

Detection covers a wide cone of up to roughly 120 degrees, reaching up to about 7 meters. Two orange potentiometers tune behavior in hardware: one sets sensitivity (effective range), and the other sets the delay time, which is how long the OUT pin stays HIGH after a trigger and can be adjusted from a few seconds up to roughly five minutes. A jumper selects between repeatable trigger mode (H), where continued motion keeps restarting the timer, and non-repeatable mode (L), where the output drops after the delay regardless of ongoing motion.

The module accepts a wide 4.5-20V supply (5V is typical) thanks to an onboard regulator, and draws well under 50µA when idle, so it suits battery projects. The OUT pin drives a clean 0V to 3.3V TTL signal, which reads as a valid logic HIGH on a 5V Arduino and connects directly to 3.3V boards like the ESP32 without any level shifting.

PIR HC-SR501 pinout

PinFunctionType
VCC VCC (5-20V)PowerPower in
OUT OUT (3.3V TTL)Digital motion outputDigital output
GND GNDPowerPower in

Specifications

Operating voltage
5 V (max 20 V)
Interface
digital
Dimensions
32 × 18 × 24 mm

Verified from the Tinkered component library · Generic.

Circuit requirements

  • Power VCC from 4.5-20V (5V is the usual choice); the onboard regulator needs that headroom, so a 3.3V rail alone will not reliably run the module even though its output is 3.3V logic.
  • OUT is an actively driven push-pull signal (0V LOW, 3.3V HIGH), so no external pull-up or pull-down resistor is needed on the output line.
  • The 3.3V HIGH is a valid logic level for a 5V Arduino input and is directly compatible with 3.3V microcontrollers, so no level shifter is required in either direction.
  • Allow roughly 30 to 60 seconds of warm-up after power-on for the sensor to settle against the ambient IR background; readings during this window can false-trigger and should be ignored.
  • Set the trigger jumper deliberately: H (repeatable) keeps OUT HIGH while motion continues, while L (non-repeatable) drops OUT after the delay time and observes a short block period (about 2.5s) before it can trigger again.
  • Keep the sensor away from HVAC vents, heat sources, and direct sunlight, and note that PIR cannot see through glass, all of which cause missed or false triggers.

Board compatibility

The PIR HC-SR501 connects to any of the microcontrollers supported in Tinkered. Mind the 5 V logic level on 3.3 V boards.

Common PIR HC-SR501 mistakes

Trusting the output before warm-up finishes

Immediately after power-up the module needs time to calibrate against the ambient IR level. During the first 30 to 60 seconds it can pulse HIGH on its own. Gate your logic (or add a startup delay) so those initial readings do not fire your alarm or actuator.

Confusing the two potentiometers

One pot sets sensitivity (detection range) and the other sets the delay time (how long OUT stays HIGH). People often turn the wrong one, then conclude the sensor is stuck HIGH when they have actually dialed the delay up toward its multi-minute maximum.

Ignoring the trigger-mode jumper

In non-repeatable mode (L) the output goes LOW after the delay even if a person is still moving, which looks like the sensor dropping out. For presence detection that should hold while motion continues, use repeatable mode (H).

Assuming a 3.3V output means a 3.3V supply

The OUT pin swings to 3.3V, but VCC still needs at least 4.5V for the onboard regulator. Powering the module from a bare 3.3V rail leaves it under-volted and unreliable; give it 5V and read the 3.3V output as-is.

Poor mounting location

Pointing the sensor at a window, a heater, an air vent, or direct sun leads to constant false triggers, because moving warm air and sunlight both look like motion to a PIR element. It also cannot detect motion through glass. Mount it facing the interior area you actually want to watch.

PIR HC-SR501 datasheet

Official PIR HC-SR501 datasheetGeneric

Popular PIR HC-SR501 projects

Automatic room and hallway lighting

Switch a lamp or LED strip on when someone enters and off after a set delay, using the time-delay pot to hold the light on between movements.

Motion-activated security alarm

Trigger a buzzer, notification, or camera capture when the OUT pin goes HIGH, with the sensitivity pot tuned to the room size.

Occupancy-based appliance control

Turn a fan, monitor, or sign on only when the area is occupied and let it power down automatically once motion stops.

Battery-powered entry notifier

Take advantage of the sub-50µA idle draw to run a low-power visitor or intrusion alert that wakes a microcontroller from sleep on motion.

Build with the PIR HC-SR501.

Drop the PIR HC-SR501 into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.