This project involves programming a digital lock system using Arduino. The user can enter a password to unlock the system and change the password if desired. The system consists of three main components: a keypad, an Arduino board, and an LCD display.
- Keypad: The input device where the user enters the password. We use a phone keypad for this purpose.
- Arduino: The processing unit that handles the input from the keypad, processes it, and sends the output to the LCD.
- LCD Display: The output device that shows the status of the lock, whether the password is correct, and other relevant messages.
To run this project, the Keypad library must be installed in the Arduino IDE. Follow these steps:
- Open the Arduino IDE.
- Go to Tools > Manage Libraries.
- In the search bar, type Keypad.
- Find the library named Keypad by Mark Stanley, Alexander Brevig and click Install.
- Once installed, the library is ready to use.
Note: The Keypad library is essential for this project. Without it, the code will not compile. Make sure to install it before proceeding.
After installing the library, upload the code to the Arduino IDE and compile it. To extract the HEX file, follow these steps:
- Open the project code in the Arduino IDE.
- Go to Sketch > Export Compiled Binary.
- The HEX file will be saved in the project folder, usually in a folder named build or in the same directory as the
.inofile.
To simulate the project in Proteus, you need to add the HEX file to the Arduino microcontroller in Proteus. Follow these steps:
- Open Proteus and design your circuit (including Arduino, keypad, LCD, and other components).
- Double-click on the Arduino microcontroller in Proteus to open its settings.
- In the Program File section, browse and select the HEX file you exported from the Arduino IDE.
- Confirm the settings and start the simulation.
-
Initial Setup:
- The default password is set to
0000. - The LCD displays a prompt for the user to enter the password.
- The default password is set to
-
Password Entry:
- The program enters an infinite loop, constantly checking for keypad input.
- If a number is pressed, it is pushed onto a stack.
- If the
*key is pressed, the last entered number is removed from the stack. - If the
#key is pressed, the entered password is compared with the stored password.
-
Password Verification:
- If the entered password matches the stored password, the LCD displays "Access Granted" and offers options to change the password or exit.
- If the password does not match, the LCD displays "Incorrect Password" and prompts the user to try again.
-
Changing the Password:
- If the user selects the option to change the password, they are prompted to enter a new password twice for verification.
- If the new passwords match, the stored password is updated, and the LCD displays "Password Changed".
- If the new passwords do not match, the LCD displays "Mismatch" and prompts the user to try again.
- Default Password: Stored in an array.
- Stack: Used to store user input.
- LCD Display: Uses the LiquidCrystal library to show messages.
Here is a video demonstrating the functionality of the Digital Lock System:
https://drive.google.com/file/d/16o0qsDbw5fpSPnZaSbAQwQ8XHM9YYBgH/view?usp=sharing
Below is an image of the project setup:
- Clone this repository to your local machine.
- Open the Arduino code in the
Arduino/folder and upload it to your Arduino board. - Open the Proteus simulation file in the
Proteus/folder and load the HEX file into the Arduino microcontroller. - Run the simulation and test the system.
