Skip to content

A room security system project written in Python that uses a Raspberry Pi, a PIR sensor and a USB camera to detect motion, sound an alarm, snap a photo of the intruder, and send an alert email with the photo attached.

License

Notifications You must be signed in to change notification settings

zaydb-dev/Room-Security-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Raspberry-Pi-Room-Security-System

OVERVIEW

A Python based room security system that uses a PIR sensor, a camera and a Raspberry Pi to detect motion and email an alert.

FEATURES

-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

KEY HARDWARE & LIBRARIES

-Raspberry Pi 4 Model B
-PIR Motion Sensor
-gpiozero, opencv-python, smtplib, pygame, os, signal libraries used.

PREREQUISITES

Hardware:

-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

Software:

-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.

Wiring:

-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.

About

A room security system project written in Python that uses a Raspberry Pi, a PIR sensor and a USB camera to detect motion, sound an alarm, snap a photo of the intruder, and send an alert email with the photo attached.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published