
Justin Sapun,
justin.sapun.th@dartmouth.edu
Chingpheng Phoun, Chingpheng.Phoun.th@dartmouth.edu
Vuthy Vey, Vuthy.Vey.th@dartmouth.edu
Micromouse is a fast-paced engineering challenge requiring a robot to autonomously navigate a 16x16 maze as efficiently as possible. Our team designed, built, and programmed a two wheeled robot from scratch, integrating custom hardware, realtime sensor feedback, path finding algorithms, and control logic. Throughout the term, we iterated on mechanical design, tuned control loops, and debugged navigation behavior to achieve reliable maze solving performance.
Necessary Components
-
Arduino Due microcontroller
-
Two N20 motors with encoders
-
Adafruit VL53L0X ToF sensors for wall detection
-
MPU6050 IMU for orientation sensing
-
Pololu DRV8833 motor driver
-
LiPo battery and voltage regulator
-
LEDs and pushbuttons for debugging
-
Custom 3D printed chassis
Implementation
Our Micromouse system was structured around a finite state machine with three major states: search, return, and race. During the search phase, the robot explores the maze, updating its internal map and making decisions using the floodfill algorithm. In the return state, the robot retraces its learned path back to the start, and in the final race state, it executes the shortest path to the center at higher speeds. These states govern all motion and sensing logic. The Arduino Due serves as the central controller, integrating data from Adafruit ToF distance sensors and an IMU for environment sensing, and reading wheel encoders for odometry. This data feeds into a control loop that uses PI-based turning and velocity controllers. Motor commands are output through dual H bridge drivers, allowing for precise realtime control. All components work in tandem to support accurate wall detection, localization, and fast, efficient maze traversal.

Velocity Control
Our velocity controller maintained a target speed as the mouse traveled through straight corridors. We used wheel encoders for feedback and implemented a lead compensator with an underlying PI to provide both responsiveness and steady state accuracy. The controller adjusted PWM outputs to the motors in realtime, enabling smooth acceleration and deceleration based on high level movement commands.

Forward-to-Wall Control
To approach walls precisely, we again implemented a PI + lead controller using distance measurements from the front-facing ToF sensor. This allowed the mouse to decelerate as it neared the target stopping distance, minimizing overshoot and ensuring consistent stopping behavior. The controller was especially useful during exploration when the mouse encountered unknown walls or needed to pause before making a turn.

Turn Control
Turns were executed using a simple PI controller acting on yaw data from the IMU. The controller compared the current heading to the desired heading and adjusted the motor speeds to complete in-place or arc turns. By focusing on angular velocity and orientation error, this system achieved consistent 90° turns critical for navigating tight maze corners.
Floodfill Solving Algorithm
Floodfill is the dominant pathfinding algorithm in Micromouse due to its efficiency and simplicity. It
assigns a numerical "cost" to each maze cell based on its distance from the goal. At every decision point,
the mouse chooses the neighboring cell with the lowest cost, naturally guiding it toward the center.
We implemented our own floodfill algorithm in C++, maintaining and updating a cost map in real time as new
walls were discovered. Each wall sensor update triggered a recalculation of the grid, allowing the mouse to
dynamically explore and refine its path. During the final race, the mouse retraced the fastest known path
using the updated cost map.
To test the algorithm, we simulated multiple maze configurations and validated that the mouse always reached
the center and back with optimal moves. The video here shows one of short successful runs, the video begins
as the mouse is finishing the first exploratory phase.
Skills
This project strengthened our skills in embedded C++ programming, digital control implementation, and sensor integration. We gained experience in debugging under hardware constraints, applying control theory, and using 3D design tools to optimize the robot's layout for sensing and maneuverability.