[{"data":1,"prerenderedAt":231},["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-\u002F2017\u002Fgirlfriend-puzzle":21,"surround-\u002F2017\u002Fgirlfriend-puzzle":218,"i-lucide:arrow-left":227,"i-lucide:arrow-right":229},{"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":206,"comments":207,"date":208,"description":30,"excerpt":207,"extension":209,"image":198,"meta":210,"navigation":20,"path":211,"readingTime":212,"seo":213,"stem":214,"subtitle":215,"tags":207,"wordCount":216,"__hash__":217},"posts\u002F2017\u002Fgirlfriend-puzzle.md","Girlfriend Puzzle",{"type":25,"value":26,"toc":199},"minimark",[27,31,38,43,46,49,65,81,85,88,114,125,134,137,148,151,163,167,170,176,179,186,194],[28,29,30],"p",{},"Knowing that my girlfriend likes brainy games and it being a while since I last built something, I decided to make her a custom puzzle: a 7x7cm mystery box that, when solved, reveals a secret message.",[28,32,33],{},[34,35],"img",{"alt":36,"src":37},"Completed puzzle","\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fbox-4.jpg",[39,40,42],"h2",{"id":41},"design","Design",[28,44,45],{},"The project is a cardboard box that is sealed from the top with semi-transparent paper: light can get out of it, but it is not possible to see inside. The box is plain and there is no visible way to operate it.",[28,47,48],{},"The multi-layer puzzle was designed as such:",[50,51,52,56,59,62],"ul",{},[53,54,55],"li",{},"Realize that tilting the box activates the LEDs (which will shine through the semi-transparent top)",[53,57,58],{},"Figure out that the blinking LEDs have a structure and pattern - red and green flashes are grouped into 8 bit segments, separated by blue flashes",[53,60,61],{},"Discover that it's a binary-encoded message (red = 0; green = 1) and decode it into ASCII decimals: letters",[53,63,64],{},"Translate the sentence from Pig Latin to English",[28,66,67,68,72,73,76,77,80],{},"When decoded, the binary message translates into ASCII character codes ",[69,70,71],"code",{},"73 87 65 89 79 86 69 76 65 89 79 85 89 65 89","\nwhich translates into ",[69,74,75],{},"IWAY OVELAY OUYAY"," which translates into ",[69,78,79],{},"I LOVE YOU",".",[39,82,84],{"id":83},"build","Build",[28,86,87],{},"Bill of materials:",[50,89,90,93,96,99,102,105,108,111],{},[53,91,92],{},"3V coin cell battery holder",[53,94,95],{},"CR2032 3V battery",[53,97,98],{},"Bare PCB and 4 PCB stands \u002F spacers for mounting it",[53,100,101],{},"3 LEDS: green, red, blue",[53,103,104],{},"3x 100Ω resistors",[53,106,107],{},"ATtiny85 IC",[53,109,110],{},"Tilt-switch (metal ball, not mercury)",[53,112,113],{},"IC socket (8-leg)",[28,115,116,117,124],{},"The build was straightforward and took only a couple of hours. First, I arranged all the components on\na breadboard and connected the ",[118,119,123],"a",{"href":120,"rel":121},"https:\u002F\u002Fwww.sparkfun.com\u002Fproducts\u002F9825",[122],"nofollow","SparkFun Pocket AVR Programmer"," to the IC, which enabled me to write and test code for it.",[28,126,127,131],{},[34,128],{"alt":129,"src":130},"Project on Breadboard","\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fbread-1.jpg",[34,132],{"alt":129,"src":133},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fbread-2.jpg",[28,135,136],{},"With the code complete and the project working on the breadboard, I transferred everything to a PCB, programmed the chip one final time and connected it to the independent, battery-powered unit.",[28,138,139,142,145],{},[34,140],{"alt":129,"src":141},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fpcb-1.jpg",[34,143],{"alt":129,"src":144},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fpcb-2.jpg",[34,146],{"alt":129,"src":147},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fpcb-3.jpg",[28,149,150],{},"I mounted the PCB into the box with glue and covered it all with semi-transparent paper: the box was complete.",[28,152,153,157,160],{},[34,154],{"alt":155,"src":156},"PCB in the box","\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fbox-1.jpg",[34,158],{"alt":155,"src":159},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fbox-2.jpg",[34,161],{"alt":155,"src":162},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fbox-3.jpg",[39,164,166],{"id":165},"reception","Reception",[28,168,169],{},"She was exited and puzzled by the box and with some pointed clues, did manage to crack it up to Pig Latin, at which point frustration set in. Looking back, I realize that the design of the puzzle was too complex and unfair: I'm a developer; binary, ASCII and Pig Latin are obvious for me; however it is unfair to expect the same from others.",[28,171,172],{},[34,173],{"alt":174,"src":175},"Decoding the puzzle","\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fdecoding.jpg",[28,177,178],{},"All in all, it was a fun project to make, but not super fair to solve.",[180,181],"iframe",{"width":182,"height":183,"src":184,"frameBorder":185,"allowFullScreen":20},560,315,"https:\u002F\u002Fwww.youtube-nocookie.com\u002Fembed\u002F28vKttjauiM?rel=0","0",[28,187,188,189,80],{},"Project schematics and code are available ",[118,190,193],{"href":191,"rel":192},"https:\u002F\u002Fgithub.com\u002Fanroots\u002Fgirlfriend-puzzle",[122],"from GitHub",[28,195,196],{},[34,197],{"alt":36,"src":198},"\u002Fcontent\u002F2017\u002Fgirlfriend-puzzle\u002Fpuzzle.jpg",{"title":200,"searchDepth":201,"depth":201,"links":202},"",2,[203,204,205],{"id":41,"depth":201,"text":42},{"id":83,"depth":201,"text":84},{"id":165,"depth":201,"text":166},"Projects",null,"2017-04-28","md",{},"\u002F2017\u002Fgirlfriend-puzzle","about 2 minutes",{"title":23,"description":30},"2017\u002Fgirlfriend-puzzle","I built a small electronic puzzle for my girlfriend",468,"VhJuyNeWPsWtUdQMv-lxWbfFgs7ZNhk9heq6VreKuHI",[219,223],{"title":220,"path":221,"stem":222,"children":-1},"Microcontrollers are Export Controlled","\u002F2016\u002Fmicrocontrollers-are-export-controlled","2016\u002Fmicrocontrollers-are-export-controlled",{"title":224,"path":225,"stem":226,"children":-1},"God Knows Me","\u002F2017\u002Fgod-knows-me","2017\u002Fgod-knows-me",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":228},"\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":230},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7l7 7l-7 7\"\u002F>",1790886931557]