Raspberry Pi Motion Detector is a Python script with which you can use Raspberry Pi and a PIR sensor as a motion detector.
- Only Raspberry Pi OS Bullseye is supported.
- Raspberry Pi
- Any three-pin PIR sensor
- In the file pir.py edit poweroff_delay and check_delay to change the screen auto-off time and the delay between sensor polling, as well as pir_pin to the one you use for the sensor (BOARD type numbering)
gpio.setmode(gpio.BOARD)
poweroff_delay = 10
check_delay = 0.85
pir_pin = 11
- Download the script:
git clone https://github.com/ByloTonix/PIR-Sensor/
cd PIR-Sensor/
- After completing the configuration, go to the directory with the script and run it:
cd ~/PIR-Sensor
sudo python3 pir.py