{"id":16089,"date":"2022-09-28T23:19:07","date_gmt":"2022-09-29T03:19:07","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/?p=16089"},"modified":"2022-09-28T23:19:08","modified_gmt":"2022-09-29T03:19:08","slug":"double-transducer-light-brightness-to-rotational-speed","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/double-transducer-light-brightness-to-rotational-speed\/","title":{"rendered":"Double Transducer: Light Brightness to Rotational Speed"},"content":{"rendered":"<p style=\"text-align: center\"><em>Jonathan Lindstrom + Frances Adiwijaya<\/em><\/p>\n<h2><strong>Narrative Description:<\/strong><\/h2>\n<p>Our work uses a little thing which reads how bright the lights are in the room. When it is really bright it will tell a tiny blue thing that turns to move a stick stuck to it up and when it is dark the same tiny blue thing that turns moves the stick down. We then have a small black thing that reads how far between it and the nearest thing. This thing is lined up with the stick so when the lights are low and the thing that turns has the stick down the small black thing will read them as close together and when it is bright it will read them as farther away from each other. If they are close together our work will decide that a second, different thing that turns should go slow and if they are far then the same thing that turns goes faster.<\/p>\n<h2>Discussion:<\/h2>\n<p>During our project process, we ran into several roadblocks, but ultimately, we managed to power through and get make a cute double transducer.<\/p>\n<p>Our original plan for our middle step was to use a linear actuator to change the height of the lego guy. While originally, it seemed like a good idea, it ended up not working, and we decided to change the middle step into a servo motor several days before the due date. The linear actuator only had two pins, and even using a motor driver, it could only go forwards, backwards, and change the speed of how fast it was moving. This was an issue for us, since we needed the linear actuator to be able to know its position, as we wanted it to change its position value based on the read of the photoresistor. While other groups found ways to work around the linear actuator, we decided to conserve our time and effort and switch to a servo motor, which worked for our purposes just fine. If we had stuck with using the linear actuator, we could have had a completely different product, (for good or for bad, who knows?) but in retrospect, I think we made a good decision to save our time and use an output we were already comfortable with.<\/p>\n<p>I think in the future, it might be a good idea to do the more difficult parts of the project first. We spent a lot of time waiting for the linear actuators to arrive, even though we knew it was the most complicated part. Because we didn\u2019t have a lot of information, we didn\u2019t know that the linear actuators couldn\u2019t sense their position. When they did arrive, we were slightly panicked, as our middle step wasn\u2019t feasible. It might have been good to have a backup plan at that time, instead of coming up with one on the fly after the linear actuators were delivered.<\/p>\n<p>I am also very glad that we had tried to line our output up with group 2\u2019s input the night before the project. Because we tried everything the night before, when we ran into some issues, e.g. having our motor be too fast and not powerful enough, we had some time to change motors.<\/p>\n<p>As a student with no experience in hardware nor software, I learned a lot during this project. I soldered for the first time, spent a lot of time debugging code, and did a lot of googling on Arduino sensors. We ran into several roadblocks, such as issues with our DC motor, LCD displays, as well as our linear actuator, but ultimately, our problem solving led to a successful end product.<\/p>\n<h2>Story Behind Our Project:<\/h2>\n<p>When we were building our transducers we thought that the mess of wires and such kind of looked like an alien planet. So we decided to base our project off Star Wars. Specifically the battle of Umbara. In this battle the droid army has control over the planet and is using it as their primary supply chain. The two clones are attempting to battle the droid army and take control of the Umbaran capital (the arduino + the lego tower) to cut off this supply chain.<\/p>\n<h2>Final Images:<\/h2>\n<div id=\"attachment_16156\" style=\"width: 1816px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16156\" loading=\"lazy\" class=\"wp-image-16156 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM.png\" alt=\"\" width=\"1806\" height=\"1312\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM.png 1806w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM-300x218.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM-1024x744.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM-768x558.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM-1536x1116.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM-973x707.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.19-AM-508x369.png 508w\" sizes=\"(max-width: 1806px) 100vw, 1806px\" \/><p id=\"caption-attachment-16156\" class=\"wp-caption-text\">Jonathan&#8217;s Final Image<\/p><\/div>\n<div id=\"attachment_16223\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16223\" loading=\"lazy\" class=\"wp-image-16223 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908.jpg\" alt=\"\" width=\"2560\" height=\"1920\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/final_photo-scaled-e1664412902908-508x381.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-16223\" class=\"wp-caption-text\">Frances&#8217;s Final Image<\/p><\/div>\n<h2>Detail Photos:<\/h2>\n<div id=\"attachment_16157\" style=\"width: 379px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16157\" loading=\"lazy\" class=\"wp-image-16157\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM.png\" alt=\"\" width=\"369\" height=\"444\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM.png 1080w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM-250x300.png 250w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM-852x1024.png 852w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM-768x923.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM-973x1169.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.53.47-AM-508x611.png 508w\" sizes=\"(max-width: 369px) 100vw, 369px\" \/><p id=\"caption-attachment-16157\" class=\"wp-caption-text\">This is the other main function of our project, the photoresistor. It will take in light and return an analog value based on the intensity of the light around it. You can see a clone hiding in the wires attacking the droids in the image below.<\/p><\/div>\n<div class=\"mceTemp\"><\/div>\n<div id=\"attachment_16224\" style=\"width: 482px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16224\" loading=\"lazy\" class=\"wp-image-16224 \" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-1024x768.jpg\" alt=\"\" width=\"472\" height=\"354\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-973x730.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/creativity-508x381.jpg 508w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><p id=\"caption-attachment-16224\" class=\"wp-caption-text\">A nice focus shot of the droids and the lego pieces that make up the story of our double transducer.<\/p><\/div>\n<div id=\"attachment_16251\" style=\"width: 447px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16251\" loading=\"lazy\" class=\" wp-image-16251\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM.png\" alt=\"\" width=\"437\" height=\"508\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM.png 998w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM-259x300.png 259w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM-883x1024.png 883w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM-768x891.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM-973x1129.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.39.44-PM-508x589.png 508w\" sizes=\"(max-width: 437px) 100vw, 437px\" \/><p id=\"caption-attachment-16251\" class=\"wp-caption-text\">A close up of our servo motor. We have attached a popsicle stick so it covers the laser distance sensor below. Furthermore you can see the clone using the popsicle stick as leverage to attack the Spider Droid below.<\/p><\/div>\n<div id=\"attachment_16250\" style=\"width: 417px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16250\" loading=\"lazy\" class=\" wp-image-16250\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.40.05-PM.png\" alt=\"\" width=\"407\" height=\"543\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.40.05-PM.png 830w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.40.05-PM-225x300.png 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.40.05-PM-768x1023.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-10.40.05-PM-508x677.png 508w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><p id=\"caption-attachment-16250\" class=\"wp-caption-text\">Close up of our laser distance module. This reads how far the distance from the popsicle stick above it is.<\/p><\/div>\n<div id=\"attachment_16153\" style=\"width: 377px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16153\" loading=\"lazy\" class=\" wp-image-16153\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.55.23-AM.png\" alt=\"\" width=\"367\" height=\"507\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.55.23-AM.png 902w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.55.23-AM-217x300.png 217w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.55.23-AM-741x1024.png 741w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.55.23-AM-768x1061.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.55.23-AM-508x702.png 508w\" sizes=\"(max-width: 367px) 100vw, 367px\" \/><p id=\"caption-attachment-16153\" class=\"wp-caption-text\">This shot highlights one of the main functions of our project, the motor driver and DC motor<\/p><\/div>\n<h2>Working Videos of Both Projects:<\/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-16089-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\/jonathan-vid.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/jonathan-vid.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/jonathan-vid.mp4<\/a><\/video><\/div>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-16089-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\/frances-vid.mp4?_=2\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/frances-vid.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/frances-vid.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<h2>Progress Images:<\/h2>\n<div id=\"attachment_16159\" style=\"width: 407px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16159\" loading=\"lazy\" class=\"wp-image-16159\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM.png\" alt=\"\" width=\"397\" height=\"447\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM.png 1094w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM-266x300.png 266w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM-909x1024.png 909w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM-768x865.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM-973x1096.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.56.30-AM-508x572.png 508w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><p id=\"caption-attachment-16159\" class=\"wp-caption-text\">Jonathan Progress Image #1: In this I got the laser sensor and motor working together so that changes in the laser sensor resulted in decreased or increased motor speed<\/p><\/div>\n<div id=\"attachment_16154\" style=\"width: 459px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16154\" loading=\"lazy\" class=\"wp-image-16154\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.51-AM.png\" alt=\"\" width=\"449\" height=\"308\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.51-AM.png 814w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.51-AM-300x206.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.51-AM-768x526.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-09-28-at-9.54.51-AM-508x348.png 508w\" sizes=\"(max-width: 449px) 100vw, 449px\" \/><p id=\"caption-attachment-16154\" class=\"wp-caption-text\">Jonathan Progress Image #2: In this I took our success in Progress Image and I #1 and added the lcd and phototransistor so that the lcd will display the values of the laser sensor, motor, and phototransistor<\/p><\/div>\n<div id=\"attachment_16219\" style=\"width: 235px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16219\" loading=\"lazy\" class=\"size-medium wp-image-16219\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress1-scaled.jpg 1920w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><p id=\"caption-attachment-16219\" class=\"wp-caption-text\">Frances Progress Image #1: LCD Display working with the photoresistor. Photoresistor values would display in the LCD screen.<\/p><\/div>\n<div id=\"attachment_16220\" style=\"width: 235px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16220\" loading=\"lazy\" class=\"size-medium wp-image-16220\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-225x300.jpg 225w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-768x1024.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-1152x1536.jpg 1152w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-1536x2048.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-973x1297.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-508x677.jpg 508w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/progress2-scaled.jpg 1920w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><p id=\"caption-attachment-16220\" class=\"wp-caption-text\">Frances Progress Image #2: Trying to figure out how to run the DC motor through the motor driver.<\/p><\/div>\n<h4>Video of the servo motor and the laser distance sensor working:<\/h4>\n<div style=\"width: 620px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-16089-3\" width=\"620\" height=\"1102\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/servo_laser.mp4?_=3\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/servo_laser.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/servo_laser.mp4<\/a><\/video><\/div>\n<div class=\"mceTemp\"><\/div>\n<h2>Schematics and Block Diagrams:<\/h2>\n<div id=\"attachment_16112\" style=\"width: 853px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16112\" loading=\"lazy\" class=\"size-full wp-image-16112\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram.jpg\" alt=\"\" width=\"843\" height=\"471\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram.jpg 843w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-300x168.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-768x429.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Untitled-Diagram-508x284.jpg 508w\" sizes=\"(max-width: 843px) 100vw, 843px\" \/><p id=\"caption-attachment-16112\" class=\"wp-caption-text\">Block Diagram representing the inputs and outputs of our project<\/p><\/div>\n<div id=\"attachment_16108\" style=\"width: 1382px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-16108\" loading=\"lazy\" class=\"wp-image-16108 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic.jpg\" alt=\"\" width=\"1372\" height=\"812\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic.jpg 1372w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic-300x178.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic-1024x606.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic-768x455.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic-973x576.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-content\/uploads\/2022\/09\/Final_Schematic-508x301.jpg 508w\" sizes=\"(max-width: 1372px) 100vw, 1372px\" \/><p id=\"caption-attachment-16108\" class=\"wp-caption-text\">Electrical Schematic of our final project<\/p><\/div>\n<p>&nbsp;<\/p>\n<h2>Code:<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\">\/*\r\n  Double Transducer Project: from light brightness to rotational speed\r\n    Frances Adiwijaya and Jonathan Lindstrom\r\n  Description: \r\n    In this project, we had to create a device that would use double transduction, \r\n    and convert the brightness of light to rotational speed. \r\n    We decided to use a servo's position and a laser distance sensor to be our \r\n    intermediate transduction. \r\n  Pin Mapping: \r\n     Arduino pin | description\r\n   ------------- |-------------\r\n   A0             Photoresistor\r\n   5              DC Motor Driver\r\n   6              DC Motor Driver\r\n   3              Servo Motor\r\n   SDA            SDA pin, LCD Display\/Laser Distance Sensor (VL53L0X)\r\n   SCL            SCL pin, LCD Display\/Laser Distance Sensor (VL53L0X)\r\n  References: \r\n  \r\n*\/\r\n\r\n\/\/ import Libraries\r\n#include \"Adafruit_VL53L0X.h\"\r\n#include &lt;Wire.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n#include &lt;Servo.h&gt;\r\n\r\nAdafruit_VL53L0X lox = Adafruit_VL53L0X();\r\n\r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\nServo gaugeMotor;\r\n\r\n\/\/ set the variables for the pins\r\nconst int MOTORPIN1 = 5;\r\nconst int MOTORPIN2 = 6;\r\nconst int PHOTORESISTORPIN = A0;\r\nconst int GAUGEMOTORPIN = 3;\r\nconst int QUARTERWAIT = 250;\r\nunsigned long quarterTimer = 0;\r\n\r\nvoid setup() {\r\n  \/\/ initialize the pins and LCD\r\n  screen.init();\r\n  screen.backlight();\r\n  pinMode(MOTORPIN1, OUTPUT);\r\n  pinMode(MOTORPIN2, OUTPUT);\r\n  pinMode(PHOTORESISTORPIN, INPUT);\r\n  gaugeMotor.attach(GAUGEMOTORPIN);\r\n\r\n  digitalWrite(MOTORPIN1, LOW);\r\n  digitalWrite(MOTORPIN2, LOW);\r\n  Serial.begin(9600);\r\n\r\n  \r\n  \/\/Setting up the laser sensor\r\n  while (! Serial) {\r\n    delay(1);\r\n  }\r\n  Serial.println(\"Adafruit VL53L0X test\");\r\n  if (!lox.begin()) {\r\n    Serial.println(F(\"Failed to boot VL53L0X\"));\r\n    while(1);\r\n  }\r\n  Serial.println(F(\"VL53L0X API Simple Ranging example\\n\\n\")); \r\n}\r\n\r\n\r\n\/\/ DC motor functions\r\nvoid set_motor_pwm(int pwm, int IN1_PIN, int IN2_PIN)\r\n{\r\n  if (pwm &lt; 0) {  \/\/ reverse speeds\r\n    analogWrite(IN1_PIN, -pwm);\r\n    digitalWrite(IN2_PIN, LOW);\r\n\r\n  } else { \/\/ stop or forward\r\n    digitalWrite(IN1_PIN, LOW);\r\n    analogWrite(IN2_PIN, pwm);\r\n  }\r\n}\r\nvoid set_motor_currents(int pwm_A)\r\n{\r\n  set_motor_pwm(pwm_A, MOTORPIN1, MOTORPIN2);\r\n}\r\nvoid spin_and_wait(int pwm_A)\r\n{\r\n  set_motor_currents(pwm_A);\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ assigning a variable to the light input\r\n  int lightVal;\r\n  lightVal = analogRead(PHOTORESISTORPIN);\r\n  lightVal = map(lightVal, 220, 1000, 0, 100);\r\n\r\n  \/\/ laser sensor stuff \r\n  VL53L0X_RangingMeasurementData_t measure;\r\n  Serial.print(\"Reading a measurement... \");\r\n  lox.rangingTest(&amp;measure, false); \/\/ pass in 'true' to get debug data printout!\r\n  if (measure.RangeStatus != 4) {  \/\/ phase failures have incorrect data\r\n    int distanceVal = measure.RangeMilliMeter;\r\n    Serial.print(\"Distance (mm): \"); Serial.println(distanceVal);\r\n  } else {\r\n    Serial.println(\" out of range \");\r\n  }\r\n\r\n  \/\/ set a variable for the servo's position, and change it based on the photoresistor value\r\n  int motorPos = 0;\r\n  motorPos = map(lightVal, 0, 100, 170, 92);\r\n  gaugeMotor.write(motorPos);\r\n\r\n  \/\/ change the motor speed depending on the laser sensor's read\r\n  int motorspeed = map(measure.RangeMilliMeter, 20, 100, 65, 194);\r\n  set_motor_currents(motorspeed);\r\n\r\n  \/\/ store the laser sensor's read in a variable\r\n  int distanceVal = measure.RangeMilliMeter;\r\n\r\n  if ((millis() - quarterTimer) &gt;= QUARTERWAIT) {\r\n    \r\n    \/\/print the intermediate values (mapped)\r\n    \r\n    screen.clear();\r\n    screen.home();\r\n    screen.print(\"i:\");\r\n    screen.print(lightVal);\r\n\r\n    screen.setCursor(6, 0);\r\n    screen.print(\"m:\");\r\n\r\n    motorPos = map(motorPos, 170, 92, 0, 99);\r\n    screen.print(motorPos);\r\n\r\n    screen.setCursor(8, 1);\r\n    distanceVal = map(distanceVal, 20, 100, 0, 100);\r\n    screen.print(distanceVal);\r\n\r\n    screen.setCursor(12, 1);\r\n    screen.print(\"o:\");\r\n    motorspeed = map(motorspeed, 65, 194, 0, 100);\r\n    screen.print(distanceVal);\r\n\r\n    quarterTimer = millis();\r\n  }\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jonathan Lindstrom + Frances Adiwijaya Narrative Description: Our work uses a little thing which reads how bright the lights are in the room. When it is really bright&#8230;<\/p>\n","protected":false},"author":227,"featured_media":16156,"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\/16089"}],"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\/227"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/comments?post=16089"}],"version-history":[{"count":27,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16089\/revisions"}],"predecessor-version":[{"id":16274,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/posts\/16089\/revisions\/16274"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media\/16156"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/media?parent=16089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/categories?post=16089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2022\/work\/wp-json\/wp\/v2\/tags?post=16089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}