I used a peizo element to detect the vibrations that are created by knocking on a door, a microcontroller to recognize the pattern of knocks, and a servo motor to open and close the deadbolt on the door. A magnetic frame held the assembly securely onto the inside of the door.