Instructables
loading
loading
Picture of Secret Knock Detecting Door Lock
knock_lock_side_view.jpg
knock_sensor_bb.jpg
Protect your secret hideout from intruders with a lock that will only open when it hears the secret knock.

This started out as a bit of a joke project, but turned out to be surprisingly accurate at judging knocks. If the precision is turned all the way up it can even detect people apart, even if they give the same knock! (Though this does trigger a lot of false negatives, which is no fun if you're in a hurry.)

It's also programmable. Press the programming button and knock a new knock and it will now only open with your new knock. By default the knock is "Shave and a Haircut" but you can program it with anything, up to 20 knocks long. Use your favorite song, Morse code, whatever.

Maybe a video will explain it better:


Important Notes:
(I hate to even have to say this, but since someone's going to say it, I'll say it first:)
1) This is for entertainment purposes only. Really. This decreases the security of your door by adding another way to unlock it, and it makes your unlock code known to anyone who can hear. If you put this on your door, be sure to carry your key too. The batteries might die, the suction cups might fail or you might forget your knock. Don't complain to me if someone imitates your knock and steals all your stuff, you've been warned.

For obvious improvements to safety, security and whatever, see the final page of the Instructable.


2) This is not a project for a beginner! Read through it carefully and be sure you understand it before you start! I will not take time to answer questions that are already in the instructions or from people who have gotten in over their head.

(If you think this project is too complex you might go here and sign up for the kit mailing list. The kits will be much more simple than this.)

Sorry about that. Now that that's out of the way, lets get to work.
 
Remove these adsRemove these ads by Signing Up
1-40 of 301Next »
VisionaryNutcases made it!3 months ago

My version is installed in a fridge and using an electromagnetic lock - keep those office thieves away!

http://ink361.com/app/users/ig-240858804/jas_cal/photos/ig-870056726990911200_240858804

IMG_7738.JPGIMG_7759.jpg

excelente

Krizbleen made it!3 months ago

Guys - thank you for this tutorial! I used the code to program a secret sliding library door project and it works great. The secret knock is the part people like the best. People giggle when I show it to them. I owe you a beer!

http://www.instructables.com/id/Automatic-Secret-Library-Door/

IMG_0363.jpg
Grathio (author)  Krizbleen3 months ago
Fantastic work! I love how well the bookshelf hides your secret room. Never would have guessed it was a pocket door.

Thanks for sharing!
KGuy1 year ago

Here we are! Finally done after months of procrastination! I added a buzzer and a third led (not in the picture). The code was changed very slightly but it works perfectly. A latch in the back hangs it on the door. I must thank you, however for the genius of this invention.

IMG_0255.JPG

hi sir, how did you do this one. where do i put the new code for the led and the piezo.. please, needed for a presentation, our prof. did not give us enough time to master this. and it serves as our final exam.. thank you in advance..

Grathio (author)  KGuy1 year ago

Beautiful work! Thanks for sharing!

Matienzo1 year ago

here is my little one in an iphone box

vinny033 years ago
I have modified the Arduino code to add the functionality of ''Users''. What it does is that it let you program a secretCode for four users. For example: If you push the button X times, after 4 seconds the green LED will blink X times and then you enter program mode (simply do your secret code). I also added the functionality to take a picture when your sequence is bad with LabVIEW and a WebCam camera. Then the picture is saved in my folder and pictures are incrementing with numbers.
Circuit sur porte.JPGMontage.JPG
Grathio (author)  vinny033 years ago
Looks great, and really nice added features! I had done a version with his & hers knocks, but this goes well beyond that!

Fantastic job!
bserrato4 years ago
I saw your project some time back and I thought it was great. I decided to take it and improve on it, the result was a system that locks and unlocks. Also if a person inputs an incorrect knock, the system will send a signal via bluetooth to a computer terminal to snap a picture and save it.

http://www.youtube.com/watch?v=6k6XwyB8Hh0

Check out the vid. Hope you like it.
Grathio (author)  bserrato4 years ago
That really made my week! It looks fantastic and works great. And the bluetooth camera is a great idea of added security.
josiasfilho5 years ago
Hi Steve!
As you know, I already started to do mine, with a few modifications. I uploaded a new video with a new option:


As soon as I finish my project I'll post the code online
Did you finish yet?  Can't wait to see the code.
Grathio (author)  josiasfilho5 years ago
Fantastic work with the servo and the unlock option.  (And an off switch!)

It looks like your setup is really sensitive.  Really nicely done! Your achievement patch is on the way!
TheBestJohn5 years ago
I have been playing around with this code for the past hour or so and found out how you can hard code in your own rhythm if need be.... at the part that looks like this
// If we're recording a new knock, save the info and get out of here.
  if (digitalRead(programSwitch)==HIGH){
      for (i=0;i<maximumKnocks;i++){ // normalize the times
        secretCode[i]= map(knockReadings[i],0, maxKnockInterval, 0, 100);

add this little guy
          Serial.println(secretCode[i]);
and open up your serial monitor....
make sure you un-commented the serial begin up at the setup and then it should spit some numbers back at you... put these numbers into the array and enjoy.
Whoot finally got my relays for my motor and heres a neat little Idea for your visual feedback....

 
Grathio (author)  TheBestJohn5 years ago
Oh, and for your awesome work you have been added as an official Master of Secret Knocks.  Your patch is on its way!
Grathio (author)  TheBestJohn5 years ago
 This is awesome!  Thanks for sharing your code and video.  Having the door unlatch too makes it that much more mysterious.  And I like the feedback through the peephole.

Great work!

And if I ever have any questions about taping something to something else I'll be asking you. :)
mathewvgarcia made it!11 days ago

This was berry helpful thank you. I'm working on a music box for my wife and I though I would add the Knock detector to make it a little more fun. Thank you!


Zelda Knock.jpg
YousefA120 days ago

when ever i knock it says "New lock stored." after the knock what do i do??? :(

unable to upload code gives error Arduino: 1.6.0 (Windows 7), Board: "Arduino Uno"

sketch_mar01a.cpp.o: In function `setup':

/Arduino/sketch_mar01a.ino:46: undefined reference to `pinMode'

/Arduino/sketch_mar01a.ino:47: undefined reference to `pinMode'

/Arduino/sketch_mar01a.ino:48: undefined reference to `pinMode'

/Arduino/sketch_mar01a.ino:49: undefined reference to `pinMode'

/Arduino/sketch_mar01a.ino:54: undefined reference to `digitalWrite'

sketch_mar01a.cpp.o: In function `triggerDoorUnlock()':

/Arduino/sketch_mar01a.ino:163: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:164: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:166: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:168: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:172: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:173: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:174: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:175: undefined reference to `delay'

sketch_mar01a.cpp.o: In function `validateKnock()':

/Arduino/sketch_mar01a.ino:210: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:211: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:212: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:213: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:214: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:215: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:217: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:218: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:221: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:222: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:223: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:225: undefined reference to `delay'

sketch_mar01a.cpp.o: In function `listenToSecretKnock()':

/Arduino/sketch_mar01a.ino:85: undefined reference to `millis'

/Arduino/sketch_mar01a.ino:86: undefined reference to `millis'

/Arduino/sketch_mar01a.ino:88: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:90: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:92: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:93: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:95: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:99: undefined reference to `analogRead'

/Arduino/sketch_mar01a.ino:103: undefined reference to `millis'

/Arduino/sketch_mar01a.ino:108: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:110: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:112: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:113: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:115: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:119: undefined reference to `millis'

/Arduino/sketch_mar01a.ino:130: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:132: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:133: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:134: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:135: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:137: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:143: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:144: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:146: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:147: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:148: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:149: undefined reference to `delay'

/Arduino/sketch_mar01a.ino:150: undefined reference to `digitalWrite'

/Arduino/sketch_mar01a.ino:151: undefined reference to `digitalWrite'

sketch_mar01a.cpp.o: In function `loop':

/Arduino/sketch_mar01a.ino:59: undefined reference to `analogRead'

/Arduino/sketch_mar01a.ino:61: undefined reference to `digitalRead'

/Arduino/sketch_mar01a.ino:66: undefined reference to `digitalWrite'

C:\Users\kaumudi\AppData\Local\Temp\build8307707147705721311.tmp/core.a(main.cpp.o): In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:32: undefined reference to `init'

collect2: error: ld returned 1 exit status

Error compiling.

please fix

Grathio (author)  yashkapoor75424 days ago

I've just tested the code with your setup (Arduino 1.6.0 IDE, Windows 7 Arduino Uno) and found no errors.

Troubleshoot your system by uploading a simple sketch, like Blink, and make sure that works. If so, download the secret knock sketch again, and follow the instructions.

can we use arduino uno for knock detecting door lock system?

can we use arduino uno for knock detecting door lock system?

Aidanj11 month ago

Have not made this yet, but you can make a song detector where you have to play a song to open it. It would take a little more programming, but would be fun.

goldenshuttle2 months ago

If you replace the piezo with a microphone, will it work as a secret clap switch ?

Grathio (author)  goldenshuttle2 months ago
If you want to use a microphone, check out this version of the project: http://makezine.com/projects/sound-activated-outlet/

(It's not a door lock, but you should be able to swap the circuit for the microphone, and the code, and get something that works.)

Thanks Grathio: indeed the link you gave has things that would do. Now I am working on a totally different project based on the clap switch..sky is the limit here...many thanks..please keep posting these creative gems.

thank you for this great project sir..

Sundback2 months ago

Hi Grathio!

First of all - a very nice project! I have a tiny problem and that is that when I've unlocked the door I can't turn the lock back to it's origin. When I've unlocked the door, how am I supposed to do so I can turn the lock back?

I would really like to get an answer.

Thanks in advance, Alex.

Nadeera NadiM2 months ago

what type of motor and lock its specification

we took this idea for diploma engineering project, we made the circuit connection correctly. after that connect it to the Aurdiuno (freeduino board). but the motor is not running. can u tell us the probable errors? pls reply fast..........

RHED2 months ago

can i use electret mic as substitute to the piezo?

ArvindS25 months ago

Hey Grathio

We took this idea for school project. We made the circuit connections correctly. After that we connected it to the Ardiuno ( UNO instead of a duemilanove). But the motor is not running. Can u tell us the probable errors? ( Will UNO cause problem since we didnt use Duemilanove?)

Regards

AzizK1 ArvindS22 months ago

we are using Uno board aswell, code will not compile properly. can you help us?

Krizbleen made it!3 months ago

Guys - thanks for posting this tutorial! I used the code as part of my secret sliding library door project and it works great. People giggle when I demo it to them. I owe you a beer for this!

IMG_0363.jpg
shreyask1 made it!3 months ago

AWESOME!!!!!project......It works properly.......Can someone say me how can i put a servo instead of a geared motor........PLZZZZ.

SECRET KNOCK DETECTOR.jpg

Hey guys, how can I program a DEFAULT secret code? I means how can I determinate de values (in the array), per knock? for example if I want something like "HBD to YOU" or "We r the champions my friend", many thanks for your help.

1-40 of 301Next »