The Elegoo Tumbller Robot Completing the obstacle course.

Michael Leahy
4 min readApr 19, 2021

Well the time is here the final part of these series of blogs for the Elegoo Tumbller Robot. I know I know, I’m upset about it as well! They grow up so fast… he’s going to venture out into the crazy world that is the obstacle course and get things fired at him but he’ll pick them right out of the air, I believe in him! Welcome back and thanks for keeping on tuning in.

Challenge:

You will be required to assemble a home obstacle course for your robot to navigate. The obstacle course will be 60cm wide and 200cm long and will contain a range of obstacles. The goal will be to navigate your robot through the obstacle course, stop to collect ping pong balls and then cross the finish line.”

This challenge was given to us by our design professor and I have throughly enjoyed it and I think most people have. The hands on experience is what all of us engineers at Trinity College Dublin crave!

But how are earth are we going to program the robot to complete this tricky maze? I started by downloading Arduino IDE. The Arduino Integrated Development Environment (IDE) is a cross-platform application that is written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards, boards like the one used with the Elegoo Tumbller ….. Hell yeah !!!

I downloaded the source code for the Tumbller robot from the Elegoo website and spent sometime going through it all in the Arduino IDE to get a good grasp on what the frick is going on. This took a few days to get used to but there are so many open source examples of similar code online, this makes the learning curve for Arduino IDE much faster. As I have an attachment that allows the robot to balance by itself, there was no longer any need for the self balancing code, along with removing this section of code many other sections of code (eg. led party mode or obstacle follow mode) can be removed as they aren’t necessary to complete this obstacle course. The source code for the motors was retained as these were necessary for movement throughout the course… some of this source code can be seen below.

The functions I used to make the robot move through the maze were based off the robot detecting obstacles via its sensors… when the robot came within a stated distance from an obstacle in front of it, I had the robot turn whichever way I needed it to. The turning and moving in straight lines through the maze were all based on timing, ie. if there’s an obstacle within 10 units I activate the left motor for a certain amount of time to turn it to a desired direction…the same was done with straight movements. It took some time to get my head around it but in the end it wasn’t too bad. I suppose all challenges are similar in a way to that, in hindsight things we find “difficult” are looked at with ease after you’ve done it a few times.

  • The code above on the leftmakes the robot move forward until it’s within 10 units from an obstacle, it will then stop. If no obstacle present the robot will just keep going forward at speed 60 until it is met with an obstacle.
  • The code on the right is the turning system I implemented. It works off delays, I tell the robot to activate the left motor and it’ll keep doing this for the duration if the delay stated. After this delay ends the robot will stop and then I will use the code on the left again to move the robot forward in the obstacle course.

The same method was used for turning right, ie. the right motor activated.

Completing the Course:

Link for full completion of course: https://www.instagram.com/p/CN3LlefAd4W/

Link for accuracy of launcher: https://www.instagram.com/p/CN3KXRZAogy/

After many painstaking attempts of trying to get the robot to complete the course… it finally happened. The completion of the course has to be given merit based on the accuracy of the launcher design… if my launcher wasn’t accurate I may have been weeks trying to get a “fluke” completion. This wasn’t the case however… after calibrating the times in my code carefully to complete the course, the robot can navigate the obstacle course with ease along with catching a ping pong ball everytime. MISSION COMPLETE!! Signing out for now.

Peace and Love,

Michael.

--

--