Secret Knock Detecting Door Lock – Grathio Labs

download Secret Knock Detecting Door Lock – Grathio Labs

of 9

Transcript of Secret Knock Detecting Door Lock – Grathio Labs

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    1/9

    « Made: A Mess Knock Lock Kit Update & Mailing List »

    Secret Knock Detecting Door Lock on November 2, 2009 – 9:54 am

     

    Update #4: Nov 23: The Instructable is complete. If you want more instructions than are listed here, go here and readall of the steps, see all the photos, and enjoy!

    Update #3: Nov 11: If you’d like to get updates about the progress of the kits (like when they’ll be for sale and howmuch) you can sign up for the mailing list here.

    Update 2 Nov 5th: Thanks for all of your (overwhelming!) interest in buying/making/finding one for yourself!Unfortunately I don’t have the spare time to make any extras right now. However I’m looking into what I can do to puttogether a kit or finished product for you guys. When I know something concrete I’ll post a message to the site.

    Update Nov 3: Added a proper schematic. (Thanks Nik!) Also hosted some of the images elsewhere so hopefully the site will stay up until I can find a new,more reliable web host.

    How many times have you seen a secret hideout with a secret knock? It’s a staple of cheesy dramas, Saturdayafternoon movies, and tree houses throughout the world.

    While working on another project I ran across the Arduino knock sensor tutorial. Sensing a single knock is a great littleproject for learning about microcontrollers, but what about sensing specific knocks? Seeeeecret knocks? And if wecould detect a secret knock, shouldn’t it unlock a door? If you can’t tell by looking this was cobbled together fromspare stuff around the lab, it’s not much more than a piezo speaker, a tiny gear reduction motor, and an Arduino. AndPVC pipe. How about a video to explain:

    Click onward to read more details, source code, photos, etc.**Disclaimer: This was built with stuff I had lying around the lab. There are many better ways to build this project. Tellme about them in the comments.

    Search

     

    Steve Hoefer is a writer, inventor, and

    creative problem solver based in Las VegasNevada. His creations are known all over theworld and have been featured everywherefrom the New York Times to... (More)

     RSS Feed

     Google +

      Email

      Email

      Twitter

      Google+

      Vimeo

      Flickr  Media Contact

    Rock Paper Scissors Glove

    A glove that playsRock-Paper-scissors againstthe wearer.

    Touch Screen Glove Hack

    Modify yourgloves so they'll

    work with yourtouch screen.

    Match RocketsCreate fun and(reasonably) saferockets fromthings youprobably alreadyhave. They reallyfly!

    http://grathio.com/http://grathio.com/projects/http://grathio.com/resources/http://grathio.com/about/http://grathio.com/http://grathio.com/projects/#match_rocketshttp://grathio.com/projects/#match_rocketshttp://grathio.com/projects/#touchscreen_gloveshttp://grathio.com/projects/#touchscreen_gloveshttp://grathio.com/projects/#rps_gloveshttp://grathio.com/projects/#rps_glovesmailto:[email protected]://www.flickr.com/photos/ookseer/http://vimeo.com/grathiohttp://plus.google.com/117254768371563740580/abouthttps://twitter.com/#!/grathiomailto:[email protected]://feedburner.google.com/fb/a/mailverify?uri=grathio&loc=en_UShttps://plus.google.com/114901871223764151953/?prsrc=3http://grathio.com/2009/11/secret_knock_detecting_door_lock/feed/http://grathio.com/about/http://grathio.com/about/http://grathio.com/resources/http://grathio.com/projects/http://grathio.com/http://grathio.com/http://www.arduino.cc/http://www.arduino.cc/en/Tutorial/Knockhttp://grathio.com/2009/11/knock-lock-kit-update-mailing-list.htmlhttp://www.instructables.com/id/Secret-Knock-Detecting-Door-Lock/http://www.instructables.com/id/Secret-Knock-Detecting-Door-Lock/http://grathio.com/2009/11/knock_lock_kit_update_mailing_list/http://grathio.com/2009/10/made_a_mess/

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    2/9

    If you didn’t watch the video, here’s an overview:

    A microphone (okay, really a speaker) presses against the door and listens for knocks. If it hears the right number of knocks in the right cadence it triggers the motor to turn the deadbolt and unlock the door. If the sequence isn’trecognized, the system resets and listens for knocks again.

    Side view. Arduino microcontroller up top and peeking out at the left is the button to program new knocks. The shiny bit with the nut and bolt goes over the

    lock and is connected to a motor you can’t see. But you can see the piezo speaker on it’s spring to press it against the door.

    The default code is Shave and a Hair Cut but if that’s too obvious you can enter a new knock sequence by holdingdown the red button and knocking your new secret knock (up to 20 knocks). The rhythm of your favorite song, Morsecode, whatever! The widget will play back your knock (by blinking the lights) so you can be sure it heard everythingcorrectly.

    The whole thing is attached to the door with suction cups

    The components are simple, most of the work is done in the microcontroller. The source code for the Arduino isavailable at the bottom of the page if you’re curious.

    How does it work?

    First it records the time between knocks. If there is a long wait for a knock it stops listening and starts analyzing.

    First it checks the number of knocks. If that’s right, we go on to more vigorous authentication. First it converts theabsolute timing of the knocks to the rhythm of the knocks. This lets us knock fast or slow and as long as we get therhythm right it will unlock. That way I can still unlock the door if I’m tired or full of caffeine. After this it compares thetiming with the secret key and if any individual knock is off by too much or the whole thing is off by a certain averageamount the door stays locked. If not, we trigger the motor to turn and the lock to unlock. If the programming button ispressed it saves the rhythm information and then plays it back.

    The detection is surprisingly accurate and can even be dialed up so it’s precise enough to detect an individual person’svariation on a knock, similar to a Morse coder’s ‘fist‘. (Though when the verifying is this tight it also triggers falsenegatives which are annoying.)

    To keep things simple (and it’s because it’s what I had available) a motor is attached to the deadbolt using two piecesof spring steel bolted across the D shaft of the motor so that the connection will slip when the lock turns as far as itcan. A more precise (and probably durable) way to do it would be to use a servo to turn the lock or have a detector

    sense when the lock had reached its extent. Or replace the dead bolt with a solenoid. Or whatever else you can thinkof.

    The rest of the electronics are nothing special. Its so simple that just adding feedback LEDs almost doubled the partscount. The Arduino has a lot of unused potential on this project.

    No proper schematic yet, but there’s a layout and parts list at the bottom of the page. Look for a fully documentedInstructable soon.

    With some extra electronics (an H-bridge) it would be possible to have the door automatically lock as well as unlock.Other improvements or changes that someone could do:

    Adding a knob to adjust the sensitivity.

    Building it into an actual door knocker.

    Using a more economical microcontroller and enabling a s leep mode for better battery life.

    Making the whole package small enough to fit inside the door.

    Storing several knocks so several people can have their own private knocks.

    Adding a real-time clock and using different knocks for different days of the week or times of day.

    Listening for door bell presses rather than door knocks.

    http://en.wikipedia.org/wiki/H-bridgehttp://www.instructables.com/http://books.google.com/books?id=k3XeGh9PXAYC&lpg=PA677&ots=PLV5LGJ712&dq=code%20breaking%20world%20war%20II%20fist%20-first&pg=PA677#v=onepage&q=&f=falsehttp://en.wikipedia.org/wiki/Shave_and_a_Haircut

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    3/9

    Do I have to point out that this is not a great security measure since overhearing a knock sequence is pretty trivial?No. But it’s fun to make and play with.

    Here’s my code:Update: If you have trouble with cut and paste below you can download the .pde file here.

    And here’s the layout and parts list. (click to zoom in.)

    Special thanks for this schematic to the hard work of Nik K.B. (knutsonbradacnl(at)gmail.com)

      .knockSensorValue = analogRead(knockSensor);

     if (digitalRead(programSwitch)==HIGH){  // is the program button pressed?

    programButtonPressed = true;  // Yes, so lets save that statedigitalWrite(redLED, HIGH);  // and turn on the red light too so we know we're programming.

    } else {  programButtonPressed = false;  digitalWrite(redLED, LOW);  } 

    if (knockSensorValue >=threshold){  listenToSecretKnock();  }} 

    // Records the timing of knocks.

    void listenToSecretKnock(){  " "  

    Adding a servo or solenoid powered knocker to provide feedback through the door. It could then offer achallenge-response security where the door starts a knock sequence and the user has to finish it correctly.

    Rather than listening for knocks, putting a photoresistor in the peep hole and detecting flashes of light from apocket flashlight or simply by placing your hand over the peephole. Or an infrared receiver and use special keypresses on a remote control.

    mailto:knutsonbradacnl%28at%29gmail.comhttp://grathio.com/assets/secret_knock_detector.pde

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    4/9

    « Made: A Mess Knock Lock Kit Update & Mailing List »

    Also thanks to Adafruit Industries, oomlout, and Sparkfun between whom I think I bought all of the electronics for thisproject. And even if I didn’t, they’re awesome.

    PS: Here’s a zero-technology solution to the “Yeah, but they’ll overhear your secret knocks” problem: Scream whileknocking. No one will overhear the knock over the racket you’re making.

    This entry is filed under Software , Problem Solving  , Electronics.

    181 Comments 1

    Join the discussion…

    Dan Dennis

    great project! You should submit this to the Fun With Arduino contest.http://arduinofun.com/blog/200...

    Reply

    Leonard Gallion

    This is similar to a commercial product called the knocklock(knocklock.com). However the knocklock simply activates and internal relay

    and is designed for doors with an electric strike or a magnetic lock. The reallycool part of this design is the piping and the suction cups so this lock adaptsto pretty much any deadbolt situation. Great thinking.

    Reply

    Oz

    This is a very fun and inspiring project. I hope you create instructions soon...

    Reply

    Thomas Sturm

    http://knocklock.com/http://grathio.com/category/software/http://grathio.com/category/problem-solving/http://grathio.com/category/electronics/http://adafruit.com/http://www.oomlout.com/http://www.sparkfun.com/commerce/categories.phphttp://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461948http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461947http://knocklock.com/http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461945http://arduinofun.com/blog/2009/11/01/fun-with-arduino-contest/http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461944https://disqus.com/home/inbox/https://disqus.com/home/forums/grathio/http://grathio.com/category/electronics/http://grathio.com/category/problem-solving/http://grathio.com/category/software/http://www.sparkfun.com/commerce/categories.phphttp://www.oomlout.com/http://adafruit.com/http://grathio.com/2009/11/knock_lock_kit_update_mailing_list/http://grathio.com/2009/10/made_a_mess/

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    5/9

    That's genius. I agree with Leonard - the cool part is the execution: Putting itall into the PVC piping is a great idea and looks pretty nice. Also, this is non-destructive, which is kinda important in a rental situation. :-)

    Reply

    Celien

    You are a genius !

    This object seems to me very usefull, as example for disabled persons !Great thinking !Celien, from Belgiumps : excuse me for my English, I'm just a student ... !

    Reply

    robert

    wonderful! A great way to add a remote doorlock w/o running power lines!I'd love some more details!

    Reply

    Tim

    Awesome project. One may consider building a bracket such that rather thanusing the suction cup attachment, one could mount it with the same screwswith which the doorknob is attached.

    Reply

    Steve Hoefer

    Thanks for all the thoughtful and encouraging comments guys!Sorry that my lousy web host wasn't up to the task of standing up to the

    traffic from Gizmodo, but I hope it should be okay now. I've added aschematic for those of you who like that stuff.Keep the good ideas coming!

    Reply

    Tony D'Ambrosio

    Wow this is definitely very cool! For someone with a medical background andno electrical know-how, is there a chance you'd sell this?Or maybe the parts to it that we could just assemble ourselves? I'm sure itcould be profitable, the components look relatively cheap(although I honestlyhave no idea what an Arduino Microcontroller is).

    Reply

    Tim Fredlund

    First, props on your awesome build. I particularly like the effectiveness of thesuction cups, as well as using the space inside the PVC to hold the driverboard.From an aesthetic point of view, I might suggest drilling out two holes for theLEDs and embedding them inside. (I've always found that embedded LEDslook nice on a project)One other suggestion for adding capabilities could be a form of challenge-

    res onse. You knock the Initiator Cadence A, the device knocks back

    http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461948https://disqus.com/by/Grathio/http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461963http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461960http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461959https://disqus.com/by/Grathio/http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461957http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461953http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461949http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461948

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    6/9

     (Possibly using a spring-loaded solenoid) a Challenge Cadence, and youknock back the memorized Response Cadence.

    Reply

    AO

    Wow, great project and demo vid!

    Reply

    Geekologie - Gadgets, Gizmos,

    I Want: A Secret Knock Door Lock

    Holy shit, it's a PVC pipe bomb! No, not really. It's the Knock Lock, ahomebrew door lock that will only release the deadbolt if you perform thesecret knock. Cooooool -- I want one for my clubhouse! A...

    Reply

    Taylor S

    I would pay you an unreasonable amount of money for one of those.Or for a kit to build it.Or for the knowledge.I want it so bad.my email is [email protected] if you'd consider it!

    Reply

    Anonymous

    Very cool... I have a not so quick suggestion, though.

    "...overhearing a knock sequence is pretty trivial"

    Well... I know what you could do to make it a little secure. ;)

    First of all, the problem is that someone can overhear the code rendering it useless. How to preventthat is to not program the code via knocks (it's neat but not secure). As a general rule, you should not

    use the same code twice or you should make the use of it unpredictable. (One code for every day of the

    week is not unpredictable... just less predictable). The solution is obvious... use a random code.

    But the problem is also obvious: How do you communicate this code to the user?

    Solution: LED blink sequences. I suggest a three number code with digits from 1 to 5 (e.g. 2 knocks, 4

    knocks, 1 knock). Press the program button to generate the sequence randomly (However this may be

    done). Commit the sequence to memory and deliver the knock upon your return to unlock the door. As

    an added measure of security, if the knock sequence fails, wait ten seconds; if it fails again, wait one

    minute; at three, five minutes; and at four, ten minutes (on upward). With 125 possible sequences, a

    potential intruder can not afford the delay.

    Before going to the store, press the program button and observe what code it spits out. Close the door

    and knock a "lock" code (I don't know... two knocks or something). Return with the groceries and knock

    out the "unlock" code.

    That would make it more secure in my opinion.

    Reply

    Kyle

    I want one - can this be arranged haha?

    Reply

    Nathan

    http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461983http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461978http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461975http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461971http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168462288http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461967

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    7/9

    Load more comments

    Introducing my new video series: MAKE:Inventions

    A — Very nice, I look forward to you're

    episode on a Tokamak

    Tip: Mason Jar Organizing•

    A  — I like plastic peanut butter jars - MJ's

    are very unforgiving when dropped (he said as

    he picked the tiny brass screws out of a pile …

    Combining Fiction And Code To TeachProgramming

    A  — I loved these books as a kid! So

    fun!

    Quick Tip: Cutting Bolts To Length•

    A  — If I have to cut many screws to the

    same length, I first cut a piece of aluminum

    tube to the desired length minus the width of …

    GRATHIO LABS

    Thanks Steve, you've made my morning. Inventions like this inspire me tolearn!

    Reply

    Jason

    Thats great until the suction cups pop loose and it hits the floor.

    Reply

    random bloke

    YOU ARE SO SICK DUDE. IN GOOD WAY. I feel sorry for myself that im suchas looser lol... keep up the good work!!!

    Reply

    Valery

    Aha, it would be very cool to knock all kinds of music when your key will belocked inside and suction cups just FAIL as they often do.

    Reply

    matthew lamb

    dude i have to get this. how much?

    Reply

    https://help.disqus.com/customer/portal/articles/1657951?utm_source=disqus&utm_medium=embed-footer&utm_content=privacy-btnhttps://publishers.disqus.com/engage?utm_source=grathio&utm_medium=Disqus-Footerhttps://disqus.com/http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461990http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461989http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461988http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461986http://grathio.com/2009/11/secret_knock_detecting_door_lock/#comment-168461983http://disq.us/url?url=http%3A%2F%2Fgrathio.com%2F2013%2F06%2Fquick-tip-cutting-bolts-to-length%2F%3AaNoSvElzipsakbVrExTHWDNa3qw&imp=5c76r720jl6d3&prev_imp&forum_id=689511&forum=grathio&thread_id=258517942&thread=1412680049&zone=thread&area=bottom&object_type=thread&object_id=1412680049http://disq.us/url?url=http%3A%2F%2Fgrathio.com%2F2012%2F12%2Fcombining-fiction-and-code-to-teach-programming%2F%3AigOi34hfIAg0l0x9vvluB0pUSWU&imp=5c76r720jl6d3&prev_imp&forum_id=689511&forum=grathio&thread_id=258517942&thread=967470603&zone=thread&area=bottom&object_type=thread&object_id=967470603http://disq.us/url?url=http%3A%2F%2Fgrathio.com%2F2013%2F02%2Ftip-mason-jar-organizing%2F%3A61FQHrdeIzc0MIperJoAyr_KLIw&imp=5c76r720jl6d3&prev_imp&forum_id=689511&forum=grathio&thread_id=258517942&thread=1077382059&zone=thread&area=bottom&object_type=thread&object_id=1077382059http://disq.us/url?url=http%3A%2F%2Fgrathio.com%2F2013%2F05%2Fintroducing-my-new-video-series-make-inventions%2F%3Alw2orXOTh4yf4A4B52hxRmDaH18&imp=5c76r720jl6d3&prev_imp&forum_id=689511&forum=grathio&thread_id=258517942&thread=1278518082&zone=thread&area=bottom&object_type=thread&object_id=1278518082

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    8/9

  • 8/17/2019 Secret Knock Detecting Door Lock – Grathio Labs

    9/9

    This work by Steve Hoefer and Grathio Labs is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

    http://creativecommons.org/licenses/by-nc-sa/3.0/us/http://grathio.com/http://creativecommons.org/licenses/by-nc-sa/3.0/us/