Just as when writing code, taking an iterative approach to building hardware is always advisable: change one thing, test, and then change another. In later chapters, we’ll take the evolutionary approach one more step forward and move our sensors off the breadboard, but for now, let’s add another sensor.
The next sensor we’ll add is one to detect motion.
We’re going to make use of a Passive Infra-Red (PIR) motion sensor (see Figure 3-1).
PIR sensors are commonly used in alarm systems, as they’re an inexpensive and fairly easy-to-use way to detect motion. While there are a number of different PIR boards commonly available (and each will have slightly different specifications), they all pretty much work the same way.
A PIR consists of a pyroelectric sensor that can detect levels of Infra-Red (IR) radiation split into two halves. The halves are wired to cancel each other out if the amount of IR radiation is constant. However, if the levels are changing, such that one half of the sensor sees more (or less) than the other, then the combined output of the two will be pulled high or low.
The PIR board in Figure 3-1 contains a pyroelectric sensor underneath a Fresnel lens (the plastic dome on ...