Knock Lock Balks Knock, Uses CapSense Without Shock

[Rob Hemsley] sent in an update to an RFID-based door lock. Previously, if you wanted to enter the MIT media lab, a RFID-enabled card was required to get in. Now, with [Rob]’s update, you only need to tap the door handle in a ‘secret’ pattern.

The earlier RFID-enabled build used about $80 in hardware, not a very economical solution. The new touch-based solution only uses an Arduino and servo, making the build much cheaper.

The touch sensitive lock uses the CapSense Arduino library. By turning the door handle into a touch sensor, [Rob] allowed a secret code to be saved in the EEPROM. Repeating this sequence when the door is locked sends power to the servo, unlocking the door.

A very cool build that’s also a little more secure than the traditional, audible knock lock. Check out the video after the break.

42 thoughts on “Knock Lock Balks Knock, Uses CapSense Without Shock

  1. Is it me, or does it audibly unlock before he finishes the tap pattern at the end? Does it really just unlock after you tap some # of times? ;) (And did it unlock when you held the lock for 10 seconds? Seems like that would be a downside too…)

    1. Probably the way any IC reacts when you over-voltage it without a clamping network, Kaboom.

      I will add that there are internal clamping diodes on digital I/O pins and this -might- be able to keep it out of harms way, but likely not a permanent solution.

      Another related question is if it has a floating ground or not?

    1. An MSP430 isn’t that much less equipment and it’s only a few bucks cheaper at this point and it doesn’t already have easily available libraries like CapSense. The reason you have to ask how to implement answers the question of why you’d do it this way.

      1. The MSP430 development system (MSP-EXP430G2) is $4.30+free shipping, Arduino Uno is ~$30+shipping. A wee bit more than a ‘few bucks’

        Also many MSP devices have a native capsense I/O pin that does a lot of the work for you.

      2. @eldorel And to program firmware onto an arduino you need a what? A TTL serial adapter of some sort and supporting circuitry, those aren’t free either. I was comparing one dev platform to another. Not to mention the MSP is a -real- debugger.

        $5.50?! that’s still more than the TI DEV offering, sorry, still beat.. add shipping to that $5.50 while you’re at it..

      3. Nova if you already have an arduino you can use it to program the chip, pull it out of the board and add a few caps and a crystal.

        And if you’re playing with an arduino you most likely already have a dev board.

        That way it will only cost you the price of the chip, 2 caps and a crystal.

        Of course on top of that it needs some voltage regulation, but you’d need that anyway.

      4. This is the media lab we’re talking about. They’ve got plenty of atmel chips and have a few programmers so dev tools/board cost isn’t an issue. Probably less true for the MSP430.

        Now why they used an arduino instead of just one of the chips in the parts draw and a board – I mean, a full atmega328p seems a little overkill to me.

        But it’s probably great for prototyping something like this, so I stand corrected.

      5. These comments are making me face-palm. What if you don’t have an arduino already, or an ISP to program the bootloader onto a raw chip? I’m talking about the cost of starting from scratch. If you already have that stuff laying around, great! It’s cheaper for you but not everyone is in arduino-land.

        I’m not arduino-hating, I have one myself. But the cost to start on the MSP and have a -real- dev platform is significantly less. And by real I mean a debugger with breakpoints, variable monitoring, etc..

      1. If you don’t have an arduino, you can can still program it provided your computer has a serial port. All you need are the tx, rx, and dtr pins for programming the atmega328p. If you’ve seen the breadboard arduino, you’ll see that you only need a resonator, resistor, and a 5V source (via linear regulator or perhaps directly via the serial port). The atmega328p can be bought on mouser for only $3.

      2. I can understand the msp430 argument if you’re searching for a lower power solution, or attributes where the msp430 is superior to atmega, but mentioning cost for a small project where the difference in cost is only a few dollars is insane.

        These days, you can get a raspberry pi for $35, and it will come with all the tools you need for programming the arduino — simply “apt-get install arduino-mk” and you can upload the bootloader code as well as your sketch logic via the serial port found on the GPIO header of the raspberry pi.

        Unless you work as a peasant farmer in India, you should be able to afford a small computer like the RPi, and about $5 in parts for the arduino — that’s all you need to get started.

    1. Oh god, I’m sure I gonna need this some day and just commentate to give me at least some way to find your post in the future again.
      HaD needs a favorite-option so badly.

  2. This is a very good idea but if anyone is rhythmically challenged or has very good rhythm, they can have a hard time remembering the pattern or some one can easily figure it out just by watching once.

  3. I think it was IbM many years ago developed a way of transmitting data via someone just shaking hands. Kind of an electronic business card. you could use the same system in a watch.
    Have the lock handle send out a ID when it detects a hand on the door then the MC in the watch sends a code back to the lock and authenticates the code and unlocks.

  4. So, without even knowing the code, you can mischievously alter it ! And the door seems to unlock itself during recording ! At the moment, any old Joe can come along and do the same, so where is the security ?

    I think the MIT logic needs a little honing.


  5. Excellent, even if it’s a rigged demo.

    Older than dirt – I’ve seen numerous projects circa 1978-1980s where you tapped morse code to a cap switch (CD 4011 cmos IC and a few parts) and something happens, usually a solenoid being pulled so the door can open.

    I saw a very cool shadow puppet lock using an early DRAM chip with a microscope cover slide glued on and a nightlight. It wasn’t very accurate, even if it was a cool demo.

    The best one was the lighted doorbell button with a tiny CDS cell (very small, used for VFDs in microwaves) which had two 7493 counters attached. I don’t remember the logic, but it was really simple, maybe a triple nand and a dual-d flip flop or something. You held your finger or hand out for a few seconds, which reset the counter, then waved your hand a few times , waited and waved it again. it was like 5, pause, 5, pause, 1.

    The first counter went at the first pause, the second counter went after the second and then if a short wave followed, it would compare the two numbers, and if they were both 5, the magic occurred. I suppose this would be 50 lines of code in any microcontroller under the sun.

    What was interesting is that it worked really, really well. It was basically for lost key situations, but he ended up using it all the time. One weekend some neighbor kids came over to help him do something to his yard and paid close attention as he let them into the house.

    Boom! The next day (Monday) when he came home from work, all his booze was missing, along with his ice-cream, some tapes and a few other accessories normally associated with the “gentlemanly arts”. He blamed himself for not realizing that Monkey-See Monkey-Do is a time honored tradition, and a reason why anything short of elaborate morse code is risky.

    And this is why hard-wired logic sucks.

    As a side note, thank god no one has re-created Hefner’s short-lived Playboy club in Bangkok VIP room “kiss the no-fig-leaf-covered part of the statue” to gain access to the bar. I’m sure it seemed like a good idea at the time, but it lasted less than a week. It was an awful place.

  6. You could add lots of randomising factors to make it a bit more secure such as having a RTC on the uController and having to tap the Hour in binary at the end. Will stick to an RFID keyfob for my home for now though :-)

  7. BlueTooth’s MAC address “of the day” seems more entertaining.

    yes, spoof the MAC address.. why bother with simple passphrases as this will appear entirely passive

    Spoof MAC on android devices with creative framework modification

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.