Using a PIR Sensor in a Motion Detection System Design
By Lars Thornqvist, FAE, Future Electronics Sweden
|
READ THIS TO LEARN ABOUT
 |
- Operation of multi-element PIR sensors
- Design of motion sensing systems
- Selection of Cypress PSoC devices for motion detection applications
|
 |
|
|
The Pyro-electric Infra-Red (PIR) sensor is an extremely useful device for detecting the presence of a moving body. This is due to its ability to sense the infrared radiation that every living body emits.
Part of the appeal of the PIR1 sensor is its ability
to reliably distinguish moving bodies from other
objects, as well as from stationary bodies. Its basic
mode of operation is to detect the difference in
heat signature between two ‘segments’ in its field
of view. The model of the internal structure of a PIR
sensor (see Figure 1) clearly illustrates this operating
principle.

Figure 1: Murata’s IRA-E940ST1 PIR sensor
To avoid triggering upon sensing normal temperature
variations or disturbances in airflow, a
dual-element PIR sensor connects two elements
in pairs. These are inverted with respect to each
other in terms of polarization. When the two inverted
elements are exposed to the same infrared
radiation level, they cancel each other out, generating
a zero-output signal as a result.
This means that the detected body will have to
move into or between the two elements’ field of
view to cause the sensor to generate an output
signal. In this way, a dual- or quad-element sensor
is able to reject false detections accurately and
effectively.
By using a dual- or quad-element sensor, it is also
possible to detect the direction in which the object
is moving. The quad-element sensor in Figure 1
has two outputs: this means that it can indicate
in which area the movement is occurring (for instance,
on the ceiling or on the floor), and at the
same time whether the object is moving in the
horizontal or vertical plane. The dual sensor can
only indicate movement in one axis; for example,
the horizontal plane.
When specifying a sensor, the number of elements
is only the first consideration.
Other important parameters that vary between
sensors are frequency response,
which determines
the sensor’s ability to detect
low and high speed
movements, the angle of
the field of view, which
will affect the size of the
sensor’s coverage area
and immunity to RF and
background noise.
Configuring the Lens
The sensor itself is inefficient if it does not have a
lens to focus the radiation. The most commonly
used lens type is the Fresnel lens, due to its low
losses and small form factor. A Fresnel lens is a
compressed plano-convex lens that comprises a
set of discontinuous surfaces (see Figure 3).
The grooves on the lens are arranged facing the
PIR sensor. This leaves a flat, dust and weather
proof surface facing the outside and protecting the
otherwise vulnerable sensor.

Figure 3: Convex lens (left) and Fresnel lens (right)
The Signal Conditioning Circuit
To be usable, the signal from the sensor has to be
amplified and then converted into a digital value for
further analysis in software. A typical block schematic
for this application is shown in Figure 4.
There are several ways to design a circuit to realize
this schematic. The two preferred approaches use
either discrete analog components, or, in a more
integrated implementation, a mixed-signal programmable
array such as a Cypress Semiconductor
Programmable System-on-Chip (PSoC) device.

Figure 4: PIR sensor signal conditioning circuit: block diagram
The Discrete Solution
The most common approach to PIR sensor signal
conditioning is to design the amplifier and signal
conditioning stage by using discrete components
such as operational amplifiers, comparators, diodes,
resistors and capacitors. Next in the signal
path, a microcontroller with an integrated ADC performs
signal identification and also supports
connection to a communications
interface, such as a radio.
This traditional approach occupies a
large PCB footprint. But a PIR sensor
produces a very low signal level, so it is
essential to keep PCB traces short and
the design compact to avoid creating
unwanted antennas. These can pick up
background noise and RF signals, which
can cause the device to trigger falsely. If
the PIR sensor is connected to a wireless
network (for instance, as part of an intruder alarm
system), the danger of this is particularly high.
The PSoC Solution
A second approach, which produces a more compact
result, is to use a PSoC device from Cypress. The
PSoC is a programmable mixed-signal controller with
an 8-bit core and a set of analog and digital blocks
that can be used to create the functionality needed.
Analog blocks that can be realized in the PSoC
include ADCs, DACs, filters, amplifiers and comparators.
Integrated digital functions include timers,
counters, UARTs, SPI and PWMs. Designers using a
PSoC will be able to realize the blocks shown in Figure
4 with far fewer components than in the discrete
implementation described above.
Different devices in the PSoC family provide different
numbers and types of digital and analog
blocks, offer different memory sizes and use different
packages. The first step in implementing a
PIR sensor with a PSoC device should be to identify
the required analog and digital functionality. When
the block diagram is defined, an appropriate device
with the right number of programmable blocks can
be selected.

Figure 2: A PIR sensor works by sensing the difference in infra-red radiation
between one sensing element and another
Conclusion: Why Use a PIR Sensor
While a number of technologies for motion detection
exist, including ultrasonic and microwave radiation
sensors, the PIR sensor is popular for its
ease-of-setup and high performance. In addition,
PIR sensors are inexpensive and draw little power.
Future Electronics expects the rate of
adoption of PIR sensors to grow fast,
with applications such as surveillance
and alarm systems, as well as power
saving devices, driving increased usage.
Future Electronics, a broad line component
distributor, can supply every
component required in a PIR sensor
system, including PIR sensors, lenses,
discrete components, microcontrollers
and PSoC devices. Future Electronics’ FAEs
can provide customers with technical support in
the implementation of PIR sensor system designs.
1 A PIR sensor should not be confused with the thermopile
sensor (eg the Melexis MLX90247), the output of which
is proportional to static radiation. Thermopiles are more
commonly used in temperature measurement devices.