Wiring up
So far, we have discussed all the components of our system in detail and now we will wire up all the components together with the Raspberry Pi, one by one.
Interfacing PIR sensor module HC-SR501
Refer to Figure 6.15 for connection details:

Figure 6.15
As shown in Figure 6.15:
- The ground terminal of the PIR sensor is connected to the ground pin of the Raspberry Pi GND (Pin 06)
- The output of the sensor is connected to GPIO 19 (pin 35) of the Raspberry Pi
- The Vcc terminal is connected to +5V (pin 04) of Raspberry Pi
Interfacing an active IR sensor
Refer to Figure 6.16 for connection details:

Figure 6.16
In Figure 6.16:
- The O/P terminal of the sensor is connected to GPIO 05 (pin 29) of Raspberry Pi
- The GND terminal of the sensor is connected to GND (pin 06) of Raspberry Pi
- The Vcc terminal of the sensor is connected to +5V (pin 04) of Raspberry Pi
Interfacing an ultrasonic sensor HC-SR04
Refer to Figure 6.17 for connection details:

Figure 6.17
As shown in Figure 6.17:
- The Gnd terminal of the sensor is...