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.
    Screw drivers.
    Heat-shrink tubing and/or electrical tape.
    Wire stripper.
    Safety glasses.

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  Photodiode
    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)
<p>The photoresistor keeps getting triggered, even though I did everything from putting electric tape on it to unplugging it from analog input E. I do not understand what is going wrong. Literally every 200 milliseconds the photoresistor goes off because that is the minimum time. Whats going on?</p>
<p>Hi AndrewD1,</p><p>Have you been able to debug the photo-diode issue with it continuously being triggered? Even readjusting the photoknockfadetime (line 16) doesn't seem to help.</p><p>Thanks!</p>
Hi lilgfergi, <br> <br>Would it be possible for you to post the links to where you bought all your electronics?
hello! i am quite impressed with you project? But i am somewhat confused with the photodiode? can you explain how the photodiode works in this project? what i am confused regarding the photosensor is that if you stick it close to the peephole, the light will be already stricking at the photodiode. So how the light effect will act as a secret code?
hi lilgfergi, im from the Philippines and i already build the secret knock detecting door lock created by grathio and i build it correctly, know i want to try yours, im just concern, do i have to record the same code for the knock and the flash of light? because we only have one reset button so if i want to changed the knock light, it will also changed the knock? i really need your answer as soon as possible. tnx and nice revision by the way
&quot;Based on&quot;? <br> <br>So why are the images identical? <br>

About This Instructable




More by lilgfergi:Arduino Light & Knock Detecting Door Lock 
Add instructable to: