{"id":9515,"date":"2014-08-25T12:39:59","date_gmt":"2014-08-25T20:39:59","guid":{"rendered":"http:\/\/www.perivision.net\/wordpress\/?p=9515"},"modified":"2014-09-11T13:11:11","modified_gmt":"2014-09-11T21:11:11","slug":"building-a-door-opening-robot-because-robots","status":"publish","type":"post","link":"https:\/\/www.perivision.net\/wordpress\/2014\/08\/building-a-door-opening-robot-because-robots\/","title":{"rendered":"Building a door opening robot because&#8230; robots!"},"content":{"rendered":"<p><em>I originally wrote this for <a href=\"http:\/\/www.monsoonco.com\/one-door-remote-multiple-people-build-robot\/\">Monsoonco.com<\/a>.\u00a0 This is a repost.<\/em><\/p>\n<p><a href=\"https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/monsoon-office.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-9516\" src=\"https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/monsoon-office-300x128.jpg\" alt=\"monsoon office\" width=\"300\" height=\"128\" srcset=\"https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/monsoon-office-300x128.jpg 300w, https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/monsoon-office-1024x438.jpg 1024w, https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/monsoon-office.jpg 1400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>We work out of a historic bank in downtown Oakland. \u00a0It\u2019s gorgeous. There are high ceilings with gorgeous artwork, and we have not one, but two bank vaults with huge metal doors that we use as conference rooms. \u00a0Unfortunately, solving simple problems in a historic building can be a challenge. \u00a0Years ago, someone installed a card key system for getting into the office, but by the time we moved in, there were only a few card keys left for employees. \u00a0This\u00a0wasn\u2019t\u00a0a problem when we were fifteen people, but now over 40 employees ring the doorbell to\u00a0get in every day\u2026and since we have code to write and apps to design, opening the door 40 times a day\u00a0isn\u2019t\u00a0ideal.<\/p>\n<p>How does a crew of hackers solve this kind of a problem? \u00a0Simple! \u00a0They build and customize a robot that opens the door via a mobile app.<\/p>\n<p><a href=\"https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/door-robot-clicker.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-9517\" src=\"https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/door-robot-clicker.jpg\" alt=\"door robot clicker\" width=\"225\" height=\"300\" \/><\/a><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-1014 size-medium\" src=\"http:\/\/www.monsoonco.com\/wp-content\/uploads\/2014\/07\/Door-Robot-Closeup-225x300.jpg\" alt=\"Door Robot Closeup\" width=\"225\" height=\"300\" \/><\/p>\n<p>Here\u2019s how we did it:<\/p>\n<p>First things first, we need to get the hardware in place. \u00a0Using a Raspberry Pi and breakout board, we wired in a simple mechanical claw. \u00a0Since this is going to be running 24\/7, we wired in a AC-DC converter to keep it powered. Cool. Now we code up a simple Python script to tell the claw to do three things.. First, position the claw at the open position. Then a script that tells the claw to move to a slightly closed position, then back to open again. \u00a0That is it. \u00a0So you can see from the image below, the script allows the claw to do one job. \u00a0Click the button on the remote.<\/p>\n<p>Now the client side. \u00a0We wrote both an iPhone app and a web app. I have Android so I\u2019ll use the web app for the screenshots. \u00a0Not much to say here. Basically we have a webpage with one button on it. \u00a0Click that button and if the server is happy with the communication (and it\u2019s between working hours) you get a happy \u2018accepted\u2019 message and a request is sent to the Node server, which in turn sends a request to the Raspberry Pi to execute the button click method.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-1013 size-medium\" src=\"http:\/\/www.monsoonco.com\/wp-content\/uploads\/2014\/07\/2014-07-07-20.50.10-168x300.png\" alt=\"2014-07-07 20.50.10\" width=\"168\" height=\"300\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-1012 size-medium\" src=\"http:\/\/www.monsoonco.com\/wp-content\/uploads\/2014\/07\/2014-07-07-20.49.59-168x300.png\" alt=\"2014-07-07 20.49.59\" width=\"168\" height=\"300\" \/><\/p>\n<p>Even though we now have a working device, we live in the real world and need to think about security. \u00a0To deal with that we put a few checks in like only letting those authenticated in our system to even access the web page in the first place and passing certain params on the call. \u00a0You can put in other checks as well like sending a password or looking for device ID.<\/p>\n<p>As cool as this looks. we really need to put this in a case, propping this up on some business cards is ghetto but we want to do this right. \u00a0I\u2019ve built an amp a few years back and put it in a cool plastic case I got from radioshack, so we may do something like this unless I get really ambitious and put something together in 3D and send it to a 3D printer. Next I want to write a javascript app for my Pebble watch so I can simply click a button and have it open the door for me. \u00a0More on that later.<\/p>\n<p>When we first started building this we thought it was be a quick half day task. \u00a0Turns out it took much longer than we thought. \u00a0Mostly because we did not consider; power, where are we going to put this?, how to align the claw to the button, is it close enough to a cat5 line? \u00a0What about security? \u00a0Even something as simple as wear and tear on the claw gears. \u00a0At one point it stopped working. \u00a0I looked at the set up and after a few tests realized that the claw was not closing on the button enough to activate the remote, so we have to go back and change the close position by 1 deg. \u00a0I bet that a few months from now we will have to tweak it again, but that is just a simple change in the Python script.<\/p>\n<p>But the main point is it WORKS!! Now anyone of us can simply walk up to the door, press a button on our phones and we are in. \u00a0This is even better than giving out card keys because; one if someone loses a key, we cannot replace it, and second, if we need to shut someone out, we simply remove them from the approved list on the server. \u00a0Same thing with someone who needs access just for a short amount of time. \u00a0Just add a profile and log their activity. \u00a0Sweet.<\/p>\n<div class=\"SPOSTARBUST-Related-Posts\"><H3>Related Posts<\/H3><ul class=\"entry-meta\"><li class=\"SPOSTARBUST-Related-Post\"><a title=\"WANT! iphone ipad controlled Helicopter for $40 with shipping\" href=\"https:\/\/www.perivision.net\/wordpress\/2011\/07\/iphone-ipad-controlled-helicopter-for-40-with-shipping\/\" rel=\"bookmark\">WANT! iphone ipad controlled Helicopter for $40 with shipping<\/a><\/li>\n<li class=\"SPOSTARBUST-Related-Post\"><a title=\"RC helicoptor (drone) control using the iphone with remote camera\" href=\"https:\/\/www.perivision.net\/wordpress\/2010\/01\/rc-helicoptor-drone-control-using-the-iphone-with-remote-camera\/\" rel=\"bookmark\">RC helicoptor (drone) control using the iphone with remote camera<\/a><\/li>\n<li class=\"SPOSTARBUST-Related-Post\"><a title=\"Control your presentations from the new apple earphones?\" href=\"https:\/\/www.perivision.net\/wordpress\/2009\/03\/control-your-presentations-from-the-new-apple-earphones\/\" rel=\"bookmark\">Control your presentations from the new apple earphones?<\/a><\/li>\n<\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>I originally wrote this for Monsoonco.com.\u00a0 This is a repost. We work out of a historic bank in downtown Oakland. \u00a0It\u2019s gorgeous. There are high ceilings with gorgeous artwork, and we have not one, but two bank vaults with huge metal doors that we use as conference rooms. \u00a0Unfortunately, solving simple problems in a historic&hellip; <a class=\"read-more\" href=\"https:\/\/www.perivision.net\/wordpress\/2014\/08\/building-a-door-opening-robot-because-robots\/\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":9517,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1922],"tags":[2206,321,2205],"class_list":["post-9515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to-2","tag-raspberry-pi","tag-remote-control","tag-robots"],"jetpack_featured_media_url":"https:\/\/www.perivision.net\/wordpress\/wp-content\/uploads\/2014\/08\/door-robot-clicker.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pjzQD-2tt","_links":{"self":[{"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/posts\/9515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/comments?post=9515"}],"version-history":[{"count":1,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/posts\/9515\/revisions"}],"predecessor-version":[{"id":9518,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/posts\/9515\/revisions\/9518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/media\/9517"}],"wp:attachment":[{"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/media?parent=9515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/categories?post=9515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.perivision.net\/wordpress\/wp-json\/wp\/v2\/tags?post=9515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}