Alarm systems using motion sensors are a ubiquitous part of our society. With our Raspberry Pi, they are incredibly easy to build. We will cover the following in this section:
- What is a PIR sensor?
- Using the
GPIO buzzer
class - Building a basic alarm system
PIR sensors, a type of motion sensor, are used to detect motion. Applications for PIR sensors are pretty much based on detecting motion for security systems. PIR stands for passive infrared, and PIR sensors contain a crystal that detects low-level radiation. PIR sensors are actually constructed in two halves, as it is the difference between the halves that detects motion. The following is a photo of an inexpensive PIR sensor:
Note
In the preceding photo, we can see the positive (+), negative (-), and signal (S) pins. This particular PIR sensor sits well on a breadboard.
The following is the wiring diagram of our PIR circuit. The positive pin connects to the 5 V DC output on...