{"id":1841,"date":"2020-11-10T16:33:45","date_gmt":"2020-11-10T21:33:45","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/?p=1841"},"modified":"2020-11-19T17:14:52","modified_gmt":"2020-11-19T22:14:52","slug":"audible-cooking-thermometer","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/?p=1841","title":{"rendered":"Audible Cooking Thermometer"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>I always find tracking the internal temperature of the things being cooked tedious . Sometimes I have to stop what I am doing to check on it, sometimes I have to look at it the whole time if the food can easily be overcooked. If I forget to check, there is a risk of overcooking and therefore bad texture and taste.<\/p>\n<h1>Solution<\/h1>\n<p>A device that actively tracks the internal temperature of the food and reminds the user when needed can solve this problem. The device is composed of a temperature sensor, a transducer speaker, and a screen. The temperature sensor of the device will be stuck into the middle of the meat or broth to measure the rate of rise in temperature.<\/p>\n<figure id=\"attachment_1842\" aria-describedby=\"caption-attachment-1842\" style=\"width: 840px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" class=\"wp-image-1842 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-1024x505.jpg\" alt=\"\" width=\"840\" height=\"414\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-1024x505.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-300x148.jpg 300w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-768x379.jpg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-1536x758.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-2048x1010.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3571-1200x592.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-1842\" class=\"wp-caption-text\">The components of the device<\/figcaption><\/figure>\n<p>If the rising rate is too large that might lead to overcooking, the device plays &#8220;Mi Re Do&#8221; to remind the user to turn down the gas. Text will be displayed on the screen if the user needs further information. In the same fashion, if the rising rate is too small, the device plays &#8220;Do Re Mi&#8221;. The user can stop the sound by pressing the device. In addition, specific instructions can be set for different foods. For the demo, an reminder to flip the fish for stir-frying salmon comes up when the temperature reaches a specific value. The device will play a melody when the food is cooked when the temperature reaches its ideal value. However, the device will only be successful if the algorithm of the cooking temperature for different foods is well developed.<\/p>\n<h1>Proof of Logic<\/h1>\n<p>Because I am not sure if the sensor can be used on real meat, and because it will take a longer time, I changed the rate of temperature rise in each cooking stage and did a demonstration with my hand instead. I stimulate the cooking process by holding the temperature sensor and raises its temperature from room temperature (about 23 Celcius) to 32 Celcius.<\/p>\n<p><iframe title=\"Demo for the audible cooking thermometer\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/HaifHXgZuc4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<figure id=\"attachment_1843\" aria-describedby=\"caption-attachment-1843\" style=\"width: 768px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" class=\"wp-image-1843 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-768x1024.jpg\" alt=\"\" width=\"768\" height=\"1024\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-1200x1600.jpg 1200w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/IMG_3570-scaled.jpg 1920w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><figcaption id=\"caption-attachment-1843\" class=\"wp-caption-text\">Overall setup of the prototype<\/figcaption><\/figure>\n<figure id=\"attachment_1844\" aria-describedby=\"caption-attachment-1844\" style=\"width: 840px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" class=\"wp-image-1844 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic-1024x489.png\" alt=\"\" width=\"840\" height=\"401\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic-1024x489.png 1024w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic-300x143.png 300w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic-768x367.png 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic-1536x734.png 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic-1200x574.png 1200w, https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/wp-content\/uploads\/2020\/11\/schematic.png 1770w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-1844\" class=\"wp-caption-text\">Schematics<\/figcaption><\/figure>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/\/libary\r\n#include &lt;OneWire.h&gt;\r\n#include &lt;DallasTemperature.h&gt;\r\n#include \"pitches.h\"\r\n#include &lt;Wire.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n\r\n\r\n\/\/definition\r\n#define ONE_WIRE_BUS 5\r\n#define SPEAKER 7\r\n#define CONFIRM_BUTTON 2\r\n\r\n\/\/Attachment\r\nOneWire oneWire(ONE_WIRE_BUS);\r\nDallasTemperature sensors(&amp;oneWire);\r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\n\r\n\r\n\r\n\/\/Global variable\r\nfloat Celcius = 0;\r\nfloat Fahrenheit = 0;\r\nfloat room_temp = 0;\r\nint start_time = 0;\r\n\r\nconst bool isInterrupt = true;\r\nbool confirmbuttonState = false;\r\nbool isDone = false;\r\n\r\nstatic const float salmon_flip_over_temp = 28;  \/\/This is the default temperature for flipping salmon\r\nstatic const float done_temp = 32;  \/\/This is the temperature when the salmon is \"cooked\".\r\nbool flip = false;\r\n\r\nfloat last_read = 0;\r\nfloat current_read = 0;\r\nfloat rise_over_time = 0;\r\n\r\n\r\n\/\/Varibles for the timer of recording data, record data every 2 seconds\r\nunsigned long clock_data = 0; \/\/ variable for timing\r\nconst int INTERVAL1 = 2000; \/\/ milliseconds between updates\r\n\r\n\/\/Functions\r\nvoid read_temperature() {\r\n  sensors.requestTemperatures();\r\n  Celcius = sensors.getTempCByIndex(0);\r\n  Fahrenheit = sensors.toFahrenheit(Celcius);\r\n  Serial.print(\" C  \");\r\n  Serial.print(Celcius);\r\n  Serial.print(\" F  \");\r\n  Serial.println(Fahrenheit);\r\n}\r\n\r\nvoid ConfirmButtonPressed()\r\n{\r\n  if (digitalRead(CONFIRM_BUTTON) == LOW) {\r\n   confirmbuttonState = true;\r\n  }\r\n}\r\n\r\n\r\n\r\nvoid temp_rise(float rise_over_time, float lowerbound, float upperbound) {\r\n  if (rise_over_time &gt; upperbound) {\r\n    screen.clear();\r\n    screen.setCursor(3, 0);\r\n    screen.print(\"Turn Down\");\r\n    while (confirmbuttonState == false) {\r\n      tone(SPEAKER, NOTE_E4, 200);\r\n      delay(350);\r\n      tone(SPEAKER, NOTE_D4, 200);\r\n      delay(350);\r\n      tone(SPEAKER, NOTE_C4, 200);\r\n      delay(1000);\r\n\r\n    }\r\n\r\n    confirmbuttonState = false;\r\n    screen.clear();\r\n  }\r\n\r\n  if (rise_over_time &lt; lowerbound) {\r\n    screen.clear();\r\n    screen.setCursor(4, 0);\r\n    screen.print(\"Turn Up\");\r\n    while (confirmbuttonState == false) {\r\n      tone(SPEAKER, NOTE_C4, 200);\r\n      delay(350);\r\n      tone(SPEAKER, NOTE_D4, 200);\r\n      delay(350);\r\n      tone(SPEAKER, NOTE_E4, 200);\r\n      delay(1000);\r\n\r\n    }\r\n\r\n    confirmbuttonState = false;\r\n    screen.clear();\r\n  }\r\n}\r\n\r\n\/\/The song to play when cooking is finished\r\nvoid fly_me_to_the_moon() {\r\n  tone(SPEAKER, NOTE_C5);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_B4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_A4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_G4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_F4);\r\n  delay(1000);\r\n  tone(SPEAKER, NOTE_G4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_A4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_C5);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_B4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_A4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_G4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_F4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_E4);\r\n  delay(1250);\r\n  if (confirmbuttonState == true){\r\n    return;\r\n  }\r\n  \r\n  noTone(SPEAKER);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_A4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_G4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_F4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_E4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_D4);\r\n  delay(1000);\r\n  tone(SPEAKER, NOTE_E4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_F4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_A4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_F4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_GS4);\r\n  delay(750);\r\n  tone(SPEAKER, NOTE_F4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_E4);\r\n  delay(500);\r\n  tone(SPEAKER, NOTE_D4);\r\n  delay(250);\r\n  tone(SPEAKER, NOTE_C4);\r\n  delay(1750);\r\n\r\n\r\n  noTone(SPEAKER);\r\n  delay(1000);\r\n}\r\n\r\n\/\/This function is called when the \"salmon\" option is selected\r\nvoid stirfry_salmon() {\r\n  \/\/check the rate of temperature rise every 2 seconds\r\n  if (millis() &gt;=  clock_data) {\r\n    sensors.requestTemperatures();\r\n    Celcius = sensors.getTempCByIndex(0);\r\n   \r\n\r\n    current_read = Celcius;\r\n    rise_over_time = (current_read - last_read) \/ 2;\r\n\r\n    \/\/Print information onto the lcd screen\r\n    int minute = (millis() - start_time) \/ 60000;\r\n    int second = (millis() - 60000 * minute) \/ 1000;\r\n\r\n    \/\/Serial.print(minute);\r\n    \/\/Serial.println(second);\r\n\r\n\r\n    screen.setCursor(0, 0);\r\n    screen.print(\"Salmon\");\r\n    screen.setCursor(0, 1);\r\n    screen.print((String)\"Temp:\" + current_read + \"C\");\r\n    screen.setCursor(7, 0);\r\n    screen.print((String)\"Time:\" + minute + \":\" + second);\r\n\r\n\r\n\r\n\r\n    \/\/Check whether it is time to flip the fish\r\n    if (current_read &gt;= salmon_flip_over_temp &amp;&amp; flip == false) {\r\n      screen.clear();\r\n      screen.setCursor(6, 0);\r\n      screen.print(\"Flip\");\r\n      screen.setCursor(7, 1);\r\n      screen.print(\"it\");\r\n      while (confirmbuttonState == false) {\r\n        tone(SPEAKER, NOTE_C5, 200);\r\n        delay(350);\r\n        tone(SPEAKER, NOTE_B4, 200);\r\n        delay(350);\r\n        tone(SPEAKER, NOTE_A4, 200);\r\n        delay(350);\r\n        tone(SPEAKER, NOTE_G4, 200);\r\n        delay(350);\r\n        tone(SPEAKER, NOTE_A4, 200);\r\n        delay(350);\r\n        tone(SPEAKER, NOTE_B4, 200);\r\n        delay(350);\r\n        tone(SPEAKER, NOTE_C5, 200);\r\n        delay(1000);\r\n      }\r\n\r\n      confirmbuttonState = false;\r\n      screen.clear();\r\n      flip = true;\r\n    }\r\n\r\n    \/\/Checked if the fish is already cooked\r\n    if (current_read &gt;= done_temp) {\r\n      screen.clear();\r\n      screen.setCursor(5, 0);\r\n      screen.print(\"Cooked\");\r\n      while (confirmbuttonState == false) {\r\n        fly_me_to_the_moon();\r\n      }\r\n\r\n      confirmbuttonState = false;\r\n      screen.clear();\r\n      isDone = true;\r\n      return;\r\n    }\r\n\r\n    \/\/Every cooking stage has a different \"standard\" rate of temperature rise\r\n    \/\/0-10s The first stage of cooking\r\n    if (millis() - start_time &lt;= 10000) {\r\n      temp_rise(rise_over_time, 0.12, 0.7);\r\n    }\r\n\r\n    \/\/10-16s The second stage of cooking\r\n    if (millis() - start_time &gt; 10000 &amp;&amp; millis() - start_time &lt;= 16000 ) {\r\n      temp_rise(rise_over_time, 0.12, 0.19);\r\n    }\r\n\r\n    \/\/16-24s The third stage of cooking\r\n    if (millis() - start_time &gt; 16000 &amp;&amp; millis() - start_time &lt;= 24000 ) {\r\n      temp_rise(rise_over_time, 0.6, 0.9);\r\n    }\r\n\r\n    \/\/&gt;24s The fourth stage of cooking\r\n    if (millis() - start_time &gt; 10000 &amp;&amp; millis() - start_time &lt;= 16000 ) {\r\n      temp_rise(rise_over_time, 0, 0.3);\r\n    }\r\n\r\n\r\n\r\n    last_read = current_read;\r\n    clock_data = millis() + INTERVAL1 ;\r\n    \/\/Serial.print(Celcius);\r\n    \/\/Serial.print(\"     \");\r\n    Serial.print(current_read);\r\n    Serial.print(\"     \");\r\n    Serial.println(rise_over_time);\r\n  }\r\n}\r\n\r\nvoid setup()\r\n{\r\n  \/\/Initialization\r\n  Serial.begin(9600);\r\n  sensors.begin();\r\n  screen.init();\r\n  screen.backlight();\r\n\r\n  \/\/Setting the pinMode\r\n  pinMode(CONFIRM_BUTTON, INPUT_PULLUP);\r\n\r\n  \/\/Attach interrupt\r\n  if (isInterrupt) {\r\n    attachInterrupt (digitalPinToInterrupt(CONFIRM_BUTTON), ConfirmButtonPressed, FALLING);\r\n  }\r\n\r\n\r\n  \/\/Record the room temperature\r\n  sensors.requestTemperatures();\r\n  Celcius = sensors.getTempCByIndex(0);\r\n  room_temp = Celcius;\r\n  last_read = room_temp;\r\n\r\n  \/\/test-field\r\n  \/\/tone(SPEAKER, NOTE_A4,200);\r\n  \/\/screen.setCursor(0, 1);\r\n  \/\/screen.print(\"2nd row text\");\r\n  start_time = millis();\r\n\r\n \r\n\r\n}\r\n\r\nvoid loop(void)\r\n{\r\n  if (isDone == false) {\r\n  stirfry_salmon();\r\n  }\r\n  \r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem I always find tracking the internal temperature of the things being cooked tedious . Sometimes I have to stop what I am doing to check on it, sometimes I have to look at it the whole time if the food can easily be overcooked. If I forget to check, there is a risk of &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/?p=1841\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Audible Cooking Thermometer&#8221;<\/span><\/a><\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=\/wp\/v2\/posts\/1841"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1841"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=\/wp\/v2\/posts\/1841\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=\/wp\/v2\/posts\/1841\/revisions\/1845"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/f2020\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}