[{"data":1,"prerenderedAt":235},["ShallowReactive",2],{"i-lucide:menu":3,"i-lucide:arrow-up-right":8,"i-lucide:moon":10,"i-lucide:sun":12,"i-lucide:rss":14,"i-simple-icons:github":16,"i-simple-icons:linkedin":18,"post-\u002F2018\u002Fshut-it-an-arduino-door-alarm":21,"surround-\u002F2018\u002Fshut-it-an-arduino-door-alarm":222,"i-lucide:arrow-left":231,"i-lucide:arrow-right":233},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 7h10v10M7 17L17 7\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"4\"\u002F>\u003Cpath d=\"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":15},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0 1 16 16\"\u002F>\u003Ccircle cx=\"5\" cy=\"19\" r=\"1\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":17},"\u003Cpath fill=\"currentColor\" d=\"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":19,"hidden":20},"\u003Cpath fill=\"currentColor\" d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037c-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85c3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.06 2.06 0 0 1-2.063-2.065a2.064 2.064 0 1 1 2.063 2.065m1.782 13.019H3.555V9h3.564zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0z\"\u002F>",true,{"id":22,"title":23,"body":24,"category":209,"comments":210,"date":211,"description":30,"excerpt":210,"extension":212,"image":213,"meta":214,"navigation":20,"path":215,"readingTime":216,"seo":217,"stem":218,"subtitle":219,"tags":210,"wordCount":220,"__hash__":221},"posts\u002F2018\u002Fshut-it-an-arduino-door-alarm.md","\"Shut It!\" - An Arduino Door Alarm",{"type":25,"value":26,"toc":201},"minimark",[27,31,48,53,56,72,75,101,108,112,115,121,124,130,133,136,142,147,153,159,162,167,170,175,179,182,188,192],[28,29,30],"p",{},"The outer door to the office had a problem: sometimes, it wouldn't lock properly. It's one of those doors that\nhas a mechanical automatic closure system, but the system was worn down and would sometimes not close and properly lock the door.\nThe result, a security risk: a distracted employee could leave the office and forget the door unlocked.",[28,32,33,34,41,42,47],{},"To mitigate this issue, I decided to build a small, simple DIY door alarm, that would alert employees when the office door\nhad been left open for a prolonged period of time. This was the perfect practical project as an introduction to digital\nelectronics and Arduino for ",[35,36,40],"a",{"href":37,"rel":38},"http:\u002F\u002Feppolekors.com",[39],"nofollow","@epplkrs",", a graphical designer who\n",[35,43,46],{"href":44,"rel":45},"https:\u002F\u002Fgithub.com\u002Fanroots\u002Felectronics-labs",[39],"wanted to learn about Arduino",". She did most of the\nprototyping, soldering and product design and built her first real Arduino product.",[49,50,52],"h2",{"id":51},"requirements","Requirements",[28,54,55],{},"Build a small door sensor that would start beeping when the door is open for too long.",[57,58,59,63,66,69],"ul",{},[60,61,62],"li",{},"Small form-factor (can be attached to a wall)",[60,64,65],{},"Monitors the state of the door (open \u002F locked)",[60,67,68],{},"If the door has been open for longer than 30 seconds, start beeping annoyingly until someone comes and shuts the door",[60,70,71],{},"Runs on batteries",[28,73,74],{},"Considering the requirements, we settled on the following design:",[57,76,77,80,83,86,89,92,95,98],{},[60,78,79],{},"Arduino as \"the brain\" - Atmega328 on a breadboard",[60,81,82],{},"Runs on 3 AA batteries (4.5V)",[60,84,85],{},"Project installed in a small paper box (taped to the wall), with an extending sensor wire",[60,87,88],{},"Sensor (reed switch with a magnet) attaches to the door to monitor door state",[60,90,91],{},"When the door is open, the reed switch activates and powers ON the Arduino",[60,93,94],{},"A status LED on the front panel indicates that the door is open",[60,96,97],{},"If the door is not closed within 30 seconds, an internal Piezo buzzer will start beeping",[60,99,100],{},"When the door is closed, the cycle repeats",[28,102,103],{},[104,105],"img",{"alt":106,"src":107},"Project schematic","\u002Fcontent\u002F2018\u002Fshut-it\u002Fschematic.png",[49,109,111],{"id":110},"build-process","Build Process",[28,113,114],{},"We started with a breadboard prototype: Arduino hooked up to a sensor, a LED and a buzzer.",[28,116,117],{},[104,118],{"alt":119,"src":120},"Breadboard","\u002Fcontent\u002F2018\u002Fshut-it\u002Fbreadboard.jpg",[28,122,123],{},"This enabled us to write and test the Arduino firmware.",[28,125,126],{},[104,127],{"alt":128,"src":129},"Arduino code","\u002Fcontent\u002F2018\u002Fshut-it\u002Fprogramming.png",[28,131,132],{},"With the code properly reading sensors and activating the buzzer, came the time for physical assembly:\nThe project needed to come off the breadboard and into a permanent, fixed PCB.",[28,134,135],{},"The Atmega328 chip was attached to an empty PCB, with all the required I\u002FO\ndevices and connectors soldered onto it.",[28,137,138],{},[104,139],{"alt":140,"src":141},"Soldering","\u002Fcontent\u002F2018\u002Fshut-it\u002Fsolder1.jpg",[28,143,144],{},[104,145],{"alt":140,"src":146},"\u002Fcontent\u002F2018\u002Fshut-it\u002Fsolder2.jpg",[28,148,149],{},[104,150],{"alt":151,"src":152},"Soldering done","\u002Fcontent\u002F2018\u002Fshut-it\u002Fpcb-done.jpg",[28,154,155],{},[104,156],{"alt":157,"src":158},"Completed box","\u002Fcontent\u002F2018\u002Fshut-it\u002Fcompleted-box-in.jpg",[28,160,161],{},"We used an Apple Mouse box as the project enclosure. As a result, the completed project was\nelegantly White.",[28,163,164],{},[104,165],{"alt":157,"src":166},"\u002Fcontent\u002F2018\u002Fshut-it\u002Ffinished-front.jpg",[28,168,169],{},"Double-sided tape to the back of the box keeps the project on a wall.",[28,171,172],{},[104,173],{"alt":157,"src":174},"\u002Fcontent\u002F2018\u002Fshut-it\u002Ffinished-back.jpg",[49,176,178],{"id":177},"installation","Installation",[28,180,181],{},"We installed the project to the problematic door; and it works: when the door is\nopened, the project powers ON, waits for 30 seconds and will then start BEEPING, alerting the\noffice: the door was left open again.",[28,183,184],{},[104,185],{"alt":186,"src":187},"Installing","\u002Fcontent\u002F2018\u002Fshut-it\u002Finstalling.jpg",[49,189,191],{"id":190},"source","Source",[28,193,194,195,200],{},"Project schematics and source code ",[35,196,199],{"href":197,"rel":198},"https:\u002F\u002Fgithub.com\u002Fanroots\u002Fshut-it",[39],"are available from Github"," under the MIT license.",{"title":202,"searchDepth":203,"depth":203,"links":204},"",2,[205,206,207,208],{"id":51,"depth":203,"text":52},{"id":110,"depth":203,"text":111},{"id":177,"depth":203,"text":178},{"id":190,"depth":203,"text":191},"Hardware",null,"2018-02-13","md","\u002Fcontent\u002F2018\u002Fshut-it\u002Fheader.jpg",{},"\u002F2018\u002Fshut-it-an-arduino-door-alarm","about 2 minutes",{"title":23,"description":30},"2018\u002Fshut-it-an-arduino-door-alarm","We built a door alarm to combat \"I forgot to lock the door\" problem",494,"tlToq4etHoR7tMX0TIv44nSn8KWqRToSUij-1_KdXbs",[223,227],{"title":224,"path":225,"stem":226,"children":-1},"Repurposing an Old Phone: Personal HUD Screen","\u002F2017\u002Fscreen","2017\u002Fscreen",{"title":228,"path":229,"stem":230,"children":-1},"Outage Reports From Personal Homelab","\u002F2018\u002Foutage-reports-from-personal-homelab","2018\u002Foutage-reports-from-personal-homelab",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":232},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 19l-7-7l7-7m7 7H5\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":234},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7l7 7l-7 7\"\u002F>",1790886931247]