{"id":16149,"date":"2022-09-28T21:38:32","date_gmt":"2022-09-29T01:38:32","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/?p=16149"},"modified":"2022-09-28T21:38:32","modified_gmt":"2022-09-29T01:38:32","slug":"double-transducer-rotational-position-to-height-of-index-card","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/double-transducer-rotational-position-to-height-of-index-card\/","title":{"rendered":"Double Transducer: Rotational Position to Height of Index Card"},"content":{"rendered":"<p style=\"text-align: center\">Ethan Hu &amp; Francesca Menendez<\/p>\n<h2 style=\"text-align: center\">Simple Narrative Description:<\/h2>\n<p><span style=\"font-weight: 400\">When a knob is turned, a fan blows wind faster or slower accordingly, which then activates an airflow sensor. This then makes an index card move up and down.<\/span><\/p>\n<h2 style=\"text-align: center\">Technical Description:<\/h2>\n<p><span style=\"font-weight: 400\">Our double transducer consists of a potentiometer, DC fan, servo motor, wind sensor, and an Arduino to change the height of an index card according to the rotational position of the potentiometer. To achieve this, we first took the analog input of the potentiometer and translated that into a PWM signal which was then sent to a MOSFET that controls the RPM of the fan. Placed in front of the fan, we had our wind sensor taking measurements of the wind speed created by the fan, which was then processed through a series of calculations to determine an output value to the servo motor that then moves the index card vertically.<\/span><\/p>\n<h2 style=\"text-align: center\">Final Double Transducers:<\/h2>\n<div id=\"attachment_16238\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16238\" loading=\"lazy\" class=\"size-large wp-image-16238\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-1024x768.jpg\" alt=\"\" width=\"620\" height=\"465\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2577-508x381.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16238\" class=\"wp-caption-text\">Board 1<\/p><\/div>\n<div id=\"attachment_16239\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16239\" loading=\"lazy\" class=\"size-large wp-image-16239\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-1024x768.jpg\" alt=\"\" width=\"620\" height=\"465\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2591-2-508x381.jpg 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16239\" class=\"wp-caption-text\">Board 2<\/p><\/div>\n<h2 style=\"text-align: center\">Detailed Photos:<\/h2>\n<div id=\"attachment_16202\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16202\" loading=\"lazy\" class=\"wp-image-16202 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-1024x768.png\" alt=\"\" width=\"620\" height=\"465\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-2048x1536.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-1-e1664411202770-508x381.png 508w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16202\" class=\"wp-caption-text\">MOSFET + Soldering<\/p><\/div>\n<div id=\"attachment_16203\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16203\" loading=\"lazy\" class=\"wp-image-16203 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-2-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16203\" class=\"wp-caption-text\">Moving the Index Card using Servo Motor<\/p><\/div>\n<div class=\"mceTemp\"><\/div>\n<div id=\"attachment_16205\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16205\" loading=\"lazy\" class=\"wp-image-16205 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-4-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16205\" class=\"wp-caption-text\">Fan + Airflow Sensor<\/p><\/div>\n<div id=\"attachment_16204\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16204\" loading=\"lazy\" class=\"wp-image-16204 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/detail-3-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16204\" class=\"wp-caption-text\">Potentiometer Input<\/p><\/div>\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-16149-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\/IMG-2595.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2595.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2595.mp4<\/a><\/video><\/div>\n<h2 style=\"text-align: center\"><strong>Discussion<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">The easiest part of our project was coming up with the idea. Using the requirements given to us &#8211; rotational position to the movement of an index card, we thought it would be interesting &#8211; albeit ridiculous &#8211; to use a fan blowing wind into a wind sensor (which neither of us had used before) to then make an index card move up and down using a servo motor. Beyond the simple initial ideation, we ran into lots of issues while building that required us to constantly recheck our work and debug, but ultimately worked when added to the chain of devices other students made.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Because we were working with varied voltages &#8211; 5V, 12V, 9V &#8211; we had to be especially careful when connecting to laptops and adding power. And though we did spend a lot of time testing each part of our device, we still ended up burning one servo motor and having to replace it due to connecting power sources incorrectly. Once we smelled the smoke, we were able to backtrack and fix the issue. However, we still faced a series of issues that continued to be problematic even when presenting our final devices. For example, the potentiometer could only read a specific range of values and if it would go under or over the threshold (500-900), it would completely freeze and only when back in the correct range, would begin working again as expected. Due to this potentiometer issue, we also found that the wind sensor could now only sense wind speed from 4-8 mph) and, because it was integer mapped, it could only move to 5 positions total, making it clunky when moving. However, we were able to fix this problem by multiplying our values by 10 so that, for example, instead of reading 5.5 mph, it can be read as 55, 60, etc. and, because it is an integer, it can be read more easily. Additionally, we faced some challenges in getting the LCD display to work properly, but by going through our code multiple times, we were able to solve the problem, although it still cannot read any value outside of the range created by the potentiometer problem. While we were able to get the first board working mostly as we expected, the second board, due to not testing the MOSFET before soldering it, the soldering might be one reason as to why it is not working as we would like it to.<\/span><\/p>\n<p><span style=\"font-weight: 400\">While we did face a lot of challenges in building our two boards, we spent a lot of time using the multimeter testing different parts of our device and learned a lot about how to deal with issues that may arise in future projects. We especially learned how important it is to check power sources before connecting them so that nothing goes wrong. It was also especially interesting to learn about MOSFET and the possibilities in redirecting different voltages to avoid anything getting too much voltage. If given the opportunity to do this project again, we would take the time to test the MOSFET before soldering to make sure the second board works as planned and, if given time, we would figure out how to solve the potentiometer issue with range. Ultimately, despite the issues, our two devices reflect the time we put into working and reworking most things on the boards.<\/span><\/p>\n<h2 style=\"text-align: center\"><strong>\u00a0Process Images<\/strong><\/h2>\n<div id=\"attachment_16214\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16214\" loading=\"lazy\" class=\"wp-image-16214 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-3-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16214\" class=\"wp-caption-text\">Testing Fan Action<\/p><\/div>\n<div id=\"attachment_16215\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16215\" loading=\"lazy\" class=\"wp-image-16215 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-2-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16215\" class=\"wp-caption-text\">Testing mosFET after Fan Failure<\/p><\/div>\n<div id=\"attachment_16216\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16216\" loading=\"lazy\" class=\"wp-image-16216 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-1-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16216\" class=\"wp-caption-text\">Airflow Sensor Coding<\/p><\/div>\n<div id=\"attachment_16213\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16213\" loading=\"lazy\" class=\"size-large wp-image-16213\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-768x1024.jpg\" alt=\"\" width=\"620\" height=\"827\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/process-4-scaled.jpg 1920w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16213\" class=\"wp-caption-text\">Testing 12V Power Source<\/p><\/div>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-16149-2\" 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\/IMG-2653.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2653.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/IMG-2653.mp4<\/a><\/video><\/div>\n<h2 style=\"text-align: center\"><strong>Functional Block Diagram &amp; Schematic<\/strong><\/h2>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-16229 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-1024x376.jpg\" alt=\"\" width=\"620\" height=\"228\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-1024x376.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-300x110.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-768x282.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-1536x564.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-973x358.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248-508x187.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/89248.jpg 1600w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<div id=\"attachment_16222\" style=\"width: 630px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-16222\" loading=\"lazy\" class=\"wp-image-16222 size-large\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214-1024x749.png\" alt=\"\" width=\"620\" height=\"453\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214-1024x749.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214-300x220.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214-768x562.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214-973x712.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214-508x372.png 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-205214.png 1338w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><p id=\"caption-attachment-16222\" class=\"wp-caption-text\">Electrical Schematic<\/p><\/div>\n<p style=\"text-align: center\"><strong>Code<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/*Copyright &lt;2022&gt; &lt;Ethan Hu, Francesca Menendez&gt;\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n*\/\r\n\r\n\/*Double transducer: Rotational position to the height of an index card.\r\nEthan Hu &amp; Francesca Menendez\r\n\r\n\r\n\r\n1. Take the input of the potentiometer\r\n2. Output signal to the MOSFET, which will control the fan speed.\r\n3. Take the input from the Wind Sensor.\r\n4. Sent PWM signal to the Servo to adjust the height of the index card.\r\n\r\npin mapping:\r\n\r\nArduino pin \/ role  \/  description\r\n A0           input    Wind speed input from the wind sensor\r\n A2           input    Temperature input from the wind sensor\r\n A5           input    Initial potentiometer input\r\n 6            output   Signal to the MOSFET to control the fan speed\r\n 7            output   PWM signal to the servo moter\r\n\r\n*\/\r\n\r\n#include &lt;Servo.h&gt;\r\n#include &lt;Wire.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n\r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\nServo smotor;\r\n\r\nint potVal = 0;\r\nint wind = 0;\r\nint temp = 0;\r\nint fanIn = 0;\r\nint motorIn = 0;\r\n\r\nvoid setup() {\r\n  Serial.begin(9600);\r\n  pinMode(6,OUTPUT);\r\n  smotor.attach(5);\r\n  Wire.begin();\r\n  screen.init();\r\n  screen.backlight();\r\n  screen.home();\r\n  screen.print(\"It's working!\");\r\n  delay(1000);\r\n}\r\n\r\nvoid loop() {\r\n  int time = millis();\r\n  \/\/initial input from the potentiometer\r\n  potVal = analogRead(A5);\r\n  \r\n  \/\/the input that the fan is taking in\r\n  fanIn = map(potVal, 0, 1023, 0, 255);\r\n  analogWrite(6,fanIn);\r\n  \r\n  \/\/direct and processed information from the wind sensor\r\n  wind = analogRead(A0);\r\n  float windMPH = pow((((float)wind - 264.0) \/ 85.6814), 3.36814);\r\n  \r\n  \/\/input send out to the servo\r\n  motorIn = map(windMPH*10,0,80,0,180);\r\n  \r\n  \/\/motor set to execute input every quarter of a second\r\n  if (time % 250 == 0){\r\n     smotor.write(motorIn);\r\n  }\r\n  \r\n  \/\/LCD screen\/serial monitor update data every half of a second\r\n  if (time % 250 == 0){\r\n    screen.clear();\r\n    \r\n    \/\/update input from the potentiometer\r\n    Serial.print(\"potVal:\");\r\n    Serial.println(potVal);\r\n    screen.setCursor(0, 0);\r\n    screen.print(potVal);\r\n    \r\n    \/\/update the output to the fan\r\n    Serial.print(\"fan input:\");\r\n    Serial.println(fanIn);\r\n    screen.setCursor(8, 0);\r\n    screen.print(fanIn);\r\n    \r\n    \/\/update the wind speed from the wind sensor\r\n    Serial.print(windMPH);\r\n    Serial.println(\"MPH\");\r\n    screen.setCursor(0, 1);\r\n    screen.print(windMPH);\r\n    \r\n    \/\/update the output to the servo\r\n    Serial.print(\"motorIn:\");\r\n    Serial.println(motorIn);\r\n    screen.setCursor(8, 1);\r\n    screen.print(motorIn);\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ethan Hu &amp; Francesca Menendez Simple Narrative Description: When a knob is turned, a fan blows wind faster or slower accordingly, which then activates an airflow sensor. This&#8230;<\/p>\n","protected":false},"author":234,"featured_media":16152,"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\/16149"}],"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\/234"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/comments?post=16149"}],"version-history":[{"count":12,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16149\/revisions"}],"predecessor-version":[{"id":16221,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16149\/revisions\/16221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media\/16152"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media?parent=16149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/categories?post=16149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/tags?post=16149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}