How to Build a Micromouse Robot - Mechanical, Hardware, Software

How to Build a Micromouse Robot - Mechanical, Hardware, Software

This detailed guide explains how to build a complete Micromouse robot from scratch.



Mechanical Design Considerations of Micromouse

Chassis

The chassis determines weight distribution, sensor placement, and ground clearance. Most competitive teams design a custom PCB that doubles as the chassis - this saves significant weight over acrylic or aluminium plates. Good mechanical design is critical.

Key Mechanical Constraints

  • Footprint: Must fit inside a 25 × 25 cm square (the maze cell opening is 16.8 cm wide)
  • Ground clearance: 2?5 mm to avoid catching on wall posts
  • Wheel base: 70?90 mm between drive wheel centers for stable turning
  • Weight: Lighter is faster ? aim for under 100 g including battery
  • Center of mass: Keep low and centered over the drive axle to minimize wheel slip during acceleration
  • Weight Distribution : Aim for balanced weight near the center.
-. Stable turning
-. Reduced wheel slip
-. Better acceleration
  • Ground Clearance
-. Too high: Unstable 
-. Too low: Scrapes maze floor
-. Recommended: 1–3 mm clearance 

Differential Drive vs Omni

Most Micromice use differential drive (two driven wheels, one or two passive front casters). Omni-wheel designs are rare and mechanically complex. For your first build, a two-wheel differential drive with a ball caster is the standard approach.

PCB-as-Chassis Approach

Design your main PCB in KiCad or EasyEDA with mounting holes for motors and sensor mounts. Use 1.6 mm FR4 PCB material ? stiff enough to serve as structural chassis while being light. Route motor traces on copper pour to handle current without extra wiring.

Recommended Dimensions

For half-size Micromouse:

    • Width: 7–9 cm
    • Length: 8–12 cm
    • Height: under 5 cm

Wheels and Tires

Wheel quality significantly affects performance.

Important Factors

    • Grip
    • Diameter consistency
    • Low vibration
    • Lightweight

Common Wheel Sizes

    • 20–35 mm diameter

Silicone tires are widely used for excellent traction.


Hardware Design Considerations of Micromouse

Microcontroller

The microcontroller is the brain of the robot.

Common Choices

MCUAdvantages
STM32Fast and powerful
ESP32Wireless support
TeensyHigh-speed processing
ArduinoBeginner-friendly

Recommended

STM32 is widely used in competitive Micromouse robots due to:

    • Fast ADC
    • Hardware timers
    • Interrupt support
    • High processing speed

Sensors

Sensors are the mouse's eyes. You need to reliably detect walls in three directions: front, left, and right. Some advanced designs also use diagonal sensors for wall-following accuracy during turns.

Infrared (IR) Emitter / Detector Pairs

The classic approach uses an IR LED paired with an IR phototransistor. The maze walls reflect IR light, and the detector reading indicates distance. You need at least three pairs: front-left diagonal, front-right diagonal, and optionally a straight-ahead pair. Advantages include high speed (no I²C overhead), low latency, and low cost.

The main challenge with IR is ambient light interference. Solve this by rapidly toggling the emitter (e.g., at 10 kHz) and reading the difference between the "LED on" and "LED off" ADC values ? this cancels ambient noise.

Time-of-Flight (ToF) Sensors

VL53L0X or VL53L1X sensors use laser ranging and return absolute distance in mm over I²C. They are more accurate and immune to ambient light, but add I²C bus latency. Multiple sensors on a single I²C bus require addressing via XSHUT pins on startup.

Sensor Placement

    • Diagonal IR sensors: Mount at 45° on each front corner to detect side walls as the robot enters a cell
    • Front sensor: Aimed straight ahead, detects the wall at the end of the current cell before arrival
    • Mounting height: Aim sensors at the midpoint of the wall height (approximately 3 cm off the ground)

Motors

A fast, precise motor system is critical. You need not just speed but exact speed control- both wheels must turn at precisely calculated rates to navigate straight lines and accurate 90° turns.

Motor Selection

Pololu N20 micro metal gearmotors are the industry standard for Micromouse. Choose a gear ratio based on your target speed. A 10:1 ratio gives a high top speed; a 30:1 gives more torque for climbing slight imperfections. For 32 mm wheels at 6 V, a 10:1 or 15:1 ratio typically reaches 1-2 m/s. Stepper Motors are less common today due to lower efficiency at high speed.

Motor Driver

The TB6612FNG or DRV8833 dual H-bridge handles both motors. Connect PWM, direction, and standby pins to your MCU. Use PWM frequencies of 10-20 kHz to avoid audible motor whine.

Quadrature Encoders

Magnetic encoders (e.g., Pololu magnetic encoder kit) attached to the motor shaft provide velocity and position feedback. Wire both A and B channels to interrupt-capable MCU pins for quadrature decoding - this gives you direction as well as count. At 512 counts per revolution with a 32 mm wheel, you get approximately 0.2 mm per count resolution.


Power System

A clean, stable power supply is crucial. Motor switching noise can corrupt sensor ADC readings and crash your MCU if not properly managed.

Power Architecture

    • Battery: 2S LiPo (7.4 V nominal, 8.4 V full charge) powers the motors directly via the motor driver
    • MCU rail: 3.3 V from an LDO regulator (AP2112K or similar, 600 mA) - separate from motor power
    • Sensor rail: Some IR emitters may run at 3.3 V; ensure your regulator can supply adequate current
    • Decoupling: Place 100 nF ceramic capacitors on every IC power pin, with a 10 μF bulk capacitor near the motor driver input
    • Power switch: A physical slide switch for safe power-on before placing in the maze

Battery Management

Add a battery voltage divider to an MCU ADC pin. Implement a low-battery warning (e.g., an LED or buzzer when voltage drops below 7.0 V) to prevent LiPo damage from over-discharge. Never run a LiPo below 3.0 V per cell.



Software Design Considerations of Micromouse

Main Software Modules

ModulePurpose
Sensor processingRead wall data
Motor controlDrive motors
PID controllerStabilize movement
Maze mappingStore maze structure
Path planningFind shortest route
Motion profilingSmooth acceleration

PID Control System

PID control stabilizes the robot.

PID Formula

          u(t)=Kpe(t)+Kie(t)dt+Kdde(t)dtu(t)=K_p e(t)+K_i \int e(t)dt+K_d \frac{de(t)}{dt}

Where:

    • KpK_p = proportional gain
    • KiK_i = integral gain
    • KdK_d = derivative gain

Wall Following

The robot continuously adjusts position using side-wall sensors.

Objectives

    • Stay centered
    • Reduce oscillation
    • Maintain high speed

Maze Solving Algorithms

The maze-solving algorithm is the heart of Micromouse intelligence.

1. Flood Fill Algorithm

Most popular method.

How It Works

      • Assign values to maze cells
      • Goal has value 0
      • Neighboring cells increase in value
      • Robot follows lowest-value path

Advantages:

      • Reliable
      • Efficient
      • Easy to implement

2. DFS (Depth First Search)

Explores one path fully before backtracking.

Advantages: Simple implementation

Disadvantages: Slower optimization

3. Dijkstra Algorithm

Finds shortest path mathematically.

Advantages: Accurate

Disadvantages: More computation


Motion Profiling

Competitive Micromouse robots use motion profiles for smooth acceleration.

Trapezoidal Velocity Profile

            v(t)=v0+atv(t)=v_0+at

Benefits:

    • Smooth movement
    • Reduced wheel slip
    • Better cornering

Recommended Development Tools

ToolPurpose
KiCadPCB design
STM32CubeIDEFirmware development
PlatformIOEmbedded development
MATLABSimulation

Summary

Building a Micromouse robot is a complete engineering education in miniature. You will learn PCB design, embedded firmware, real-time control theory, and algorithm design - all in a competition format that gives you immediate feedback on every decision.

Whether you are a student, hobbyist, or professional engineer, Micromouse development provides an exciting challenge that improves both technical and problem-solving abilities.

With proper design, tuning, and testing, your Micromouse robot can successfully navigate complex mazes and compete in international robotics competitions.

Start simple: get a robot moving reliably in a straight line. Then add sensors, then mapping, then pathfinding. Each layer builds on the last. The journey from blinking LED to center-cell finish is one of the most satisfying in all of robotics.

"The best Micromouse is not the fastest motor - it is the most accurate map."

Comments

Popular posts from this blog

Micromouse Competitions – Types, Overview, Comparison, Advantages, Worldwide

Micromouse - Introduction, History, Core Technical Concepts, Future