Secrete Knock Door Lock

28 01 2016

I would like to share one of my latest creations, a door lock that opens by “listening” to a secrete, pre-configured, sequence of four knocks.



I thought about this idea a long time ago but never really got to make it. I think the reason for that is the programming.  I’m fairly confident about my basic Arduino programming skills, but when it comes to more complex programs, it tends to intimidate me.

But considering I’m a hero ( 😅) I decided I’ll give it a shot. From that point, I have been planning and rethinking how to program this thing, for a long long time. Using mostly sketches in my notebook and writing code on tiny pieces of paper while travelling by plane.

The physical aspect of this mechanism is extremely simple. It consists only of one 9 gram servo, that pushes a gate lock that is screwed on to the door. From its inner side.

Finally, after returning home, I wrote the sketch, fixed its bugs and voila! It worked!


This program has 3 levels, and functions that fulfil these tasks.

At the beginning, a calibration takes place.  In this segment the code is listening for 4 knocks, records the duration of time that passes between them (the breaks) and divides them by each other. The devision is necessary so that the program will be able to recognise the “sequence code” only by the rhythm, and not by the actual timing of the knocks. For example if your code is four knocks with equal breaks between them. It will be very easy for you to remember, but very hard to produce time after time with the exact timing you had when you first calibrated the device. This way, by dividing the breaks by each other, we get break variables, that account only for the ratio between the breaks, which is the rhythm. When the calibration is over, the Break Variables are saved in the arduino’s memory (EEPROM).

The second phase of the program is the main loop, that has two parts. The listening and checking.

First, the device listens for any knocks. when a knock is heard, the same process as the one that takes place in the calibration happens. Break times are measured, divided by each other and presented as variables.

Now it’s time to check if the code is correct. The method for doing this is very simple. The code compares between the new break variables of the calibration’s, by subtracting one from another. If the outcome is lesser than a set threshold, that means the rhythm of the knocks is correct (with acceptable human error).

Finally after a decision is made, it is time to take action. In this case the application for the software is to open a lock, If the code is correct, or lock it if it isn’t. But this program has great potential is many fields, and is just subject for imagination.

If you would like to read the actual program I’ll be glad to share it with you.






Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: