We are tasked to build a mBot robot that can find its way through a maze in the shortest time. There will be challenges along the way in the form of coloured tiles that signify the next direction the robot needs to head towards to traverse the maze. There are walls surrounding the maze and the robot needs to avoid them while navigating the maze.
Pictures of our mBot project:
![]() |
![]() |
---|---|
Left side (Infrared sensor) | Right side (Ultrasonic sensor) |
Our robot is tasked to navigate through a maze similar to the one shown below. It must not hit any walls at the sides indicated by blue lines.
While navigating the maze, a waypoint challenge will be indicated with a black strip on the maze floor. A waypoint challenge is simply a colored tile on the floor. There are 5 different possible colors, red, orange, green, blue and purple. Each color represents a type of turn the robot needs to execute to correctly traverse the maze.
At the end of the maze, the colour of the paper underneath the mBot at the waypoint challenge will be white to signify the end.
The following are the hardware connections to the mBot for our program to run correctly.
Motor connections | mBot sensor connections | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Arduino | Component |
---|---|
A0 | Light Dependent Resistor |
A1 | Infrared Detector |
A2 | 1A of 2-to-4 decoder |
A3 | 1B of 2-to-4 decoder |
Next, the light sensor will be calibrated by running color_calibration.ino
. You will be instructed to place a white piece of paper followed by a black piece of paper below the mBot. Once calibration is complete, the program will show the raw RGB values it is currently sensing.
Lastly, run the main program project.ino
. Other files including a_utility.ino
, b_navigation.ino
, c_periperhals.ino
and d_sensor.ino
are tabs to the main ino file and should be compiled together. Ensure that they are recognised as tabs for the program to compile correctly.
A brief description of the sensors used in our implementation is as follows:
Sensor | Purpose |
---|---|
Ultrasonic sensor | Mounted on the right side of mBot intended to detect proximity to walls on the right. However, as the IR sensor was not used, we implemented the PID algorithm to ensure the robot maintains a ideal distance of 10 cm away from the right wall. The distance measured by the ultrasonic sensor was used as input to the PID algorithm. A digital low-pass filter was implemented to reduce noise in the ultrasonic readings to further improve the performance of the PID algorithm. |
mBot line follower | Mounted at the front of mBot facing downwards to detect the black line on the floor which indicates the presence of a waypoint challenge |
Custom color sensor | Mounted at the bottom of mBot facing downwards to identify the color of the tile at a waypoint challenge. The corresponding turn can then be executed to navigate the maze.
|
Infrared sensor | Intended to detect left wall but not used due to lack of reliability |
A more detailed explanation of our implementation can be found here.
The full explanation of our robot implementation can be viewed in our group report here.
We did not implement the IR sensor due to the lack of reliable readings from the sensor. We decided to focus on improving the robustness of our colour sensor and PID algorithm.
There are a few edge cases where the robot will veer off course and an IR sensor would have helped completely eliminate such issues. Perhaps if there was more time, we could have implemented the IR circuit properly into our robot.
Somehow the PID algorithm is able to navigate the maze even when there are no walls. It does so by applying corrections to the robot's movements when the ultrasonic sensor detects the pillars on the field.