{"id":15311,"date":"2022-03-14T22:53:16","date_gmt":"2022-03-15T02:53:16","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/?p=15311"},"modified":"2022-03-15T22:11:42","modified_gmt":"2022-03-16T02:11:42","slug":"daily-diary-reminder-box","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/daily-diary-reminder-box\/","title":{"rendered":"Daily Diary Reminder Box"},"content":{"rendered":"<p>This box reminds the user to write something down at the end of every day to entice journaling habits!<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-15311-1\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Video-Demo.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Video-Demo.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Video-Demo.mp4<\/a><\/video><\/div>\n<p>This video demonstrates how the box works. The box is triggered by the IR sensor detecting a person approaching near the box, then it releases the solenoid, popping open the box, and sounds an alarm that doesn&#8217;t stop until the user takes the journaling book out of the box.<\/p>\n<div id=\"attachment_15379\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15379\" loading=\"lazy\" class=\"wp-image-15379 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-scaled.jpg\" alt=\"A Closed Diary Reminder Box\" width=\"2560\" height=\"2188\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-300x256.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-1024x875.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-768x656.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-1536x1313.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-2048x1750.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-973x832.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0002-508x434.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15379\" class=\"wp-caption-text\">The Diary Reminder Box when it is Closed<\/p><\/div>\n<div id=\"attachment_15380\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15380\" loading=\"lazy\" class=\"wp-image-15380 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-scaled.jpg\" alt=\"Back Side of the box\" width=\"2560\" height=\"2545\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-300x298.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-1024x1018.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-150x150.jpg 150w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-768x763.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-1536x1527.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-2048x2036.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-88x88.jpg 88w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-973x967.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/back-508x505.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15380\" class=\"wp-caption-text\">Back Side of the Reminder Box when it is Closed<\/p><\/div>\n<div id=\"attachment_15382\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15382\" loading=\"lazy\" class=\"wp-image-15382 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-scaled.jpg\" alt=\"Lock Mechanism of the Box\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/lock-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15382\" class=\"wp-caption-text\">The solenoid lock mechanism keeps the lid closed when the box isn&#8217;t activated. The solenoid snaps into the wooden loop above to hold the lid shut and releases the loop when powered.<\/p><\/div>\n<div id=\"attachment_15384\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15384\" loading=\"lazy\" class=\"wp-image-15384 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-scaled.jpg\" alt=\"Hinges of the box\" width=\"2560\" height=\"1513\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-300x177.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-1024x605.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-768x454.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-1536x908.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-2048x1210.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-973x575.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/DSC_0008-508x300.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15384\" class=\"wp-caption-text\">The two hinges in the back would swings open the lid when the mechanism is activated. It is normally held stable, as seen in this picture, by the solenoid lock.<\/p><\/div>\n<div id=\"attachment_15395\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15395\" loading=\"lazy\" class=\"wp-image-15395 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-scaled.jpg\" alt=\"Hinge from an inside view\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/inside-hinge-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15395\" class=\"wp-caption-text\">The view of the hinge from the inside. The hinge is carved into the side of the box so there won&#8217;t be gaps between the hinge itself and the box.<\/p><\/div>\n<h3>Process Images and Review<\/h3>\n<div id=\"attachment_15394\" style=\"width: 2206px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15394\" loading=\"lazy\" class=\"wp-image-15394 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt.jpg\" alt=\"Burnt finger in front of the a bread board\" width=\"2196\" height=\"2472\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt.jpg 2196w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-267x300.jpg 267w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-910x1024.jpg 910w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-768x865.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-1365x1536.jpg 1365w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-1819x2048.jpg 1819w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-973x1095.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/burnt-508x572.jpg 508w\" sizes=\"(max-width: 2196px) 100vw, 2196px\" \/><p id=\"caption-attachment-15394\" class=\"wp-caption-text\">I burnt my finger while attempting to wire the solenoid to the arduino board by touching an extremely hot transistor (circled in red). After talking with Professor Zacharias, I realized that I used the wrong transistor and was overheating the PNP transistor.<\/p><\/div>\n<div id=\"attachment_15399\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15399\" loading=\"lazy\" class=\"wp-image-15399 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-scaled.jpg\" alt=\"The top part of the box\" width=\"2560\" height=\"2212\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-300x259.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-1024x885.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-768x664.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-1536x1327.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-2048x1769.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-973x841.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/redone-top-508x439.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15399\" class=\"wp-caption-text\">I had to redo the entire top half of the box because I overlooked the lock part of the box completely. I also implemented bolted joints instead of finger joints in fear that the loop wouldn&#8217;t hold the force pulling on it by the solenoid.<\/p><\/div>\n<div id=\"attachment_15400\" style=\"width: 2742px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15400\" loading=\"lazy\" class=\"wp-image-15400 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3.png\" alt=\"a sketch of the reminder box with block diagrams and questions\" width=\"2732\" height=\"2048\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3.png 2732w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-1536x1151.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-2048x1535.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-973x729.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/Untitled_Artwork-3-508x381.png 508w\" sizes=\"(max-width: 2732px) 100vw, 2732px\" \/><p id=\"caption-attachment-15400\" class=\"wp-caption-text\">During the brainstorming phase, I created this diagram of what I thought the box would look like and how everything would be arranged. Everything remained similar except that I changed the lock configuration completely and moved the outside Infrared sensor down into the wiring compartment.<\/p><\/div>\n<div id=\"attachment_15396\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-15396\" loading=\"lazy\" class=\"wp-image-15396 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-scaled.jpg\" alt=\"wired mechanism on a desk\" width=\"2560\" height=\"1719\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-300x201.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-1024x688.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-768x516.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-1536x1031.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-2048x1375.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-973x653.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/wiring-finished-508x341.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-15396\" class=\"wp-caption-text\">For this project, I separated the woodshop\/laser cutting from the wiring because it would be difficult to take out and fix the wirings after I assembled the different parts.<\/p><\/div>\n<h3>Discussion<\/h3>\n<p><span style=\"font-weight: 400\">This project was overly ambitious when it came to its ideation. Before starting the project, I had an idea of a box that pops open when I get close to it during bedtime. Unbeknownst to me, the box would be a terribly complex thing for me to build without knowing how to design a box that springs open and locks. I 3D modeled a box with an enclosed compartment and finger joints with no issues, so I laser cut all of the pieces out with a few minor hiccups as it was my first-time laser cutting. however, after meeting with Professor Zacharias a few more times working out how I will make the box lock and open, I realized that I need to scratch the top half of the box and redesign it so that it can lock the box in place and be bolted down with two self-opening hinges (which I mistakenly bought over self-closing hinges, which could have saved the effort cutting out notches on the box for the spring of the hinge). The project became a lot more woodshop heavy than I imagined when I decided that I didn&#8217;t want to waste a lot of the wood I have laser cut before, so I resorted to a mortise and tenon machine, band saws, and other types of machinery. Because of this, I was unable to get the lock mechanisms fully working with the solenoid because I drilled the hole for holding the solenoid a little too low. Justifiably, I got comments such as &#8220;<\/span><span style=\"font-weight: 400\">Improve the locker for the next step&#8221; and &#8220;I think the lock can be worked on a little more&#8221; for the critique comments, and I think it is completely valid as my whole box relied on this mechanic. I also got a comment saying that I should &#8220;make the top just a flat piece of wood&#8221; as the book is very thin and doesn&#8217;t need the space up top; I completely agree with this comment as the top was also a lot heavier than the spring of the hinges can handle, so they barely lift the top unless it&#8217;s at less of an angle, and it is just a lot more efficient material-wise if I used a flat top. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Overall, I am mostly satisfied with what I had come up with and created, as this project marked a lot of firsts for me, first time designing a mechanism, first time laser cutting, first time combining woodshop skills with wiring and coding, the list goes on. However, I do think that there are also a lot that I could improve on and a lot that I learned from. I learned that it is very easy to over-scope projects and overestimate my skills and abilities, and it is very hard to create a fully functioning mechanism. If the mechanism doesn&#8217;t work perfectly, it doesn&#8217;t do its job correctly. In the future, I will try my best to gauge and estimate each step of the design and see if it will fit into the schedule. A completed but less fancy project would be better than a project that doesn&#8217;t work at all. <\/span><\/p>\n<p><span style=\"font-weight: 400\">I think I won&#8217;t try to make a completely new iteration of the project, but I were to, I would change the top like the comment suggested to one piece of wood, sand down the lock mechanism so it closes and opens properly, and add a safekeeping system to prevent the book from not being returned to the chest.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Technical Information<\/h3>\n<h4>Block Diagram:<\/h4>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/block.svg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-15431\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/block.svg\" alt=\"\" width=\"1081\" height=\"601\" \/><\/a><\/p>\n<h4>Schematic Diagram:<\/h4>\n<h4><img loading=\"lazy\" class=\"alignnone size-full wp-image-15432\" style=\"font-weight: 400\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-content\/uploads\/2022\/03\/schematic.svg\" alt=\"\" width=\"1265\" height=\"1421\" \/><\/h4>\n<h4>Code:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/*\r\n  Project Titles: Daily Reminder Box\r\n\r\n  Project Creator: Weiwen \"Andy\" Jiang\r\n\r\n  Description: Real Time Clock activates the rest of the device when the time is between 9 pm and 11:59 pm.The Arduino first checks for whether or not the mechanism has been triggered or not. If not, the outside IR sensor checks if subjects are approaching the box. If anyone is approaching, the box snaps back the solenoid and releases the lid while activating a buzzer every one second. Then the buzzer continues to beep until the book is removed from the box. The inside IR sensor would detect that removal and stop the buzzer and the solenoid, also marking the mechanism as \"triggered already\" for the day through a boolean variable.\r\n\r\n  Pin mapping:\r\n    Arduino pin | role   | description\r\n    ------------|--------|-------------\r\n    A0            input     Outside IR proximity sensor\r\n    A1            input     Inside IR proximity sensor\r\n    4             output    Buzzer\r\n    9             output    Solenoid\r\n    SCL                     SCL of Real Time Clock\r\n    SDA                     SDA of Real Time Clock\r\n\r\n\r\n  Real Time Clock code adapted from: https:\/\/create.arduino.cc\/projecthub\/MisterBotBreak\/how-to-use-a-real-time-clock-module-ds3231-bc90fe\r\n  Comment formatting adapted from: Siddarth Parthiban\r\n*\/\r\n\r\n#include &lt;config.h&gt;\r\n#include \"ds3231.h\"\r\n#include &lt;Wire.h&gt;\r\n\r\n\/\/Initialising structure t for the Real Time Clock\r\nstruct ts t;\r\n\r\n\/\/Initializing pin ports for Arduino\r\nconst int IROutPin = A0;\r\nconst int IRInPin = A1;\r\nconst int SolePin = 9;\r\nconst int BuzzerPin = 4;\r\n\r\n\/\/Initialising other variables\r\nint currentHour;\r\nint irInVal;\r\nint irOutVal;\r\nint irT = 0;\r\n\r\n\/\/Setting up boolean variables that stores the status of the box\r\nbool trigger = 0; \/\/Stores the status of the buzzer and solenoid\r\nbool removed = 0; \/\/Stores the status of the book\r\nbool done = 0; \/\/Stores whether or not the mechanism has been triggered for the day\r\n\r\n\/\/Initialising time variables\r\nunsigned long prevBuzztime = 0;\r\nunsigned long prevRTCtime = 0;\r\n\r\n\r\nvoid setup() {\r\n  Serial.begin(9600);\/\/Setting data rate\r\n  Wire.begin();\/\/Setting up wire library\r\n\r\n  \/\/Setting up pin mapping\r\n  pinMode(IROutPin, INPUT);\r\n  pinMode(IRInPin, INPUT);\r\n  pinMode(SolePin, OUTPUT);\r\n  pinMode(BuzzerPin, OUTPUT);\r\n\r\n  \/\/Setting up real time clock\r\n  DS3231_init(DS3231_CONTROL_INTCN);\r\n  t.hour = 22;\r\n  t.min = 10;\r\n  t.sec = 0;\r\n  t.mday = 20;\r\n  t.mon = 2;\r\n  t.year = 2022;\r\n}\r\n\r\nvoid loop() {\r\n\r\n  \/\/Read IR proximity sensor input for every 1\/4 second\r\n  if (millis() - irT &gt;= 250) {\r\n    irOutVal = analogRead(A0);\r\n    irInVal = analogRead(A1);\r\n  }\r\n\r\n  \/\/Read real time clock input for every second\r\n  if (millis() - prevRTCtime &gt;= 1000) {\r\n    DS3231_get(&amp;t);\r\n    currentHour = t.hour;\r\n    prevRTCtime = millis();\r\n  }\r\n\r\n  \/\/Check if the box has been activated already today\r\n  if (done == 0){\r\n    \r\n  \/\/ Activate the buzzer and solenoid when it is between 9:00 pm and 11:59 pm and if IR sensor detects subject approaching\r\n  if (currentHour &gt;= 21) {\r\n      if (irOutVal &gt; 40) {\r\n        digitalWrite (SolePin, HIGH);\r\n        trigger = 1; \/\/stores the status of the alarm\r\n        removed = 0; \/\/stores the status of the book\r\n\r\n      }\r\n    }\r\n\r\n    \/\/Sound the buzzer every 1 second and unlock the chest if the book has not been removed\r\n    if (trigger == 1) {\r\n      if (removed == 0) {\r\n        if (millis() - prevBuzztime &gt;= 1000) {\r\n          if (digitalRead (BuzzerPin) == HIGH) {\r\n            digitalWrite (BuzzerPin, LOW);\r\n          }\r\n          else {\r\n            digitalWrite (BuzzerPin, HIGH);\r\n          }\r\n          prevBuzztime = millis();\r\n        }\r\n\r\n        \/\/if the inside IR sensor detects the removal of the book, stop the solenoid and the buzzer, reset the status of the boolean variables of the buzzer, solenoid and the book, change the status of the box to had been activated\r\n        if (irInVal &lt; 40) {\r\n          removed = 1;\r\n          digitalWrite (BuzzerPin, LOW);\r\n          trigger = 0;\r\n          digitalWrite (SolePin, LOW);\r\n          done = 1;\r\n        }\r\n\r\n      }\r\n\r\n    }\r\n  }\r\n  \/\/reset the status of the box to haven't been activated for today at 12am\r\n  if (currentHour == 0){\r\n    done = 0;\r\n}\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This box reminds the user to write something down at the end of every day to entice journaling habits! This video demonstrates how the box works. The box&#8230;<\/p>\n","protected":false},"author":206,"featured_media":15367,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[89],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/posts\/15311"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/users\/206"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/comments?post=15311"}],"version-history":[{"count":9,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/posts\/15311\/revisions"}],"predecessor-version":[{"id":15434,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/posts\/15311\/revisions\/15434"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/media\/15367"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/media?parent=15311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/categories?post=15311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2022\/work\/wp-json\/wp\/v2\/tags?post=15311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}