{"id":13965,"date":"2021-10-05T02:17:05","date_gmt":"2021-10-05T06:17:05","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/?p=13965"},"modified":"2021-10-05T02:17:05","modified_gmt":"2021-10-05T06:17:05","slug":"double-transducer-rotational-position-to-frequency-of-tapping","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/double-transducer-rotational-position-to-frequency-of-tapping\/","title":{"rendered":"Double Transducer: Rotational Position to Frequency of Tapping"},"content":{"rendered":"<p><strong>Description<\/strong><\/p>\n<p>This project is a double transducer that takes a rotational position (0-90) as input and produces a frequency of tapping (20-60 taps per min) as output. The double transducer takes in the rotational degree and adjusts the rotation of the stepper motor accordingly. The stepper motor then drives the pulley to change the position of the obstacle. The ultrasonic ranger detects the distance between the obstacle and itself to adjust the frequency of tapping in accordance.<\/p>\n<p>Overall Logic:<\/p>\n<p>Rotational Position (Potentiometer) &#8211;&gt; Stepper Motor Rotation &#8211;&gt; Pulley System Movement &#8211;&gt; Obstacle Movement &#8211;&gt; Distance Detection by Ultrasonic Ranger &#8211;&gt; Frequency of Tapping (Solenoid)<\/p>\n<p><strong>Overall Photos<\/strong><\/p>\n<div id=\"attachment_13971\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13971\" loading=\"lazy\" class=\"wp-image-13971 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0023-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13971\" class=\"wp-caption-text\">Serena&#8217;s Overall<\/p><\/div>\n<div id=\"attachment_13970\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13970\" loading=\"lazy\" class=\"wp-image-13970 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0024-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13970\" class=\"wp-caption-text\">Bella&#8217;s Overall<\/p><\/div>\n<p><strong>Detailed Photos<\/strong><\/p>\n<div id=\"attachment_13978\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13978\" loading=\"lazy\" class=\"size-full wp-image-13978\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0037-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13978\" class=\"wp-caption-text\">Stepper Motor<\/p><\/div>\n<div id=\"attachment_13975\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13975\" loading=\"lazy\" class=\"wp-image-13975 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0032-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13975\" class=\"wp-caption-text\">Stepper Motor Pulley System<\/p><\/div>\n<div id=\"attachment_13977\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13977\" loading=\"lazy\" class=\"size-full wp-image-13977\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0036-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13977\" class=\"wp-caption-text\">Stepper Motor Driver Closeup<\/p><\/div>\n<div id=\"attachment_13972\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13972\" loading=\"lazy\" class=\"size-full wp-image-13972\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0029-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13972\" class=\"wp-caption-text\">Solenoid Driver Circuit<\/p><\/div>\n<div id=\"attachment_13974\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-13974\" loading=\"lazy\" class=\"size-full wp-image-13974\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/DSC_0031-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-13974\" class=\"wp-caption-text\">Stepper Motor (left) and Solenoid (right) Driver Circuits<\/p><\/div>\n<p><strong>Movies<\/strong><\/p>\n<p style=\"text-align: center\">Serena&#8217;s video:<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-13965-1\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/doubletransducer.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/doubletransducer.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/doubletransducer.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\">Bella&#8217;s video:<\/p>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-13965-2\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_0371.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_0371.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_0371.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p><strong>Progress Images<\/strong><\/p>\n<div id=\"attachment_14087\" style=\"width: 2086px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14087\" loading=\"lazy\" class=\"size-full wp-image-14087\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1.jpg\" alt=\"\" width=\"2076\" height=\"1548\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1.jpg 2076w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-300x224.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-1024x764.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-768x573.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-1536x1145.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-2048x1527.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-973x726.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo1-508x379.jpg 508w\" sizes=\"(max-width: 2076px) 100vw, 2076px\" \/><p id=\"caption-attachment-14087\" class=\"wp-caption-text\">Figuring out the solenoid voltage problem<\/p><\/div>\n<div id=\"attachment_14088\" style=\"width: 2084px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14088\" loading=\"lazy\" class=\"size-full wp-image-14088\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2.jpg\" alt=\"\" width=\"2074\" height=\"1552\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2.jpg 2074w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-300x224.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-1024x766.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-768x575.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-1536x1149.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-2048x1533.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-973x728.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/photo2-508x380.jpg 508w\" sizes=\"(max-width: 2074px) 100vw, 2074px\" \/><p id=\"caption-attachment-14088\" class=\"wp-caption-text\">Figuring out how to use a solenoid<\/p><\/div>\n<div id=\"attachment_14100\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/double-transducer-rotational-position-to-frequency-of-tapping\/img_8693-2\/\" rel=\"attachment wp-att-14100\"><img aria-describedby=\"caption-attachment-14100\" loading=\"lazy\" class=\"size-full wp-image-14100\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8693-1-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/a><p id=\"caption-attachment-14100\" class=\"wp-caption-text\">Initial prototype for pulley system with stepper motor and potentiometer<\/p><\/div>\n<div id=\"attachment_14080\" style=\"width: 1930px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/double-transducer-rotational-position-to-frequency-of-tapping\/img_8721\/\" rel=\"attachment wp-att-14080\"><img aria-describedby=\"caption-attachment-14080\" loading=\"lazy\" class=\"size-full wp-image-14080\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-scaled.jpg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-scaled.jpg 1920w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/IMG_8721-508x677.jpg 508w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><p id=\"caption-attachment-14080\" class=\"wp-caption-text\">Added LCD display and solenoid to the mix after switching to a stepper motor for a more hefty rotational force<\/p><\/div>\n<p><strong>Discussion<\/strong><\/p>\n<p>The project taught us that implementing a fun idea could present so many challenges, ones that we anticipate and ones that come out of nowhere. For this project, some parts we were prepared to tackle with patience from the beginning, such as the pulley system controlled by the stepper motor. We spent a long time brainstorming on how to use a stepper motor, how to make the pulley work, how to move the obstacle attached to the pulley, etc. But the real frustration came from the parts that we thought would be as easy as a breeze, such as a solenoid. The solenoid seemed to be simpler than most of the things we&#8217;ve seen in class. However, it was unexpected that adding the solenoid would cause a disruption for the voltage for the entire project. The solenoid causes the 5V to drop to around 3V whenever it is activated, causing the LCD display to dim and the stepper motor to shake. After an hour of tinkering in the OH on the night before the due, we still could not find the problem. Since we left the solenoid to be the last to do, it was too late to find an alternative to solve the issue. This experience shows that every part of the project should be tested out in the beginning stage, even the ones that appear to be easy to implement.<\/p>\n<p>This project also showed the importance and efficiency of the &#8220;divide and conquer&#8221; strategy. During the early stages, we experimented with different sections of the project. While one of us attempts to figure out how to use a stepper motor, the other one would fiddle with the LCD display. Being responsible for different tasks and piecing them together in the end allowed us to work efficiently and effectively within a limited time.<\/p>\n<p><strong>Functional Block Diagram<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"size-full wp-image-14076\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/Project1FBD.svg\" alt=\"\" width=\"1453\" height=\"733\" \/><\/p>\n<p><strong>Schematic Diagram<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/Project1ESD-1.svg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-14078\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/10\/Project1ESD-1.svg\" alt=\"\" width=\"1591\" height=\"1193\" \/><\/a><\/p>\n<p><strong>Code<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/*\r\n * Double Transducer: Rotational Position -&gt; Frequency of Tapping\r\n * \r\n * Team Members: Bella Liu, Serena Ying\r\n * \r\n * Description:\r\n *   The program is designed to receive input from the potentiometer and convert\r\n *   the value to appropriate rotatoin for the stepper motor in order to control\r\n *   the pulley and therefore move the obstacle. The ultrasonic ranger then detects \r\n *   the distance between itself and the obstacle, and converts it to a frequency for\r\n *   the solenoid tapping accordingly.\r\n *  \r\n * Pin Mapping Table:\r\n * \r\n *   Arduino pin | description\r\n *   ------------|-------------\r\n *   A0            Potentiometer\r\n *   \r\n *   11            Echo pin, ultrasonic ranger\r\n *   12            Trigger pin, ultrasonic ranger\r\n *   \r\n *    2            Step pin, A4988 driver chip for stepper motor\r\n *    3            Direction pin, A4988 driver chip for stepper motor\r\n *    \r\n *   SDA           SDA pin, LCD display\r\n *   SCL           SCL pin, LCD display\r\n *\r\n *\r\n * References: \r\n *  https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/tutorials\/ultrasonic-ranger\r\n *  https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/tutorials\/stepper\r\n *  https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/tutorials\/I2C-lcd\r\n *\/\r\n\r\n\/\/ Libraries\r\n#include &lt;Wire.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n#include &lt;AccelStepper.h&gt;\r\n#include &lt;NewPing.h&gt;\r\n\r\n\/\/Pin for potentiometer\r\nconst int POTEN = A0;\r\n\r\n\/\/Pins for ultrasonic ranger\r\nconst int TRIGGER_PIN = 12;\r\nconst int ECHO_PIN = 11;\r\nconst int MAX_DISTANCE = 200;\r\n\r\n\/\/Pins for A4988 diver chip\r\nconst int STEP_PIN = 2; \/\/ A4988 \"STEP\" pin wired to Arduino pin 2 (you can change this)\r\nconst int DIR_PIN = 3; \/\/ A4988 \"DIRECTION\" pin wired to Arduino pin 3 (you can change this)\r\n\r\n\/\/Variables for LCD display\r\nunsigned long LCDtimer = 0;\r\nconst int LCDwait = 500;\r\nbool LCDstate = LOW;\r\n\r\n\/\/Pin and variables for solenoid\r\nconst int SOLENOID = 5;\/\/This is the output pin on the Arduino\r\nunsigned long SOLEtimer = 0;\r\nint SOLEwait = 0;\r\nbool SOLEstate = LOW;\r\n\r\n\/\/Setups\r\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\nAccelStepper motor(1, STEP_PIN, DIR_PIN);\r\n\r\nvoid setup() {\r\n\r\n  \/\/Pin setup\r\n  pinMode(POTEN, INPUT);\r\n  pinMode(SOLENOID, OUTPUT);\r\n\r\n  Serial.begin(9600);\r\n  Serial.begin(115200);\r\n\r\n  \/\/LCD screen initialization\r\n  screen.init();\r\n  screen.backlight();\r\n\r\n  \/\/ set cursor to home position, i.e. the upper left corner\r\n  screen.home();\r\n\r\n  \/\/Stepper motor initialization\r\n  motor.setMaxSpeed(6000); \/\/ measured in steps per second\r\n  motor.setAcceleration(8000); \/\/ measured in steps per second squared\r\n\r\n}\r\n\r\nvoid loop() {\r\n\r\n  \/\/Variables to store values for potentiometer and ultrasonic ranger\r\n  int potVal = analogRead(A0);\r\n  int ranger = sonar.ping_cm();\r\n\r\n  \/\/Printing potentiometer and ultrasonic ranger values in the monitor for debugging\r\n  Serial.println(potVal);\r\n  Serial.print(\"ping:\");\r\n  Serial.print(sonar.ping_cm());\r\n  Serial.println(\"cm\");\r\n\r\n  \/\/Adjust the stepper motor rotation according to the rotational degree\r\n  int motorPos = map(potVal, 0, 1023, 0, 400);\r\n  motor.moveTo(motorPos);\r\n  motor.run();  \r\n\r\n  \/\/Adjust the frequency of tapping based on the distance detected by the ranger\r\n  SOLEwait = map(ranger, 19, 0, 800, 300);\r\n  if ( (millis() - SOLEtimer) &gt;= SOLEwait ) { \r\n    SOLEstate = !SOLEstate; \r\n    SOLEtimer = millis(); \r\n  }\r\n  digitalWrite(SOLENOID, SOLEstate);\r\n\r\n  \/\/display on the LCD\r\n  if ( (millis() - LCDtimer) &gt;= LCDwait ) { \/\/ millis() is always the number of milliseconds since the Arduino powered up\r\n    LCDstate = !LCDstate; \/\/ this will \"toggle\" the value of \"quarterStateLight\" to its opposite\r\n    LCDtimer = millis(); \/\/ reset the timer before exiting the function.\r\n  }\r\n\r\n  \/\/display values for the LCD\r\n  int input = map(potVal, 0, 1023, 0, 99);\r\n  int mid = map(motorPos, 0, 400, 0, 99);\r\n  int mid2 = map(ranger, 20, 0, 0, 99);\r\n  int output = map(SOLEwait, 300, 100, 0, 99);  \r\n  \r\n  if (LCDstate == HIGH) {\r\n      screen.clear();\r\n      screen.print(\"i:\");\r\n      screen.setCursor(6,0);\r\n      screen.print(\"m:\");\r\n      screen.setCursor(6,1);\r\n      screen.print(\"m:\");\r\n      screen.setCursor(12,1);\r\n      screen.print(\"o:\");\r\n      screen.setCursor(2, 0);\r\n      screen.print(input);\r\n      screen.setCursor(8, 0);\r\n      screen.print(mid);\r\n      screen.setCursor(8, 1);\r\n      screen.print(mid);\r\n      screen.setCursor(14,1);\r\n      screen.print(output);\r\n  } \r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description This project is a double transducer that takes a rotational position (0-90) as input and produces a frequency of tapping (20-60 taps per min) as output. The&#8230;<\/p>\n","protected":false},"author":200,"featured_media":13970,"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\/f2021\/work\/wp-json\/wp\/v2\/posts\/13965"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/users\/200"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/comments?post=13965"}],"version-history":[{"count":22,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/13965\/revisions"}],"predecessor-version":[{"id":14102,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/13965\/revisions\/14102"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/media\/13970"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/media?parent=13965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/categories?post=13965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/tags?post=13965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}