Building an alarm system using the Raspberry Pi Zero
In this section, we will build a simple alarm system with a PIR sensor connected to the Raspberry Pi Zero. This is an important project as it can be added to the home, including other sensors, in order to monitor it.
Motion sensor with Raspberry Pi Zero
For this project we need the Raspberry Pi Zero, a motion sensor PIR, and some cables. The hardware configuration for this project will actually be very simple. First, connect the VCC pin of the motion sensor to a 3.3V pin on the Raspberry Pi. Then, connect the GND pin of the sensor to one GND pin on the Pi. Finally, connect the OUT pin of the motion sensor to the GPIO17 pin on the Raspberry Pi. You can refer to the previous chapters to find out about pin mapping on the Raspberry Pi Zero board.
The following image shows the final circuit with the connections:
Software code
You can now either copy the code inside the folder called Project1
, or just get the complete code from the folder for this...