Unlock your door with Siri, SMS, or a secret knock

Unlock your door with Siri:

For our first Arduino project, we hacked together a wifi-enabled door lock with some nifty features. After seeing cool projects like John Grathio’s secret knock and Billy Chasen’s ethernet unlocker, we were inspired to build our own. We combined the two ideas using an Arduino and a WiFly shield, a modified servo motor, and a few other things.

The end product is pretty cool and has these features:

  • Unlock / Lock your door with your voice using Siri, an iPhone app, SMS, or a mobile web page (iphone app requires iOS developer account)
  • Monitor whether the door is locked or unlocked from far away
  • Get SMS messages when someone knocks on your door
  • Unlock your door with a secret knock (hard-coded for now)

A demo of the iPhone app and secret knock in action:

The Siri hack works by creating a contact called ‘Door’, which is the phone number that we use to accept SMS messages like ‘open’ or ‘lock. We used Google app engine for a server component since it’s free for small usage like this. We then created an iPhone simple iPhone app to send unlock commands and monitor the door state. Twilio.com enabled us to send and receive SMS messages.

All the code we used is available on github here: https://github.com/cclaan/lockerino

* DISCLAIMER * Remember, we hacked this together for fun! – It’s not intended to protect your belongings or loved ones. The code probably has some bugs, might malfunction, or could easily be hacked by someone!

We intend to write up a more detailed how-to on Instructables.com, so stay tuned for that.

Also, this project is probably for advanced builders since your lock may be different than ours and require some custom solutions for mounting the servo to the lock. You may also have to modify our code a little to get the knock detection thresholds and servo angles correct, since they will be slightly different for everyone. Since it requires a web server, you will have to setup google app engine, which is free, but requires a little technical know how.

The total cost right now for all the parts ends up at around $170.. but if you have some of the common parts lying around it could be a lot less. Plus, we hear that the Arduino folks are introducing a cheaper WiFi shield in the next few months, since the one we use costs $90. Or you could use an Ethernet Pro that only costs $54.95 and saves you about 65 bucks, but requires a long ethernet cable.

Here are the parts we used for the project:
Stuff you need
Here’s what you’ll need:

  • Ardunio Uno, or any arduino with shield mounts (mega, etc) ( $29.95 Sparkfun )
  • Stackable headers for attaching the WiFly shield to arduino ( $1.50 Sparkfun )
  • WiFly shield – ( $89.95 Sparkfun )
  • Standard servo (we used Tower SG-5010) – modded to read the internal pot ( $13.95 Sparkfun )
  • Piezo element from sparkfun, radio shack has them in buzzers. ( $1.50 Sparkfun )
  • A 1k resistor – goes in parallel between the piezo element ( $0.25 Sparkfun )
  • Some jumper wires ( $6.95 Sparkfun )
  • A 5.1mm power jack ( $2.00 Sparkfun or radio shack )
  • Instamorph or shapelock for the servo / lock arms ( $9.95 Instamorph.com )
  • A power supply to arduino, many will work ( $6.95 Sparkfun )
  • Some velcro with adhesives, or dualock tm by 3M ( Radio Shack )
  • 3M dual sided sticky tape, the thick kind (Radio Shack)
  • Thin plywood to mount arduino to the door and also to create the servo mount ( $5.00 Home Depot )
  • Clothes hanger, for the wire, or other thick wire to connect servo to door lock
  • Long wire to run the power cable to arduino, ( radio shack )
  • L-brackets for servo, ( $2.00 home depot )
  • A dremel , maybe a jigsaw or handsaw for cutting the plywood
  • A soldering iron for modifying the servo

  • A fritzing sketch of how to wire it up:
    How to wire it up

    Here’s a short video of putting it together, again, expect a more detailed tutorial to come soon.


    Here’s how to modify a servo to read the position via its internal potentiometer:

    Attaching the brackets to the servo:

    Let us know what you think in the comments!

    -Laan Labs

    Posted in Uncategorized | Tagged , , , , , | 16 Comments

    Moldable Plastic

    Fun little new toy for making chew toys and such – you can get your own from instamorph.

    Posted in experiments | 1 Comment

    3d Video from Kinect on the iPad

    We used the String Augmented Reality SDK to display real-time 3d video+audio recorded from the Kinect.

    Libfreenect from http://openkinect.org/ project was used for recording the data coming from the Kinect. A textured mesh was created from the calibrated depth+rgb data for each frame and played back in real-time. A simple depth cutoff allowed us isolate the person in the video from the walls and other objects.

    Using the String SDK, we projected it back onto a printed image marker in the real world. We also experimented with actively removing the image marker from the scene using camera data from the areas surrounding the image marker.

    Posted in Uncategorized | 23 Comments

    An iPhone Developer’s (evil) April Fools’ Day Prank

    As iPhone developers, one of the worst fears we have is Apple giving us some bad news about one of our apps. Things like getting rejected aren’t fun, but getting a live app pulled from the App Store sucks pretty bad, especially if it’s paying your rent. Apple has been known to pull apps for various reasons, things like inappropriate content, or use of an unapproved API within your app can get it taken down. It’s happened to us before and it doesn’t feel good.

    So for this April Fools’ Day, we decided to play on that fear and prank some of our developer friends.

    A little context for non-developers:
    Anytime Apple wants to update you about the status of your app, they send you an email from a certain account, with a certain template, it looks like this:

    Typical Apple Email about an app

    With a little help from an email spoofing website called http://www.sharpmail.co.uk, we can fake the sender and re-create the HTML template Apple uses. So the idea is pretty simple: Send a fake email from Apple telling someone their app has been yanked from the store for no good reason.

    First I tried pranking the other member of Laan Labs, Jason, about our app Tap DJ. It’s currently sitting at #45 in the top paid list, so you can understand why we wouldn’t want it pulled from the store. Here’s what the email he received looked like:

    Fake email to Jason from me

    We only pranked good friends, and we clued them a few minutes later as to prevent them from doing anything crazy like calling Apple and yelling at them.

    Happy April Fools’ Day Friends,
    Laan Labs

    Posted in Uncategorized | Tagged , , , , | 1 Comment

    How to make time lapse screencaptures of your design work for free (mac)

    Tap DJ Icon Final VersionFor our upcoming app Tap DJ ( tap.dj ), we made the icon ourselves and decided to screencast the process for fun. It turned out to be a fun way to share the creation process, and a motivator to get the whole thing done in one sitting because the “cameras were running.”

    Here is the video on vimeo:

    Since I plan on timelapsing more design sessions as more of a journal type thing, I though I’d share the process of making it, since it’s free. You could use a screencapture tool like screenflow or snapz pro, but they tend to cost money, and you don’t get to write fun command line scripts. (This technique has already been covered in a few blogs, but I didn’t find a consolidated version with everything I needed. See links at bottom for more info.)

    To start your timelapse, you’ll type this script into a terminal window:
    i=1;while [ 1 ];do screencapture -t jpg -x ~/Desktop/screencapture/$i.jpg; let i++;sleep 4; done

    The script simply captures a screenshot every 4 seconds in this case and saves it into the “Desktop/screencapture” directory with a naming convention of 1.jpg, 2.jpg, and so on. Before you begin, make sure the directory exists, or it won’t work. Then change the sleep number (4 here) to however many seconds you want to wait between screenshots. The script will run infinitely so when you’re done capturing, make sure to Ctrl+C or close the window to stop the script.
    If you need to pause, just Ctrl+C to kill the script, then to resume, change the “i=1″ to be whatever the last screenshot image number is plus one. So if the last image taken was “123.jpg” then set i=124 in the script.

    When you’re done capturing, you will want to render all your screenshots into movie. To do this, you’ll need to have ffmpeg installed. To install, type each line into terminal…
    cd /tmp/
    svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
    cd ffmpeg

    ./configure --enable-shared --disable-mmx
    sudo make
    sudo make install

    A more detailed install explanation with more options is here:
    http://stephenjungels.com/jungels.net/articles/ffmpeg-howto.html

    Now, simply cd into the directory with all your images, and type:
    ffmpeg -r 24 -i %d.jpg -b 15000k timelapse.mov

    The number 24 represents frame rate, and you might want to adjust it based on how fast the movie should play. Lowering it to something like 18 will make the video longer, but possibly more watchable for a shorter process. The number 15000k is the target bitrate, and is pretty large because the video will be the size of your screen.

    You will notice the video has some compression artifacts, I didn’t spend too long messing with ffmpeg options, but it should be possible to resize or increase the video quality by adding a few command line options to ffmpeg. You can read more here:
    http://www.ffmpeg.org/ffmpeg-doc.html#SEC7

    Note:
    During capturing, I accidentally stopped capturing and restarted again in a different folder. If your image numbers somehow get messed up, you can use this script to rename them based on creation date. First move all images into one folder regardless of the name screwups. Now create a folder called “imgs”, and in terminal, cd to this directory and type this script…

    x=1; for i in $(ls -r -t *jpg); do counter=$(printf %d $x); ln "$i" imgs/"$counter".jpg; x=$(($x+1)); done

    Now all your images are named in a numbered sequence based on when they were created, and you can use the above ffmpeg script in this directory.

    Post used for reference:
    http://www.mactricksandtips.com/2009/12/take-timed-lapsed-screen-shots-from-terminal.html
    http://www.carbonsilk.com/development/timelapse-video-mac/

    Posted in experiments, Uncategorized | Tagged , , , , , , | 6 Comments

    iPhone USB Photo and Video Transfer ( no syncing )

    USB Photo and Video Transfer
    If you’re looking for a quick way to send some photos and videos from your camera roll to your computer, we might have an app for you.

    We made this simple app ‘USB Photo and Video Transfer’ to cut down on the time it takes to send one or two photos or videos back to the desktop.

    Simply select one or more photos and videos from your camera roll and they will instantly appear in iTunes. From there you can save them anywhere you like. No desktop syncing software required.

    You can get it free for a limited time on iTunes!

    For the iOS developers/designers out there:
    As developers that do our own designs, we frequently send screenshots from the phone back to our computers to edit in photoshop. While there are some cool apps for previewing desktop designs on your phone, sending them from your phone to your desktop is more difficult. With this in mind, we’ve created a filter in the app that will only show images that are screenshots, making it easy to quickly send some screenshots to the desktop.

    Posted in products | Tagged , , , | 6 Comments

    Hacking on the kinect

    So cc spent a few hours hacking the kinect based on the work of the openKinect project.

    [waring the audio is a bit rough on this one]

    Posted in experiments | 3 Comments

    Small Update to iVideoCamera


    So we have made a small update to iVideoCamera with a couple of bug fixes, but mainly we wanted to make the FX free as there are some great ones there that some of you had yet to try. A BIG thanks to you out that that purchased FX before We hope that you are not too mad at us for changing them to free, but you did have them before anyone else – its kinda like apple lowing the price of the iPhone after its out a while – anyway…

    NOTES: The landscape playback of videos no longer works (we were using an undocumented feature to allow videos to playback in landscape mode) — hopefully we will have it in the next update. Breaking News effect can sometime not display on first open — just change orientation of your phone and it will display properly. Thanks!

    Posted in products | Tagged , , | 19 Comments

    iBanner for iPad

    Don’t know if you have come accross our iPad apps yet, but iBanner is definitely worth checking out (plus its currently #2 in app store right now). CC whipped this little app out right before the iPad came out so we would have a nice little suite of (physical) messaging apps that would go nicely with iSigns. Its a fun way to turn your oversized iphone into one of those led banner devices, which are great in storefronts, bars and other situations where you (or your sign) needs attention. Get it from the store now.

    Posted in products | Tagged , , , | 1 Comment

    iSigns HD for the iPad

    So last week before the ipad deadline we whipped out a little app, iSigns HD – 150+ signs, in a few hours because we just wanted to be sure we had a least one app in the iPad store. Expect more serious iPad apps from us in the near future relating to video and media management, but for now this little app is a fun way to show off that big screen. Let people know the are a “Wide Load” or a “Dip” in the next office meeting or maybe if you are really board just find a good place on the street and stand there with a “No Parking” or “Detour” sign.

    Posted in products | Tagged , , | 3 Comments