Micromouse is a small robot about the size of your palm. This robot can detect a black line on the floor using sensors and automatically follow the line.
This submission includes two models: a simulation model and a hardware implementation model. It contains a set of .slx and .ioc files for hardware deployment, as well as an .stl file for rendering a CAD model in the simulation environment. The models are designed for student teams participating in the Micromouse competition. Teams can use this app as a reference to learn about model-based design (MBD).
-
Install the Simulink 3D Animation™ software and Computer Vision Toolbox™ software.
-
Open the LineTrace_2024b.slx model. (Note: The files Course.stl and Tracer.stl are located in the current folder.)
-
Run the model.
-
Install Embedded Coder Support Package for STMicroelectronics STM 32 Processors. (MATLAB®, Simulink, Embedded Coder®, MATLAB Coder™, Simulink Coder™, Embedded Coder Support Package for STMicroelectronics STM32 Processors)
-
Select the "LineTrace_Hardware" model that matches your hardware (Version 1 or Version 2) and Open the model
-
Connect your hardware to your laptop using a USB cable
-
Check the COM port number from Device Manager on your PC.
-
Update the COM port number in the Simulink model based on the value you found in step 4: Configuration Parameters → Hardware Implementation → Target hardware resources → Connectivity → Serial port.
6.1. To perform "Monitor & Tune": Before clicking the button, go to Configuration Parameters → Code Generation → Build Configuration, and set it to "Faster Runs".
6.2. To perform "Build, Deploy & Start": Before clicking the button, go to Configuration Parameters → Code Generation → Build Configuration, and set it to "Faster Build".
By modifying and extending each subsystem, more advanced simulations can be achieved. This model is designed as a versatile and lightweight demo, and with appropriate adaptations, it can be applied to a wide range of fields such as automotive, rockets, robotics, drones, aircraft, railways, and marine systems.
For Simulation:
Simulink
Simulink 3D Animation
Computer Vision Toolbox
For Hardware & Support Package
MATLAB
Simulink
Embedded Coder
MATLAB Coder
Simulink Coder
Embedded Coder Support Package for STMicroelectronics STM32 Processors
Copyright 2025 The MathWorks, Inc.