Introduction: Prototype: Doorlock, That Automatically Opens on Knock Pattern

Our process of prototyping a door that automatically works as you knock a specific pattern:

Step 1: The Idea

A door, that knows a secret knock pattern and opens when you knock it. How great would that be?

Of course, i wouldn't use it every day, for i would be too afraid that my neighbours hear my secret knock pattern. But it could be very helpful, in case i forget my key.

What do we need for that?

  • a microphone (ARD Mic Modul 4)
  • an arduino to memorioze recognize the right pattern (Arduino Uno)
  • a motor to turn the key (V-TEC 12V 6mm Schneckengetriebemotor 19RPM)
  • and its controlboard (Pololu DRV 8876)
  • a case (made in a 3D-printer)
  • a battery (we used 8 AA's)
  • LED's
  • a small speaker
  • a door with a lock and keys for testing

Step 2: First Things First: a Door

We needed a door to work in the universitys lab so we went to get one, that was given away on Ebay an cut the important part out just in place.

A little paint and a new lock made it exactly what we needed for our prototype.

Later we decided to give it a whole design and we painted it over and laser-cut out these words to glue them to our door and make it most interactive.

Step 3: Detecting the Knock

In order to process the sound, we wrote code for the arduino:

To detect one knock as one, and only one, we used a threshhold variable, that we can adjust according to the material we use (like the table on the picture). Sometimes the microphone would also detect surrounding noise as knocks, so we set that threshhold quite high and after some tuning, it worked really reliably.

To memorize the pattern, we connected a knob to the Arduino and changed the code, such that one can set up a pattern simply by pressing the knob and then knocking whichever pattern is wanted. The Arduino will wait until there wasn't a knock for 5 seconds and then saves an array of the distances between the knocks in milliseconds. The maximum number of knocks is in our case 1024 due to the limited RAM of the Arduino. But it will be enough.

To detect the pattern, one can simply start knocking and it will check for accordance with a 50ms buffer to both sides.

Once one has entered a wrong pattern, a red LED will light up and a specific sound will be played.

If the pattern was right, a green LED will light up and another sound is played. Now the motors open function is called.

Step 4: How to Automatically Turn a Key?

We needed a motor that was strong enough to turn the key, yet not too strong to break it.

After a long research we found the right one and a control board, that tells us, when the resistance is too high (when the key is fullly opened). For this we implemented a variable, that we can change depending on how hard it is to turn the key around. It needed to be just strong enough to turn it all the way but not too strong to break the key afterwards.

When the key is turned all the way, the motor does a half circle back and rotates the key into a position such that it can be pulled out along with the motor and the whole case.

We were really happy: no key ever broke and from the first try, the motor could turn the key without a problem.

We also realised, that the usual 9 Volt that the Arduino gets, weren't enough to power the motor, so we tried 12V and that worked perfectly. A battery case with 8 AA batteries found its place right nex to the 3D printed case later:

Step 5: Casing

For the casing, we intended to 3D-print a 3D-Model, we built using Autodesk Fusion 365. At first try, the laser cutter broke for a reason we still don't know. At second try, everything worked fine and we could print at least the main part of our design.

Due to our time limit we could not print out the other parts and so some of the hardware was located outside the casing as we presented our prototype.

The prototype works already very realiably and didnt't let us down in the presentation