This hack aims to both record and detect knocking patterns to unlock a door in order to protect a secret hideout from intruders. It is accurate at judging knocks as it uses an Arduino, a motor, and a piezo sensor. The knocking sequence can be changed by pressing the programming button. The device can be suction cupped to any dead bolt since it is completely mobile as shown in the image below. It can be programmed with anything up to 20 knocks long although the “Shave and a Haircut” is the default knock. A video of its operation is shown below.
From the image below, the main materials required consist of Arduino Duemilanove, gear reduction motor, piezo speaker, SPST momentary pushbutton, red/green LED, 9V battery & holder, and some transistors, resistors, and diodes. Along with them are the PVC pipes, connectors & end plugs, suction cups, metal strip/sheet, and screws & nuts.
The Arduino is program in order to handle the sensitivity of the knock detector, to determine how accurately someone has to knock, for crude debounce timer for the knock sensor, for the number of milliseconds to run the motor to unlock the door, for the number of recorded knocks, for the maximum number of milliseconds it will wait for a knock, and for recognizing the default knock when turned ON.
A schematic diagram is shown below which illustrates the layout of the circuit. It includes wiring the piezo sensor by soldering a pair of 12” leads to the piezo speaker, wiring up the LEDs to avoid using a serial cable, wiring the programming button by soldering 8” leads to the button, and wiring in the motor.
The next image shows how the case was prepared. The button mount is done by taking one of the PVC end and drilling a hole through the center appropriate for the push button, mounting the motor by taking the other PVC end cap and drilling a hole big enough for the shaft of the motor to pass through, making the arms by cutting one piece of PVC pipe 5 inches long, adding a few extra holes using a pencil or marker to draw a line down the center of the top and bottom of the long arm, and making the legs that will be attached to the door.
The image below shows the construction of a clamp that attaches to the D-shaft of the motor which can turn the lock by fitting easily over the lock latch. It is securely attached to the motor but there is some give in so that it can slip if it finds itself between a hard place and a rock. The width of the lock latch is measured in order to determine how much zig we’re going to bend into each piece of metal.
For the knock detector to press securely up against the door, it is placed on the end of a little springy bit. A piece of paper can be used or even glue or screw it straight to the door. The parts shown in the next image include a strip of thin metal, piezo sensor, and a piece of PVC. The sensor is attached to the metal strip using glue, hot glue, or tape and the piezo sensor is fastened to one end of the metal strip. The metal strip is attached to the PVC by threading the free end of the wire through the bottom hole on the PVC and inserting the free end of the metal strip on the slot.
In soldering the circuits, the leads are soldered to the LEDs, and the perfboard is prepared. The ground line is run across the back for the components to connect to along with the +5V line. The knock sensor is made by mounting the speaker firmly at the end of the spring and winding the wire a few times around it. The button is fastened through the hole on the end plug. The other connections are shown in the below image.