10

How do I detect the pattern of the knock on a door, and use it as a signature to unlock a door?

littlebirdceo
  • 4,697
  • 8
  • 41
  • 61

3 Answers3

8

This site has fairly detailed answers to how they did it

http://grathio.com/2009/11/secret-knock-detecting-door-lock.html

Method description from that webpage, for permanence:

A microphone (okay, really a speaker) presses against the door and listens for knocks. If it hears the right number of knocks in the right cadence it triggers the motor to turn the deadbolt and unlock the door. If the sequence isn't recognized, the system resets and listens for knocks again.

boardbite
  • 4,892
  • 11
  • 47
  • 73
4

From Make magazine's blog:

enter image description here

RFID card readers becoming passé? Maybe what you need to guard the door to your high-tech lair is a secret knock detecting door lock. Using an Arduino and a bunch of parts found around the lab, Steve Hoefer built a device that unlocks your door when it receives a certain knock pattern. It works by counting the time between successive knocks, and can be re-programmed at the touch of a button.

Of course, this system is susceptible to a replay attack, because anyone can listen to the knock pattern and then know how to get in. If you are planning to use something like this, I would recommend either incorporating a timestamp into the message, or using a series of one time knocks, in order to make it harder to break into. Actually, that might make it more secure than a regular lock.

Bruno Ferreira
  • 4,470
  • 2
  • 25
  • 36
Craig Trader
  • 1,573
  • 9
  • 15
1

I think the easy way would be to measure time between knocks using a microcontroller.
To detect the knocks you can use an electret microphone connected to a Diferential Amplifier, and its output shuld be the trigger of a 555 timer configured as monostable.
The monostable output then is connected to a "Capture And Compare Pin" of the microcontroller.
All the rest is just coding.

Gero Nimo
  • 111
  • 2