Hardware Reference
In-Depth Information
As you can see, when the voltage on the negative side is higher the circuit is completed and the LED turns on;
DC current flows from one side of the circuit to the other. When the voltage is higher on the positive side, the circuit
is broken because current cannot flow from the positive side of the LED to the positive side of the comparator. This is
our analog-to-digital converter, converting an analog signal into a digital on/off state.
Now that you know all the parts inside your PIR, I will tell you exactly how they all work together to give you a
nice digital on/off signal. When your PIR has its map of temperature built up, the voltage across the photoelectric
sensor will not change. As soon as the infrared heat profile of your area changes, this will generate a small charge
inside the photoelectric sensor. This small charge is then amplified by the internal amplifier inside the PIR; this will
then be handed off to the comparator. The comparator will detect there is a larger voltage and will switch on the
output signal of the PIR or send the output high. Once the charge inside the PIR has gone away, the comparator sets
the output back to low. This digital signal is what the Raspberry Pi can read via its GPIO pins. This signal will look
something like what you see in Figure 5-3 to the Raspberry Pi.
High
Detected
Low
Clear
Figure 5-3. The digital output of the PIR sensor
As you can see, the PIR takes care of most of the hard work and gives you a nice clean digital output to work with
and that's perfect for the Raspberry Pi.
Introducing the Pressure Mat
The next device, your common pressure sensing mat, is far simpler than the PIR but just as useful for detecting
motion. I personally often thought of these devices as some form of high-tech equipment that would be hard to
interface with. I was very wrong on this fact. If you were to vertically cut your pressure mat in half it would look
something like Figure 5-4 .
Top of mat
+
Positive Side (+)
Void
-
Negative Side (-)
Bottom of mat
Figure 5-4. A diagram of a common pressure mat
 
Search WWH ::




Custom Search