{"id":18101,"date":"2023-04-04T14:45:30","date_gmt":"2023-04-04T18:45:30","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/?p=18101"},"modified":"2023-04-04T14:45:30","modified_gmt":"2023-04-04T18:45:30","slug":"pill-alarm-clock","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/pill-alarm-clock\/","title":{"rendered":"Pill Alarm Clock"},"content":{"rendered":"<p><span style=\"font-weight: 400\">This is an alarm clock that goes off a certain time each day and doesn\u2019t stop until the pills on the top are removed from the red stripe.<\/span><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-18104 aligncenter\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-297x300.png\" alt=\"\" width=\"297\" height=\"300\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-297x300.png 297w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-1013x1024.png 1013w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-768x776.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-1520x1536.png 1520w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-2027x2048.png 2027w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-88x88.png 88w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-973x983.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6369-508x513.png 508w\" sizes=\"(max-width: 297px) 100vw, 297px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-18103 aligncenter\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-300x277.png\" alt=\"\" width=\"300\" height=\"277\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-300x277.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-1024x944.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-768x708.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-1536x1417.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-2048x1889.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-973x897.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6367-508x469.png 508w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355.png\"><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-18105 aligncenter\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-284x300.png\" alt=\"\" width=\"299\" height=\"316\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-284x300.png 284w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-971x1024.png 971w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-768x810.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-1456x1536.png 1456w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-1941x2048.png 1941w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-973x1027.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_6355-508x536.png 508w\" sizes=\"(max-width: 299px) 100vw, 299px\" \/><\/a><\/p>\n<h3>Process Images and Review:<\/h3>\n<p>I decided to go from an automated refill process to refilling by hand.<\/p>\n<p>I decided to make an individual moveable object rather than integrate it into my physical daily routine.<\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-18106 aligncenter\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-300x235.png\" alt=\"\" width=\"300\" height=\"235\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-300x235.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-1024x802.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-768x601.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-1536x1203.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-2048x1604.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-973x762.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/IMG_5986-508x398.png 508w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-1.png\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-18107\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-1-229x300.png\" alt=\"\" width=\"229\" height=\"300\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-1-229x300.png 229w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-1-508x665.png 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-1.png 557w\" sizes=\"(max-width: 229px) 100vw, 229px\" \/>\u00a0\u00a0\u00a0\u00a0<\/a> <a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-18108\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2-300x174.png\" alt=\"\" width=\"517\" height=\"300\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2-300x174.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2-1024x595.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2-768x447.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2-973x566.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2-508x295.png 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/04\/2023-04-04-2.png 1111w\" sizes=\"(max-width: 517px) 100vw, 517px\" \/><\/a><\/p>\n<h3>Response to Class Comments:<\/h3>\n<p><span style=\"font-weight: 400\">\u201cI wonder if the housing could be smaller; feels like an unnecessarily large footprint for a few components\u201d<\/span><\/p>\n<p><span style=\"font-weight: 400\">A: I purposefully made the housing larger so that the object would call attention to itself, acting as another way to remind me that it was there and I need to take my medication.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u201cMaybe you could have like a weekly pill dispenser. Like pills are placed in different boxes and dispensed at alarm at each specific day, because an RTC module can also keep the date as well\u201d<\/span><\/p>\n<p>A: <span style=\"font-weight: 400\">This was the original goal for this project and I think it&#8217;s a great idea. Unfortunately out of my skill set right now but it would be a much more productive invention than my finished product.<\/span><\/p>\n<h3>Self Critique:<\/h3>\n<p><span style=\"font-weight: 400\">I think that my biggest self-critique is that I could have gone further with the casing and the refill mechanism. I would have liked the casing to be more intentional in its shape and function and made of a more permanent material like wood or acrylic. My original plan was for a linear actuator to move the pills into the break beam sensor day by day as a sort of automated refill mechanism but my technical and coding skills just weren\u2019t strong enough to make that happen for the final product.<\/span><\/p>\n<h3>What I Learned:<\/h3>\n<p><span style=\"font-weight: 400\">During this process, I learned that the break beam sensor is a surprisingly reliable component and I had the least amount of trouble with it as an input compared to my other inputs and outputs. I also learned that the debugging and trial and error process takes much longer than I planned for and is something that a lot of time needs to be allotted.\u00a0<\/span><\/p>\n<h3>Next Steps:<\/h3>\n<p><span style=\"font-weight: 400\">Going forward I would like to work to make my alarm clock more reliable than it is currently by working out the remaining code and technical bugs. I would also like to see if I can automate the day-by-day \u201crefill\u201d process by using my original concept with the linear actuator.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/Pill Alarm Clock\r\n\/\/Lily Hummel\r\n\/\/This code displays the time, day, and year on a LCD and sets off an alarm at a predetermined time of day.\r\n\/\/When the alarm goes off, it doesn't stop until the breakbeam sensor is unblocked.\r\n\/\/Credit to \/https:\/\/www.circuitbasics.com\/how-to-use-a-real-time-clock-module-with-the-arduino\/ and Zach for writing portions of this code.\r\n\/\/ YOLO LICENSE\r\n                             \/\/Version 1, July 10 2015\r\n\r\n\/\/THIS SOFTWARE LICENSE IS PROVIDED \"ALL CAPS\" SO THAT YOU KNOW IT IS SUPER\r\n\/\/SERIOUS AND YOU DON'T MESS AROUND WITH COPYRIGHT LAW BECAUSE YOU WILL GET IN\r\n\/\/TROUBLE HERE ARE SOME OTHER BUZZWORDS COMMONLY IN THESE THINGS WARRANTIES\r\n\/\/LIABILITY CONTRACT TORT LIABLE CLAIMS RESTRICTION MERCHANTABILITY SUBJECT TO\r\n\/\/THE FOLLOWING CONDITIONS:\r\n\/\/1. #yolo\r\n\/\/2. #swag\r\n\/\/3. #blazeit\r\n\r\n\r\n#include &lt;Wire.h&gt;                   \/\/ for I2C communication\r\n#include &lt;LiquidCrystal_I2C.h&gt;      \/\/ for LCD\r\n#include &lt;RTClib.h&gt;                 \/\/ for RTC\r\n\r\nLiquidCrystal_I2C lcd(0x27, 16, 2); \/\/ create LCD with I2C address 0x27, 16 characters per line, 2 lines\r\nRTC_DS3231 rtc;                     \/\/ create rtc for the DS3231 RTC module, address is fixed at 0x68\r\n\r\n\/*\r\n   function to update RTC time using user input\r\n*\/\r\n#define BUZZPIN 9\r\n#define SENSORPIN 4\r\n\r\nbool Alarmtrigtoday = false;\r\n\r\nbool Wasunblockedtoday = false;\r\n  \r\n\/\/ variables will change:\r\nint sensorState = 0, lastState=0;         \/\/ variable for reading the pushbutton status\r\n\r\n  \r\nvoid updateLCD()\r\n{\r\n\r\n   \/\/ get time and date from RTC and save in variables\r\n  DateTime rtcTime = rtc.now();\r\n\r\n  \r\n\r\n  int ss = rtcTime.second();\r\n  int mm = rtcTime.minute();\r\n  int hh = rtcTime.twelveHour();\r\n  int DD = rtcTime.dayOfTheWeek();\r\n  int dd = rtcTime.day();\r\n  int MM = rtcTime.month();\r\n  int yyyy = rtcTime.year();\r\n\r\n  \/\/ move LCD cursor to upper-left position\r\n  lcd.setCursor(0, 0);\r\n\r\n  \/\/ print date in dd-MMM-yyyy format and day of week\r\n  if (dd &lt; 10) lcd.print(\"0\");  \/\/ add preceeding '0' if number is less than 10\r\n  lcd.print(MM);\r\n  lcd.print(\"\/\");\r\n  lcd.print(dd);\r\n  lcd.print(\"\/\");\r\n  lcd.print(yyyy);\r\n\r\n  \/\/ move LCD cursor to lower-left position\r\n  lcd.setCursor(0, 1);\r\n\r\n  \/\/ print time in 12H format\r\n  if (hh &lt; 10) lcd.print(\"0\");\r\n  lcd.print(hh);\r\n  lcd.print(':');\r\n\r\n  if (mm &lt; 10) lcd.print(\"0\");\r\n  lcd.print(mm);\r\n \r\n\r\n  if (rtcTime.isPM()) lcd.print(\" PM\"); \/\/ print AM\/PM indication\r\n  else lcd.print(\" AM\");\r\n}\r\nvoid setup()\r\n{      \r\n  pinMode(BUZZPIN, OUTPUT);\r\n  \/\/ initialize the sensor pin as an input:\r\n  pinMode(SENSORPIN, INPUT);     \r\n  digitalWrite(SENSORPIN, HIGH); \/\/ turn on the pullup\r\n  \r\n  Serial.begin(9600); \/\/ initialize serial\r\n\r\n  lcd.init();       \/\/ initialize lcd\r\n  lcd.backlight();  \/\/ switch-on lcd backlight\r\n\r\n  rtc.begin();       \/\/ initialize rtc\r\n  rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\r\n}\r\nvoid loop()\r\n{\r\n  DateTime rtcTime = rtc.now();\r\n\r\n\r\n  if (rtcTime.second() == 0 &amp;&amp; rtcTime.minute() == 14 &amp;&amp; rtcTime.hour() == 12){\r\n    tone(BUZZPIN, 200);\r\n    Alarmtrigtoday = true;\r\n    while (sensorState == LOW) { \r\n      sensorState = digitalRead(SENSORPIN);\r\n    }\r\n    noTone(BUZZPIN);\r\n  }\r\n\r\n  \r\n \r\n  updateLCD();  \/\/ update LCD text\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is an alarm clock that goes off a certain time each day and doesn\u2019t stop until the pills on the top are removed from the red stripe&#8230;.<\/p>\n","protected":false},"author":44,"featured_media":18102,"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\/s2023\/work\/wp-json\/wp\/v2\/posts\/18101"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/comments?post=18101"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/18101\/revisions"}],"predecessor-version":[{"id":18109,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/18101\/revisions\/18109"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/media\/18102"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/media?parent=18101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/categories?post=18101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/tags?post=18101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}