How adham011/smart-security-lock- works
Main Components
• Hardware Input Devices:
• Four potentiometers for setting each digit of the combination.
• Enter Button: Initiates validation of the entered combination.
• Set Button: Switches the system into “set mode” for entering a new combination.
• Hardware Output Devices:
• LCD Display (managed by the NHD_0216HZ.cpp/h modules) to show the current combination and status messages.
• LED Indicator(s) to provide immediate visual feedback (correct/incorrect combination).
• Servo Motor (handled by Servo.cpp/h) to operate the physical lock mechanism (if applicable).
• Software Core:
• Main Control Logic (found in main.cpp) that ties all the hardware together.
• Supporting Modules:
• The NHD_0216HZ module manages the interface with the LCD.
• The Servo module controls the servo motor, possibly for the actual locking/unlocking mechanism.
• Interrupt and Mode Management:
• The system distinguishes between Validation Mode and Set Mode.
• An ISR (Interrupt Service Routine) is triggered via the Set Button to switch modes and update combination states.
Out the Relationships and Interactions
• A central “Smart Lock Controller” block (represented by main.cpp) that acts as the brain.
• “Potentiometer Input Module” indicating that the controller reads the analog inputs.
• “Button Input Module” (for both Enter and Set actions) indicating event-driven mode changes.
• “LCD Interface Module” (NHD_0216HZ) that receives commands from the controller to update display information.
• “LED Control” as an output feedback mechanism.
• “Servo Controller” that triggers physical actuation on successful validation.
• That interrupts (via the Set Button) are used to switch modes for setting a new combination.
Architectural and Design Patterns
• Modular Design – The separation into distinct modules (potentiometer reading, display output, servo control) allows reusability and clear separation of concerns.
• Interrupt-Driven Mode Switching – Clearly highlight the mechanism where the Set Button triggers an ISR to change the system state.
• Real-Time Feedback Loop – Show that after input is gathered, the system processes the combination, validates it, and feeds back to both the LCD and LED indicators.
Relevant Technologies and Files
• mbed-os: Indicate that the firmware is built atop the mbed platform (using mbed_app.json and mbed-os.lib).
• CMake and build scripts: Note the use of CMake (as shown by CMakeLists.txt) for project compilation, although these are more on the build configuration side than runtime architecture.