A smart security system using facial recognition, running on Raspberry Pi with cloud integration and MQTT communication.
- Real-time facial recognition for authentication
- Multiple authentication methods (Face, PIN)
- Cloud storage for unauthorized access images using Cloudinary
- MQTT integration for remote monitoring and control
- SQLite database for access logs and user management
- Automated door lock/unlock mechanism
- Intruder detection and alerting system
- Raspberry Pi (3 or newer recommended)
- Ubuntu 20.04
- Webcam or camera module
- Python 3.7+
- Internet connection for cloud features
- MQTT broker (optional for remote monitoring)
- Clone the repository:
git clone https://github.com/Smart-Home-Automation-System-Project/Secure-Access-Surveillance-System
cd Secure-Access-Surveillance-System
- Set up a virtual environment:
python3 -m venv --system-site-packages venv
source venv/bin/activate
- Update packages:
sudo apt update
sudo apt full-upgrade
- Install dependencies in the virtual environment:
pip install -r requirements.txt
- https://core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/
- https://www.youtube.com/watch?v=3TUlJrRJUeM&t=432s
Create .env file in the root directory with the following structure:
# Cloudinary Configuration
CLOUDINARY_CLOUD_NAME=<your_cloud_name>
CLOUDINARY_API_KEY=<your_api_key>
CLOUDINARY_API_SECRET=<your_api_secret>
# MQTT Configuration
MQTT_BROKER_IP=<your_mqtt_broker_ip>
MQTT_BROKER_PORT=1883
# Stream Configuration
STREAM_HOST=0.0.0.0
STREAM_PORT=5000
# Firebase Configuration
FIREBASE_DATABASE_URL=<your_firebase_database_url>
- Create a Cloudinary account and set up a new project.
- Obtain the Cloudinary credentials (cloud name, API key, API secret) and update the
.env
file.
- Create a Firebase project and enable the Realtime Database.
- Download the service account key JSON file and place it in the
config/
directory. - Update the
.env
file with the Firebase database URL.
- Start the main system:
python main.py
or
chmod +x run.sh # Make the script executable
./run.sh
- Select which Part of the system to run:
Select an option:
1. Open User Interface
2. Start Security Services
3. Exit
Enter your choice (1/2/3):
- Login using username and password. (default: admin/1234)
- After successful login, you will be redirected to the main page.
- You can add a new user by clicking on the "Start Now" button under the "Add User" section. Then click on the "Start Data Collection" button to start capturing images for the new user.
- After adding a user, click on the "Confirm" button under the "Confirm User" section to save the user details.
- You can view the access logs and intruder images by clicking on the "Access Logs" button.
-
Start the security services by selecting option 2 in the main menu.
-
Available commands:
status
: Check door lock statuslock
: Manually lock the doorpin XXXX
: Unlock using PINexit
orctrl+c
: Stop the service
python -m pytest test/
- Create feature branch
- Implement changes
- Submit pull request
- Store sensitive configuration separately
- Use secure MQTT communication (TLS)
- Regularly update authorized users list
- Monitor access logs for unauthorized attempts
- Back up the database regularly
- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Submit pull request
- Face recognition using face_recognition
- MQTT implementation with paho-mqtt
- Cloud storage using Cloudinary
chmod +x run_application.sh
./run_application.sh