Welcome to the official repository of our Open Source Micromouse - a fast, intelligent, and compact maze-solving robot. This project aims to document every step of the design and development process, making it easy for students, hobbyists, and engineers to learn and contribute.
To design and develop a four-wheel differential drive Micromouse robot capable of solving mazes efficiently with smooth acceleration, encoder feedback, and intelligent path planning - while maintaining openness for community learning and contribution.
- 🔍 Research & Reference Designs
- 🧩 Component Selection
- 📐 Mechanical Design
- ⚙️ Drive System
- 🔩 Drive System Assembly
- 🔌 Electronics & PCB Design
- 📦 Firmware Development
- 🖥️ Using the Mouse
- 🧠 Algorithms & Strategy
- 📸 Gallery
- 📚 Resources
- 🤝 Contributing
- 📜 License
- 📬 Contact & Support
Before jumping into development, we explored multiple Micromouse designs, performance benchmarks, and open-source efforts.
- Ukmars
- Greenye (Good YouTube channel)
- Micromouse Online Handbook
- Speed Profile
- Green-Giant
Reference images:
| Reference Design 1 | Reference Design 2 |
|---|---|
![]() |
![]() |
Every part was chosen with precision to balance performance, weight, and efficiency.
| Component | Description | Datasheet |
|---|---|---|
| MCU | STM32F405 (ARM Cortex-M4) | Datasheet |
| Motors | Coreless Motor 1215 with quadrature magnetic encoders | Buy |
| Encoders | Built-in quadrature magnetic encoders | - |
| IMU | ICM-42688 | Datasheet |
| Sensors | TEFT4300 IR sensors with SFH4545 | Datasheet |
| Power | 2S Li-Po 250mAh | Buy |
💡 Includes datasheets for all components in the
Research/Datasheetsfolder.
- Designed in Onshape
- Lightweight 3D printable chassis
- Wheel size and placement optimized for turn radius
💡 Includes STL files for all parts in the
Design/folder.
- Differential drive with PID-based velocity control
- Closed-loop motor control using encoders and gyro
- Acceleration curve implemented to avoid overshoot and wheel slippage
- ✔️ Encoder and Gyro feedback integrated
- ✔️ PWM control through timer
- ✔️ Slew rate limiter for smooth turns
| V1 | V2 | V3 |
|---|---|---|
![]() |
![]() |
![]() |
- Initial concept: single driven wheel per side - very simple and lightweight, but limited in traction, torque, and fault tolerance.
- Iteration: switched to two wheels per side with proper gearing to share load, increase effective traction and torque, and add redundancy; gear ratio chosen for balanced acceleration and top speed.
- Optimization: integrated motor mounts and trimmed mounting hardware to reduce space and mass; components repositioned to lower the center of gravity and simplify wiring and belt/gear routing.
- Result: a compact, lightweight differential-drive assembly with improved performance, reliability, and manufacturability - documented trade-offs between complexity, weight, and available space.
Tools required: screwdriver and some patience :)
- Big gear and pins - harvested from an MG996R servo. You can either reuse the original gear pins or cut the servo screws and use those as compact pins (we need 4 of them).
- Small gear - taken from an SG90 servo (we need 2 of them).
- O-Rings - find them at your local hardware shop.
- All other structural parts - 3D printed (mounts, spacers).
- Prepare O-Rings, gears, and pins.
- Fit O-Ring into the 3D printed rim.
- Insert the pin/screw as shown in the figure.
- Install the small gear on its printed mount and verify axial alignment with the big gear. Adjust spacers as needed for proper backlash (~0.1–0.3 mm).
- Mount the motor.
- Assemble the two-wheel side: place the wheels with pins into the mount.
- Final check: rotate assembly by hand, verify smooth mesh, confirm no binding at extreme angles, and measure encoder counts while rotating to ensure correct coupling.
- Keep gear mesh slightly loose to avoid binding under load.
- If using servo screws as pins, file the screw heads flush and secure with a small dab of adhesive.
- Document final spacer thicknesses for repeatable builds.
Designed using EasyEDA - a free tool for beginners. Our custom 2-layer PCB includes:
- STM32F405 MCU
- Power ICs
- Motor, encoder, and power connectors
- Motor drivers (DRV8833)
- Programming header (SWD)
- Debugging ports (UART)
| Design | Soldered |
|---|---|
![]() |
![]() |
💡 Includes relevant files in the
PCB/folder.
# PCB files and Gerbers:
PCB/
├── BOM.csv
├── micromouse.sch
└── gerbers/- Download and install STM32CubeIDE from STMicroelectronics.
- ST-Link USB debugger and drivers (or STMicro STM32CubeProgrammer for flashing).
- USB cable and target board powered.
- Open the repository and find the Firmware folder (
Firmware/). - Confirm structure:
Core/(Src, Inc),Drivers/,.ioc,Debug/orRelease/.
- File → Import → General → Existing Projects into Workspace → select Firmware and finish.
- If there is a
.iocfile, double-click it to open the CubeMX editor.
- The project already contains generated init functions (
MX_GPIO_Init,MX_TIMx_Init,MX_USARTx_Init, etc.) inCore/Src(gpio.c,tim.c,usart.c). main.ccalls theseMX_*functions. Do not delete them.- If you need to change pin assignments: edit the
.iocin CubeMX, re-generate code (Project → Generate Code). Keep user code within theUSER CODE BEGIN/ENDblocks to avoid overwrites.
If you see missing headers from Core/Drivers/Inc, add the folder to the IDE include paths:
Project → Properties → C/C++ Build → Settings → Tool Settings → GCC C Compiler / GCC C++ Compiler → Includes
Add this include path (for both C and C++):
${workspace_loc:/${ProjName}/Core/Drivers/Inc}- Project → Build All (or Ctrl+B).
- Fix any MCU mismatch by verifying the target MCU in the
.iocor project properties.
- Connect the board via ST-Link.
- Run → Debug As → STM32 Debugging (or Run As → STM32 C/C++ Application to run).
- Ensure target power and correct debug port (SWD).
- Preserve
USER CODE BEGIN/ENDregions when regenerating code. - If HAL symbols are missing, re-generate CubeMX code or enable the required middleware/peripherals in the
.ioc. - If pins appear wrong at runtime, verify
.iocpinout matches the board silkscreen/labeling and thatMX_GPIO_Initis being called frommain.c.
- Firmware imported →
.iocverified → Generate (if changed) → Build → Connect ST-Link → Flash/Debug.
This will get the provided firmware building, pins initialized (via the generated MX_* init functions), and the code running on your STM32 target.
- Once flashed, the mouse firmware will run automatically on power-up.
- The mouse should start tracking movement and button presses based on the configured sensors and GPIO pins.
For runtime debugging and configuration, you can communicate with the mouse over UART:
- Connect an HC-05 Bluetooth module to the UART TX/RX pins (refer to the PCB layout).
- Alternatively, use a USB-to-UART adapter directly connected to your PC.
- Baud rate: 115200
- Data bits: 8
- Parity: None
- Stop bits: 1
- Pair your phone with the HC-05 Bluetooth module.
- Use a Serial Bluetooth terminal app (e.g., "Serial Bluetooth Terminal" on Android).
- Connect to the HC-05 device.
- Send
helpto display all available debug commands. - Use the listed commands to inspect sensor values, test buttons, adjust sensitivity, or troubleshoot issues in real-time.
> help
[List of commands appears]
> info
[Current mouse state and sensor readings]
This allows you to tune and debug the mouse behavior without reflashing the firmware.
We welcome contributions from the community! Whether you're fixing bugs, improving documentation, or adding new features:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open-source for educational and non-commercial use only.
- Firmware: Licensed under GNU GPLv3
- Designs, PCBs, Images and Research Documentation: Licensed under CC-BY-NC-SA 4.0
You must:
- Credit RoboticGen (Pvt) Ltd when sharing or modifying.
- Release your derived works under the same license.
- Not use this work or any derivative for commercial purposes.
Example attribution:
Based on the RoboticGen (Pvt) Ltd Open Source Micromouse Project - OBO Mouse v4 (https://github.com/RoboticGen/obo-mouse-v4)
This is not an overnight project. The current state of the Obo-Mouse v4 codebase is the culmination of years of consistent effort and tireless dedication by the robotics enthusiasts at RoboticGen. Everything you see here was built on the foundation of hands-on experience, countless iterations of building micromouse robots, and the invaluable knowledge gained from participating in competitions over the years.
A massive thank you to the team who made this open-source release possible:
Have questions or need help? Feel free to reach out!
- Issues: Open an issue on this repository
- Discussions: Join our community discussions
Happy building! 🐭🚀
Made with ❤️ by the Sri Lankan Open Source Micromouse Team





















