{"id":16623,"date":"2022-10-27T07:16:27","date_gmt":"2022-10-27T11:16:27","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/?p=16623"},"modified":"2022-10-27T08:35:58","modified_gmt":"2022-10-27T12:35:58","slug":"do-not-disturb-toaster","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/","title":{"rendered":"Do Not Disturb Toaster"},"content":{"rendered":"<p>This device is intended to let everyone around you know when you are working or not so that you are able to stay on task.<\/p>\n<div id=\"attachment_16648\" style=\"width: 610px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/ezgif-com-gif-maker-19\/\" rel=\"attachment wp-att-16648\"><img aria-describedby=\"caption-attachment-16648\" loading=\"lazy\" class=\"wp-image-16648 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/ezgif.com-gif-maker-19.gif\" alt=\"\" width=\"600\" height=\"1067\" \/><\/a><p id=\"caption-attachment-16648\" class=\"wp-caption-text\">This is the toaster switching from free time mode to work mode. You see once work mode is on, the lights starts to flash which is from the noise in the room. The linear actuator has to complete its&#8217; movement before the mode properly switches.<\/p><\/div>\n<div id=\"attachment_16638\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0484-2\/\" rel=\"attachment wp-att-16638\"><img aria-describedby=\"caption-attachment-16638\" loading=\"lazy\" class=\"wp-image-16638 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0484-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16638\" class=\"wp-caption-text\">Main Photo For Scale: The toaster has a &#8220;Do Not Disturb&#8221; sign and a &#8220;Free To Talk&#8221; sign at the top. 10 LEDs on the top. An LCD that says &#8220;Break Time!&#8221; or &#8220;Work Time!&#8221;. A switch to start timer and sound sensor are in the back.<\/p><\/div>\n<div id=\"attachment_16637\" style=\"width: 1919px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0462-2\/\" rel=\"attachment wp-att-16637\"><img aria-describedby=\"caption-attachment-16637\" loading=\"lazy\" class=\"wp-image-16637 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-scaled.jpg\" alt=\"\" width=\"1909\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-scaled.jpg 1909w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-224x300.jpg 224w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-764x1024.jpg 764w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-768x1030.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-1145x1536.jpg 1145w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-1527x2048.jpg 1527w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-973x1305.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0462-2-508x681.jpg 508w\" sizes=\"(max-width: 1909px) 100vw, 1909px\" \/><\/a><p id=\"caption-attachment-16637\" class=\"wp-caption-text\">Detail Shot: This gives a good view of the top so you can see the whole top and all the LEDs. Also in this photo you can see the button, sound sensor, and the hole for all the cords, which is located on the back of the toaster. When the button is clicked it starts the Pomodoro timer.<\/p><\/div>\n<div id=\"attachment_16636\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0437-3\/\" rel=\"attachment wp-att-16636\"><img aria-describedby=\"caption-attachment-16636\" loading=\"lazy\" class=\"wp-image-16636 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0437-3-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16636\" class=\"wp-caption-text\">Detail Photo: This is the inside of the toaster. The wiring is pretty intense because of the 10 LEDs. I had to tape\/puddy some connections so they wouldn&#8217;t come undone. I taped down\/glued two bread boards inside so they stayed stable in the box to avoid loose connections, and so the switch would be available on the outside of the box.<\/p><\/div>\n<div id=\"attachment_16639\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0504-2\/\" rel=\"attachment wp-att-16639\"><img aria-describedby=\"caption-attachment-16639\" loading=\"lazy\" class=\"wp-image-16639 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0504-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16639\" class=\"wp-caption-text\">Action Photo: When the &#8220;Free To Talk&#8221; sign is up that means it is break time according to the Pomodoro timer. The timer will constantly switch between 25 minutes and 5 minutes because it is based off the Pomodoro technique for most efficient work. Work time is suppose to be 25 minutes long and break time is 5 minutes long.<\/p><\/div>\n<div id=\"attachment_16640\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0527-2\/\" rel=\"attachment wp-att-16640\"><img aria-describedby=\"caption-attachment-16640\" loading=\"lazy\" class=\"wp-image-16640 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0527-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16640\" class=\"wp-caption-text\">When the &#8220;Do Not Disturb&#8221; sign is up that means it is work time. The lights will flash if you start talking and if you talk loud enough they will blink red for 1 second to alert you that you are distracting the user from being productive. When the &#8220;Do Not Disturb&#8221; sign lowers then the toaster will stop flashing the LEDs.<\/p><\/div>\n<div id=\"attachment_16641\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0535-2\/\" rel=\"attachment wp-att-16641\"><img aria-describedby=\"caption-attachment-16641\" loading=\"lazy\" class=\"wp-image-16641 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0535-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16641\" class=\"wp-caption-text\">Action Photo: There is an LCD screen that is for the user to look at so they can know if it&#8217;s break time or work time. It is also there as another reminder to stay focused.<\/p><\/div>\n<div id=\"attachment_16642\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0545-2\/\" rel=\"attachment wp-att-16642\"><img aria-describedby=\"caption-attachment-16642\" loading=\"lazy\" class=\"wp-image-16642 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0545-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16642\" class=\"wp-caption-text\">Action Photo: The sound sensor does not send signals to the lights when the &#8220;Free To Talk&#8221; sign is up. If there is minimal noise the lights will not light up. The toaster needs to detect &#8220;disturbing levels of noise&#8221; to flash lights. This makes it so the toaster can be used in a public area and notify people when they are being too disturbing so that the user doesn&#8217;t need to do it themselves.<\/p><\/div>\n<h3>Process<\/h3>\n<div id=\"attachment_16647\" style=\"width: 610px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/ezgif-com-gif-maker-14\/\" rel=\"attachment wp-att-16647\"><img aria-describedby=\"caption-attachment-16647\" loading=\"lazy\" class=\"wp-image-16647 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/ezgif.com-gif-maker-14.gif\" alt=\"\" width=\"600\" height=\"338\" \/><\/a><p id=\"caption-attachment-16647\" class=\"wp-caption-text\">The first big decision in my process was deciding how the sound detector was going to identify it&#8217;s signals. I originally organized my sounds into quiet, moderate, and loud. After Zach helped me get a more reliable sound detection, I started messing with the sensitivity. I was adjusting what the Arduino identified as quiet and loud, and at this point I made the decision on what the toaster is going to react too. I decided that first of all there was going to be some wiggle room so that a loud room does not trigger the toaster. Then I made the decision that moderate and loud would have different response. I decided here that the toaster should get &#8220;more angry&#8221; when it detects loud noise, which would cause it to flash the red light longer. I think this thinking and decision making really effected the logic of my code and how I approached it. This decision came pretty earlier on and I think that is made obvious by how I coded the whole device. It overall had a heavy influence on the design.<\/p><\/div>\n<div id=\"attachment_16635\" style=\"width: 838px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0392-2\/\" rel=\"attachment wp-att-16635\"><img aria-describedby=\"caption-attachment-16635\" loading=\"lazy\" class=\"wp-image-16635 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0392-2-e1666860270685.png\" alt=\"\" width=\"828\" height=\"609\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0392-2-e1666860270685.png 828w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0392-2-e1666860270685-300x221.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0392-2-e1666860270685-768x565.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0392-2-e1666860270685-508x374.png 508w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/a><p id=\"caption-attachment-16635\" class=\"wp-caption-text\">The second big decision came much later in the process. When I was deciding how the toaster was going to look, I also considered how it was going to act and be interacted with. I made a couple last minute decisions when designing the outer look and experience. There were two things that I felt like were feeling unclear in my design. First, I was concerned it wouldn&#8217;t be obvious enough when the toaster would detect loud sounds. This made me realize I am going to need an LED strip or lots of LEDs. I decided that the design would look kinda pretty and less tacky if used little LEDs and had them dotted around the top, plus it would be hard to miss many LEDs flashing at you, especially 10. Secondly, I realize for some it may not be fully clear when it is break time or work time, so that is when I decided the LED screen was necessary, because it wasn&#8217;t always planned to be in the design. Thus, when I was designing the lasercut box I put in a rectangle hole for the LCD, however there was then an even more last minute switch up. Last minute I realized I made a switch for my box and that needs to be easily accessible on the outside. So, I ended up using the LCD hole as a place to put the breadboard with the switch in it so I didn&#8217;t have to open the box to start it. In the picture you can see the lasercut box before it&#8217;s fully assembled, and at this moment is when I realized I need to move the switch off my big breadboard and onto a tiny one.<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_16650\" style=\"width: 678px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/screen-shot-2022-10-27-at-6-16-52-am\/\" rel=\"attachment wp-att-16650\"><img aria-describedby=\"caption-attachment-16650\" loading=\"lazy\" class=\"wp-image-16650 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.16.52-AM.png\" alt=\"\" width=\"668\" height=\"496\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.16.52-AM.png 668w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.16.52-AM-300x223.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.16.52-AM-508x377.png 508w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/a><p id=\"caption-attachment-16650\" class=\"wp-caption-text\">This is the first sketch of my device. What&#8217;s interesting is in the beginning of ideating I wasn&#8217;t thinking about the code as much, so in this drawing I have a knob that you can turn to the amount of time you want to work. I quickly realized after I moved out of ideating that this could be difficult and would potentially be a lot of coding, so I later opted for a button which is a simple on\/off mechanism rather than the user being able to select a time.<\/p><\/div>\n<div id=\"attachment_16633\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0385-2\/\" rel=\"attachment wp-att-16633\"><img aria-describedby=\"caption-attachment-16633\" loading=\"lazy\" class=\"wp-image-16633 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0385-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16633\" class=\"wp-caption-text\">This is my setup to test the sound detector to light signal. So this helped me visualize how sensitive the sound detector is and also if the LED would actually light up when I wanted too. I did a lot of clap and talking and yelling with this simple set up when trying to calibrate my sensor properly.<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_16651\" style=\"width: 3594px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/screen-shot-2022-10-27-at-6-29-07-am\/\" rel=\"attachment wp-att-16651\"><img aria-describedby=\"caption-attachment-16651\" loading=\"lazy\" class=\"wp-image-16651 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM.png\" alt=\"\" width=\"3584\" height=\"2040\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM.png 3584w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-300x171.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-1024x583.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-768x437.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-1536x874.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-2048x1166.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-973x554.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/Screen-Shot-2022-10-27-at-6.29.07-AM-508x289.png 508w\" sizes=\"(max-width: 3584px) 100vw, 3584px\" \/><\/a><p id=\"caption-attachment-16651\" class=\"wp-caption-text\">During the whole coding process I constantly had many Arduino files open. That is for a couple reasons. First reason is because I was looking at example code and trying new things out, so if I wanted to try a new approach I just made a new sketch and attempted in the new sketch (hence in this picture why I have two LCD sketches). Secondly, some sketch files were more for testing sensors or outputs. I had one sketch file that would reset the linear actuators for me. I also had a sketch file that would test the sound detector. I had another sketch file that would print the timer on the LCD screen for me. All of this helped me debug my code. Lastly, I was scared of messing up whatever I made work successfully, so I had each part of the system in it&#8217;s own sketch. Thus, I had an LCD sketch, Timer sketch, Sound Sensor + LED sketch, and a linear actuator sketch. So at the end of coding I had to compile all my sketches together carefully and neatly.<\/p><\/div>\n<div id=\"attachment_16634\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0386-2\/\" rel=\"attachment wp-att-16634\"><img aria-describedby=\"caption-attachment-16634\" loading=\"lazy\" class=\"wp-image-16634 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0386-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16634\" class=\"wp-caption-text\">This is me wiring the button. I never wired a button before I had to kinda look it up and guess, but it ended up successfully and coded the button after wiring it.<\/p><\/div>\n<div id=\"attachment_16632\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/img_0384-2\/\" rel=\"attachment wp-att-16632\"><img aria-describedby=\"caption-attachment-16632\" loading=\"lazy\" class=\"wp-image-16632 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/IMG_0384-2-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-16632\" class=\"wp-caption-text\">I had a lot of trouble with making the linear actuator fit into the code properly with my timer code I made. The main reason is because linear actuators aren&#8217;t told to go a distance, they are just told to go and stop. The example code I referenced used delays to make the linear actuator go the distance it wanted, so it was really difficult to fit that into code that was all based around millis(). It took a lot of experimenting with the linear actuators just sat on the table until I was able to figure out the code. It was also difficult because I have a break time mode and a work time mode in my code, so at first I had no idea where which linear actuator should be extended or retracted. That took a little bit of guessing and thinking through.<\/p><\/div>\n<h3>Discussion<\/h3>\n<p><span style=\"font-weight: 400\">I am overall pretty happy with my project. I think it does exactly what I intended it to do. It detects sound levels decently well and the linear actuators actually work perfectly how I intended them too. I think if anything I wish I could add in more of my fun ideas. For example, I wish I could add more stimuli to happen when the noise levels get loud. I think that would make the project even more fun and interesting. I also wish I did put more time into the design of the project just because I am a design major and I think it would enhance the interaction of this device.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Overall, I did fumble a lot along the way. I think I still don\u2019t fully understand the sparkfun sound detector. I tried to calibrate it exactly how I wanted, but I only had so much time and I never got back around to it. Yet, the hardest part was actually making the timer and switching the modes between work and break. I am used to coding in functions, so for me, it is hard to code into a loop. A couple times I forgot that the program is constantly looping, which caused bugs. It took me a while to figure out ways around it (aka I made variables that acted as switches), but it was hard to figure out how to make my initial logic work. Then after that I had to add in the linear actuator code which was challenging because I couldn\u2019t remember where break mode and work mode was being turned off and on. So, I think overall, my code could\u2019ve been much cleaner because it started to confuse me. I think there&#8217;s too many switches on and off and there must be a way to simplify and make the variable names clearer.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The critiques brought up some great points and I actually ended up listening to one of them. The first one that stood out said \u201c<\/span><span style=\"font-weight: 400\">Maybe add double sided signs and have the signs disappear all the way into the toaster\u201d. I strongly agreed with them and I ended up remaking my signs to be double sided and sturdier, however, the linear actuators are too tall to actually get the signs all the way in, but I would\u2019ve loved to also incorporate that into my design. The second critique said \u201cI would say if, theoretically, you were trying to use this device in a library, or somewhere quiet, then the sound of the linear actuators might be a bit loud and counterintuitive for its purpose\u201d. I honestly don\u2019t have a solution for that currently, but I thought this was an interesting thing to point out. I kinda agree that the sound could end up being distracting, yet my limitations were partially due to what was available.<\/span><\/p>\n<p><span style=\"font-weight: 400\">If I were to make a whole new iteration, I would definitely clean up the wiring and code, since those both caused me lots of extra time. However, I also think there&#8217;s so many ways to expand on this idea like adding a more advanced timer, or adding more interactions that help keep you on task, thus I think this would be a really good project to iterate on because of the endless possibilities.<\/span><\/p>\n<h3>Technical Information<\/h3>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/do-not-disturb-toaster\/project2-schematicjpg\/\" rel=\"attachment wp-att-16654\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-16654\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg.jpg\" alt=\"\" width=\"1941\" height=\"1032\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg.jpg 1941w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg-300x160.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg-1024x544.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg-768x408.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg-1536x817.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg-973x517.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/10\/project2-schematicjpg-508x270.jpg 508w\" sizes=\"(max-width: 1941px) 100vw, 1941px\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/* The Do Not Disturb Toaster\r\n  By: Gia Marino\r\n\r\n  My code has a switch that tells when the program should start.\r\n  Then the program takes a start time and starts calculating time passed.\r\n  If currentTime hits 25 mins and the program is not in break mode\r\n  then it will switch over to break mode and move the linear actuator to\r\n  indicate this. If it is in break mode and the currentTime hits 5 minutes\r\n  then the program will switch into break mode and moves linear actuator\r\n  accordingly. If in workmode the program will take inputs from the sound\r\n  detector and send signals to the LED pin if detects moderate or loud noise.\r\n  It continuously switches inbetween these modes unless stopped.\r\n\r\n\r\n  Arduino pin | role   | description\r\n  ------------|--------|-------------\r\n  A0            input    enevelope pin on sound detector\r\n  2             output   gate pin on sound detector\r\n  6             output   LED pin\r\n  4             input    button pin\r\n  7             output   DO NOT Disturb linear actuator\r\n  8             output   DO NOT Disturb linear actuator\r\n  11            output   FREE to talk linear actuator\r\n  12            output   FREE to talk linear actuator\r\n  SDA           output   LCD serial pin\r\n  SCL           input    LCD clock pin\r\n  GND           input    ground\r\n  5V            output   5v\r\n\r\n  My linear actuator code was inspired by\r\n  https:\/\/www.firgelliauto.com\/blogs\/tutorials\/how-do-you-control-a-linear-actuator-with-an-arduino.\r\n  I used this code to start and ended up breaking it up into two parts and putting that into my if\r\n  statements. Secondly, my sound detector code was copied from\r\n  https:\/\/learn.adafruit.com\/adafruit-microphone-amplifier-breakout\/measuring-sound-levels. I basically\r\n  left most of it the same since it worked well for my application and I labeled it as the sound detector code.\r\n  Additionally, I used https:\/\/learn.sparkfun.com\/tutorials\/sound-detector-hookup-guide\/all#software-example\r\n  as a launchpad to creating my sound detector code. I ended up not following it for my main code, but my code\r\n  may be slightly inspired by this source. To understand button wiring and coding, I referenced https:\/\/youtu.be\/TIBa_RQB3Ek.\r\n  Lastly, we copied the LCD tutorial code and worked off of that, so our code for the LCD display\r\n  is also heavily influenced by this tutorial: https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/tutorials\/I2C-lcd\r\n*\/\r\n\r\n\r\n\/\/LCD set up\r\n#include &lt;Wire.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\n\r\n#define BUTTON_PIN 4    \/\/button pin\r\n#define PIN_GATE_IN 2   \/\/sound detector\r\n#define PIN_LED_OUT 6   \/\/ all LEDs are hooked up to pin 6\r\n#define PIN_ANALOG_IN A0    \/\/sound detector\r\n\r\n\/\/ sound detector variables\r\nconst int sampleWindow = 50; \/\/ Sample window width in mS (50 mS = 20Hz)\r\nunsigned int sample;\r\n\r\nbool workTimerSwitch; \/\/tells the program it is work mode\r\nbool breakTimerSwitch;  \/\/tells the program it is break mode\r\n\/\/this tells program whether it is break time mode (when 1) or work time mode (when 0)\r\nbool breakTimerON;\r\n\r\nunsigned long startTime; \/\/ when the timer starts\r\nunsigned long currentTime = 0; \/\/ how long the timer has been going\r\n\r\nbool DEMO_MODE = 1; \/\/ Demo mode is turned on if 1\r\nbool startToaster = 0;  \/\/ variable that indicates that button turned on toaster\r\nbool TURN_MIC_ON = 0; \/\/ lets the program know whether the LEDs should flash if theres sound\r\n\r\n\r\nvoid setup() {\r\n\r\n  Serial.begin(9600);\r\n  pinMode(BUTTON_PIN, INPUT);\r\n  pinMode(PIN_LED_OUT, OUTPUT);\r\n\r\n  \/\/LCD\r\n  \/\/ initialize the screen (only need to do this once)\r\n  screen.init();\r\n  \/\/ turn on the backlight to start\r\n  screen.backlight();\r\n  screen.clear();\r\n\r\n  \/\/break time actuator\r\n  pinMode(7, OUTPUT); \/\/ Configure pin 7 as an Output\r\n  pinMode(8, OUTPUT); \/\/ Configure pin 8 as an Output\r\n\r\n  digitalWrite(7, HIGH); \/\/ Initialize pin 7 as Low\r\n  digitalWrite(8, HIGH); \/\/ Initialize pin 7 as Low\r\n\r\n  \/\/work time actuator\r\n  pinMode(11, OUTPUT); \/\/ Configure pin 11 as an Output\r\n  pinMode(12, OUTPUT); \/\/ Configure pin 12 as an Output\r\n\r\n  digitalWrite(11, HIGH); \/\/ Initialize pin 11 as Low\r\n  digitalWrite(12, HIGH); \/\/ Initialize pin 12 as Low\r\n\r\n\r\n}\r\n\r\nvoid loop() {\r\n\r\n  unsigned long globalTime = millis(); \/\/ the global time\r\n\r\n  \/\/this variable stores whether button was pressed\r\n  int ON = digitalRead(BUTTON_PIN);\r\n\r\n  \/\/ if button is pressed then this if statement swtiches the startToaster\r\n  \/\/variable on HIGH which will start the program\r\n  if (ON == 1) {\r\n    startToaster = 1;\r\n  }\r\n\r\n  if (startToaster == 1) {\r\n    currentTime = globalTime - startTime; \/\/ calculates currentTime\r\n  }\r\n\r\n  if (currentTime &gt;= 1500000) { \/\/ work timer reached 25 mins\r\n    Serial.println(\"25 mins!\");\r\n\r\n    \/\/ Retracts Linear Actuator\r\n    digitalWrite(11, HIGH);\r\n    digitalWrite(12, LOW);\r\n    delay(2000); \/\/ 2 seconds\r\n    \/\/ Stop Actuator\r\n    digitalWrite(11, HIGH);\r\n    digitalWrite(12, HIGH);\r\n\r\n    \/\/ extends breaktime linear actuator\r\n    digitalWrite(7, LOW);\r\n    digitalWrite(8, HIGH);\r\n    delay(2000); \/\/ 2 seconds\r\n    digitalWrite(7, HIGH);\r\n    digitalWrite(8, HIGH);\r\n\r\n    \/\/ it is break mode so sound does not need to activate LED\r\n    TURN_MIC_ON = 0;\r\n\r\n    \/\/LCD\r\n    screen.home();\r\n    screen.print(String (\"Break Time!\"));\r\n\r\n    startTime = globalTime; \/\/ reset\r\n    breakTimerSwitch = 1; \/\/ turns on break time mode\r\n  }\r\n\r\n  \/\/ this is so the program doesn't continue to loop in the workTimer statment\r\n  \/\/ b\/c otherwise it would continue to reset startTime which would make currentTime zero\r\n  \/\/ hence why the variable is labeled as a switch\r\n  if (workTimerSwitch == 1) {\r\n    startTime = globalTime;\r\n    workTimerSwitch = 0;\r\n  }\r\n\r\n  if (breakTimerSwitch == 1) { \/\/ break timer switched on\r\n    breakTimerON = 1;\r\n    startTime = globalTime; \/\/ reset\r\n    breakTimerSwitch = 0; \/\/ switch is turned off so program doesn't loop in statement\r\n  }\r\n\r\n  if (breakTimerON == 1) {\r\n    if (currentTime &gt;= 300000) { \/\/ 5 mins\r\n      Serial.println(\"5 mins!\");\r\n\r\n      \/\/ Retracts break time Linear Actuator\r\n      digitalWrite(7, HIGH);\r\n      digitalWrite(8, LOW);\r\n      delay(2000); \/\/ 2 seconds\r\n\r\n      \/\/ Stop Actuator\r\n      digitalWrite(7, HIGH);\r\n      digitalWrite(8, HIGH);\r\n\r\n      \/\/ Extend Linear Actuator\r\n      digitalWrite(11, LOW);\r\n      digitalWrite(12, HIGH);\r\n\r\n      delay(2000); \/\/ 2 seconds\r\n\r\n      \/\/ Stops Actuator\r\n      digitalWrite(11, HIGH);\r\n      digitalWrite(12, HIGH);\r\n\r\n      \/\/ sound detection should now activate LEDs since in work mode\r\n      TURN_MIC_ON = 1;\r\n\r\n      \/\/ LCD\r\n      screen.home();\r\n      screen.print(String (\"Work Time!\"));\r\n\r\n      startTime = globalTime; \/\/ reset\r\n      breakTimerON = 0; \/\/ will make program exit this if statement\r\n      workTimerSwitch = 1; \/\/ switch into work mode\r\n    }\r\n  }\r\n\r\n  \/\/ SOUND DETECTOR CODE\r\n  if (TURN_MIC_ON == 1) {\r\n    unsigned long startMillis = millis(); \/\/ Start of sample window\r\n    unsigned int peakToPeak = 0;   \/\/ peak-to-peak level\r\n    unsigned int signalMax = 0;\r\n    unsigned int signalMin = 1024;\r\n\r\n    \/\/ collect data for 50 mS\r\n    while (millis() - startMillis &lt; sampleWindow)\r\n    {\r\n      sample = analogRead(PIN_ANALOG_IN);\r\n      if (sample &lt; 1024)  \/\/ toss out spurious readings\r\n      {\r\n        if (sample &gt; signalMax)\r\n        {\r\n          signalMax = sample;  \/\/ save just the max levels\r\n        }\r\n        else if (sample &lt; signalMin)\r\n        {\r\n          signalMin = sample;  \/\/ save just the min levels\r\n        }\r\n      }\r\n    }\r\n\r\n    peakToPeak = signalMax - signalMin;  \/\/ max - min = peak-peak amplitude\r\n    double volts = (peakToPeak * 5.0) \/ 1024;  \/\/ convert to volts\r\n\r\n    if (volts &lt;= 0.10) \/\/ quiet noise levels\r\n    {\r\n      Serial.println(\"Quiet.\");\r\n      digitalWrite(PIN_LED_OUT, 0);\r\n    }\r\n    else if ( (volts &gt; 0.10) &amp;&amp; ( volts &lt;= 0.30) )\r\n    {\r\n      Serial.println(\"Moderate.\");    \/\/ moderate noise levels\r\n      digitalWrite(PIN_LED_OUT, 50);\r\n    }\r\n    else if (volts &gt; 0.30)\r\n    {\r\n      Serial.println(\"Loud.\");     \/\/ loud noise levels\r\n      digitalWrite(PIN_LED_OUT, 200);\r\n    }\r\n  }\r\n\r\n  \/\/ DEMO MODE\r\n\r\n  if (DEMO_MODE == 1) { \/\/ DEMO MODE is turned on\r\n    if (currentTime &gt;= 6000) { \/\/ 1 min\r\n\r\n      \/\/ Retracts Linear Actuator\r\n      digitalWrite(11, HIGH);\r\n      digitalWrite(12, LOW);\r\n      delay(2000); \/\/ 2 seconds\r\n      \/\/ Stop Actuator\r\n      digitalWrite(11, HIGH);\r\n      digitalWrite(12, HIGH);\r\n\r\n      \/\/ extends breaktime linear actuator\r\n      digitalWrite(7, LOW);\r\n      digitalWrite(8, HIGH);\r\n      delay(2000); \/\/ 2 seconds\r\n      digitalWrite(7, HIGH);\r\n      digitalWrite(8, HIGH);\r\n\r\n      \/\/ it is break mode so sound does not need to activate LED\r\n      TURN_MIC_ON = 0;\r\n\r\n      \/\/LCD\r\n      screen.home();\r\n      screen.print(String (\"Break Time!\"));\r\n\r\n      startTime = globalTime; \/\/ reset\r\n      breakTimerSwitch = 1; \/\/ turns on break time mode\r\n    }\r\n    if (breakTimerON == 1) {\r\n      if (currentTime &gt;= 6000) { \/\/ 1 min\r\n\r\n        \/\/ Retracts break time Linear Actuator\r\n        digitalWrite(7, HIGH);\r\n        digitalWrite(8, LOW);\r\n        delay(2000); \/\/ 2 seconds\r\n\r\n        \/\/ Stop Actuator\r\n        digitalWrite(7, HIGH);\r\n        digitalWrite(8, HIGH);\r\n\r\n        \/\/ Extend Linear Actuator\r\n        digitalWrite(11, LOW);\r\n        digitalWrite(12, HIGH);\r\n\r\n        delay(2000); \/\/ 2 seconds\r\n\r\n        \/\/ Stops Actuator\r\n        digitalWrite(11, HIGH);\r\n        digitalWrite(12, HIGH);\r\n\r\n        \/\/ sound detection should now activate LEDs since in work mode\r\n        TURN_MIC_ON = 1;\r\n\r\n        \/\/ LCD\r\n        screen.home();\r\n        screen.print(String (\"Work Time!\"));\r\n\r\n        startTime = globalTime; \/\/ reset\r\n        breakTimerON = 0; \/\/ will make program exit this if statement\r\n        workTimerSwitch = 1; \/\/ switch into work mode\r\n      }\r\n    }\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This device is intended to let everyone around you know when you are working or not so that you are able to stay on task. Process &nbsp; &nbsp;&#8230;<\/p>\n","protected":false},"author":236,"featured_media":16640,"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\/f2022\/work\/wp-json\/wp\/v2\/posts\/16623"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/users\/236"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/comments?post=16623"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16623\/revisions"}],"predecessor-version":[{"id":16656,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16623\/revisions\/16656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media\/16640"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media?parent=16623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/categories?post=16623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/tags?post=16623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}