{"id":488,"date":"2022-12-15T23:30:24","date_gmt":"2022-12-15T23:30:24","guid":{"rendered":"https:\/\/portfolio.wcu.edu\/bpeden1\/?p=488"},"modified":"2022-12-15T23:30:24","modified_gmt":"2022-12-15T23:30:24","slug":"finished-robot","status":"publish","type":"post","link":"https:\/\/portfolio.wcu.edu\/bpeden1\/2022\/12\/15\/finished-robot\/","title":{"rendered":"Finished Robot"},"content":{"rendered":"<p>For this objective, this robot is built and coded to run through a maze. At the end of the maze this robot has a sensor to detect a fire which is the &#8220;problem&#8221; and distinguish the flame with a fan. Some unique iterations on the robot include the motor mount, ultrasonic sensor, fire sensor, and wheel. For this we decided that its best to place everything with a purpose. The collection of the three components with fan, fire sensor, and ultrasonic sensor is best when close together. We placed the fire sensor right over the fan to increase accuracy when putting out the flame, and also put the ultrasonic sensor in the front to detect the wall clearly. With the wheels we built this with unique size and dimensions.<\/p>\n<p>Here&#8217;s the link to my partners blog, https:\/\/portfolio.wcu.edu\/ajjudson1\/<\/p>\n<pre><span style=\"color: #95a5a6;\">\/*<\/span>\r\n<span style=\"color: #95a5a6;\">*\/<\/span>\r\n\r\n<span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">inches<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">;<\/span>\r\n\r\n<span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">cm<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">;<\/span>\r\n<span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">delayTime<\/span><span style=\"color: #434f54;\">=<\/span><span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">;<\/span>\r\n\r\n<span style=\"color: #00979c;\">long<\/span> <span style=\"color: #000000;\">readUltrasonicDistance<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">triggerPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">echoPin<\/span><span style=\"color: #000000;\">)<\/span>\r\n<span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #d35400;\">pinMode<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">triggerPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">OUTPUT<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> \u00a0<span style=\"color: #434f54;\">\/\/ Clear the trigger<\/span>\r\n \u00a0<span style=\"color: #d35400;\">digitalWrite<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">triggerPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">LOW<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #d35400;\">delayMicroseconds<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">2<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #434f54;\">\/\/ Sets the trigger pin to HIGH state for 10 microseconds<\/span>\r\n \u00a0<span style=\"color: #d35400;\">digitalWrite<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">triggerPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">HIGH<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #d35400;\">delayMicroseconds<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">10<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #d35400;\">digitalWrite<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">triggerPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">LOW<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #d35400;\">pinMode<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">echoPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">INPUT<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #434f54;\">\/\/ Reads the echo pin, and returns the sound wave travel time in microseconds<\/span>\r\n \u00a0<span style=\"color: #5e6d03;\">return<\/span> <span style=\"color: #d35400;\">pulseIn<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">echoPin<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">HIGH<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n<span style=\"color: #000000;\">}<\/span>\r\n\r\n<span style=\"color: #00979c;\">void<\/span> <span style=\"color: #5e6d03;\">setup<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">)<\/span>\r\n<span style=\"color: #000000;\">{<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">begin<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">9600<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n<span style=\"color: #000000;\">}<\/span>\r\n\r\n<span style=\"color: #00979c;\">void<\/span> <span style=\"color: #5e6d03;\">loop<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">)<\/span>\r\n<span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #434f54;\">\/\/ measure the ping time in cm<\/span>\r\n \u00a0<span style=\"color: #000000;\">delayTime<\/span><span style=\"color: #434f54;\">=<\/span><span style=\"color: #000000;\">readUltrasonicDistance<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">7<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #000000;\">8<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">cm<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">0.01723<\/span> <span style=\"color: #434f54;\">*<\/span> <span style=\"color: #000000;\">readUltrasonicDistance<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">7<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #000000;\">8<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #434f54;\">\/\/ convert to inches by dividing by 2.54<\/span>\r\n \u00a0<span style=\"color: #000000;\">inches<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">cm<\/span> <span style=\"color: #434f54;\">\/<\/span> <span style=\"color: #000000;\">2.54<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">print<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">delayTime<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">print<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #005c5f;\">\"s, \"<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">print<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">cm<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">print<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #005c5f;\">\"cm, \"<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">print<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">inches<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<b><span style=\"color: #d35400;\">Serial<\/span><\/b><span style=\"color: #434f54;\">.<\/span><span style=\"color: #d35400;\">println<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #005c5f;\">\"in, \"<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #d35400;\">delay<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">100<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ Wait for 100 millisecond(s)<\/span>\r\n<span style=\"color: #000000;\">}<\/span><\/pre>\n<p>This is an example code of the ultrasonic sensor. We collectively used this code and codes for the fire sensor, and stepper motor. We setup the code is a fashion where all the codes sat in a for loop banking on the action of the other. For example the ultrasonic sensor reads the front of the robot to see if its clear and then the wheel will only activate then.<\/p>\n<p>&nbsp;<\/p>\n<p>Here are the final pictures below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-489\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-7-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-490\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-6-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-491\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-5-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-492\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-4-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-493\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-3-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-494\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-2-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-495\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-1-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-496\" src=\"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-content\/uploads\/sites\/1719\/2022\/12\/image0000-300x135.jpg\" alt=\"\" width=\"300\" height=\"135\" \/><\/p>\n<p>If we had more time on the project I would built the robot to not be exposed. I would built it to expose the fan, ultrasonic sensor, fire sensor, and plug for Arduino. Everything else I would cover up to protect the integrity of the piece. This strength would make the robot perform and look better. I would also replace the rubber bands on the wheels to O rings that would sit in a dished ring on the printed wheel. This would cause less slippage.<\/p>\n<p>Here&#8217;s the video of failing and success<\/p>\n<p>https:\/\/youtu.be\/12gXiiWuWqY\u200b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this objective, this robot is built and coded to run through a maze. At the end of the maze this robot has a sensor to detect a fire which is the &#8220;problem&#8221; and distinguish the flame with a fan. Some unique iterations on the robot include the motor mount, ultrasonic sensor, fire sensor, and [&hellip;]<\/p>\n","protected":false},"author":1935,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-488","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/posts\/488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/users\/1935"}],"replies":[{"embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":3,"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":499,"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/posts\/488\/revisions\/499"}],"wp:attachment":[{"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/bpeden1\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}