This project implements a smart, secure door control system that uses password authentication and dual microcontroller (MCU) communication for efficient functionality. Designed with advanced embedded systems techniques, this project leverages UART, EEPROM, motor control, a PIR sensor, and a keypad to enhance the security and usability of door access control.
- Project Overview
- Features
- Hardware Components
- Operation Steps
- System Requirements
- Drivers and Libraries
- References
This door control system uses two ATmega32 MCUs:
- HMI_ECU (Human-Machine Interface): Manages user interactions, receiving password input through an LCD and keypad.
- Control_ECU: Processes password verification, controls door access with a motor, and handles additional functions like motion detection with a PIR sensor and security alerts with a buzzer.
The system enables secure password management, password-protected door unlocking, and includes advanced security mechanisms like timed locks and alarm activation after multiple failed attempts.
- Password Authentication: Users can set and manage passwords stored securely in EEPROM.
- LCD and Keypad Interface: User-friendly interface for entering and managing passwords.
- UART Communication: Ensures smooth data exchange between HMI_ECU and Control_ECU.
- External EEPROM: Stores passwords and system settings.
- Motorized Door Control: Uses H-bridge for motorized door operation.
- Buzzer Alerts: Activates on incorrect password attempts or security alerts.
- PIR Motion Detection: Detects movement to control door state.
- Change Password Option: Allows users to update the password after verification.
- Security Lock: Locks system for one minute after three failed attempts.
-
LCD (8-bit mode)
- RS → PC0
- Enable → PC1
- Data Pins D0-D7 → Port A (PA0 - PA7)
-
Keypad (4x4)
- Rows → PB0 - PB3
- Columns → PB4 - PB7
-
UART Communication
- TXD and RXD pins connect to Control_ECU.
-
EEPROM (I2C Communication)
- SCL → PC0
- SDA → PC1
-
Buzzer: Connected to PC7.
-
H-bridge Motor Driver
- Input 1 → PD6
- Input 2 → PD7
- Enable1 → PB3 (OC0)
-
Motor for Door Control: Connects to the H-bridge.
-
PIR Sensor: Connects to PC2 for motion detection.
-
Create System Password
- LCD prompts user to enter a 5-digit password and confirm it.
- Password is verified and stored in EEPROM.
-
Main Options Menu
- User can select between unlocking the door or changing the password.
-
Open Door
- User enters the password to unlock the door.
- If the password is correct, the motor rotates to unlock, and the PIR sensor detects motion to hold the door open.
- Once clear, the door locks automatically.
-
Change Password
- Password verification followed by a prompt to enter a new password.
-
Security Lock Mechanism
- After three incorrect password attempts, buzzer activates for 1 minute and the system locks temporarily.
- System Frequency: 8 MHz
- Microcontroller: ATmega32
- Architecture: Layered model with separate HMI_ECU and Control_ECU
- GPIO Driver: Used across both ECUs.
- UART Driver: Custom UART driver for communication.
- LCD and Keypad Drivers: For HMI_ECU interface.
- I2C Driver: For EEPROM communication on Control_ECU.
- PWM Driver: Controls motor speed via Timer0.
- Timer Driver: Manages timing operations for motor control and message display.
- Buzzer Driver: Manages alerts and notifications.
- PIR Driver: Detects motion to hold door state.
- DC Motor Driver: Drives motor in coordination with Timer0 PWM.
- UART_ConfigType and TWI_ConfigType: Allows flexible configuration of UART and I2C protocols.
- Timer_ConfigType: Manages timer operations across both ECUs.
- Video Demo: Dual Microcontroller Door Lock System
- PIR Sensor Library Setup: Proteus PIR Library Guide
- PIR Sensor Library Download: Download PIR Library