This project was developed from scratch for the World Robotics Championship (WRC), where robots navigate through complex mazes autonomously. The robot uses advanced algorithms and precise hardware to efficiently solve and traverse mazes.
The World Robotics Championship challenges to create autonomous robots capable of navigating complex mazes. Robots must efficiently explore, map, and solve the maze while adhering to strict competition rules.
The robot's hardware was carefully selected to balance performance, reliability, and ease of implementation:
- Microcontroller: Arduino Mega
- Motors: N20 1000rpm motors with encoders
- Sensors: Sharp IR sensors for wall detection
- Chassis: Zero pcb board
-
Arduino Mega: opted for the Arduino Mega instead of the Nano due to its increased number of interrupt pins, which were crucial for our encoder implementation,STM 32 was preferred but because of less time remaining for the competition and increased complexity of STM32 arduino mega was choosen.
-
N20 Motors with Encoders: These compact motors with built-in encoders provide precise control over movement. The encoders allow for accurate position tracking, essential for navigating the maze reliably.
-
IR Sensors: Used three IR sensors (left, front, right) for wall detection, enabling the robot to map its surroundings and make navigation decisions.
Our software implementation combines several algorithms and techniques to efficiently solve the maze:
-
Flood Fill Algorithm: The core of our maze-solving strategy. It helps determine the optimal path to the goal and unlike wall hugging algorithms it doesn't get stuck because of free standing wall.
-
PID Control: Implements precise motor control for smooth movement and turns.
-
Wall Detection and Mapping: Continuously updates the maze map based on sensor readings.
-
Orientation Tracking: Keeps track of the robot's direction within the maze.
-
Dynamic Path Planning: Recalculates the optimal path as new information about the maze is discovered.
-
State machine architecture: The robot's behavior is managed through a state machine, allowing for clear transitions between different modes of operation (e.g., exploration, backtracking, goal-seeking).
-
Modular code structure: The software is organized into distinct modules for sensor management, motor control, maze solving, and high-level decision making, improving maintainability and allowing for easier future enhancements. Key software features:
- Real-time maze mapping
- Efficient path recalculation
- Smooth motion control
- Error handling and recovery strategies
To set up and run the project:
- Clone this repository
- Install the Arduino IDE
- Install required libraries (Wire.h,stdint.h)
- Connect the hardware components according to the pin configuration in the code
- Upload the code to your Arduino Mega
- Place the robot at the start of the maze and power it on and dont forget to specify the maze size and the target position.
-
Migrate to STM32: While we chose Arduino for its simplicity and our time constraints, migrating to an STM32 microcontroller could offer improved performance and more advanced features.
-
Optimize Flood Fill: Further refine our flood fill algorithm for even faster maze solving.
-
Enhance Sensor Array: Add more sensors for improved environmental awareness and obstacle detection.
-
Develop Custom PCB: Design a custom PCB to reduce wiring complexity and improve reliability.
-
Use of Vaccuum fan: Design ,test and implement a vaccuum suction device for improved friction to avaoid slippage which adds up to position inaccuracy.
I welcome contributions and suggestions to improve Maze Solver Robot.

