Passive infrared (PIR) motion sensors

A passive infrared (PIR) motion sensor can detect changes in infrared radiation, most often in order to detect the motion or presence of people or animals.

The sensor can be thought of as a two-pixel infrared camera. It has two internal infrared sensors and circuitry to detect changes between them. The internal sensors are covered by a Fresnel lens that determines the PIR device's field of view.

The following relates specifically to the HC-SR501 model, but it should also apply to similar PIR motion sensors for hobbyists.

Infrared receiver modules

Infrared receiver modules are commonly used in remote control systems, and sometimes for line-of-sight wireless data transmission.

For the IR receiver module pictured here, which is based on a VS1838B sensor receiving a 38 kHz carrier, we will use a library called IRremote, which includes support for several different modules and protocols.

The module has three pins, labeled `G`, `R`, and `Y`. These letters may (or may not) stand for green, red, and yellow, which happen to be sensible colors to use for the wires connecting ground, voltage, and signal pins, respectively.

Subscribe to infrared