How pranavsurya77/smart-home-door-lock-system works
Main Components
• Hardware Block (embedded):
• RFID Reader (MFRC522)
• Arduino Uno (microcontroller)
• Servo Motor (door actuator)
• LEDs, Resistors, Buzzers (audio alerts)
• Software Block (host PC/RPi):
• Python Backend (pyemail.py)
– pyserial (Serial I/O)
– openpyxl (Excel logging)
– smtplib (Email alerts)
– pygame (Audio alerts)
• Excel File (information.xlsx)
• External Service:
• SMTP Email Server (e.g., Gmail)
Interactions & Data Flows
• RFID card presented → MFRC522 reads UID → Arduino
• Arduino logic (success/fail count) → sends status over USB‐Serial
• Python script listens on serial port
a. On “access granted” →
• Send “unlock” command back → Arduino actuates servo → door unlocks
• Log event row into information.xlsx
• Send email via SMTP → homeowner receives notification
• Play success audio via pygame
b. On “access denied” →
• Increment failure count → if ≥3, lockout logic
• Log failure in Excel
• Send “denied” or “lockout” command → Arduino signals LED/buzzer
• Send email alert (optional)
• Play failure audio
Architectural Patterns & Principles
• Hardware/firmware separation:
• Real-time control and sensor I/O on Arduino
• High-level processing (logging, email, audio) on host
• Single Responsibility:
• Arduino: I/O, servo control, basic state machine
• Python: user-notification, persistence, external comms
• Loosely coupled via serial interface