An advanced IoT door lock system with multi-factor authentication: PIN (4x4 keypad), fingerprint (R307), and facial recognition (Pi Camera), plus a cloud backend (Flask on VPS + Supabase) and Telegram notifications.
Click the image above to watch the full demo on YouTube 👆
- 🔒 Triple authentication: PIN + Fingerprint + Face
- 🖥️ Touch-friendly GUI (Pygame) for 7-inch displays
- ☁️ Cloud sync via Supabase + Flask backend (VPS)
- 📱 Telegram notifications (unlock events, failed attempts, admin commands)
- 🔄 Automatic face model retraining and sync
- 📊 Access logs and admin management
Three layers:
- Edge device (Raspberry Pi) — GUI, sensors, local auth fallback
- Cloud backend (VPS + Supabase) — user management, model training/hosting, logs
- Notifications (Telegram Bot)
- Raspberry Pi 4/5 and official power adapter
- 7-inch touchscreen (800x480)
- R307 Optical Fingerprint Sensor (UART)
- Pi Camera Module (v1.3/2)
- SG90 Servo Motor
- 4x4 Matrix Keypad (GPIO)
- Jumper wires, microSD card (≥32GB)
- Fingerprint (UART): VCC 5V, GND, TX→GPIO15 (RX), RX→GPIO14 (TX)
- Keypad: Rows GPIO 5,6,13,19; Cols GPIO 12,16,20,21
- Servo: Signal GPIO 18; VCC 5V; GND
- Camera: CSI ribbon to Pi camera port
- Clone repository
git clone https://github.com/sasukeuchiha14/fingerprint-camera-door-lock.git cd fingerprint-camera-door-lock - Raspberry Pi dependencies
cd "Rasberry pi" pip3 install -r requirements.txt
- Configure environment
cp ../.env.example .env nano .env # Fill in BACKEND_URL, Supabase keys, Telegram details - Run the Pi app
python3 main.py
Backend setup, Telegram bot setup, and full deployment are documented in SETUP_GUIDE.md.
fingerprint-camera-door-lock/
├── Rasberry pi/
│ ├── main.py # Main Pi flow (PIN → Face → Fingerprint)
│ ├── raw_data.py # Raw sensor reads logger (week 1a)
│ ├── face_recognition_folder/ # Face recognition modules
│ ├── fingerprint/ # R307 fingerprint interface
│ ├── numpad/ # Keypad input
│ └── servo/ # Door lock control
├── Backend/
│ ├── server.py # Flask API (VPS)
│ └── requirements.txt
├── supabase/
│ └── setup.sql # Database schema
├── assets/
│ ├── banner.png
│ ├── gpio.png
│ └── raspberrypi5.jpg
├── README.md
└── LICENSE
Base URL: <BACKEND_URL> (for example: https://your-domain.example.com/doorlock)
GET /health— Health checkPOST /api/verify-user— Verify user credentialsPOST /api/log-access— Log access attemptGET /api/get-users— List usersPOST /api/add-user— Add userPOST /api/upload-face-image— Upload face imagePOST /api/retrain-model— Retrain face modelGET /api/get-model-info— Get current model infoGET /models/trained_model.pkl— Download current modelGET /api/get-access-logs— Access logsPOST /api/sync-status— Pi status sync
Use Rasberry pi/raw_data.py to record unprocessed sensor logs for PIN keypad, fingerprint, and camera recognition. The script prints timestamped logs suitable for screen recording.
- Never commit
.envor secrets - Use HTTPS for backend
- Enable Supabase RLS policies
- Rotate keys periodically
- Monitor access logs
This project is licensed under the Boost Software License 1.0 — see the LICENSE file for details.
Hardik Garg (@sasukeuchiha14)
- Face Recognition library (ageitgey)
- Adafruit Fingerprint Sensor resources
- Supabase team
- Raspberry Pi Foundation
