
{"id":7275,"date":"2023-06-30T08:02:36","date_gmt":"2023-06-30T08:02:36","guid":{"rendered":"https:\/\/dyor.webs.upv.es\/?p=7275"},"modified":"2023-06-30T08:02:36","modified_gmt":"2023-06-30T08:02:36","slug":"english-dancing-and-object-avoiding-bped-robot","status":"publish","type":"post","link":"https:\/\/dyor.webs.upv.es\/en\/english-dancing-and-object-avoiding-bped-robot\/","title":{"rendered":"Dancing and object avoiding bPED Robot"},"content":{"rendered":"<p>For our Mobile Robotics projects, we chose to construct a bPED robot with laser-cut wood, and implemented a simple object avoidance algorithm, an audio feedback for the ultrasonic sensor and a remote control app which can make the robot move, dance, and show different emotions.<\/p>\n<p><!--more--><\/p>\n<p>For hardware, we ordered the &#8220;DYOR bPED B\u00e1sico con LEDs Corte L\u00e1ser Madera&#8221; from <a href=\"https:\/\/roboticafacil.es\/cat\/robots-es\/\">roboticafacil.es<\/a> and assembled the robot following the <a href=\"https:\/\/roboticafacil.es\/doc\/Robot-bPED-Madera-Metal-OLED-Guia-de-Iniciacion.pdf\">given instructions<\/a>. The robot includes a buzzer, an ultrasonic sensor, LEDs and a bluetooth module. To demonstrate the full functionality of this robot, we implemented three different programs which we explain in the following paragraphs.<\/p>\n<p><strong>Object avoidance<\/strong><\/p>\n<p>The object avoidance algorithm is fairly straightforward and shows the basic functionality of the robot. Once activated, the robot walks forward, until it comes to close to an object, at which point it stops, turns left for a bit, and then continues walking. This is a simple state machine, where the robot regularly measures the distance, then decides by comparing the measurement to a given safety distance to enter either state 1 for forward walking straight or state 2 for turning left. All different states are accompanied by LED expressions (neutral for measuring, happy for walking straight, sad for turning left). The code can be easily implemented using <a href=\"https:\/\/facilino.webs.upv.es\/dashboard.php\">facilino<\/a>, as can be seen in the following screenshot:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7281 \" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/code-163x300.jpg\" alt=\"\" width=\"212\" height=\"390\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/code-163x300.jpg 163w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/code.jpg 415w\" sizes=\"auto, (max-width: 212px) 100vw, 212px\" \/><\/p>\n<p><strong>Audio feedback for distance sensor<\/strong><br \/>\nThe idea of this program is for the robot to act as the audio sensor a car might possess for parking. That means the robot should emit a beeping sound which gets faster the closer the robot is to an obstacle, giving audio feedback for its distance measurements. While this might seem very straightforward, contrary to the first program this can not simply be accomplished by using facilino building blocks. This is because the actions of walking and distance measurement\/beeping need to be performed simultaneously and continuously for the idea to work. As two things need to happen at once, using the delay() function is not a valid option to implement the intervals between different beeps. Instead a timer must be used and continuously updated and compared. Furthermore, the walking action takes long and so if we perform the distance measurement\/beep only after each walking cycle, the interval between subsequent tones never becomes sufficiently short to produce the desired effect. We solved these problems by editing the code directly in the Arduino IDE: We implemented a function which performs both the distance measurement\/beeping and then call this function inside the movement cycle (bPED_moveServos(&#8230;) and bPED_oscillateServos(&#8230;)):<\/p>\n<div>\n<pre>\/\/measures distance, and checks if beep is necessary\r\nunsigned long beepboop(unsigned long prev_ms){\r\n  int dist=distance((D9),(D8));\r\n  unsigned long interval_ms=100 * dist;\r\n  if ((unsigned long) (millis() - prev_ms) &gt;= interval_ms) {\r\n  \u00a0 prev_ms=millis();\r\n  \u00a0 _tone(D3,440,50,0);\r\n  \u00a0 }\r\n  return prev_ms;\r\n}<\/pre>\n<\/div>\n<p>Finally, this program too has a safety distance implemented at which the audio feedback stops, a decending tone sequence is played and the robot walks backwards for a few steps before continuing. Again, the states are accompanied by LED expressions.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Bluetooh Module<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-7277 alignleft\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/5e95fc26-86b3-45f2-b4af-a0db790a5528-144x300.jpg\" alt=\"\" width=\"144\" height=\"300\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/5e95fc26-86b3-45f2-b4af-a0db790a5528-144x300.jpg 144w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/5e95fc26-86b3-45f2-b4af-a0db790a5528-493x1024.jpg 493w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/5e95fc26-86b3-45f2-b4af-a0db790a5528-768x1597.jpg 768w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/5e95fc26-86b3-45f2-b4af-a0db790a5528-739x1536.jpg 739w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/5e95fc26-86b3-45f2-b4af-a0db790a5528.jpg 985w\" sizes=\"auto, (max-width: 144px) 100vw, 144px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-7276 alignleft\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/2-1-144x300.jpg\" alt=\"\" width=\"144\" height=\"300\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/2-1-144x300.jpg 144w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/2-1-493x1024.jpg 493w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/2-1-768x1597.jpg 768w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/2-1-739x1536.jpg 739w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/2-1.jpg 985w\" sizes=\"auto, (max-width: 144px) 100vw, 144px\" \/>As already mentioned, the robot is equipped with a bluetooth module that it can use to receive instructions remotely.<\/p>\n<p>Taking advantage of the MIT APP INVENTOR programme, we developed an app that would act as an interface between the operator and the robot to allow it to perform a series of simple tasks. All the tasks where implemented by using Facilino.<\/p>\n<p>Once the Bluetooth connection between the devices is ensured, the user can choose between three categories of actions: &#8220;Move&#8221;, &#8220;Dance&#8221; and &#8220;Emoji&#8221;.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The &#8220;Move&#8221; screen is equipped with five cross-shaped buttons that allow the operator to choose the robot&#8217;s direction of movement. Each direction is associated with a colour that will be shown by the LED module.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-7280 alignleft\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/move-144x300.jpg\" alt=\"\" width=\"144\" height=\"300\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/move-144x300.jpg 144w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/move-493x1024.jpg 493w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/move-768x1597.jpg 768w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/move-739x1536.jpg 739w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/move.jpg 985w\" sizes=\"auto, (max-width: 144px) 100vw, 144px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-7279 alignleft\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/emoji-144x300.jpg\" alt=\"\" width=\"144\" height=\"300\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/emoji-144x300.jpg 144w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/emoji-493x1024.jpg 493w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/emoji-768x1597.jpg 768w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/emoji-739x1536.jpg 739w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/emoji.jpg 985w\" sizes=\"auto, (max-width: 144px) 100vw, 144px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-7278 alignleft\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/dance-144x300.jpg\" alt=\"\" width=\"144\" height=\"300\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/dance-144x300.jpg 144w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/dance-493x1024.jpg 493w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/dance-768x1597.jpg 768w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/dance-739x1536.jpg 739w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/dance.jpg 985w\" sizes=\"auto, (max-width: 144px) 100vw, 144px\" \/>The &#8220;Dance&#8221; screen provides a list of songs to choose from to play. Each song will be played by the buzzer; in addition, the robot will perform a series of dance steps and will show on the led module choreographies of colours in line with the selected song.<\/p>\n<p>The &#8220;Emoji&#8221; screen shows six expressions\/emotions that the robot can display. Each emotion is associated with a &#8216;facial expression&#8217; (shown by the LED module) and simple steps.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Video of the robot:<\/p>\n<p><div style=\"width: 600px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-7275-1\" width=\"600\" height=\"345\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/Robot_dyor.mp4?_=1\" \/><a href=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/Robot_dyor.mp4\">https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/Robot_dyor.mp4<\/a><\/video><\/div><\/p>","protected":false},"excerpt":{"rendered":"<p>For our Mobile Robotics projects, we chose to construct a bPED robot with laser-cut wood, and implemented a simple object avoidance algorithm, an audio feedback for the ultrasonic sensor and a remote control app which can make the robot move, dance, and show different emotions.<\/p>\n","protected":false},"author":813,"featured_media":7282,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[81],"tags":[],"class_list":["post-7275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/WhatsApp-Image-2023-06-22-at-09.45.50.jpeg","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":7882,"url":"https:\/\/dyor.webs.upv.es\/en\/english-dyor-tobias\/","url_meta":{"origin":7275,"position":0},"title":"DYOR: Tobias","author":"DasAas","date":"Wednesday June 26th, 2024","format":false,"excerpt":"The objective of this post is to provide an overview of the assignment to build a robot in the Mobile Robotics course during the spring semester of 2024. The robot is built with lowcost components and should have some functionalities like line tracking, obstacle avoidance, moving its arms, and making\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/dyor.webs.upv.es\/en\/category\/blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2024\/06\/profil.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2024\/06\/profil.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2024\/06\/profil.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2024\/06\/profil.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2024\/06\/profil.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2024\/06\/profil.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":2575,"url":"https:\/\/dyor.webs.upv.es\/en\/ensamblaje-dyor-bped-laser\/","url_meta":{"origin":7275,"position":1},"title":"Assembly of DYOR bPED with Laser Cutting","author":"soporte","date":"Wednesday January  3rd, 2018","format":false,"excerpt":"In this entry, we describe the assembly of DYOR bPED (manufactured with Laser cutting). Legs and feet 1. Glue the ankle to the robot's foot. 2. Insert the ball bearing inside the hole of the back-side leg part and insert the rivet inside the ankle's hole. 3. Glue the tip\u2026","rel":"","context":"In &quot;corte_laser&quot;","block_context":{"text":"corte_laser","link":"https:\/\/dyor.webs.upv.es\/en\/category\/fabricacion\/corte_laser\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/DYOR_assembly.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5411,"url":"https:\/\/dyor.webs.upv.es\/en\/disenos-2d-corte-laser-3mm\/","url_meta":{"origin":7275,"position":2},"title":"2D Robot Designs with Laser Cutting in 3mm","author":"soporte","date":"Thursday March  4th, 2021","format":false,"excerpt":"This post describes different 2D designs made with the DYOR, bPED and qPED robot and all its variants so far that can be used for the manufacture of parts by laser cutting with 3mm thickness. The DYOR robot, together with all its variants, as well as the bPED and qPED\u2026","rel":"","context":"In &quot;corte_laser&quot;","block_context":{"text":"corte_laser","link":"https:\/\/dyor.webs.upv.es\/en\/category\/fabricacion\/corte_laser\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2021\/03\/dise%C3%B1os_dyor_corte_laser.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8199,"url":"https:\/\/dyor.webs.upv.es\/en\/dyor-omnibeast\/","url_meta":{"origin":7275,"position":3},"title":"DYOR &#8211; OmniBeast","author":"OleMerulo","date":"Monday June 16th, 2025","format":false,"excerpt":"Introduction\u00a0 In our robotics project, we developed a mobile robot capable of omnidirectional movement and proximity-based audio feedback. The robot is based on a metal chassis and uses four Omniwheels (Swedish Wheels) powered by four TT DC motors. It is wirelessly controlled through a mobile app created with MIT App\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/dyor.webs.upv.es\/en\/category\/blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2025\/06\/omni_beast_main_MAIN-300x169.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2025\/06\/omni_beast_main_MAIN-300x169.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2025\/06\/omni_beast_main_MAIN-300x169.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":5816,"url":"https:\/\/dyor.webs.upv.es\/en\/english-pandabot\/","url_meta":{"origin":7275,"position":4},"title":"PandaBot","author":"CristinaAsenjo","date":"Saturday June 10th, 2023","format":false,"excerpt":"In this entry we are going to explain the design and programming of a panda robot based on the proposed DYOR kit. DESIGN: The proposed design is based on the DYOR kit from roboticafacil, specifically the panda model. For this purpose, the following components have been used: Arduino Nano +\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/dyor.webs.upv.es\/en\/category\/blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2021\/06\/dise%C3%B1o-261x300.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":7345,"url":"https:\/\/dyor.webs.upv.es\/en\/english-dyor-mobile-robotics-report\/","url_meta":{"origin":7275,"position":5},"title":"DYOR: Mobile Robotics Report","author":"dmschonh","date":"Friday June 30th, 2023","format":false,"excerpt":"In this post entry we explain our mobile robotics work assigment. The Design of the robot We assembled the robot by our own by buying the parts separately. Our robot consists of: Two steerable wheels with motors (no servomotors) and a caster wheel Two infrared sensors (obstacle detection) IR line\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/dyor.webs.upv.es\/en\/category\/blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/20230625_151744-1-scaled.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/20230625_151744-1-scaled.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/20230625_151744-1-scaled.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/20230625_151744-1-scaled.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/20230625_151744-1-scaled.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2023\/06\/20230625_151744-1-scaled.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/7275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/users\/813"}],"replies":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/comments?post=7275"}],"version-history":[{"count":3,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/7275\/revisions"}],"predecessor-version":[{"id":7409,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/7275\/revisions\/7409"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media\/7282"}],"wp:attachment":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media?parent=7275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/categories?post=7275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/tags?post=7275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}