This is a great gadget for a secret clubhouse and for people like me who always seem to loose their keys! This project is based on the original Secret Knock Lock instructable by Grathio (available below) with the following main modifications:
1) Has a second secret input for when people are around who could overhear your knock. Now a photo-diode can register a "photo knock" (light flash) through the peep hole!
2) Includes an H-Bridge, giving it the ability to both Unlock and Lock a door (changes the direction of voltage across motor)
3) Programing now records the average (background) noise/sound levels and adjusts the sensitivity (threshold values) accordingly
***The information here is adapted from Grathio's instructable. Many thanks and credit go to Grathio Labs for making such a comprehensive guide available to the rest of us! I will take you through the steps for programming and wiring the electronics and then send you to the step in Grathio's instructable for making a PVC door mount (sadly, I am still in the process of creating a functional case)
For Grathio's original Knock-Lock instructable, go to https://www.instructables.com/id/Secret-Knock-Detecting-Door-Lock/
Step 1: Tools, Supplies, and Skills
To complete this project you should be able to:
Do basic soldering.
Read a schematic.
Have some knowledge of microcontrollers (I'll be using the Arduino.)
Drill (ideally a drill press) and an assortment of drill bits.
Saw capable of cutting PVC pipe. (ie: Pretty mcuh any saw.)
Soldering iron and solder.
Heat-shrink tubing and/or electrical tape.
Other things you might find handy: a ruler/tape measure, a multimeter, a breadboard, some tape, a magic marker, sand paper, files, hot glue. And if you're like me a well stocked first aid kit.
1 Arduino Uno (or similar) Microcontroller
1 12v Gear reduction motor with high torque
1 Small Microphone
1 SPST momentary pushbutton. (normally "off" / "open")
1 Red LED
1 Green LED
1 Quadruple half H-Bridge SN754410NE chip
1 100k ohm resistor (1/4 watt)
1 10k ohm resistor (1/4 watt)
1 1M ohm resistor (1/4 watt)
2 560 ohm resistor (Or whatever will run your red and green LED's at 5v)
1 small piece of perf board. 5x15 holes or longer.
1 12V Wall Adapter plug for Arduino
It's also a good idea to have a breadboard for setting up and testing the circuit before you solder it. We'll be doing this in step 3.
(This design comes directly from Grathio source.)
20" PVC Pipe 1/2".
3 right angle 1/2" PVC connectors.
1 5-way 1/2" PVC connector. (example)
2 1/2" PVC end plug.
3 1 1/2" suction cups. (Available at hardware stores and craft centers.) NOTE: If your door is unsuitable for suction cups then replace these with three end caps and you can use adhesive strips or screws to mount the lock.
6" of 1/2" wide by 1/64" thick metal strip (steel, tin, copper, etc.) (available at hardware, craft, and art supply stores.)
4.5" of 1" wide metal sheet, 1/32" thick (steel, tin, copper, etc.) (available at hardware, craft, and art supply stores.)
2 3/32" x 3/8" screws with nuts. (1/8" will work too if you can't find the smaller ones.)
2 1.6M (metric) 16mm screws. Ideally with countersunk heads if you can find them. (For securing the motor. Check your motor specs to see what screws it needs. One motor I tried used 1.6M, the other 2M. You'll probably have to buy long ones and cut them to length.)
1 Large Suction Cup (for photodiode)