{"id":17111,"date":"2023-02-14T15:13:11","date_gmt":"2023-02-14T20:13:11","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/?p=17111"},"modified":"2023-02-14T15:14:15","modified_gmt":"2023-02-14T20:14:15","slug":"double-transducer-light-color-to-sound-pitch","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/double-transducer-light-color-to-sound-pitch\/","title":{"rendered":"Double Transducer: Light Color to Sound Pitch"},"content":{"rendered":"<div id=\"attachment_17173\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17173\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17173 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1.jpg\" alt=\"\" width=\"2016\" height=\"1511\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1-1024x767.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1-1536x1151.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1-973x729.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/j1-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17173\" class=\"wp-caption-text\">Juhi&#8217;s Double Transducer<\/p><\/div>\n<div id=\"attachment_17174\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17174\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17174 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1.jpg\" alt=\"\" width=\"2016\" height=\"1511\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1-1024x767.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1-1536x1151.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1-973x729.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/a1-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17174\" class=\"wp-caption-text\">Andres&#8217;s Double Transducer<\/p><\/div>\n<h3>Detail Photos<\/h3>\n<div id=\"attachment_17180\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17180\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17180 size-full\" style=\"font-size: 16px\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945.jpg\" alt=\"\" width=\"2016\" height=\"1512\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7945-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17180\" class=\"wp-caption-text\">The Adafruit TCS34725 RGB color sensor is propped up by an inch to align with the output of the other team and receive the input.<\/p><\/div>\n<div id=\"attachment_17178\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17178\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17178 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949.jpg\" alt=\"\" width=\"2016\" height=\"1512\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7949-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17178\" class=\"wp-caption-text\">Close up of the wiring we did to connect the Arduino to different sub-systems of the double transducer project.<\/p><\/div>\n<div id=\"attachment_17177\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17177\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17177 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950.jpg\" alt=\"\" width=\"2016\" height=\"1512\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7950-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17177\" class=\"wp-caption-text\">The linear actuator is responsible for extending and retracting the rubber band (i.e. the lever mechanism) dependent on the color read by the RGB sensor.<\/p><\/div>\n<div id=\"attachment_17176\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17176\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17176 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951.jpg\" alt=\"\" width=\"2016\" height=\"1512\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7951-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17176\" class=\"wp-caption-text\">Close up of the middle step. The force sensor is supported by a wall and is being pushed by the lever pivoted on a stand, which is moved by the linear actuator.<\/p><\/div>\n<div id=\"attachment_17179\" style=\"width: 2026px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17179\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17179 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948.jpg\" alt=\"\" width=\"2016\" height=\"1512\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948.jpg 2016w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG_7948-508x381.jpg 508w\" sizes=\"(max-width: 2016px) 100vw, 2016px\" \/><p id=\"caption-attachment-17179\" class=\"wp-caption-text\">The output i.e. the speaker that varied the sound pitch (from 200Hz to 2000 Hz) according to the amount of force received by the force sensor. (In the color spectrum red being the lowest to purple being the highest)<\/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-17111-1\" width=\"620\" height=\"1102\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-17111-2\" width=\"620\" height=\"1102\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled-1-1.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled-1-1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Untitled-1-1.mp4<\/a><\/video><\/div>\n<h3>Narrative Description<\/h3>\n<p>The machine sees the color emitted by LED, then uses the color value to expand or compress a motor which moves a lever mechanism. The force exerted by the lever mechanism is detected by a senor and is used to change the pitch of a speaker.<\/p>\n<h3>Progress Images<\/h3>\n<div id=\"attachment_17200\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17200\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17200 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2258-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-17200\" class=\"wp-caption-text\">At first, we tested out all our inputs and output individually to see whether they were working or not (Juhi)<\/p><\/div>\n<div id=\"attachment_17199\" style=\"width: 1104px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17199\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17199 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d.jpg\" alt=\"\" width=\"1094\" height=\"1211\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d.jpg 1094w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d-271x300.jpg 271w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d-925x1024.jpg 925w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d-768x850.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d-973x1077.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/8a5f2bf5-9bfc-4bd4-99ba-ecb21c23569d-508x562.jpg 508w\" sizes=\"(max-width: 1094px) 100vw, 1094px\" \/><p id=\"caption-attachment-17199\" class=\"wp-caption-text\">Once we had all our elements, we were experimenting with the linear actuator and its position in terms of the range we set in relation to the color spectrum (Juhi)<\/p><\/div>\n<div id=\"attachment_17204\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17204\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17204 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-8935-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-17204\" class=\"wp-caption-text\">To connect our parts in relation to the other we had to solder a few things (Andres)<\/p><\/div>\n<div id=\"attachment_17203\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-17203\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-17203 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/IMG-2310-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-17203\" class=\"wp-caption-text\">To create our middle step we were experimenting with different types of lever mechanisms that would suit our transducer (Andres)<\/p><\/div>\n<h3>Discussion<\/h3>\n<p><span style=\"font-weight: 400\">Our double transducer project, while educational, was filled with unexpected challenges. We faced many throughout the project, but the biggest were converting the RGB input signal form into a usable scale, controlling the linear actuator, and coding in general. To start with the RGB adafruit color sensor, depending on the color it \u2018sees\u2019 it outputs a RGB value to the arduino; however, we needed to convert this to a linear scale to control the linear actuator. We did this by transforming from the RGB domain to the \u2018HSL\u2019 domain where H or hue can be used to put colors on a linear scale from 0 to 360. But, not knowing anything about colors before this project, we had to do research online, speak to the professor and the TA to not only understand how to do this but understand that this was even an option. Moving on to controlling the linear actuator, as it doesn\u2019t have an integrated control, or position controller, we had to figure out how to not only determine position but control that position using time passed and an experimentally determined rate of speed. As neither of us knew a lot about code, we had to once again conduct outside research and learn what and how to use an open loop controller which was extremely helpful in controlling both the actuator, and updates on the I2C screen. Finally, we made bug fixing our code much more challenging than it had to be. This is because we began putting things together before we had debugged each individual piece. Meaning errors propagated throughout the system that could have been fixed piecemeal if we had done more rigorous testing early on. For example, we connected the color sensor to the actuator early on and when the actuator didn\u2019t output the correct distance, I was sure that it was because I mapped the hue incorrectly when actually it was because I was incorrectly controlling the non-feedback actuator.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Being open to change and adapting original ideas was also, in my opinion, one of the most significant and positive parts of our creation process. For instance, when we started, I was sure that a spring was the only way to go in regards to attaching the actuator to the FSR sensor, but through testing we realized a spring added unneeded complexity that just using a weak rubber band would fix. Another thing we had to be open to changing was how to transmit the force to the FSR sensor. Because it only senses compression, at first we weren\u2019t sure of the best way to switch the tension force we were getting from the actuator to compression. We solved this issue by meeting, talking, and listing out ideas before deciding that a simple lever as seen above was the best solution. Finally on things we would have changed if there was more time, two come to mind. The first is changing from a 4 inch extending actuator to a 2 inch as the extra distance only added error to our conversion that a smaller range would have solved. The second is further research into how the Adafruit color sensor works. Because much of the code was based on examples provided by the downloaded library, we were using features and commands that we weren&#8217;t 100% certain of their purpose. Because of this, things that we could have changed or adjusted for more ease of use were taken as set in stone. For instance, the sensor has an optional white LED to make colors clearer to the sensor, but since our input was from a LED itself, for us this was unnecessary. However, we weren\u2019t aware it could be turned off and the glare it caused, created problems we had to work around that had an extremely easy fix.<\/span><\/p>\n<p><span style=\"font-weight: 400\">As a group some of the biggest lessons we learned from this project was to avoid unnecessary stress and take things one step at a time. I think we were worried about succeeding 100% in everything we set out to do, which is good, but not to the point of frustration. Every part had value and even if we didn\u2019t succeed completely the learning is more important than success. The other thing we hope to take away from this into project two is while these electronics combine into one system, they are composed of many different individual components. If there is a problem it is most likely in one of these subsystems and the best practice is to start at the beginning and move up when testing.<\/span><\/p>\n<h3>Block and Schematic Diagram<\/h3>\n<h3><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Idea-3_-spring-Block_electrical.drawio.svg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-17208\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-content\/uploads\/2023\/02\/Idea-3_-spring-Block_electrical.drawio.svg\" alt=\"\" width=\"1387\" height=\"1752\" \/><\/a><\/h3>\n<p>&nbsp;<\/p>\n<h3>Code<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/* Double transducer: From light color to sound pitch\r\n   {Andres Montemayor, Juhi Kedia}\r\n\r\n   The code below processes and translates an input RGB reading\r\n   from LED lights to a speaker pitch (200Hz to 2000Hz). The \r\n   middle step for the double transducer is a liner actuator\r\n   that extends and contracts according to the RGB color sensor\r\n   reading and pushes along a force sensing resistor according to \r\n   the color spectrum (red being the lowest and violet being the hightest).\r\n\r\n  Pin Map:\r\n  pin        | mode   | description\r\n\r\n  FSR_pin    | input  | LED\r\n  MOTORCONT1 | output | potentiometer: sets blink rate\r\n  MOTORCONT2 | output | pushbutton: affect blink rate\r\n  SPEAKER    | output | tone from 200 Hz to 2000 Hz based on FSR reading\r\n  SQL      | OUTPUT\/INPUT | SCREEN and ADAFRUIT go in here\r\n  SDA      | OUTPUT\/INPUT | SCREEN and ADAFRUIT go in here\r\n\r\n  RGB sensor code sourced from adafruit Color control\r\n  Used example code from adafuit library 'color view' and code linked below to write this:\r\n  https:\/\/www.geeksforgeeks.org\/program-change-rgb-color-model-hsv-color-model\/\r\n\r\n  Conversion from RGB to HSV values makes use of an algorithm sourced from:\r\n  https:\/\/www.rapidtables.com\/convert\/color\/rgb-to-hsv.html\r\n*\/\r\n\r\n\r\n\/*\r\n   have Working: adafruit color sensor, force sensor, speaker\r\n   in progress: done test on board\r\n*\/\r\n\r\n\r\n#include &lt;Wire.h&gt;\r\n#include \"Adafruit_TCS34725.h\"\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n\r\n\/\/ set to false if using a common cathode LED\r\n#define commonAnode true\r\n\r\n\/\/ our RGB -&gt; eye-recognized gamma color\r\nbyte gammatable[256];\r\n\r\nAdafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);\r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\n\r\n\/\/ rename pins\r\nconst int FSR_pin = A0;\r\nconst int MOTORCONT1 = 10;\r\nconst int MOTORCONT2 = 11;\r\nconst int SPEAKER = 2;\r\n\r\n\/\/ Set variables for use throughout code\r\nfloat posPast;\r\ndouble travelTime;\r\nfloat stopTime;\r\nint swtch = 0;\r\nfloat hPast = 0;\r\nint swtch2 = 1;\r\nunsigned int timer = 250;\r\n\r\n\r\nvoid setup() {\r\n  pinMode(FSR_pin, INPUT);\r\n  pinMode(MOTORCONT1, OUTPUT);\r\n  pinMode(MOTORCONT2, OUTPUT);\r\n  pinMode(SPEAKER, OUTPUT);\r\n  pinMode(A3, INPUT);\r\n  screen.init();\r\n  screen.backlight();\r\n  Serial.begin(9600);\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 sensor\");\r\n  }\r\n  extend();\r\n  delay(3000);\r\n  stop();\r\n}\r\n\r\n\/\/ extends the linear actuator\r\nvoid extend() {\r\n  digitalWrite(MOTORCONT2, LOW);\r\n  digitalWrite(MOTORCONT1, HIGH);\r\n}\r\n\/\/ returns the linear actuator\r\nvoid retract() {\r\n  digitalWrite(MOTORCONT2, HIGH);\r\n  digitalWrite(MOTORCONT1, LOW);\r\n}\r\n\r\n\/\/stops the linear actuator\r\nvoid stop() {\r\n  digitalWrite(MOTORCONT1, LOW);\r\n  digitalWrite(MOTORCONT2, LOW);\r\n}\r\n\r\nvoid loop() {\r\n\r\n  \/*\r\n  \/\/read a pot val was used for testing\r\n  int potVal = 0;\r\n  \/\/do the read and store the value into potVal\r\n  potVal = analogRead(A3);\r\n\r\n  \/\/send potVal's value back to computer\r\n  *\/\r\n\r\n  \/\/FSR control\r\n  int fsrReading = analogRead(FSR_pin);\r\n  \/\/Serial.println(fsrReading);\r\n  \/\/ this done input of fsrReading tells force on sensor 0 -&gt; 1023... might need to adjust if too much force being put on\r\n  \/\/ can just change spring as well\r\n\r\n  uint16_t r, g, b, c;\r\n  double h = 0;\r\n  \/\/ Gather various color data from RGB sensor\r\n  tcs.getRawData(&amp;r, &amp;g, &amp;b, &amp;c);\r\n\r\n  \/\/ RGB to HSV\r\n  float rNew = r \/ 65535.0;\r\n  float gNew = g \/ 65535.0;\r\n  float bNew = b \/ 65535.0;\r\n  \/\/ RGB to HSV algorithm\r\n  float cmax = max(rNew, max(gNew, bNew));  \/\/ maximum of r, g, b\r\n  float cmin = min(rNew, min(gNew, bNew));  \/\/ minimum of r, g, b\r\n  float diff = cmax - cmin;                 \/\/ diff of cmax and cmin.\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  \/\/ if cmax equal r then compute h\r\n  else if (cmax == rNew) {\r\n    h = fmod(60 * ((gNew - bNew) \/ diff) + 360, 360);\r\n  }\r\n  \/\/ if cmax equal g then compute h\r\n  else if (cmax == gNew) {\r\n    h = fmod(60 * ((bNew - rNew) \/ diff) + 120, 360);\r\n  }\r\n  \/\/ if cmax equal b then compute h\r\n  else if (cmax == bNew) {\r\n    h = fmod(60 * ((rNew - gNew) \/ diff) + 240, 360);\r\n  }\r\n  Serial.print(\"Hue: \");\r\n  Serial.println(h);\r\n\r\n  \/\/end color control h: 0 -&gt; 360 red -&gt; purple\r\n\r\n  \/\/motor control\r\n  int travelTime = map(h, 0, 360, 0, 3000);\r\n  int posNew = map(h, 0, 360, 0, 100);\r\n  \/\/int posNew = potValMap;\r\n\r\n\r\n  if (abs(posNew - posPast) &gt; 5) {\r\n\r\n    if (swtch == 0) {\r\n      float travelProportion = abs(posNew - posPast) \/ 100;\r\n      stopTime = millis() + (travelTime * travelProportion);\r\n      swtch = 1;\r\n    }\r\n    \/\/Serial.println(\"Need to move\");\r\n\r\n    if (stopTime &lt; millis()) {\r\n      stop();\r\n      posPast = posNew;\r\n      swtch = 0;\r\n    }\r\n    if (posNew &lt; posPast) {\r\n      retract();\r\n      Serial.println(\"retract\");\r\n    }\r\n    if (posNew &gt; posPast) {\r\n      extend();\r\n      Serial.println(\"extend\");\r\n    }\r\n  }\r\n\r\n  \/*\r\n  Serial.print(\"PosNew: \");\r\n  Serial.println(posNew);\r\n  Serial.print(\"posPast: \");\r\n  Serial.println(posPast);\r\n  *\/\r\n\r\n  \/\/speaker control\r\n  int pitch = map(fsrReading, 0, 1023, 200, 2000);  \/\/dropped from 1023 to 900 because sensor wasn't reaching max\r\n  \/\/Serial.println(\"pitch: \");\r\n  \/\/Serial.println(pitch);\r\n  tone(SPEAKER, pitch, 0);  \/\/(pin, frequency, delay between tones: should be 0)\r\n\r\n\r\n  \/\/lcd screen\r\n  \/\/only want to update every quarter of a second so made swtch2 to do that\r\n  if (swtch2 == 1) {\r\n    Serial.println(\"screen update\");\r\n    screen.clear();\r\n    screen.home();\r\n    screen.print(\"i:\");\r\n    int hPrint = map(h, 0, 360, 0, 99);\r\n    screen.print(hPrint);\r\n    screen.setCursor(6, 0);\r\n    screen.print(\"m:\");\r\n    screen.print(posNew);\r\n    screen.setCursor(8, 1);\r\n    int fsrPrint = map(fsrReading, 0, 1023, 0, 99);\r\n    screen.print(fsrPrint);\r\n    screen.setCursor(12, 1);\r\n    screen.print(\"o:\");\r\n    int pitchPrint = map(pitch, 200, 2000, 0, 99);\r\n    screen.print(pitchPrint);\r\n    swtch2 = 0;\r\n  }\r\n\r\n  if (millis() &gt;= timer) {\r\n    swtch2 = 1;\r\n    timer += 200;\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Detail Photos Working Videos &nbsp; Narrative Description The machine sees the color emitted by LED, then uses the color value to expand or compress a motor which moves&#8230;<\/p>\n","protected":false},"author":35,"featured_media":17163,"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\/17111"}],"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\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/comments?post=17111"}],"version-history":[{"count":7,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/17111\/revisions"}],"predecessor-version":[{"id":17330,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/posts\/17111\/revisions\/17330"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/media\/17163"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/media?parent=17111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/categories?post=17111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2023\/work\/wp-json\/wp\/v2\/tags?post=17111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}