Inspiration

One of our teammates simply had the idea for a knock sequence protected door out of the blue, and everyone that heard the idea would seem really excited about it, with many of them demonstrating what sequence of knocks they would set as their knock code.

What Does it Do?

The KnockLock first reads in the knock sequence you would like to use as your passcode, and then stores this information in the system. After that, the door will only open if the same knock sequence is read again. Red and green LEDs indicate whether or not the passcode was entered correctly upon each attempt.

How Was it Built?

The main component of the system is in Arduino board, which uses a sound sensor to detect each knock. The code on the board then checks to make sure the sequence matches the proper passcode (within reasonable range). If the code is not a match, the red LED is powered on momentarily. If the code is correct, the green LED is powered, and shortly after a motor unlocks the deadbolt and opens the door. A relay is then used to reverse the direction of the motor. which locks the door again after entry.

Challenges We Ran Into

The biggest challenges that we had to face came from the hardware aspect of this build. For one, finding a way to turn the deadbolt was the most time-consuming task. For one, each of the three servos we initially tried to use were not working as intended, and the switch to a motor only made things more difficult when it came to having it spin both directions. After attempting to use a broken H-Bridge component, roughly two hours were spent troubleshooting a series of relays that were missing a small but necessary component. It wasn't until there was a mere hour remaining that we got our motor to work as intended.

There were, of course, some other issues when it came to the coding of the system. Another hour or so was spent debugging a conditional statement that was missing proper syntax, and another good chunk of time was spent finding the sensitivity sweet spot of our sound sensor, as it would occasionally read one knock as two, by mistake. This fine-tuning also lasted until the final hour of our allotted time, meaning that the original purpose of our yellow LED was re-purposed as an indication that the code had finished its execution.

Accomplishments That We're Proud Of

For one, there was absolutely no better feeling than seeing the motor unlock the door for the first time. With all of the time spent troubleshooting the system, this sent chills down our spines in excitement. Also, of course, there's the fact that it functioned exactly as we intended, and it ended up being kind of fun to use, as well. There's just something so amusing about a door that's protected by a knock sequence - almost like it's the entrance to a secret clubhouse or something.

What We Learned

Each of us in the group learned a little something from the experience. On the software side of things, some of us learned more about Arduino code syntax and implementing array variables. On the hardware side of things, we learned how to implement a relay to control motor direction, and we learned one of the most valuable of lessons when it comes to hardware; always check that it works before you use it!

What's Next for KnockLock?

The main thing we'd like to do with KnockLock is revise the code that makes the system work. Due to the amount of time lost in troubleshooting, the code only allows for knock sequences that are strictly five knocks long, and requires a manual reset upon reading a proper code. While this was enough for demonstration purpose, we would like to run the code on a loop for a more practical application of the idea, as well as supporting any length of sequence up to a maximum number of knocks. We'd also like to add a way to change your knock code upon request, which could be done using a button mounted to the back of our yellow LED that was never implemented. One could press the yellow LED to change their code, input their current one, and then enter the new one twice for confirmation.

Built With

Share this project:

Updates