{"id":2456,"date":"2022-04-06T11:06:58","date_gmt":"2022-04-06T15:06:58","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2456"},"modified":"2022-04-06T11:08:43","modified_gmt":"2022-04-06T15:08:43","slug":"2456","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2456","title":{"rendered":"Doorbell for the Blind"},"content":{"rendered":"<p><span style=\"text-decoration: underline\"><strong>Concept:<\/strong><\/span><\/p>\n<p>The concept for this device was to create a doorbell that could be used navigated and used with little to no eyesight required. My goal was to eliminate the component of doorbell interactions where the user has to navigate on the door to find the button and ring the doorbell. I ended up settling on a doormat that senses when a person is present and then greets the user and prompts them to stomp a specified amount of times for desired interactions. The actions were made to resemble those of a traditional answering machine: stomp once to hear the address, stomp twice to ring the doorbell, stomp three times to hear the options again. Going further into the design, I think it would be helpful to add a message component so the user could leave a message to the resident if they want. I think it would also be helpful for security sake to incorporate a notification system to the resident is notified of any users on their doorstep and a picture is captured of whoever is there.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Electrical Schematic:<\/strong><\/span><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2491\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit-300x177.jpg\" alt=\"\" width=\"707\" height=\"417\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit-300x177.jpg 300w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit-1024x604.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit-768x453.jpg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit-1536x907.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit-1200x708.jpg 1200w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/SoundCritCircuit.jpg 1779w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Demo Video:<\/strong><\/span><\/p>\n<p><iframe loading=\"lazy\" title=\"Sound Crit Demo Video\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/mHlY0osCdlg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Code:<\/strong><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/*\r\n   Warning Machine for Something Approaching\r\n*\/\r\n\r\n#include &lt;Audio.h&gt;\r\n#include &lt;Wire.h&gt;\r\n#include &lt;SPI.h&gt;\r\n#include &lt;SD.h&gt;\r\n#include &lt;SerialFlash.h&gt;\r\n\r\nAudioPlaySdWav           playWav;\r\n\r\nAudioOutputMQS           mqs1;           \/\/xy=625,279\r\nAudioConnection          patchCord1(playWav, 0, mqs1, 0);\r\nAudioConnection          patchCord2(playWav, 1, mqs1, 1);\r\n\r\n\r\n\/\/ Use these with the Teensy 3.5 &amp; 3.6 SD card\r\n#define SDCARD_CS_PIN     BUILTIN_SDCARD\r\n#define SDCARD_MOSI_PIN   11  \/\/ not actually used\r\n#define SDCARD_SCK_PIN    13  \/\/ not actually used\r\n\r\n#define pressurePlate     14\r\n\r\n\r\n\r\nString message = \"\";\r\nint stompCounter = 0;\r\n\r\n\r\nvoid setup() {\r\n  \/\/ put your setup code here, to run once:\r\n\r\n  Serial.begin(9600);\r\n\r\n  \/\/ Audio connections require memory to work.  For more\r\n  \/\/ detailed information, see the MemoryAndCpuUsage example\r\n  AudioMemory(8);\r\n\r\n  \/\/ Comment these out if not using the audio adaptor board.\r\n  \/\/ This may wait forever if the SDA &amp; SCL pins lack\r\n  \/\/ pullup resistors\r\n\r\n  SPI.setMOSI(SDCARD_MOSI_PIN);\r\n  SPI.setSCK(SDCARD_SCK_PIN);\r\n  if (!(SD.begin(SDCARD_CS_PIN))) {\r\n    \/\/ stop here, but print a message repetitively\r\n    while (1) {\r\n      Serial.println(\"Unable to access the SD card\");\r\n      delay(500);\r\n    }\r\n  }\r\n\r\n\r\n  pinMode(pressurePlate, INPUT);\r\n\r\n\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ put your main code here, to run repeatedly\r\n\r\n  bool someoneOnPressurePlate = doPlatePresenceCheck();\r\n\r\n  if (someoneOnPressurePlate) {\r\n    doPressurePlateCheck();\r\n  }\r\n\r\n  \r\n  Serial.print(\"Pressure Plate Reading: \");\r\n  Serial.print(analogRead(pressurePlate));\r\n  Serial.print(\"\\t\");\r\n  Serial.print(\"Stomp Counter: \");\r\n  Serial.print(stompCounter);\r\n  Serial.print(\"\\t\");\r\n  \/\/  Serial.print(\"Pressure Plate Pressence: \");\r\n  \/\/  Serial.print(someoneOnPressurePlate);\r\n  \/\/  Serial.print(\"\\t\");\r\n\r\n  Serial.print(\"Message: \");\r\n  Serial.print(message);\r\n  Serial.print(\"\\t\");\r\n  Serial.println(\"\");\r\n  delay(5);\r\n\r\n\r\n}\r\n\r\nvoid playSound(const char *filename) {\r\n  playWav.play(filename);\r\n  delay(25);\r\n  while (playWav.isPlaying()) {\r\n\r\n  }\r\n}\r\n\r\nbool doPlatePresenceCheck() {\r\n\r\n  int standingThreshold = 600;\r\n  int standingTimeThreshold = 2000; \/\/ [ms]\r\n  static bool timingStand = false;\r\n  static bool someoneOnPressurePlate = false;\r\n  static unsigned long standingTime = 0;\r\n\r\n\r\n  int plateReading = analogRead(pressurePlate);\r\n\r\n  if (plateReading &gt; standingThreshold) {\r\n    if (!timingStand) {\r\n      timingStand = true;\r\n      standingTime = millis();\r\n    }\r\n  } else if (plateReading &lt; standingThreshold) {\r\n    timingStand = false;\r\n    someoneOnPressurePlate = false;\r\n  }\r\n\r\n  if (timingStand &amp;&amp; millis() - standingTime &gt; standingTimeThreshold) {\r\n    if (!someoneOnPressurePlate) {\r\n      playSound(\"Initial Greeting.WAV\");\r\n      playSound(\"Options Sound.WAV\");\r\n    }\r\n    timingStand = false;\r\n    someoneOnPressurePlate = true;\r\n  }\r\n\r\n  return someoneOnPressurePlate;\r\n\r\n}\r\n\r\n\r\nvoid doPressurePlateCheck() {\r\n\r\n  int debounceTime = 300;\r\n  int stompThreshold = 900;\r\n  int countTimerThreshold = 3000; \/\/ [ms]\r\n  static bool DEBOUNCE = false;\r\n  static bool timeDebounce = false;\r\n  static bool countStart = false;\r\n  static unsigned long debounceTimer = 0;\r\n  static unsigned long countTimer = 0;\r\n\r\n  int pressureReading = analogRead(pressurePlate);\r\n\r\n\r\n  if (!DEBOUNCE &amp;&amp; pressureReading &gt; stompThreshold) {\r\n    if (!countStart) {\r\n      countStart = true;\r\n      countTimer = millis();\r\n    }\r\n\r\n    DEBOUNCE = true;\r\n    stompCounter += 1;\r\n  }\r\n\r\n  if (millis() - countTimer &gt; countTimerThreshold || stompCounter &gt; 3) {\r\n    actionBasedOnStompCount(stompCounter);\r\n    countStart = false;\r\n    stompCounter = 0;\r\n  }\r\n\r\n\r\n  if (DEBOUNCE &amp;&amp; timeDebounce) {\r\n    timeDebounce = false;\r\n    debounceTimer = millis();\r\n  }\r\n\r\n  if (millis() - debounceTimer &gt; debounceTime) {\r\n    DEBOUNCE = false;\r\n    timeDebounce = true;\r\n  }\r\n\r\n}\r\n\r\n\r\nvoid actionBasedOnStompCount(int stompCount) {\r\n  if (stompCount == 1) {\r\n    \/\/user wants to read address\r\n    message = \"Read Address\";\r\n\r\n    playSound(\"Address Sound.WAV\");\r\n    \r\n  } else if (stompCount == 2) {\r\n    \/\/user wants to ring doorbell\r\n    message = \"Ring Doorbell\";\r\n\r\n    playSound(\"Doorbell Sound.WAV\");\r\n    \r\n  } else if (stompCount == 3) {\r\n    \/\/user wants to leave message\r\n    message = \"Reading Options Again\";\r\n\r\n    playSound(\"Options Sound.WAV\");\r\n\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Concept: The concept for this device was to create a doorbell that could be used navigated and used with little to no eyesight required. My goal was to eliminate the component of doorbell interactions where the user has to navigate on the door to find the button and ring the doorbell. I ended up settling &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2456\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Doorbell for the Blind&#8221;<\/span><\/a><\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2456"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2456"}],"version-history":[{"count":5,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2456\/revisions"}],"predecessor-version":[{"id":2495,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2456\/revisions\/2495"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}