MF LOCK

A Multi-Factor Authenticated Lock

By Diego Jerez and Alexander Ward

Overview

Our goal is to implement a lock that has a display plus a pin-pad in order to unlock the lock. Then for multi-factor authentication, we use Bluetooth to enter another code on our device to unlock the lock. The display will show the status of the lock (unlocked vs locked) and display the directions to unlock.

Block Diagram

Implementation Responsibilities

Alexander:  Program the keypad, create state machine, program step motor, program interrupts.

Diego: Program LCD display, program UI for screen to have status checks, quality assurance, morale booster.

Software Structure

The following will be written in C, and the UART and SPI interfaces will be used to communicate with the peripherals via GPIO pins. Naturally, all necessary initialization and communication will be programmed at the register level. 

We will use a state machine to keep track of which peripherals have been successfully unlocked, as well as whether the door itself is locked or unlocked. The machine will start in the "Locked" state.  The micro controller will then accept entered numbers 4 digits have been pressed. If the passcode is incorrect, the state machine will return to "Locked".

If the pass code was correct, the state machine will enter the "MFA" state. In this state, the number pad will be locked from use, and the MFA be enabled. If it reads the correct password, the program will enter the "Open" state. The microcontroller will then send a signal to the motor to unlock the door. Otherwise, if the internal button is pressed, acting as the inside lock, it will send an interrupt to lock the door and the device will be in the "Locked" state. This button can also be used to unlock the door in the "Enter Code" state.

The user is also able to change the password by pressing the "#" key during the unlocked state. When pressed, the user will be prompt to enter MFA code. Next the user can type in their new 4 digit code and then confirm. The new password is now set and the lock goes back to the unlocked state.

Demo Video

Source Code