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.
Passive infrared motion detector that outputs a simple 3.3V digital HIGH when a warm body moves across its field of view.

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.
| Pin | Function | Type |
|---|---|---|
VCC VCC (5-20V) | Power | Power in |
OUT OUT (3.3V TTL) | Digital motion output | Digital output |
GND GND | Power | Power in |
Verified from the Tinkered component library · Generic.
The PIR HC-SR501 connects to any of the microcontrollers supported in Tinkered. Mind the 5 V logic level on 3.3 V boards.
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.
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.
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).
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.
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.
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.
Trigger a buzzer, notification, or camera capture when the OUT pin goes HIGH, with the sensitivity pot tuned to the room size.
Turn a fan, monitor, or sign on only when the area is occupied and let it power down automatically once motion stops.
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.
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.