AN1828
APPLICATION NOTE
PIR (PASSIVE INFRARED) DETECTOR USING
ST7FLITE05/09/SUPERLITE
INTRODUCTION
The document explains how to design a low cost PIR detector (human motion detector) using
the ST7FLITE05(09) microcontroller family. The technique used is software Sigma-Delta A/D
Conversion, suitable for detecting low-frequency sensor signals. Refer to AN1827 for a de-
tailed explanation of the Sigma-Delta technique. The same concept can also be used for other
sensor applications such as:
– Security Systems.
– Automatic lighting Systems
– Automatic Door Openers
Rev. 1.0
AN1828/0304
1/17
1ddd
PIR (PASSIVE INFRARED) DETECTOR USING ST7FLITE05/09/SUPERLITE
1 SENSOR OVERVIEW
The human body radiates infrared waves with wavelengths of 8 to 12 micrometers. Any move-
ment by a person leads to a change in the amount of infrared energy which a sensor can de-
tect within its range. The PIR sensor reacts to this change in infrared energy and provides a
low-frequency, small amplitude signal. This signal can be amplified and decoded using a
ST7Lite05 microcontroller (as explained in
Section 1.2).
1.1 INFRARED FOCUSING BY FRESNEL LENS
The sensor can sense the change in the amount of infrared energy within small distances, ap-
proximately up to 10 inches. For detecting movements at longer distance, infrared radiation
has to be focused. This focusing is done by a Fresnel lens. A Fresnel lens divides the whole
area into different zones. Any movement between zones leads to a change in the IR (infrared)
energy received by the sensor. There are different types of Fresnel lenses depending on the
range (distance) and coverage angle. For example, volumetric lenses and curtain lenses etc.
1.2 PIR DETECTOR USING ST7FLITE05 MICROCONTROLLER
A PIR detector can be made easily with ST7FLITE05 using the circuit shown in
Figure 2.
The
sensor interfacing circuit (shown on the left side of the microcontroller in
Figure 2)
can be di-
vided into the following modules:
1.Transistor circuit used as an amplifier.
2.Transistor biasing controlled through the microcontroller.
3. Software-controlled transistor output.
Figure 1. Block Diagram
PIR sensor
RC
Integrator
Transistor
Amplifier
ST7 Micro-
controller
Alarm
Biasing Signal
2/17
2
PIR (PASSIVE INFRARED) DETECTOR USING ST7FLITE05/09/SUPERLITE
1.3 SENSOR CIRCUIT DESCRIPTION
Transistor Q3 is biased in the active region and amplifies the signal from the PIR sensor. The
microcontroller provides a biasing signal, which is connected to the biasing network on the
transistor. This biasing signal is integrated through a capacitor (C7) and resistor (R14). The
bias signal at 0 level (LOW) for a long time (greater than the discharging time of the capacitor)
puts the transistor into the cut-off region, making it OFF. The HIGH from the microcontroller for
a long time (greater than the charging time of the capacitor) causes saturation of the tran-
sistor. Thus the transistor gain is controlled by the micro-controller and it can shift the bias
from cut-off to saturation region and vice-versa.
The software adjusts the biasing signal to keep the output of transistor amplifier at constant
threshold level which is checked by continuously reading the value using the A/D Converter
(ADC) of the microcontroller. The application uses a software counter to track the number of
times the biasing signal was changed to LOW or HIGH to maintain the threshold.
The C7 capacitor at base of transistor causes integration of the biasing signal generated by
the microcontroller, causing the voltage at base of transistor to be approximately constant.
This voltage causes the transistor to operate within the active region.
1.3.1 Detecting signal variations
If there is no signal from the PIR sensor, the software counter (which tracks the number of oc-
currence of LOW / HIGH in a particular time) variation remains within in a small range. In case
of motion and hence a signal from the PIR, this software counter will change beyond the limits
set by the software.
1.3.2 Filtering signal variations due to changes in surroundings
Slow changes because of temperature, ambient light etc. are compensated by software by
keeping the transistor output/feedback signal at constant level. The effect of these parameters
may cause changes in the threshold voltage. But by maintaining the threshold signal at con-
stant level these effects are nullified. This changes the value of the software counter slightly,
which can easily be distinguished from human movement (which also causes changes in the
software counter) by comparing the magnitude and direction of the changes.
3/17
PIR (PASSIVE INFRARED) DETECTOR USING ST7FLITE05/09/SUPERLITE
Figure 2. Circuit Diagram
4/17
PIR (PASSIVE INFRARED) DETECTOR USING ST7FLITE05/09/SUPERLITE
1.4 TRANSISTOR BIASING
1. The transistor is biased using voltage-divider biasing.
This biasing has following advantages:
a. The circuit behaviour is independent of the h
fe
of the transistor
b. The circuit behaviour is independent of temperature changes etc.
c. The circuit gain is controlled
2. When the PWM signal is HIGH, the voltage drop across R17 is 0.83V
(10k *5V / (50k + 10k)).
Note:
R15=100K is in parallel with R13 =100K.
(100k || 100k) = 50K.
The circuit analysis shows that this condition will force the transistor to go into the saturation
region. For saturation, the Vbe >= 0.7V approx.
3. When the PWM signal is LOW, the voltage drop across R17 is 0.41
(= 9.09 k *5V / (100k + 9.09k)).
Note:
R13=100K is in parallel with R17 = 10K.
100k || 10k = 9.09K
The circuit analysis shows that this condition will force the transistor to go into the cutoff re-
gion. For cutoff, the Vbe <= 0.5V
4. Thus the microcontroller biasing signal (averaged by the RC circuit) can adjust the tran-
sistor biasing. The RC network is formed by R14 and C7 in
Figure 2.
1.5 TYPICAL PIR DETECTOR (CONVENTIONAL)
In conventional detectors, the IR radiation is focused by the Fresnel lens on the PIR sensor
and then the output of PIR sensor (which is very small in amplitude) is amplified by an OP-
AMP based amplifier. The OP-AMP also works as low pass filter and rejects the high fre-
quency signals (more than 10Hz typically). The output of the amplifier is connected to the
comparator which compares the signal to the threshold level. An alarm is raised/light source is
powered if the reference (threshold) voltage is crossed.
5/17