PIR Motion Sensor

A Passive Infra-Red (PIR) motion sensor uses the heat of a warmblooded animal to detect its presence. The sensor and logic board compare regions of 3D space for contrast to a cool background plane. This technique works well in environments up to about 95 F (35 C).

The HC-SR501 PIR device combines sensor and logic into a compact board. It uses a dome shaped fresnel lens with regions that focus infrared light alternately onto two infrared sensors which are wired to produce positive or negative voltages in a electronic circuit. Normally, when the field of view is uniform, these opposing signals cancel each other. When a warm body enters the field of view its strong infrared emissions result in unequal voltages from the two sensors. The movement of the body produces an alternating voltage signal that a circuit recognizes as a detection event.


The additional circuitry in the PIR detects the transition from a constant current to an alternating one and uses that to switch between two modes of operation. The device has three connection pins: positive and negative for power and an output signal pin. Normally the device produces 0 volts on its output pin. When a sensitivity threshold is passed, an event mode is activated where the device outputs a 3.3V current to a rated maximum of 60 mA. This is enough to operate a buzzer but better results (more noise) can be had from the use of a transistor to amplify the signal. Both the sensitivity and the duration of the event are adjustable with a screwdriver.

These devices are usually designed to detect humans and large mammals. It remains to be seen if they work for squirrels and mice. According to this article, tree squirrels, which do not hibernate and thus stay warm all winter, have a similar body temperature to humans (95F-100F or 35C-37C).

The device has a 120 degree cone of detection. The device must be located so that the target is within this cone. A small animal near the apex of the cone will occupy the same area as a larger animal farther from the apex. So a squirrel in this confined space is a reasonable target for this device.

Sensitivity can be adjusted to cut off range at between 3m and 7m. This application will use the lower range.

Piezo-Electric Buzzer (Active and Passive)

Piezo means pressure. Certain materials were found to produce electricity when subjected to pressure. This property is used to make grill igniters. A spring loaded device hits a ceramic and produces enough electricity to make a spark at the igniter’s electrodes.

It also happens that an electric charge applied to a small sliver of this ceramic material will cause its shape to suddenly distort, moving a small amount of air in the process. Sounds are created by small repetitive movements in air that generate pressure waves.

Devices called piezo electric transducers will make sudden shape changes that produce movement in the air. A transducer moves once for each change in electrical charge so to make an audible sound the charge must be repetitively stimulated to produce a desired sound frequency. Transducers can be used to make audio speakers or simple buzzers when combined with other electronics. See this discussion of piezo buzzers.

Two kinds of piezo electric buzzers are commercially available: passive and active.

A passive piezo electric buzzer is a device that drives a piezo electric transducer in its simplest manner. An input to the device produces a single movement in the transducer. To create useful sound, the device must be given repetitive inputs at a frequency for the desired sound output. Generally passive buzzers are meant to be used with a microcontroller to create a stream of inputs to control output.

An active piezo electric buzzer is an electronic device that contains all the electronics to drive a transducer at a designed frequency to produce a particular sound. It only needs an input to turn on the process. Generally an input is a signal from another device, for example a PIR motion sensor.