Hardware Reference
In-Depth Information
Introduction to the PIR
Let's take a look at the passive infrared sensor, or PIR for short. Let's get one thing straight first: PIRs do not
detect motion. What do they detect then? To answer that I first need to talk about how they work. The first step to
understanding how these sensors work is to understand that everything above zero kelvin or absolute zero emits some
form of heat. This heat can be seen as infrared radiation. This radiation is commonly known as infrared light, and
humans cannot see this light wavelength. Figure 5-1 shows a large spectrum of wavelengths that humans cannot see.
Radio
Microwave
Infrared
Visible
ltraviolet
X-Ray
Gamma Ray
Low frequency
High frequency
Figure 5-1. Figure showing some available wavelengths
Each segment in Figure 5-1 if broken down further would contain many types of wavelengths. The easiest way to
think about this is with the visible wavelength. If you were to break this group down, each frequency between infrared
and ultraviolet would be a color you can see with your eyes. The PIR is no different to humans in this regard; it can see
only a certain range of frequencies. The range of frequencies that the PIR can see is infrared. The PIR is unable to see
anything in the visible frequency range just as much as humans are unable to see anything in the infrared range.
That has still not answered exactly how the sensor detects motion. When active, the PIR will detect all the current
heat sources in a given space by using a photosensitive receiver. These receivers are similar to the remote control for
your TV. Within seven seconds of its initial powering on, the PIR will have built up a map of heat sources in your given
area. What PIR you have governs what happens next; the PIR you have I would hope is of the digital type and not of
the analog output type. The analog version will just send back a voltage difference and the Raspberry Pi has no analog
inputs to sense this.
So then how will your digital PIR work? This is a two-step process that all happens inside the PIR itself.
1.
The first step is to amplify the signal detected by the photoelectric sensor to a level that can
be easily worked with by other semiconductors. This step happens in both the analog and
digital versions of the PIR. In the analog version the signal is sent out of the sensor and on
to another external device.
2.
Because we're concerned with the digital version of the PIR, the signal is sent over to
another small chip that lives inside the PIR. This little chip is from a family of circuits
called a comparator. You would mostly find a comparator inside an analog-to-digital
converter, just like your PIR. A comparator's sole job is to compare two voltages or currents
and then switch an output to indicate which is larger. Figure 5-2 is a diagram of how a
comparator will work.
+
1.0v
3.3v
+
L ED
L ED
+
+
1.0v
3.3v
-
-
Circuit is Open
Led is OFF
Circuit is completed
Led is on
Figure 5-2. A very basic comparator circuit
 
 
Search WWH ::




Custom Search