Door Lock System

Embedded Systems
Implementing a door lock system
Project Overview
In this project, I attempted to write firmware for a digital door lock that can accept a sequence of button presses that dictate the user’s eligibility to enter. I put together a simple state machine that outlined the life cycle of the system. A state machine describes all the possible states different components of the door lock can be in and the ways it can reach these states.


Circuit design



One of the things that you can see from my initial state diagram is that I’ve included a timer. A timer passing a certain threshold value can be used as a way for the firmware to interpret the user essentially saying “this is what I think the code is”. I wanted to take this approach until my lab technician asked me, “well, what if the user is old and has a hard time remembering things?”.

This is the essence of real-world engineering. There are no perfect solutions. Only trade-offs that can be managed. The reason why I wanted to use a timer was that it would hide the length of the passcode from the user. But this would mean a slightly unpleasant experience for someone who has a hard time remembering and having to start all over again when the timer runs out. But on the other hand, with the approach that I ended up taking, it means that when a fraudulent user enters a code at random and the buzzer goes off suggesting a failed attempt, the user can gather as much the length of the sequence. This is information that’s revealed about the passcode which is a potential security hazard.

Balancing these trade-offs and playing the roles of both a white and black hat hacker were the biggest takeaways from this project.

Link to the Medium article and Github