{"id":16103,"date":"2022-09-28T15:14:09","date_gmt":"2022-09-28T19:14:09","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/?p=16103"},"modified":"2022-10-12T15:44:22","modified_gmt":"2022-10-12T19:44:22","slug":"double-transducer-printed-color-to-servo-angle","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/double-transducer-printed-color-to-servo-angle\/","title":{"rendered":"Double Transducer: Printed Color to Servo Angle"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-16170\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p style=\"text-align: left\"><span style=\"font-weight: 400\">Elise Chapman, Remington Frank, Sharon Li, Sarah Yun\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Simple Narrative Description<\/h3>\n<p>The <span class=\"livespell_redwiggle\">machine<\/span> sees the color on the paper <span class=\"livespell_redwiggle\">strip<\/span>, then uses that color to <span class=\"livespell_redwiggle\">extend<\/span> a <span class=\"livespell_redwiggle\">motor<\/span> a <span class=\"livespell_redwiggle\">certain<\/span> <span class=\"livespell_redwiggle\">distance<\/span>. That <span class=\"livespell_redwiggle\">distance<\/span> is <span class=\"livespell_redwiggle\">detected<\/span> and is used to <span class=\"livespell_redwiggle\">angle<\/span> a stick to a <span class=\"livespell_redwiggle\">proportional<\/span> <span class=\"livespell_redwiggle\">degree<\/span>.<\/p>\n<h3><b>Technical Description<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Our double transducer involves the following components: an RGB sensor, a linear actuator, a VL53L0X distance sensor, a servo motor, LCD, and an Arduino Uno. The RGB sensor reads the RGB values of a printed color off of a given gradient sheet. These values are then used to calculate the respective hue (HSV) value for said color. From here, the hue value (range 0 &#8211; 360) is mapped to the time the linear actuator extends (0 &#8211; 3 seconds for full range of motion). The extension of the linear actuator is read as a change in distance by the VL53L0X time of flight distance sensor. The range of the linear actuators extension is zero to two inches, so the time of flight sensor reads a range of zero to two inches as well (approximately 0 &#8211; 50 millimeters). This distance is then mapped to the servo motor\u2019s rotation (with a range of 0 &#8211; 90\u00b0). The LCD display shows all the aforementioned outputs as mapped to a 0 &#8211; 99 range.<\/span><\/p>\n<h3>Final Double Transducers<\/h3>\n<div id=\"attachment_16170\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16170\" loading=\"lazy\" class=\"wp-image-16170 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2292-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16170\" class=\"wp-caption-text\"><em>Elise&#8217;s Double Transducer<\/em><\/p><\/div>\n<div id=\"attachment_16179\" style=\"width: 2190px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16179\" loading=\"lazy\" class=\"wp-image-16179 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-scaled.jpg\" alt=\"\" width=\"2180\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-scaled.jpg 2180w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-255x300.jpg 255w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-872x1024.jpg 872w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-768x902.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-1308x1536.jpg 1308w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-1744x2048.jpg 1744w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-973x1142.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220921_202825-508x596.jpg 508w\" sizes=\"(max-width: 2180px) 100vw, 2180px\" \/><p id=\"caption-attachment-16179\" class=\"wp-caption-text\"><em>Remy&#8217;s Double Transducer\u00a0<\/em><\/p><\/div>\n<div id=\"attachment_16248\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16248\" loading=\"lazy\" class=\"size-full wp-image-16248\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182912-min-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16248\" class=\"wp-caption-text\">Sharon&#8217;s Double Transducer<\/p><\/div>\n<div id=\"attachment_16185\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16185\" loading=\"lazy\" class=\"wp-image-16185 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-scaled.jpg\" alt=\"\" width=\"2560\" height=\"2051\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-300x240.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-1024x820.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-768x615.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-1536x1231.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-2048x1641.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-973x780.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D7727D6B-A74D-4775-AF91-06D1ED3A148E-508x407.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16185\" class=\"wp-caption-text\"><em>Sarah&#8217;s Double Transducer<\/em><\/p><\/div>\n<h3>Detail Photos<\/h3>\n<div id=\"attachment_16171\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16171\" loading=\"lazy\" class=\"wp-image-16171 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2286-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16171\" class=\"wp-caption-text\"><em>Clay is used to prop up the different parts of the double transducer, including suspending the initial color sensor. (Elise)\u00a0<\/em><\/p><\/div>\n<div id=\"attachment_16186\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16186\" loading=\"lazy\" class=\"wp-image-16186 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/A49DEB22-0159-40DD-9205-E81402F0AE66-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16186\" class=\"wp-caption-text\"><em>The tcs34725 color sensor is propped up by an inch, and the color strip is removable (Sarah).<\/em><\/p><\/div>\n<div id=\"attachment_16192\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16192\" loading=\"lazy\" class=\"wp-image-16192 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1257\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-300x147.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-1024x503.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-768x377.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-1536x754.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-2048x1006.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-973x478.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_140217-508x250.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16192\" class=\"wp-caption-text\"><em>The linear actuator is responsible for driving its piston at a distance dependent on the color read by the RGB sensor (Remington).<\/em><\/p><\/div>\n<div id=\"attachment_16247\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16247\" loading=\"lazy\" class=\"size-full wp-image-16247\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220928_182924-min-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16247\" class=\"wp-caption-text\"><em>The final output of our double transducer is the servo motor which has a specific rotational position that ranges from 0 to 90 degrees based on the previous inputs (Sharon).<\/em><\/p><\/div>\n<h3>Working Videos<\/h3>\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-16103-1\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/try1-1.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/try1-1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/try1-1.mp4<\/a><\/video><\/div>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-16103-2\" width=\"620\" height=\"1102\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/double_transdu.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/double_transdu.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/double_transdu.mp4<\/a><\/video><\/div>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-16103-3\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final-1.mp4?_=3\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final-1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final-1.mp4<\/a><\/video><\/div>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-16103-4\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/4_1.mp4?_=4\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/4_1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/4_1.mp4<\/a><\/video><\/div>\n<h3>Process Photos<\/h3>\n<div id=\"attachment_16172\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16172\" loading=\"lazy\" class=\"size-full wp-image-16172\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2225-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-16172\" class=\"wp-caption-text\"><em>At first, we did not have access to a small linear actuator, so we considered using a rack and pinion attached to a motor (Elise).<\/em><\/p><\/div>\n<div id=\"attachment_16173\" style=\"width: 2463px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16173\" loading=\"lazy\" class=\"size-full wp-image-16173\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246.jpg\" alt=\"\" width=\"2453\" height=\"2361\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246.jpg 2453w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-300x289.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-1024x986.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-768x739.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-1536x1478.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-2048x1971.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-973x937.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_2246-508x489.jpg 508w\" sizes=\"(max-width: 2453px) 100vw, 2453px\" \/><p id=\"caption-attachment-16173\" class=\"wp-caption-text\"><em>We were having some trouble getting the laser distance sensor (VL53L0X) to work initially, but I worked with Zach for a bit to get it working (Elise).<\/em><\/p><\/div>\n<div id=\"attachment_16187\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16187\" loading=\"lazy\" class=\"wp-image-16187 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1727\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-300x202.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-1024x691.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-768x518.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-1536x1036.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-2048x1382.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-973x656.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_5620-508x343.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16187\" class=\"wp-caption-text\"><em>We initially started off with Ultrasonic distance sensors but transferred to VL53L0X laser distance sensors (Sarah).<\/em><\/p><\/div>\n<div id=\"attachment_16189\" style=\"width: 1180px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16189\" loading=\"lazy\" class=\"wp-image-16189 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B.jpg\" alt=\"\" width=\"1170\" height=\"1531\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B.jpg 1170w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B-229x300.jpg 229w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B-783x1024.jpg 783w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B-768x1005.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B-973x1273.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/D5AEC9D4-85DE-46AC-AC01-472FF8A38C4B-508x665.jpg 508w\" sizes=\"(max-width: 1170px) 100vw, 1170px\" \/><p id=\"caption-attachment-16189\" class=\"wp-caption-text\"><em>We tested each part individually first before incorporating them into the bigger system (Sarah).<\/em><\/p><\/div>\n<div id=\"attachment_16180\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16180\" loading=\"lazy\" class=\"wp-image-16180 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1508\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-300x177.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-1024x603.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-768x452.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-1536x905.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-2048x1207.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-973x573.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220915_104828-508x299.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16180\" class=\"wp-caption-text\"><em>Attempting to debug the VL53L0X sensor. Using a multimeter to probe the pins to ensure proper connections. The error ended up being the RGB sensor and L0X sensor sharing the same default I2C address (Remington).<\/em><\/p><\/div>\n<div id=\"attachment_16194\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16194\" loading=\"lazy\" class=\"size-full wp-image-16194\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-scaled.jpg\" alt=\"\" width=\"2560\" height=\"2122\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-300x249.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-1024x849.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-768x637.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-1536x1273.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-2048x1698.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-973x807.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/20220920_104435-508x421.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16194\" class=\"wp-caption-text\"><em>Here we swapped the stepper motor (for the rack and pinion system) for a linear actuator to simplify the mechanical process of the system (Remington).<\/em><\/p><\/div>\n<div id=\"attachment_16253\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16253\" loading=\"lazy\" class=\"size-full wp-image-16253\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9299-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-16253\" class=\"wp-caption-text\">All of the individual parts were able to work together but we were not mapping the values in a range from 0 to 99 or the correct format on our LCD display (Sharon).<\/p><\/div>\n<div id=\"attachment_16254\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16254\" loading=\"lazy\" class=\"size-full wp-image-16254\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG_9271-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-16254\" class=\"wp-caption-text\">Switched from the Ultrasonic Ranger to the VL53L0X Sensor where we realized that our soldering negatively affected the functionality and didn\u2019t give us continuous values in the serial output (Sharon).<\/p><\/div>\n<h3>Discussion<\/h3>\n<p><span style=\"font-weight: 400\">Despite the simplicity of this double transducer in concept, its execution was harder than expected\u2013especially its functionality. Although there were many late additions to our team, we were able to help each other solve similar problems and catch one another up (in which Sharon is very grateful and appreciative) in order to build four double transducers in a short period of time.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">For our input, the color sensor was reading the RGB values of the given color strip because that is how computers perceive color, but we had to convert it to HSV color values, which is how humans perceive color. It was an interesting experience to introduce device the way we perceive color in order to give it a singular value input (hue) to work with the linear actuator.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Another problem we encountered that wasn\u2019t an apparent one to us was the correct and neat soldering of our parts, specifically on the theVL53L0X sensor. This ultimately led to many problems when testing the parts individually as well as together as one entity with the other inputs and outputs. We had to make sure that our VL53L0X distance sensor was facing the right direction and that none of the metals bridged between each other. This trial and error process allowed us to understand how important it was to solder carefully and neatly as well as check our schematics beforehand.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Lastly, mapping the values so that each of the parts works cohesively was a struggle. Because there were multiple values being transferred into the next action and another action after that, it was crucial that we map each value to fit the other components&#8217; range in order to make the board functional. We had to initially test the VL53L0X distance sensor to calculate the distance it reads and limit our range to that, then maps that value to a degree the motor arm should move so that we can visually see its change. Although we got it in the end, it required some calculations and test trials to make the entire system work.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">However, overall we were able to get all the aspects working, and our team finished with functional double transducers.<\/span><\/p>\n<h3>Functional Block Diagram and Electrical Schematic<\/h3>\n<div id=\"attachment_16174\" style=\"width: 1870px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16174\" loading=\"lazy\" class=\"size-full wp-image-16174\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM.png\" alt=\"\" width=\"1860\" height=\"998\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM.png 1860w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM-300x161.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM-1024x549.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM-768x412.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM-1536x824.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM-973x522.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-2.20.19-PM-508x273.png 508w\" sizes=\"(max-width: 1860px) 100vw, 1860px\" \/><p id=\"caption-attachment-16174\" class=\"wp-caption-text\">Block Diagram<\/p><\/div>\n<h3><\/h3>\n<div id=\"attachment_16182\" style=\"width: 1283px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16182\" loading=\"lazy\" class=\"wp-image-16182 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1.jpg\" alt=\"\" width=\"1273\" height=\"686\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1.jpg 1273w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1-300x162.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1-1024x552.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1-768x414.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1-973x524.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-1-508x274.jpg 508w\" sizes=\"(max-width: 1273px) 100vw, 1273px\" \/><p id=\"caption-attachment-16182\" class=\"wp-caption-text\"><em>Electrical Schematic<\/em><\/p><\/div>\n<h3>Code<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/*\r\n   Double Transducer: From Printed Color to Servo Motor Rotation\r\n   {Sarah Yun, Elise Chapman, Sharon Li, Remington Frank}\r\n\r\n   The code below processes and translates an input RGB reading from\r\n   a printed color scale to a servo motor rotation (0 - 90\u00b0). It being\r\n   a double transducer, the middle step is a linear actuator that extends\r\n   and has its extension distance then read by a VL53L0x distance sensor.\r\n\r\n   Pin Map:\r\n  Pin | role | Description\r\n ----------------------------------------\r\n   6 | output| VCC input for linear actuator\r\n   7 | input | GND for linear actuator\r\n  9  | output| Servo motor middle pin\r\n SCL | input | SCL pin on VL53L0X sensor\r\n SDA | input | SDA pin on VL53L0X sensor\r\n  A4 | input | SCL pin on I2C LCD display\r\n  A5 | input | SDA pin on I2C LCD display\r\n  5V | output| VL53L0X sensor power\r\n3.3V | output| Power for remaining components\r\n GND | input | Ground for all components\r\n\r\n   RGB Sensor code sourced from the Adafruit TCS34725\r\n   RGB Sensor example code. For further reference,\r\n   refer to the following:\r\n\r\n   https:\/\/learn.adafruit.com\/adafruit-color-sensors\/arduino-code\r\n\r\n   VL53L0X sensor code is sourced from the Pololu library. This\r\n   library can be found at the following link:\r\n\r\n   https:\/\/github.com\/pololu\/vl53l0x-arduino\r\n\r\n   Conversion from RGB to HSV values makes use of an algorithm sourced from:\r\n\r\n   https:\/\/www.rapidtables.com\/convert\/color\/rgb-to-hsv.html\r\n\r\n   This has also been done as shown on the GeeksForGeeks site, which our\r\n   code is very akin (identical) to:\r\n\r\n   https:\/\/www.geeksforgeeks.org\/program-change-rgb-color-model-hsv-color-model\/\r\n   All credit is due to the above for the respective sections mentioned.\r\n\r\n*\/\r\n\r\n#include &lt;Wire.h&gt;\r\n#include \"Adafruit_TCS34725.h\"\r\n#include &lt;Servo.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n#include &lt;Wire.h&gt;\r\n#include &lt;VL53L0X.h&gt;\r\n\r\nVL53L0X sensor;\r\n\/* Initialise with default values (int time = 2.4ms, gain = 1x) *\/\r\n\/\/ Adafruit_TCS34725 tcs = Adafruit_TCS34725();\r\n\r\n\/* Initialise with specific int time and gain values *\/\r\nAdafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_614MS, TCS34725_GAIN_1X);\r\nServo myServo;\r\nLiquidCrystal_I2C lcd(0x27, 16, 2);\r\n\r\nconst int SERV = 9;\r\nint FWD = 6;\r\nint REV = 7;\r\n\r\n\/\/ Initialize evaluation criteria and other values\r\n\r\ndouble hue, saturation, value;\r\nlong duration;\r\ndouble distance;\r\n\r\nfloat prevRunTime;\r\nfloat runTime;\r\n\r\nunsigned long trueTime;\r\nunsigned long currTime;\r\nunsigned long delayTime;\r\nunsigned long printTime;\r\n\r\nint turn;\r\nint prevTurn;\r\nint counter;\r\n\r\nint h_print;\r\nint la_print;\r\nint dist_print;\r\nint s_print;\r\n\r\nbool printer = 1;\r\n\r\nvoid setup(void) {\r\n  Serial.begin(115200);\r\n  Wire.begin();\r\n\r\n  lcd.begin();\r\n  lcd.backlight();\r\n\r\n  bool start = 1;\r\n\r\n  \/\/ Begin color sensing sensor\r\n  if (tcs.begin()) {\r\n    Serial.println(\"Found sensor\");\r\n  } else {\r\n    Serial.println(\"No TCS34725 found ... check your connections\");\r\n    while (1);\r\n  }\r\n\r\n  \/\/ Initilize pin modes\r\n  pinMode(trigPin, OUTPUT);\r\n  pinMode(echoPin, INPUT);\r\n\r\n  pinMode(FWD, OUTPUT);\r\n  pinMode(REV, OUTPUT);\r\n\r\n  digitalWrite(FWD, LOW);\r\n  digitalWrite(REV, HIGH);\r\n  delay(3000);\r\n\r\n  myServo.attach(SERV);\r\n\r\n  sensor.setAddress(0x52);\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\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\r\nvoid loop(void) {\r\n  trueTime = millis();\r\n  \r\n  uint16_t r, g, b, c, colorTemp, lux;\r\n\r\n  \/\/ Gather various color data from RGB sensor\r\n  tcs.getRawData(&amp;r, &amp;g, &amp;b, &amp;c);\r\n  \/\/ colorTemp = tcs.calculateColorTemperature(r, g, b);\r\n  colorTemp = tcs.calculateColorTemperature_dn40(r, g, b, c);\r\n  lux = tcs.calculateLux(r, g, b);\r\n\r\n  Serial.print(\"Color Temp: \"); Serial.print(colorTemp, DEC); Serial.print(\" K - \");\r\n  Serial.print(\"Lux: \"); Serial.print(lux, DEC); Serial.print(\" - \");\r\n  Serial.print(\"R: \"); Serial.print(r, DEC); Serial.print(\" \");\r\n  Serial.print(\"G: \"); Serial.print(g, DEC); Serial.print(\" \");\r\n  Serial.print(\"B: \"); Serial.print(b, DEC); Serial.print(\" \");\r\n  Serial.print(\"C: \"); Serial.print(c, DEC); Serial.print(\" \");\r\n  Serial.println(\" \");\r\n\r\n  \/\/ RGB to HSV conversion\r\n  double rWeight = r \/ 65535.0;\r\n  double gWeight = g \/ 65535.0;\r\n  double bWeight = b \/ 65535.0;\r\n\r\n  Serial.println(\"Red Weight: \"); Serial.print(rWeight); Serial.println(\" \");\r\n\r\n  \/\/ RGB to HSV algorithm\r\n  double cmax = max(rWeight, max(gWeight, bWeight)); \/\/ maximum of r, g, b\r\n  double cmin = min(rWeight, min(gWeight, bWeight)); \/\/ minimum of r, g, b\r\n  double diff = cmax - cmin; \/\/ diff of cmax and cmin.\r\n  double h = -1;\r\n\r\n  \/\/ if cmax and cmax are equal then h = 0\r\n  if (cmax == cmin) {\r\n    h = 0;\r\n  }\r\n\r\n  \/\/ if cmax equal r then compute h\r\n  else if (cmax == rWeight) {\r\n    h = fmod(60 * ((gWeight - bWeight) \/ diff) + 360, 360);\r\n  }\r\n\r\n  \/\/ if cmax equal g then compute h\r\n  else if (cmax == gWeight) {\r\n    h = fmod(60 * ((bWeight - rWeight) \/ diff) + 120, 360);\r\n  }\r\n\r\n  \/\/ if cmax equal b then compute h\r\n  else if (cmax == bWeight) {\r\n    h = fmod(60 * ((rWeight - gWeight) \/ diff) + 240, 360);\r\n  }\r\n\r\n  Serial.println(\" \");\r\n  Serial.print(\"Hue: \"); Serial.print(h); Serial.print(\" \");\r\n  Serial.println(\" \");\r\n  \/\/--------------------------------------------------------------------------------------------------------\r\n\r\n  \/\/ Map Hue value to linear actuator distance extended. Linear actuator has an operating time\r\n  \/\/ range of 0 to 3 seconds, hence the mapping to 0 to 3000 milliseconds.\r\n  \r\n  runTime = map(h, 0, 360, 0, 3000);\r\n\r\n  if(runTime &gt; prevRunTime) {\r\n    digitalWrite(FWD, HIGH);\r\n    digitalWrite(REV, LOW);\r\n    delay(runTime - prevRunTime);\r\n  } \r\n  else if (runTime &lt; prevRunTime){\r\n    digitalWrite(FWD, LOW);\r\n    digitalWrite(REV, HIGH);\r\n    delay(prevRunTime - runTime);\r\n  }\r\n\r\n  prevRunTime = runTime;\r\n  digitalWrite(FWD, LOW);\r\n  digitalWrite(REV, LOW);\r\n\r\n  \/\/--------------------------------------------------------------------------------------------------------\r\n  \/\/ Read distance extended of linear actuator by the time of flight sensor\r\n  \r\n  distance = sensor.readRangeContinuousMillimeters() - 63;\r\n  Serial.print(distance);\r\n  if (sensor.timeoutOccurred()) { Serial.print(\" TIMEOUT\"); }\r\n\r\n  Serial.println();\r\n  \/\/--------------------------------------------------------------------------------------------------------\r\n  \/\/ Map distance detected into 90\u00b0 rotation of servo\r\n\r\n  turn = map(distance, 0, 50, 0, 90);\r\n  if(turn &gt; 90) turn = 90;\r\n  myServo.write(turn);\r\n\r\n  \/\/--------------------------------------------------------------------------------------------------------\r\n  \/\/ Print inputs and outputs to LCD display\r\n\r\n  h_print = map(h, 0, 360, 0, 99);\r\n  la_print = map(runTime, 0, 3000, 0, 99);\r\n  dist_print = map(distance, 0, 50, 0, 99);\r\n  s_print = map(turn, 0, 90, 0, 99);\r\n\r\n  \/\/ Update the LCD display every 250 milliseconds (4 times per second)\r\n  if(trueTime - printTime &gt;= 250){\r\n    lcd.home();\r\n    lcd.print(String(\"i:\") + String(int(h_print)));\r\n    lcd.setCursor(6,0);\r\n    lcd.print(String(\"m:\") + String(la_print));\r\n    lcd.setCursor(8, 1);\r\n    lcd.print(String(dist_print));\r\n    lcd.setCursor(12, 1);\r\n    lcd.print(String(\"o:\") + String(s_print)); \r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elise Chapman, Remington Frank, Sharon Li, Sarah Yun\u00a0 &nbsp; Simple Narrative Description The machine sees the color on the paper strip, then uses that color to extend a&#8230;<\/p>\n","protected":false},"author":232,"featured_media":16319,"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\/f2022\/work\/wp-json\/wp\/v2\/posts\/16103"}],"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\/232"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/comments?post=16103"}],"version-history":[{"count":28,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16103\/revisions"}],"predecessor-version":[{"id":16340,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16103\/revisions\/16340"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media\/16319"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media?parent=16103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/categories?post=16103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/tags?post=16103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}