The Door Locker Security System is the final project of Standard Embedded Systems Diploma at Edges for Training Academy, under the expert guidance of Mohamed Tarek.
The project involves creating a password-based door unlocking system using AVR ATmega32. It utilizes various drivers including GPIO, Keypad, LCD, Timer, UART, I2C, INT2, EEPROM, Buzzer, and DC Motor for functionality.
There are two Electronic Control Units (ECUs) used here:
- Human-Machine Interface (HMI) ECU:
Is just responsible interaction with the user just take inputs through keypad and display messages on the LCD.
HMI_ECU MCAL: GPIO, UART, TIMER1, and INT2.
HMI_ECU HAL: LCD and KEYPAD.
- Control ECU:
Is responsible for all the processing and decisions in the system like password checking, open the door and activate the system alarm.
CONTROL_ECU MCAL: GPIO, UART, TIMER1, INT2, PWM_TIMER0, and I2C.
CONTROL_ECU HAL: BUZZER, EEPROM, and DC MOTOR.
Here is the system sequence, HMI_ECU action start with letter "H" and CONTROL_ECU action "C". Be aware that at anytime one of ECUs is working, the other is polling and not doing any action; this to maintain a safe synchronization between them. Now, let us assume it is the first time to install the system and here are the sequences:
- C: Check if the password state in EEPROM is equal to "password not existed"
- H: A welcome message appears.
- H: A message informs the user with the rules of the password displayed.
- H: Asking the user to enter his password, then send it through the UART to C.
- C: Get the password without taking any action.
- H: Asking the user to confirm his password, then send it through the UART to C.
- C: Get the password then compare it with the first one, then send the result to H.
- H: If mismatched, the user will be asked to re-confirm the password for times less than MAX_INVALID_TRIALS (see Note 2) time, but I reached, the user will repeat from step three.
- C: If matched, try to save the password for times less than MAX_INVALID_TRIALS, if reached due to any EEPROM issue, restart the system.
- H: If matched, and saved to EEPROM, a message show successfully saved password appears.
- H: Asking the user to enter his password, then send it through the UART to C.
- C: Get the password then compare it with the saved one, then send the result to H.
- H: If wrong, the user will be asked to re-enter the password for times less than MAX_INVALID_TRIALS time, but I reached, system will be locked for one minute, and the buzzer will be switched ON by C for one minute too, then restart from step eleven.
- H: If correct password, the user now can navigate to main menu, to select one of two options: PLUS symbol to open the door, or MINUS symbol to change the password, get the command then send it through the UART to C.
- H: If command is to change the password, then restart from step three.
- H: If command is to open the door, then display a message that door is opening for fifteen seconds, and C will rotate the motor clockwise for the same duration.
- H: Display a message that door is holding for three seconds, and C will stop the motor for the same duration.
- H: Display a message that door is closing for fifteen seconds, and C will rotate the motor anti-clockwise for the same duration, then restart from step eleven.
Note 1: In case it was not the first time to install the system, the CONTROL_ECU will find that password state in the EEPROM (see step one) refers to that password existing, then jump to step eleven directly.
Note 2: The MAX_INVALID_TRIALS is a constant could be changed in the code, my MAX_INVALID_TRIALS = 3.
Note 3: All time durations used here are adjustable in the code.
Note 4: The RESET button is addition to reset the two MCUs and the EEPROM too, instead of stop running the simulation and re-insert a new EEPROM to apply tests!
Note 5: The proteus file contain three sheets, the user interface sheet, the ECUs sheet, and the background sheet.
Finally, here are some screenshots from the project:
- The User Interface:
- The Welcome message:
- The rules of password:
- Enter new password:
- Confirm password:
- Passwords matched:
- Passwords mismatched:
- Enter the password:
- Main menu:
- Door open:
- Door hold:
- Door close:
- Wrong password:
- System locked:














