A Python based room security system that uses a PIR sensor, a camera and a Raspberry Pi to detect motion and email an alert.
-PIR sensor detects motion
-Alarm sound is played
-USB camera takes a photo
-The photo is sent in an email configured using SMTP with a secure TLS connection
-Raspberry Pi 4 Model B
-PIR Motion Sensor
-gpiozero, opencv-python, smtplib, pygame, os, signal libraries used.
-Raspberry Pi (compatible with all 40 pin GPIO models, though older ones may experience slower image processing via opencv)
-A PIR Motion Sensor
-A USB Camera connected to the Pi
-Speaker for audio output
-Raspberry Pi OS
-Python 3.13.5 or later installed
-This script is preconfigured to use gmail for the alert sending email address, using another mail service requires changing the MAIL_HOSTNAME and PORT_NUMBER variables. This information is readily found online for all major email platforms.
-When using gmail, ensure that the sender email has 2FA enabled and that a 16-character App Password has been generated to use in place of the account's regular password.
-Ensure the PIR sensor is connected as follows: 1. VCC -> Pi 5V 2. GND -> Pi Gnd 3. OUT -> GPIO 18 -Note: Configure the sensor's delay and senstivity knobs to your liking, the script will work regardless of how these parameters are set.