While the electronics are somewhat important in this device, the burden of the work mostly is done by the microcontroller. It detects knocks, determines if the knocks are in the right order and if they are, controls the stepper motor to open the lock. In case of forgetful people, it also has a timer to close the lock if it's been open for about 15 minutes.

The code is a bit hackish, but works. Basically, normally the microcontroller idle-waits for something to happen, either a button-press or something at the microphone. On a button-press, it opens or closes the lock a bit, according to which button is pressed. If something is detected at the microphone, it goes and detects if the sound is a valid knock. If it is, it'll measure the time between it, a second and a third knock. If the first time is about half of the second time ('knock knock wait knock') the door unlocks. If it's the other way around ('knock wait knock knock') the door locks again.

The code is written in assembly, and can be downloaded here. It's licensed under the GNU GPL, so you're free to fiddle with it yourself. Because the hardware is hackish, please don't expect me to answer questions about the microphone part, though.

« Prev 4 Next »

© 2006-2016 Sprite_tm - Contact