
The HC-SR501 is the most common PIR (Passive Infrared) motion module in hobby electronics, and beyond the basic "detect movement" wiring, it has two onboard adjustments and a jumper that most beginners never touch — even though they change how the sensor behaves quite a bit.
Components needed
An Arduino Uno, an HC-SR501 PIR motion sensor module, an LED (or use the board's built-in LED on pin 13), a resistor if using an external LED, and jumper wires.
Wiring it up
The HC-SR501 needs 5V and ground, plus its digital OUT pin connected to an Arduino digital input — commonly pin 2, since it also supports interrupt-based reading. The module outputs HIGH when it detects motion and LOW when the area is still.
The two onboard potentiometers
Two small potentiometers sit on the board itself. One adjusts sensitivity — effectively the detection range, adjustable from roughly 3 to about 7 meters. The other adjusts the time delay — how long the OUT pin stays HIGH after motion is detected, tunable from a few seconds up to several minutes. Turning these with a small screwdriver lets you tune the sensor to a room's size and how long you want an alarm or light to stay triggered without touching a single line of code.
The H/L trigger jumper
A small jumper near the potentiometers selects between two trigger modes. In L mode (non-repeatable trigger), the OUT pin goes HIGH for the set delay time and then drops LOW even if motion continues, only re-triggering after the delay period ends. In H mode (repeatable trigger) — the more commonly used default — each new motion detected during the delay window resets the timer, so OUT stays HIGH continuously as long as movement keeps happening.
Programming it
Allow a warm-up period after power-up, then interpret OUT according to the H/L retrigger mode and adjust delay and sensitivity gradually. A PIR detects changing infrared energy from a moving warm target, not reliable presence of a stationary person; sunlight, airflow, and placement affect performance.
Where this fits
We've covered PIR motion sensing before in the context of a security alarm setup. The HC-SR501 specifically is worth knowing on its own because tuning its sensitivity, delay, and trigger mode properly is often the difference between a motion-sensing project that works reliably and one that triggers constantly or misses movement.
You can find HC-SR501 PIR motion sensor modules at Juthour Tech.
Leave your comment