8 Min Read - Updated June 2026

PIR Motion Sensor HC-SR501: Delay, Sensitivity, Retriggering & Arduino Wiring

Learn HC-SR501 PIR motion sensor wiring, Fresnel lens detection, delay and sensitivity pots, retrigger mode, false trigger fixes, and Arduino code.

HC-SR501 PIR motion sensor with Fresnel lens detecting a moving human heat signature
Sensor Type

Passive infrared pyroelectric detector

Detection Range

3-7 m typical

Field of View

About 100-120 degrees with Fresnel lens

Output

Digital HIGH on motion

Warm-Up Time

30-60 s after power on

Common Module

HC-SR501 or AM312

Quick Definition

Definition: A PIR motion sensor detects movement by watching for changes in long-wave infrared radiation from warm bodies as they pass across segmented zones of a Fresnel lens.
  • [PIR sensor] [detects] [changes in body heat radiation]
  • [Fresnel lens] [splits] [the detection area into motion zones]
  • [HC-SR501 jumper] [selects] [retriggerable or single-trigger output behavior]

How PIR Detection Actually Works

Unlike an obstacle IR module, a PIR sensor does not emit infrared light. It passively watches the room for changes in thermal radiation. A human body emits strongly around 9-10 micrometers, and the pyroelectric element responds when that heat pattern moves across its paired sensing elements.

The white dome is not just a cover. It is a Fresnel lens that divides the room into alternating zones. Motion across zones creates a changing signal; a stationary person may not keep triggering the module.

Delay, Sensitivity, and Retrigger Settings

The HC-SR501 usually has two potentiometers and one jumper. Sensitivity changes the effective detection range. Delay controls how long the OUT pin stays HIGH after motion. The jumper chooses whether motion can extend the timer while the output is already active.

For lighting automation, retrigger mode is usually better because continued movement keeps the light on. For counting events, single-trigger mode is easier because each output pulse is separated by a timeout.

  • Use low delay during debugging so you are not waiting minutes between tests.
  • Aim the dome across the direction of motion, not directly toward the approach path.
  • Keep PIR modules away from heaters, windows, exhaust fans, and direct sun patches.

Arduino PIR Motion Alarm Code

PIR modules are easy to read because the output is already digital. The tricky part is ignoring the warm-up period and avoiding repeated serial spam.

const int pirPin = 2;
bool lastMotion = false;

void setup() {
  pinMode(pirPin, INPUT);
  Serial.begin(9600);
  delay(45000); // PIR warm-up
}

void loop() {
  bool motion = digitalRead(pirPin) == HIGH;

  if (motion && !lastMotion) {
    Serial.println("Motion detected");
  }

  lastMotion = motion;
}

Frequently Asked Questions

Does a PIR sensor work through glass?

Usually no. Common glass blocks much of the long-wave infrared radiation PIR sensors detect, so a person behind a window may not trigger the sensor reliably.

Why does my PIR trigger with no person nearby?

False triggers often come from heat sources, sunlight movement, air drafts, unstable power, or insufficient warm-up time. Add decoupling, move the sensor, and reduce sensitivity.

What is retrigger mode on HC-SR501?

Retrigger mode keeps extending the HIGH output as long as motion continues. Non-retrigger mode outputs one timed pulse, then waits before it can trigger again.

References & Sources

Was this article helpful?

Tap a star to rate — no account needed

Related Resources