{"id":12318,"date":"2021-03-07T20:47:54","date_gmt":"2021-03-08T01:47:54","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/?p=12318"},"modified":"2021-03-10T09:11:47","modified_gmt":"2021-03-10T14:11:47","slug":"dates-double-transducer","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/dates-double-transducer\/","title":{"rendered":"Dates Double Transducer: Vibration to Distance"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignnone wp-image-12533 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Final-Image-Project-1-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Images:<\/b><\/h2>\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-12318-1\" width=\"620\" height=\"343\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Tinkercad_Physical_Computing.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Tinkercad_Physical_Computing.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Tinkercad_Physical_Computing.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12365\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12365\" loading=\"lazy\" class=\"wp-image-12365 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Cover-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12365\" class=\"wp-caption-text\"><strong>James&#8217; final build<\/strong><\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12418\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12418\" loading=\"lazy\" class=\"wp-image-12418 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261.jpg\" alt=\"\" width=\"2560\" height=\"1489\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-300x174.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-1024x596.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-768x447.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-1536x893.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-2048x1191.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-973x566.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6730-1-scaled-e1615312019261-508x295.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12418\" class=\"wp-caption-text\"><strong>Amelia&#8217;s final build<\/strong><\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12453\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12453\" loading=\"lazy\" class=\"wp-image-12453 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Vibration_Connection_Physical_Computing-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12453\" class=\"wp-caption-text\"><strong>Taped connection between vibration motor and accelerometer for best transfer of signal<\/strong><\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12457\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12457\" loading=\"lazy\" class=\"wp-image-12457 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-973x1297.jpeg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Cover-For-Light-Sensing-508x677.jpeg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12457\" class=\"wp-caption-text\"><strong>Cover for the light sensing part of transducer to get rid of noise from environment<\/strong><\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12459\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12459\" loading=\"lazy\" class=\"wp-image-12459 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-973x1297.jpeg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Slot-Restriction-For-Distance-508x677.jpeg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12459\" class=\"wp-caption-text\"><strong>Slot restricting the motion of Popsicle stick to mostly linear movement to create a change in distance<\/strong><\/p><\/div>\n<p>&nbsp;<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-12318-2\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Final_Product.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Final_Product.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Project_1_Final_Product.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-12318-3\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Untitled-2-1.mp4?_=3\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Untitled-2-1.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Untitled-2-1.mp4<\/a><\/video><\/div>\n<h4><\/h4>\n<h2><\/h2>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Narrative:<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">A vibrator is attached to a sensor which senses the rate of vibration. Based on this vibration, a light is turned on underneath a box. How much the vibrator vibrates determines how bright the light gets. So if the vibrator vibrates a lot, the light gets really bright, and if the vibrator does not vibrate a lot, the light does not get as bright. The brightness of the light is captured by another sensor which senses how bright the light is. The sensor then tells the computer how much to turn a motor to move a stick. So if the light is really bright, the motor is told to move the stick very far, and if the light is not as bright, the motor is told to move the stick not as far. The states of all of these inputs and outputs (i.e. the level of change) is fed to a display that shows how much each step has changed.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Progress images:<\/b><\/h2>\n<div id=\"attachment_12334\" style=\"width: 2570px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12334\" loading=\"lazy\" class=\"wp-image-12334 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6671-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-12334\" class=\"wp-caption-text\"><strong>Diagnosing the noise in the analog input pins with an oscilloscope<\/strong><\/p><\/div>\n<div id=\"attachment_12470\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12470\" loading=\"lazy\" class=\"wp-image-12470 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Vibration-Motor-to-Fake-Input-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12470\" class=\"wp-caption-text\"><strong>Vibration motor connected to two wires with male ends to make better and more maneuverable connection to bread board<\/strong><\/p><\/div>\n<div id=\"attachment_12656\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12656\" loading=\"lazy\" class=\"wp-image-12656 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/Code-Snippet-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12656\" class=\"wp-caption-text\">One of the many ways we tried to sense vibration frequency. Here we are trying to measure the duty cycle of the PWM type input from the vibration motor.<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_12333\" style=\"width: 1930px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-12333\" loading=\"lazy\" class=\"wp-image-12333 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/IMG-6649-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><p id=\"caption-attachment-12333\" class=\"wp-caption-text\"><strong>Putting together the distance component for the first time to get the layout<\/strong><\/p><\/div>\n<h2><strong>Discussion:<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">Throughout the development process, the easiest part was definitely the planning stage. The stage where we brainstormed three different ideas and paid little attention towards the actual build. It was a time where we let our imaginations run wild and had little to debug since the projects weren\u2019t fully implemented, only idealized. Once we finally got to the building and coding stage however, we found implementing past the planning phase is <\/span><i><span style=\"font-weight: 400\">much <\/span><\/i><span style=\"font-weight: 400\">harder. It involved having to build the circuit while making sure none of the wires had loose connections, building a connection between the vibration motor and Arduino which meant stripping two male- to-female wires as well as the vibration motor and securing them together with athletic tape (neither of us had electrical tape on standby), measuring the value of the accelerometer with a broken accelerometer (which we only later realized), soldering an LED and photoresistor, building a linkage system out of popsicle sticks, and figuring out the code to tie these pieces together. All of these steps came with their own frustrating challenges that allowed us to grown our knowledge of sensors and Arduino development<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">The most frustrating thing that we learned was that analog input pins on the Arduino can pick up a lot of noise from other parts of the board. In particular, adjacent analog input pins can read signals from each other almost as if they were connected. In our case, we thought the accelerometer was wired to the Arduino and we were reading a signal from it, but it turned out to not be connected to the Arduino at all. Despite this fact, we still read an analog input from that pin and when compared to the signal produced by the potentiometer, the signals matched exactly in how they changed with input into the potentiometer. Instead of reading the accelerometer data, we were actually reading ghost signals from the adjacent potentiometer input pin which was only solved by moving the accelerometer input pin to the opposite side of the analog input pin array.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">We also learned the importance of data structures in signal processing, especially when performing arithmetic operations. While trying to write values to our stepper motor, we came into a problem where we couldn\u2019t get our code to run for more than 1 loop. This was caused by the way in which we were storing the variables used to calculated step count. We chose to store the all our variables as type \u201cint\u201d by default which meant that it would round down to the nearest integer when it stored the step value. The some of the values we were setting as the used to calculate the number of steps, however, were on a scale of 0 to \u03c0 which meant that they were frequently in between 0 and 1. Because these values were rounded down even if they were 0.9, this meant that we ended up with division by zero causing our program to break and only run once. Storing the variables used to calculate step number solved this problem.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Looking back now, there are several factors that would\u2019ve changed the direction of the project completely. For instance, the first time we met to work on the project was the Sunday before the project was due because we thought it was plenty of time before the deadline. This was a mistake on our part and we should\u2019ve been more proactive about meeting before Sunday (i.e. on Friday and Saturday). This would\u2019ve given us more time to realize where we were going wrong and what we could\u2019ve done to fix the problem. Another factor would\u2019ve been a better sensor to detect the frequency of the vibration coming from the vibration motor. We noticed that the accelerometer was pretty noisy and we had trouble reading the sensor. Maybe these changes would have improved our project, <\/span><span style=\"font-weight: 400\">or possibly caused new problems, but these are just a few we\u2019ve chosen to reflect on.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Functional Block Diagram and Schematic<\/b><\/h2>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-12326\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3.jpg\" alt=\"\" width=\"2127\" height=\"1706\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3.jpg 2127w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-300x241.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-1024x821.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-768x616.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-1536x1232.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-2048x1643.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-973x780.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-content\/uploads\/2021\/03\/idea-3-3-508x407.jpg 508w\" sizes=\"(max-width: 2127px) 100vw, 2127px\" \/><\/p>\n<h2><b>Code Submission<\/b><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/*\r\n   60-223, Project 1\r\n   Amelia Lopez (aelopez)\r\n   James Kyle (jkyle1)\r\n   Time spent: 8 hours\r\n\r\n   Description:\r\n   Takes in a vibration input, transforms that analog input value\r\n   into an LED brightness, which is then transformed into a distance\r\n   controlled by the stepper motor. Vibration input is read through\r\n   an accelerometer and LED intensity value is read through a photoresistor.\r\n\r\n   Challenges:\r\n   The stepper motor isn't responding to the photoresistor's value as \r\n   we intended, so that half of the code is buggy. Since the vibration\r\n   motor works on a pulse, this causes the light to blink fairly fast but\r\n   it still dims\/brightens as a result of the vibration motor speed. \r\n\r\n   Next time: \r\n   Definitely take more time to understand what went wrong between the \r\n   photoresistor value and the stepper motor desired output. I think \r\n   looking at the Arduino libraries is a good place to start with this \r\n   because maybe someone else had the same problem and published their\r\n   solution for open source use that we can cite and tweak to the specs \r\n   of our project \r\n\r\n\r\n   Collaboration and Sources:\r\n   1) For the accelerometer readings (line 163-167), used code from\r\n    https:\/\/tinyurl.com\/Accelerometerlink\r\n   2) For LCD display, used code from http:\/\/www.arduino.cc\/en\/Tutorial\/LiquidCrystalHelloWorld\r\n   3) For stepper motor, used code from https:\/\/tinyurl.com\/StepperMotorLink\r\n\r\n   Inputs: Potentiometer (which varies vibration motor rate)\r\n   In-between: LED\r\n   Output: Stepper motor, LCD display\r\n\r\n  Pin mapping:\r\n\r\n   Arduino pin | type   | description\r\n   ------------|--------|-------------\r\n   A0            input     potentiometer\r\n   A1            input     X-pin Accelerometer\r\n   A2            input     Y-pin Accelerometer\r\n   A3            input     Z-pin Accelerometer\r\n   A4            input     photoresistor\r\n   13            output    Stepper Motor Driver IN1\r\n   12            output    Stepper Motor Driver IN2\r\n   ~11           output    Vibration motor\r\n   ~10           output    Stepper Motor Driver IN3\r\n   ~9            output    Stepper Motor Driver IN4\r\n   8             output    LCD RS\r\n   7             output    LCD E\r\n   ~6            output    LED\r\n   ~5            output    LCD D4\r\n   4             output    LCD D5\r\n   ~3            output    LCD D6\r\n   2             output    LCD D7\r\n\r\n   (digital PWM~)\r\n\r\n     LCD circuit:\r\n   LCD RS pin to digital pin 8\r\n   LCD Enable pin to digital pin 7\r\n   LCD D4 pin to digital pin 5\r\n   LCD D5 pin to digital pin 4\r\n   LCD D6 pin to digital pin 3\r\n   LCD D7 pin to digital pin 2\r\n   LCD R\/W pin to ground\r\n   LCD VSS pin to ground\r\n   LCD VCC pin to 5V\r\n   10K resistor:\r\n   ends to +5V and ground\r\n   wiper to LCD VO pin (pin 3)\r\n*\/\r\n\r\n#include &lt;Stepper.h&gt;\r\n#include &lt;LiquidCrystal.h&gt;\r\n\r\n\r\n\/\/DECLARING ARDUINO PINS\r\nconst int POTENT = A0;\r\nconst int ACCE_X = A1;\r\nconst int ACCE_Y = A2;\r\nconst int ACCE_Z = A3;\r\nconst int PHOTORES = A4;\r\nconst int STEP_IN1 = 13;\r\nconst int STEP_IN2 = 12;\r\nconst int VIBRATION_MOTOR = 11;\r\nconst int STEP_IN3 = 10;\r\nconst int STEP_IN4 = 9;\r\nconst int LCD_RS = 8;\r\nconst int LCD_E = 7;\r\nconst int LED_PIN = 6;\r\nconst int LCD_D4 = 5;\r\nconst int LCD_D5 = 4;\r\nconst int LCD_D6 = 3;\r\nconst int LCD_D7 = 2;\r\n\r\n\/\/DECLARING INTS FOR ACCELOREMETER AND LED\r\nint accel_xVal = 0;\r\nint lightVal = 0;\r\n\r\n\r\n\/\/DECLARING MISC. CONSTANTS USEFUL TO STEPPER MOTOR\r\nconst int maxAnalogValue = 1023;\r\nconst int stepsPerRevolution = 64; \/\/fits the specification of our motor\r\nconst int motorSpeed = 20;\r\nfloat currentDistance = distOfString \/ 2; \/\/PRECONDITION: OBJECT HAS TO BE HALFWAY\r\nint targetDistance;\r\nfloat steps;\r\nbool stepMotor = false;\r\n\r\n\/\/DECLARING INTS FOR LCD WAITING TIMES\r\nconst int WAIT_TIME = 300;\r\nunsigned long timeVariable = 0;\r\n\r\n\/\/ initialize the library by associating any needed LCD interface pin\r\n\/\/ with the Arduino pin number it is connected to\r\nLiquidCrystal lcd(LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7);\r\n\r\n\r\nStepper myStepper(stepsPerRevolution, STEP_IN1, STEP_IN2, STEP_IN3, STEP_IN4);\r\n\r\nvoid setup() {\r\n\r\n  \/\/INPUT PINS\r\n  pinMode(POTENT, INPUT);\r\n  pinMode(VIBRATION_MOTOR, OUTPUT);\r\n  pinMode(ACCE_X, INPUT);\r\n  pinMode(ACCE_Y, INPUT);\r\n  pinMode(ACCE_Z, INPUT);\r\n  pinMode(PHOTORES, INPUT);\r\n\r\n  \/\/OUTPUT PINS\r\n  pinMode(LED_PIN, OUTPUT);\r\n  pinMode(VIBRATION_MOTOR, OUTPUT);\r\n\r\n  \/\/MOTOR functions\r\n  myStepper.setSpeed(motorSpeed);\r\n\r\n  \/\/ set up the LCD's number of columns and rows:\r\n  lcd.begin(16, 2);\r\n\r\n  \/\/print constant letters on screen\r\n  lcd.print(\"i:\");\r\n  lcd.setCursor(6, 0);\r\n  lcd.print(\"m:\");\r\n  lcd.setCursor(8, 1);\r\n  lcd.print(\"0\");\r\n  lcd.setCursor(12, 1);\r\n  lcd.print(\"o:\");\r\n}\r\n\r\nvoid loop() {\r\n\r\n  \/\/READING POTENTIOMETER VALUE\r\n  \/\/POTENTIOMETER VALUE DETERMINES VIBRATION MOTOR RATE\r\n  int potentValue = analogRead(POTENT); \/\/ 0 &lt;= potentValue &lt;= 1023\r\n  int vibrationStrength = map(potentValue, 0, 1023, 0, 153);  \/\/ 0 &lt;= vibrationStrength &lt;= 155\r\n  analogWrite(VIBRATION_MOTOR, vibrationStrength); \/\/using PWM\r\n  int xVal = analogRead(ACCE_X);\r\n\r\n  \/\/ACCELEROMETER MEASURES VIBRATION MOTOR RATE (x-axis)\r\n  \/\/RATE MEASURED IS USED TO LIGHT UP AN LED A CERTAIN INTENSITY\r\n  int oldX = accel_xVal;\r\n  accel_xVal = analogRead(ACCE_X);\r\n  int dif = abs(oldX - accel_xVal);\r\n  int lightVal = map(dif, 0, 520, 0, 255);\r\n  analogWrite(LED_PIN, lightVal);\r\n\r\n\r\n  \/\/PHOTORESISTOR TAKES IN LED INTENSITY VALUE\r\n  \/\/PHOTORESISTOR VALUE USED TO CHANGE STEPPER MOTOR\r\n  int photoValue = analogRead(PHOTORES); \/\/ 0 &lt;= potentValue &lt;= 1023\r\n  int lowbound = 700; \/\/bright light\r\n  int highbound = 990; \/\/no light\r\n  \/\/int stepVal = map(photoValue, lowbound, highbound,\r\n\r\n  targetDistance = map(photoValue, 850, 1000, 0, 60);\r\n\r\n  \/\/Convert photoresistor value into desired distance into rotations for stepper motor\r\n  if (targetDistance != currentDistance) {\r\n    steps = (targetDistance - currentDistance) * stepsPerRevolution \/ 360;\r\n    currentDistance = targetDistance;\r\n    stepMotor = true;\r\n  }\r\n\r\n  \/\/Setting step stepper motor to desired distance\r\n  if (stepMotor == true) {\r\n    myStepper.step(steps);\r\n    delay(500); \/\/Wait 0.5s for motor to finish moving\r\n    stepMotor = false;\r\n  }\r\n\r\n  \/\/UPDATING VALUES ON LCD\r\n  if (millis() - timeVariable &gt; WAIT_TIME) {\r\n    \/\/updating input sensor value\r\n    lcd.setCursor(2, 0);\r\n    lcd.print(map(xVal, 0, 525, 0, 99));\r\n\r\n    \/\/updating middle step actuator\r\n    lcd.setCursor(8, 0);\r\n    lcd.print(map(lightVal, 0, 255, 0, 99));\r\n\r\n    \/\/updating middle step sensor value\r\n    lcd.setCursor(8, 1);\r\n    lcd.print(map(photoValue, lowbound, highbound, 0, 99));\r\n\r\n    \/\/updating output actuator value\r\n    lcd.setCursor(14, 1);\r\n    lcd.print(map(steps, 0, currentDistance, 0, 99));\r\n    delay(200);\r\n\r\n    timeVariable = millis();\r\n  }\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Images: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Narrative: A vibrator is attached to a sensor which senses the rate of vibration. Based on&#8230;<\/p>\n","protected":false},"author":172,"featured_media":12533,"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\/s2021\/work\/wp-json\/wp\/v2\/posts\/12318"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/users\/172"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/comments?post=12318"}],"version-history":[{"count":36,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts\/12318\/revisions"}],"predecessor-version":[{"id":12658,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/posts\/12318\/revisions\/12658"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/media\/12533"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/media?parent=12318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/categories?post=12318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/s2021\/work\/wp-json\/wp\/v2\/tags?post=12318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}