Hardware Reference
In-Depth Information
100K ohm resistor
10K ohm resistor
Some wire
As you can see you don't need many components for this chapter. First up I will show you how to use the
pressure mat.
The Pressure Mat
The first thing you need to understand about the GPIO pins for this part of the project is that they don't have a known
state to the operating system. You can drive it high or low, but you won't know the original voltage level. This is
because the GPIO pins are in a floating state. Just like with the I2C bus you need to pull up the GPIO pin to give it a
fixed value. This is where the 10K ohm resistor comes into the picture. I will use this resistor to pull up the GPIO pin
to a known voltage of 3.3 V. The circuit I will use to interface with the pressure mat could be used on any number
of switch-style inputs including mercury tilt switches and magnetic door sensors. It's now time to take a look at the
circuit schematic. In Figure 5-6 you can see the circuit diagram and exactly how simple it is!
Pi
26
25
24
23
22
21
20
19
Mat
18
17
1
2
16
15
14
13
12
11
10
9
8
7
6
5
4
3
10k
2
1
Figure 5-6. The pressure mat circuit schematic
Because this circuit is so simple I haven't included a breadboard image of the completed circuit. The first thing
I did was solder an extension cable and some breadboard pin headers onto the pressure mat (I cut a hook-up wire in
half for this job). You can see in Figure 5-7 the finished mat and the two unused tamper loop wires.
 
Search WWH ::




Custom Search