Prototype: Doorlock, That Automatically Opens on Knock Pattern

by intus in Workshop > Home Improvement

225 Views, 2 Favorites, 0 Comments

Prototype: Doorlock, That Automatically Opens on Knock Pattern

pexels-mike-jones-9461213.jpg

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

The Idea

signal-2023-07-07-081641.jpeg

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

First Things First: a Door

signal-2023-07-07-075345.png
signal-2023-07-14-155457_002.jpeg
signal-2023-07-14-152355_002.jpeg

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.

Detecting the Knock

WhatsApp Image 2023-06-09 at 11.43.35.jpeg

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.

How to Automatically Turn a Key?

Bildschirmfoto 2023-07-07 um 08.25.57.png

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:

Casing

WhatsApp Image 2023-07-13 at 17.03.26.jpeg
Bildschirmfoto 2023-07-19 um 06.38.00.png

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