Media Lab - Knock Lock


This is an update to the MIT door hack originally created by Valentin Heun to provide a new knock based interface to the lock. The original RFID version costs just under $80 which is quite expensive if you have several doors to secure and so this a cheaper alternative. The solution adds capacitive sensing to the door which enables the detection of the users hand on the door handle. By recording the time delay between each of the users taps it stores this as a "secret" pattern in EEPROM which can then be repeated to open the door.

By using capacitive sensing and attaching the electrode to the metallic door handle it provides a cheap and quick solution which reduces the amount of hardware and visible hacking to the door. As shown in the video this gives the opportunity to create a user interface around the existing object creating interaction in a more intuitive manner. For example to set a new code for the lock you simply touch the element you want to adjust i.e the door lock which changes state of the lock and allows you to record the new pattern.
The video below shows the lock in use and the process of creating new knock pattern.

Knock Lock Demo

The door it self is opened using a servo which is attached to the internal lock. This is based on the previous MIT Door Hack by Valentin Heun. As shown in the following picture the capacitive sensing electrode is simply attached to the metallic door handle by a strip of copper tape.

Servo attached to internal lock with capacitive electrode - Hardware by Valentin Heun

As this uses capacitive sensing it is very susceptible to small changes within the environment which leads to noise and false positive. To overcome this the lock automatically recalibrate every few minutes ensuring that it continues to responds correctly to hand touches. This isn't a particularly secure method of controlling access to an office but it works well in keeping unwanted visitors out and importantly removes the need to carry an RFID card.


1 x Arduino Uno
1 x Large Servo
1 x Resister (25 MegaOhms)
Sheet of hardboard
Several meters of wire
Strip of copper/Conductive material

Lock Design Files - Valentin Heun


Arduino board setup

Source Code

Below is the main Arduino code used to control the lock.
For the full source code and associated readme visit the GitHub repository.