Skip to content

Kwash67/door-lock-system

Repository files navigation

Door Lock System

License

A secure, embedded door lock system built with Mbed OS, supporting user and admin authentication, persistent user management, and a keypad interface. Designed for microcontroller platforms, this project demonstrates robust access control, flash-based credential storage, and modular embedded design.

Features

  • User & Admin Authentication: Separate roles for normal users and administrators
  • Keypad Input: Hardware keypad for password entry
  • Persistent Storage: User credentials stored in microcontroller flash memory
  • Admin Menu: Add, remove, or update users and passwords
  • Visual Feedback: SLCD display and LEDs for status indication
  • Lockdown Mode: Security lockout after repeated failed attempts
  • Debounced Input: Reliable keypad input handling

Getting Started

Prerequisites

  • Mbed CLI
  • Supported Mbed OS hardware (e.g., NXP/Freescale Kinetis)

Building & Running

  1. Clone the repository:
    git clone https://github.com/Kwash67/door-lock-system.git
    cd door-lock-system
  2. Import Mbed OS dependencies:
    mbed deploy
  3. Build the project:
    mbed compile -m <TARGET> -t <TOOLCHAIN>
    Replace <TARGET> and <TOOLCHAIN> with your board and toolchain (e.g., K64F, GCC_ARM).
  4. Flash to device:
    • Drag-n-drop the .bin file to your board, or use mbed flash.

Example Usage

On boot, the system prompts for a password via the keypad. Users and admins have different access:

while (true) {
    if (tries <= max_tries) {
        while (!inputModule.hasPassword()) {
            inputModule.processInput();
        }
        if (inputModule.hasPassword()) {
            const char* password = inputModule.getEnteredPassword();
            auth = userManager.authenticate(password);
        }
        if (auth == 'u') {
            openDoor();
            inputModule.reset();
        } else if (auth == 'a') {
            userManager.launch_admin();
            inputModule.reset();
        } else if (auth == 'x') {
            // Failed attempt logic
        }
    } else {
        // Lockdown logic
    }
}

Support & Documentation

Maintainers & Contributions


This project is not affiliated with Arm Mbed. For hardware support, visit the Mbed forums.

Demo Video

See the system in action on the FRDM KL46Z board:

Watch the demo video

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors