{"id":17248,"date":"2023-02-13T16:06:03","date_gmt":"2023-02-13T21:06:03","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/?p=17248"},"modified":"2023-02-15T19:05:21","modified_gmt":"2023-02-16T00:05:21","slug":"double-transducer-linear-position-to-transparency","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/double-transducer-linear-position-to-transparency\/","title":{"rendered":"Double Transducer: Linear Position to Transparency"},"content":{"rendered":"<p><em><strong>Part 1. Overall Images of the Final Product<\/strong><\/em><\/p>\n<div id=\"attachment_17230\" style=\"width: 484px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-17230\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-17230\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1.jpg\" alt=\"\" width=\"474\" height=\"474\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1.jpg 2320w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-300x300.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-1024x1024.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-150x150.jpg 150w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-768x768.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-1536x1536.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-2048x2048.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-88x88.jpg 88w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-973x973.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9630-1-508x508.jpg 508w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><p id=\"caption-attachment-17230\" class=\"wp-caption-text\">Dunn&#8217;s double transducer<br \/>(Position -&gt; Sound -&gt; Transparency)<\/p><\/div>\n<div id=\"attachment_17527\" style=\"width: 451px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-17527\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17527\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-300x269.jpg\" alt=\"\" width=\"441\" height=\"396\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-300x269.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-1024x918.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-768x688.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-1536x1376.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-2048x1835.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-973x872.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/final_proj1-508x455.jpg 508w\" sizes=\"(max-width: 441px) 100vw, 441px\" \/><p id=\"caption-attachment-17527\" class=\"wp-caption-text\">Bhairavi&#8217;s Double Transducer (position &#8211;&gt; frequency &#8211;&gt; transparency)<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><em><strong>Part 2. Details<\/strong><\/em><\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 50%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-17248 gallery-columns-2 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/double-transducer-linear-position-to-transparency\/img_9631-2\/'><img width=\"225\" height=\"300\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-225x300.jpg\" class=\"attachment-medium size-medium\" alt=\"\" decoding=\"async\" loading=\"lazy\" aria-describedby=\"gallery-1-17263\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9631-1-scaled.jpg 1920w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-1-17263'>\n\t\t\t\tPush Button Extra Feature (Dunn) The push button, when held, will alter the display mode, which converts a mapped value from 0~99 to an accurate representation. For example, when held, the display will show distance in mm.\n\t\t\t\t<\/dd><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/double-transducer-linear-position-to-transparency\/img_9632-2\/'><img width=\"225\" height=\"300\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-225x300.jpg\" class=\"attachment-medium size-medium\" alt=\"\" decoding=\"async\" loading=\"lazy\" aria-describedby=\"gallery-1-17264\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9632-1-scaled.jpg 1920w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-1-17264'>\n\t\t\t\tBuzzer &amp; Microphone Combo (Dunn) Picks up the audio output, a tone, from the buzzer and analog write that into the light valve.\n\t\t\t\t<\/dd><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<div id=\"attachment_17292\" style=\"width: 312px\" class=\"wp-caption alignleft\"><img aria-describedby=\"caption-attachment-17292\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17292\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-225x300.jpg\" alt=\"\" width=\"302\" height=\"403\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3832-scaled.jpg 1920w\" sizes=\"(max-width: 302px) 100vw, 302px\" \/><p id=\"caption-attachment-17292\" class=\"wp-caption-text\">Figuring out how to use a MOSFET for the 12V power needed for the fan. (Mo)<\/p><\/div>\n<div class=\"mceTemp\"><\/div>\n<div id=\"attachment_17512\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-17512\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17512\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-225x300.jpg\" alt=\"\" width=\"300\" height=\"400\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-scaled.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-17512\" class=\"wp-caption-text\">Accidentally plugging the light valve (purple) into a non-PWM pin. (Bhairavi)<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><em><strong>Part 3. Demonstration<\/strong><\/em><\/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-17248-1\" width=\"620\" height=\"1102\" loop=\"1\" autoplay=\"1\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled-video-4-1.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled-video-4-1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled-video-4-1.mp4<\/a><\/video><\/div>\n<p>Dunn&#8217;s project in action.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-17248-2\" width=\"620\" height=\"348\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Sequence-01_1-1.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Sequence-01_1-1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Sequence-01_1-1.mp4<\/a><\/video><\/div>\n<p>Mo&#8217;s project in action.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-17248-3\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/transducer.mp4?_=3\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/transducer.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/transducer.mp4<\/a><\/video><\/div>\n<p>Bhairavi&#8217;s project in action.<\/p>\n<p><em><strong>Part 4. Narrative\u00a0<\/strong><\/em><\/p>\n<p>A <span class=\"livespell_redwiggle\">sensor<\/span> reads the <span class=\"livespell_redwiggle\">distance<\/span> of an <span class=\"livespell_redwiggle\">object<\/span> in front of it, then <span class=\"livespell_redwiggle\">converts<\/span> that <span class=\"livespell_redwiggle\">data<\/span> to <span class=\"livespell_redwiggle\">transparency<\/span> through the use of a light <span class=\"livespell_redwiggle\">valve<\/span>. Our team had some different approaches to the middle step of the <span class=\"livespell_redwiggle\">device<\/span>. <span class=\"livespell_redwiggle\">Mo<\/span> used wind <span class=\"livespell_redwiggle\">speed<\/span> as the middle step, while <span class=\"livespell_redwiggle\">Dunn<\/span> and <span class=\"livespell_redwiggle\">Bhairavi<\/span> used sound. <span class=\"livespell_redwiggle\">Mo&#8217;s<\/span> <span class=\"livespell_redwiggle\">project<\/span> uses a <span class=\"livespell_redwiggle\">fan<\/span> that <span class=\"livespell_redwiggle\">blows<\/span> into a wind <span class=\"livespell_redwiggle\">sensor<\/span> for the middle step, while <span class=\"livespell_redwiggle\">Dunn<\/span> and <span class=\"livespell_redwiggle\">Bhairavi&#8217;s<\/span> <span class=\"livespell_redwiggle\">projects<\/span> use a <span class=\"livespell_redwiggle\">buzzer<\/span> and a <span class=\"livespell_redwiggle\">microphone<\/span>.<\/p>\n<p><em><strong>Part 5. Processes<\/strong><\/em><\/p>\n<p>Dunn&#8217;s process:<\/p>\n<div id=\"attachment_17146\" style=\"width: 379px\" class=\"wp-caption alignleft\"><img aria-describedby=\"caption-attachment-17146\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-17146\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340.jpg\" alt=\"\" width=\"369\" height=\"269\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340.jpg 1772w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340-300x219.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340-1024x747.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340-768x560.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340-1536x1120.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340-973x709.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-the-laser-to-work-scaled-e1676258230340-508x370.jpg 508w\" sizes=\"(max-width: 369px) 100vw, 369px\" \/><p id=\"caption-attachment-17146\" class=\"wp-caption-text\">I wanted to ensure the laser was working correctly before proceeding with the other components. The laser range finder required solder before attachment. This component is a much better alternative to the ultrasonic ranger, which has a shorter range and wider scanning cone.<\/p><\/div>\n<div id=\"attachment_17147\" style=\"width: 395px\" class=\"wp-caption alignright\"><img aria-describedby=\"caption-attachment-17147\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-17147\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-scaled.jpg\" alt=\"\" width=\"385\" height=\"289\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/getting-everythings-circuitry-working-508x381.jpg 508w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><p id=\"caption-attachment-17147\" class=\"wp-caption-text\">After resolving the laser issue, all other components came together fairly easily and quickly. However, I wanted to ensure everything worked before anchoring the components to the chipboard to avoid potential hardware issues.<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_17150\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-17150\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17150 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-891x1024.jpg\" alt=\"\" width=\"620\" height=\"713\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-891x1024.jpg 891w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-261x300.jpg 261w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-768x882.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-1337x1536.jpg 1337w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-973x1118.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285-508x584.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_9598-scaled-e1676259437285.jpg 1459w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-17150\" class=\"wp-caption-text\">Almost-final iteration. Most components are secured in their locations.<\/p><\/div>\n<p>Mo&#8217;s Process:<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-2 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-2 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 50%;\n\t\t\t}\n\t\t\t#gallery-2 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-2 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-2' class='gallery galleryid-17248 gallery-columns-2 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/double-transducer-linear-position-to-transparency\/img_3843\/'><img width=\"300\" height=\"225\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-300x225.jpg\" class=\"attachment-medium size-medium\" alt=\"\" decoding=\"async\" loading=\"lazy\" aria-describedby=\"gallery-2-17388\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3843-scaled-e1676423049680-508x381.jpg 508w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-2-17388'>\n\t\t\t\tWorking on getting the fan to transmit data through the wind sensor to the light valve.\n\t\t\t\t<\/dd><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/double-transducer-linear-position-to-transparency\/img_3831\/'><img width=\"300\" height=\"225\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-300x225.jpg\" class=\"attachment-medium size-medium\" alt=\"\" decoding=\"async\" loading=\"lazy\" aria-describedby=\"gallery-2-17387\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_3831-scaled-e1676423106543-508x381.jpg 508w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-2-17387'>\n\t\t\t\tThe beginnings of figuring out how the wiring will work.\n\t\t\t\t<\/dd><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<div id=\"attachment_17511\" style=\"width: 341px\" class=\"wp-caption alignleft\"><img aria-describedby=\"caption-attachment-17511\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17511 \" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-225x300.jpg\" alt=\"\" width=\"331\" height=\"441\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230206_163753368-scaled.jpg 1920w\" sizes=\"(max-width: 331px) 100vw, 331px\" \/><p id=\"caption-attachment-17511\" class=\"wp-caption-text\">Starting out by individually testing each component. This picture is the laser distance sensor \u2013 I found an example sketch on the Adafruit website which I used to\u00a0 learn how the VL530X works. (Bhairavi)<\/p><\/div>\n<div id=\"attachment_17512\" style=\"width: 310px\" class=\"wp-caption alignright\"><img aria-describedby=\"caption-attachment-17512\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17512\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-225x300.jpg\" alt=\"\" width=\"300\" height=\"400\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/PXL_20230215_043633456-scaled.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-17512\" class=\"wp-caption-text\">Last thing to change: accidentally plugging the light valve (purple) into a non-PWM pin, meaning that the transparency couldn&#8217;t be changed easily. (Bhairavi)<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>Part 6. Discussion<\/strong><\/em><\/p>\n<p>Overall, this project was an excellent introduction to physical computing: how everything works and comes together. Though our team had different solutions and approaches, they were equally unique and valid. We learned the hard lesson that the product might not work as you intended on the presentation day, and there are always issues to be resolved. It was interesting to see how our teammates approached the project prompt \u2013 each of us faced different constraints, leading us to end up with different middle steps for our transducers.<\/p>\n<p>Since there was only one fan present in the classroom, both Dunn and Bhairavi chose to use buzzers generating sound for their middle steps. Dunn chose to control the volume of the buzzer for the middle step, since he found this easier than controlling the frequency. However, Bhairavi had trouble accurately detecting the volume of the buzzer and decided to hone in on the small range of frequencies in which the microphone could detect a linear increase in frequency.<\/p>\n<p>Another difference between our projects was that the sensitivity of the transparency to movement was significantly different. Both Dunn and Bhairavi found it necessary to significantly limit the range in which the laser could detect movement due to range limitations in their middle step, while Mo was able to detect and express a larger range of movement.<\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>Part 7. Functional Block Diagram and Schematic<\/strong><\/em><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-17445 aligncenter\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Schematic-2-300x221.jpg\" alt=\"\" width=\"574\" height=\"423\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Schematic-2-300x221.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Schematic-2-768x566.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Schematic-2-973x717.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Schematic-2-508x374.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Schematic-2.jpg 1021w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-17446 aligncenter\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram-300x88.jpg\" alt=\"\" width=\"624\" height=\"183\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram-300x88.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram-1024x299.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram-768x225.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram-973x284.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram-508x149.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Transducer-1-Block-Diagram.jpg 1098w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p><em><strong>Part 8. Code Submission<\/strong><\/em><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/*\r\n File\/Sketch Name: transducer_test\r\n\r\n Version No.: v2.0 Created Feb 14 2023 Bhairavi Chandersekhar\r\n \r\n Description:  This code works to run an Arduino Uno powered double transducer. The transducer converts distance to transparency. \r\n The double transducer uses a VL53L0X 'Time of Flight' Laser distance\r\n sensor to input distance (must be between 40 and 220 mm). The distance signal is then converted by the Arduino to a frequency between\r\n 290 and 335 Hz. which is then sent to a passive piezo buzzer. An electret microphone picks up the signal from the passive buzzer and \r\n uses the frequency to control the transparency of a light valve. \r\n Input, intermediate, and output values are displayed on an LCD screen. \r\n\r\n Notes: \r\n - all frequencies between 290 and 355 Hz are not able to be used. Frequencies from 300-315 Hz are very frequently not picked up\r\n accurately by the microphone. This is why much of the code is split up using if statements; frequencies in two different nonadjacent\r\n ranges are generated, and the frequencies picked up are also present in two nonadjacent ranges. Frequencies above, below, or between these\r\n ranges are disregarded as noise. \r\n - Specific ranges in which the microphone is able to detect the frequency accurately depend on the specific choice \r\n of buzzer and microphone, as well as the ambient noise in the room. \r\n\r\n Pin Mappings: \r\n 5        one lead of the piezo buzzer (other lead to ground)\r\n 10       one lead of the light valve (other lead to ground)\r\n A0       electret microphone input\r\n 3.3 V    runs to electret microphone and laser distance sensor\r\n 5V       runs to LCD display. \r\n SCL\/SDA  connects to both the LCD display and to the laser distance sensor\r\n \r\n \r\n FFT code based on AudioFrequencyDetector code written by Clyde A. Lettsome, PhD, PE, MEM\r\n For more information visit https:\/\/clydelettsome.com\/blog\/2019\/12\/18\/my-weekend-project-audio-frequency-detector-using-an-arduino\/\r\n\r\n*\/\r\n\r\n#include \"arduinoFFT.h\"\r\n#include &lt;Wire.h&gt;\r\n#include &lt;VL53L0X.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n \r\n#define SAMPLES 128             \/\/SAMPLES-pt FFT. Must be a base 2 number. Max 128 for Arduino Uno.\r\n#define SAMPLING_FREQUENCY 3000 \/\/Ts = Based on Nyquist, must be 2 times the highest expected frequency.\r\n#define PIEZO_PIN  5      \/\/ Pin connected to the piezo buzzer.\r\n#define LIGHTVALVE 10             \/\/ digital pin connected to the light valve \r\n \r\nVL53L0X sensor;\r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\narduinoFFT FFT = arduinoFFT();\r\n \r\nunsigned int samplingPeriod;\r\nunsigned long microSeconds;\r\nunsigned long previousMillis;\r\n \r\ndouble vReal[SAMPLES]; \/\/create vector of size SAMPLES to hold real values\r\ndouble vImag[SAMPLES]; \/\/create vector of size SAMPLES to hold imaginary values\r\n\r\nint peak; \r\nint LCD_peak; \r\n \r\nvoid setup() \r\n{\r\n  \/\/ FFT setup\r\n  Serial.begin(115200); \/\/Baud rate for the Serial Monitor\r\n  samplingPeriod = round(1000000*(1.0\/SAMPLING_FREQUENCY)); \/\/Period in microseconds \r\n  \r\n  \/\/ TOF distance sensor setup\r\n  delay(100);\r\n  Wire.begin();\r\n\r\n  screen.init();\r\n  screen.backlight();\r\n  screen.home();\r\n\r\n  sensor.setTimeout(500);\r\n  if (!sensor.init())\r\n  {\r\n    Serial.println(\"Failed to detect and initialize sensor!\");\r\n    while (1) {}\r\n  }\r\n  \/\/ Start continuous back-to-back mode (take readings as\r\n  \/\/ fast as possible).  To use continuous timed mode\r\n  \/\/ instead, provide a desired inter-measurement period in\r\n  \/\/ ms (e.g. sensor.startContinuous(100)).\r\n  sensor.startContinuous();\r\n\r\n  previousMillis = millis();\r\n\r\n  peak = 0; \r\n  LCD_peak = 0; \r\n    \r\n}\r\n\r\ndouble fft() \r\n{\r\n  \/*Sample SAMPLES times*\/\r\n    for(int i=0; i&lt;SAMPLES; i++)\r\n    {\r\n        microSeconds = micros();    \/\/Returns the number of microseconds since the Arduino board began running the current script. \r\n     \r\n        vReal[i] = analogRead(0); \/\/Reads the value from analog pin 0 (A0), quantize it and save it as a real term.\r\n        vImag[i] = 0; \/\/Makes imaginary term 0 always\r\n\r\n        \/*remaining wait time between samples if necessary*\/\r\n        while(micros() &lt; (microSeconds + samplingPeriod))\r\n        {\r\n          \/\/do nothing\r\n        }\r\n    }\r\n \r\n    \/*Perform FFT on samples*\/\r\n    FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);\r\n    FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);\r\n    FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);\r\n\r\n    \/*Find peak frequency and print peak*\/\r\n    double new_peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);\r\n    long transparency; \r\n    \r\n    \/\/ print detected frequency to LCD screen. \r\n    if (new_peak &lt; 1000) {\r\n      peak = new_peak; \r\n      LCD_peak = map(peak, 865, 955, 0, 17); \r\n      LCD_peak = constrain(LCD_peak, 0, 17);\r\n      transparency = map(peak, 865, 955, 0, 17);\r\n      \/\/transparency = constrain(transparency, 0, 17);\r\n    } else if (new_peak &gt; 1190 &amp;&amp; new_peak &lt; 1410) {\r\n      peak = new_peak; \r\n      LCD_peak = map(peak, 1190, 1410, 17, 99); \r\n      LCD_peak = constrain(LCD_peak, 17, 99);\r\n      transparency = map(peak, 1190, 1410, 17, 99); \r\n      \/\/transparency = constrain(transparency, 17, 99);\r\n    }\r\n    \/* \r\n    int LCD_peak = map(peak, 850, 1500, 0, 99);\r\n    LCD_peak = constrain(LCD_peak, 0, 99); *\/ \r\n    screen.setCursor(6, 1);\r\n    screen.print(LCD_peak);\r\n    if (transparency &lt; 0) {\r\n      transparency = 0;\r\n    }\r\n    analogWrite(LIGHTVALVE, transparency);\r\n\r\n    int LCD_transparency = map(transparency, 0, 120, 0, 99);\r\n    LCD_transparency = constrain(LCD_transparency, 0, 99);\r\n    screen.setCursor(12, 1);\r\n    screen.print(LCD_peak);\r\n    Serial.print(\"peak frequency: \");\r\n    Serial.println(peak);     \/\/Print out the most dominant frequency.\r\n    Serial.print(\"transparency: \");\r\n    Serial.println(transparency);\r\n}\r\n\r\nvoid buzz()\r\n{\r\n  \/\/ detect distance\r\n  int distance = sensor.readRangeContinuousMillimeters();\r\n\r\n  \/\/ print to LCD screen\r\n  screen.home();\r\n  screen.print(\"i:\");\r\n  \/\/ map distance from 0-100\r\n  long LCD_distance = map(distance, 40, 210, 0, 99);\r\n  LCD_distance = constrain(LCD_distance, 0, 99);\r\n  screen.print(LCD_distance);\r\n  \r\n\r\n  \/\/calculate piezo freq. based on distance\r\n  int frequency; \r\n  if (distance &lt; 85) {\r\n    frequency = map(distance, 40, 85, 290, 295);\r\n    frequency = constrain(frequency, 290, 295);  \r\n  } else {\r\n    frequency = map(distance, 85, 220, 315, 335);\r\n    frequency = constrain(frequency, 315, 335); \r\n  }\r\n  tone(PIEZO_PIN, frequency);\r\n\r\n  \/\/print to LCD screen, column 6 row 0\r\n  screen.setCursor(6, 0);\r\n  screen.print(\"m:\");\r\n\r\n  \/\/ map frequency from 0 - 99;\r\n  int LCD_frequency; \r\n  if (frequency &lt;= 295) {\r\n    LCD_frequency = map(frequency, 290, 295, 0, 17);\r\n    LCD_frequency = constrain(LCD_frequency, 0, 17);\r\n  } else {\r\n    LCD_frequency = map(frequency, 315, 335, 17, 99);\r\n    LCD_frequency = constrain(LCD_frequency, 17, 99);\r\n  }\r\n  screen.print(LCD_frequency);\r\n  if (sensor.timeoutOccurred()) { Serial.print(\" TIMEOUT\"); }\r\n}\r\nvoid loop() \r\n{  \r\n  \/\/ first generate a sound \r\n  buzz();\r\n  \/\/ then read in the frequency \r\n  fft(); \r\n\r\n  \/\/ refresh the screen every half a second. \r\n  unsigned long currentMillis = millis();\r\n  if (currentMillis - previousMillis &gt; 500) {\r\n    screen.clear(); \r\n    previousMillis = currentMillis;\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 1. Overall Images of the Final Product &nbsp; Part 2. Details &nbsp; Part 3. Demonstration Dunn&#8217;s project in action. &nbsp; Mo&#8217;s project in action. &nbsp; Bhairavi&#8217;s project&#8230;<\/p>\n","protected":false},"author":38,"featured_media":17230,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[86],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/17248"}],"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\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/comments?post=17248"}],"version-history":[{"count":27,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/17248\/revisions"}],"predecessor-version":[{"id":17262,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/17248\/revisions\/17262"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/media\/17230"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/media?parent=17248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/categories?post=17248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/tags?post=17248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}