DIY Micromouse Robot Making H/W Guide - Microcontroller, Motor, Motor Driver, Sensor, Magnetic Encoder, System power, Chassis
DIY Micromouse Robot Making H/W Guide - Microcontroller, Motor, Motor Driver, Sensor, Magnetic Encoder, System power, Chassis
A Micromouse is a small autonomous robot designed to solve a maze without human control. These robots are widely used in robotics competitions, educational projects, and embedded systems learning. Building a DIY Micromouse is an exciting way to learn about electronics, programming, sensors, and mechanical design as small as possible.
This guide explains everything you need to know about making your own Micromouse robot from my experiences.
DIY Micromouse Robot
The robot operates completely autonomously using:
- Microcontrollers
- Motors
- Infrared sensors
- Motor drivers
- Batteries
- Maze-solving algorithms
Micromouse competitions are held worldwide in universities, robotics clubs, and engineering events.
1. Microcontroller - STM32F411CEU6
STMicroelectronics. It belongs to the STM32F4 series, which is widely used in embedded systems, robotics, industrial automation, IoT devices, and educational electronics projects. Due to its powerful ARM Cortex-M4 core and low power consumption, the STM32F411CEU6 has become a popular choice among engineers, hobbyists, and students. Although you can mount the CPU directly onto the Micromouse, it is more advantageous to use a development board to reduce trial and error and make maintenance easier. In addition, it has the effect of reducing the installation area of parts. This microcontroller is commonly found in compact STM32 Black Pill development board which is a very popular entry-level development board that’s usually recommended for beginners in STM32 firmware development using C, C++ languages.
Key Specifications
- ARM Cortex-M4 32-bit processor
- Clock speed up to 100 MHz
- 512 KB Flash memory
- 128 KB SRAM
- USB 2.0 support
- 3x I2C, 3x USART, 5x SPI/I2S, 1x SDIO, 1x USB 2.0 FS interfaces
- ADC and PWM functionality
- 13 Timers - 16 bit, 32 bit for count, encoder
- Low power consumption
- 20×2 Pin Headers (33 GPIO Pins)
These features make it suitable for both beginner and advanced embedded applications. Developers can program the STM32F411CEU6 using STM32CubeIDE which is the official integrated development environment provided by STMicroelectronics.
Key points for selection
The items indicated in bold above are the main factors to consider. In other words, key considerations include clock speed, memory capacity, communication interfaces with the surroundings, analog data for IR sensors and Battery voltage monitors, PWM data for motors, timers for interrupt processing, and especially considerations for motor encoders(32 bits count).
Pin Assignments
- Power ON Led display :
- GPIOC, GPIO_PIN_13
- IR Sensor
- Left Pin GPIOA, GPIO_PIN_2
- Front Pin GPIOA, GPIO_PIN_3
- Right Pin GPIOA, GPIO_PIN_4
- Optical Sensor
- Right Pin GPIOB, GPIO_PIN_14
- Front Pin GPIOA, GPIO_PIN_11
- Left Pin GPIOB, GPIO_PIN_5
- Battery Voltage
- MOTBAT Pin GPIOA, GPIO_PIN_5
- User Button
- User button 1 Pin GPIOA, GPIO_PIN_8
- User button 2 Pin GPIOA, GPIO_PIN_12
- PWM
- Timer3 - PA6(CH1), PA7(CH2), PB0(CH3), PB1(CH4)
- Encoder
- Timer2(32 bit long integer) - PA15(CH1), PB3(Ch2)
- Timer5(32 bit long integer) - PA0(CH1), PA1(Ch2)
- 500Hz Loop
- Timer9 - PSC=1000, ARR=200
- Communication(192000 Baud)
- UART : PA9(TX), PA10(RX)
- OLED display
- I2C1 : PB7(SDA), PB6(SCL)
- Lidar sensor
- I2C2 : PB9(SDA), PB10(SCL)
This Pin placement was prioritized with maximum consideration of the 32-bit long integer encoder, and the PWM Timer was placed secondarily.
2. Motor
The N20 motor with an extended shaft is a compact and highly versatile DC gear motor widely used in robotics, automation, DIY electronics, and precision control systems. Due to its small size, lightweight structure, and reliable torque output, the N20 motor has become one of the most popular choices for hobbyists, students, and professional engineers working on miniature robotic projects. An N20 motor is a micro metal gear motor that combines a small DC motor with a precision gearbox. The gearbox reduces the motor speed while increasing torque, making it suitable for applications requiring controlled motion and efficient power delivery. The “extended shaft” version of the N20 motor includes an additional output shaft on the rear side of the motor. This extra shaft is extremely useful for mounting rotary encoders, position sensors, or feedback control systems in advanced robotics applications. Even with its miniature size, the geared mechanism allows the motor to generate significant torque suitable for driving wheels and mechanical components.
Extended Rear Shaft
The extended shaft allows engineers to attach:
- Rotary encoders
- Optical sensors
- Magnetic encoders
- Speed monitoring systems
- Closed-loop feedback controllers
Multiple Gear Ratios
N20 motors are available in different gear ratios, including:
- 10:1
- 30:1
- 50:1
- 100:1
- 200:1 and higher
Higher gear ratios provide more torque but lower speed, while lower gear ratios provide higher speed.
Low Power Consumption
These motors are efficient and suitable for battery-powered systems, especially portable robots and embedded devices.
Technical Specifications
Typical specifications of an N20 motor with extended shaft include:
| Specification | Typical Value |
|---|---|
| Operating Voltage | 3V – 12V |
| Shaft Diameter | 3 mm |
| Gearbox Material | Metal |
| Motor Type | DC Brushed |
| Speed Range | 30 – 1000 RPM |
| Weight | Approximately 10g – 20g |
Specifications may vary depending on the manufacturer and gear ratio.
3. Motor Driver
The DRV8833 is a compact dual H-bridge motor driver IC widely used for controlling small DC motors, stepper motors, and brushed motor-based systems. It is commonly found in robotics, embedded systems, and low-power automation projects where efficient bidirectional motor control is required.
Designed by Texas Instruments, the DRV8833 offers a highly integrated solution that reduces the need for bulky external components, making it ideal for compact robotic platforms such as line followers, micromouse robots, and small autonomous vehicles.
Key Features of DRV8833
The DRV8833 is popular because of its efficiency and simplicity. Some of its major features include:
- Dual H-Bridge motor driver (controls 2 DC motors or 1 stepper motor)
- Wide operating voltage range (typically 2.7V to 10.8V)
- Low on-resistance for improved efficiency
-
Built-in protection features:
- Overcurrent protection
- Thermal shutdown
- Undervoltage lockout
- PWM speed control support
- Compact surface-mount package
- Low power consumption in standby mode
These features make it suitable for battery-powered embedded systems where energy efficiency is critical.
Working Principle
The DRV8833 operates using an H-bridge configuration, which allows current to flow in both directions through a motor. By controlling input logic pins, the direction and speed of the motor can be adjusted.
- Forward rotation: current flows in one direction
- Reverse rotation: current flow is reversed
- Speed control: achieved using PWM (Pulse Width Modulation) signals
This simple control mechanism allows microcontrollers such as Arduino, STM32, or ESP32 to easily interface with the driver without complex circuitry.
Limitations
While highly useful, the DRV8833 is not suitable for all applications:
- Not designed for high-current motors
- Limited voltage range compared to industrial drivers
- Not ideal for large robotic systems or heavy loads
For high-power applications, more robust drivers are recommended.
4. Sensor
Common sensors:
- Infrared (IR) sensors
- Time-of-Flight sensors
- Gyroscope modules
Typical sensor positions:
- Front sensor
- Left wall sensor
- Right wall sensor
These sensors allow precise navigation inside the maze.
Major requirements for wall sensing by IR
To detect walls using an infrared sensor, three main components are required. First, an infrared LED sensor capable of minimizing light interference and a photosensor to detect this light are necessary. Additionally, since LEDs typically consume a large amount of current due to thermal energy, a switching circuit is required to turn them on and off as needed. This circuit must be able to operate at high speed and consume little current. Typically, circuits are designed to be operated by MOSFETs. Since the amount of light emitted varies depending on the distance from the wall, this value is read as an analog value to calculate the distance proportionally. Based on whether the calculated distance is far or near, the distance between the mouse robot and the wall is adjusted in real-time by a PID to maintain a constant distance. Therefore, distinguishing the existence of walls simply by digital values of 0 and 1 presents a problem.
1) SFH_4550 Infrared Sensor
The SFH_4550 is a high-performance infrared (IR) emitting diode widely used in robotics, automation, obstacle detection, and communication systems. Designed for reliability and efficiency, this infrared LED is popular among hobbyists, students, and engineers who work on embedded systems and robotic projects such as Micromouse robots. SFH 4550 is an infrared LED manufactured by OSRAM Opto Semiconductors. It emits infrared light with a wavelength typically around 950 nm, making it suitable for IR sensing and optical communication applications. Unlike visible LEDs, the light produced by the SFH_4550 cannot be seen by the human eye. However, infrared receivers and phototransistors can detect this light efficiently.
Key Features of SFH_4550
The SFH_4550 offers several advantages that make it useful in electronic projects:
- High radiant intensity
- Fast switching speed
- Narrow emission angle
- Compact package design
- Low power consumption
- Reliable long-term operation
- Suitable for pulse-driven applications
Technical Specifications
| Parameter | Typical Value |
|---|---|
| Device Type | Infrared LED |
| Peak Wavelength | 950 nm |
| Forward Voltage | Approximately 1.35 V |
| Forward Current | 100 mA |
| Emission Angle | About ±10° |
| Package Type | T-1 3/4 (5 mm) |
Tips for Better Performance
To achieve better sensing performance:
- Use proper resistor values
- Avoid direct sunlight interference
- Place the receiver carefully
- Use modulation techniques for noise reduction
- Maintain proper alignment between emitter and receiver
These methods improve sensor reliability and accuracy.
2) TEFT4300 Optical Sensor
The TEFT4300 is a high-performance ambient light sensor and phototransistor component widely used in electronics projects, automation systems, robotics, and industrial applications. Engineers and hobbyists often choose this sensor because of its reliable light detection capability, compact size, low power consumption, and easy integration with microcontrollers such as Arduino, ESP32, Raspberry Pi, and STM32 boards. The TEFT4300 is an ambient light phototransistor designed to detect visible and infrared light levels. It converts light energy into electrical signals that can be processed by electronic circuits. The sensor is manufactured for accurate light sensing applications where stable and fast response times are required. The TEFT4300 operates similarly to a transistor, but instead of using electrical current at the base terminal, it uses light as the control signal.
Technical Specifications of TEFT4300
| Specification | Value |
|---|---|
| Device Type | Phototransistor |
| Package Type | Through-hole / SMD |
| Operating Voltage | Depends on circuit |
| Light Detection | Visible & Infrared |
| Response Time | Fast |
| Power Consumption | Low |
| Operating Temperature | Industrial grade |
| Applications | Light sensing, automation, robotics |
Specifications may vary slightly depending on manufacturer versions and circuit design.
TEFT4300 vs Standard LDR Sensors
| Feature | TEFT4300 | LDR |
|---|---|---|
| Response Speed | Fast | Slow |
| Accuracy | High | Moderate |
| Power Consumption | Low | Moderate |
| Reliability | High | Medium |
| Precision | Better | Lower |
| Automation Use | Excellent | Basic |
Tips for Using TEFT4300
To achieve the best performance:
- Use proper resistor values in the circuit.
- Avoid excessive electrical noise.
- Keep the sensor surface clean.
- Shield from unwanted light sources when necessary.
- Calibrate readings for accurate measurements.
3) MOFFET SSM3K324R
The SSM3K324R is a compact MOSFET transistor commonly used in modern electronic circuits for switching and power management applications. Engineers, students, hobbyists, and embedded system developers often use this component in portable devices, battery-powered systems, and microcontroller-based hardware projects. Because of its small size, efficient performance, and low power consumption, the SSM3K324R has become useful in many compact electronic designs. Understanding how this MOSFET works is important for anyone interested in electronics, robotics, IoT systems, or PCB design. The SSM3K324R is a semiconductor device categorized as a MOSFET (Metal Oxide Semiconductor Field Effect Transistor). A MOSFET works as an electronic switch or amplifier inside electrical circuits. This is especially suitable for compact PCB layouts due to its miniature surface-mount package.
Key Features of SSM3K324R
- Compact Surface-Mount Package is designed for modern surface-mount technology (SMT). Its compact size allows engineers to save PCB space in portable devices.
- Low Power Consumption help reduce total power consumption in embedded systems.
- Efficient thermal performance allows stable operation under continuous switching conditions.
- The transistor supports fast switching operations, making it useful in: PWM circuits, DC motor control, Switching regulators, Digital control systems
- One of the most important features of this MOSFET is its low ON resistance which means:
- Reduced heat generation
- Better power efficiency
- Improved battery life
Basic Working Principle
A MOSFET controls current flow using voltage applied to the gate terminal. The SSM3K324R generally includes three terminals:
- Gate (G)
- Drain (D)
- Source (S)
When voltage is applied to the gate, the MOSFET allows current to flow between the drain and source terminals. When the gate voltage is removed, current flow stops.
This switching mechanism is essential in digital electronics and power management systems.
Comparison with Traditional Transistors
Compared with bipolar junction transistors (BJTs), MOSFETs like the SSM3K324R offer several benefits:
| Feature | MOSFET | BJT |
|---|---|---|
| Power Efficiency | High | Moderate |
| Switching Speed | Fast | Slower |
| Input Current | Very Low | Higher |
| Heat Generation | Lower | Higher |
| Control Method | Voltage | Current |
Because of these advantages, MOSFETs are widely preferred in modern electronics.
Safety and Handling Tips
When working with semiconductor devices:
- Avoid static electricity exposure
- Use proper soldering temperature
- Prevent reverse polarity connections
- Verify voltage ratings before operation
- Store components in anti-static packaging
Proper handling improves reliability and lifespan.
5. Magnetic Encoder
The Magnetic Encoder with Side-Entry Connector is a compact and precise motion-sensing solution designed specifically for use with Pololu Micro Metal Gearmotors. It is widely used in robotics, automation systems, and embedded motion-control applications where accurate feedback on motor rotation is required. This encoder system enables closed-loop control by providing real-time position and speed data, making it essential for high-precision robotic designs such as Micromouse robots, line-following robots, and autonomous navigation platforms.The magnetic encoder consists of two main components:
- A small magnetic disk mounted on the motor shaft
- A magnetic sensor board with a side-entry connector that reads rotation changes
As the motor shaft rotates, the magnetic field changes are detected by the sensor, which converts them into digital pulses. These pulses represent the rotation speed and direction of the motor.
Key Features
1. High-Resolution Feedback
The encoder provides accurate pulse output, allowing precise measurement of:
- Motor speed (RPM)
- Direction of rotation
- Relative position
This is critical for applications requiring fine motion control.
2. Side-Entry Connector Design
The side-entry connector is a major improvement in compact robotics design:
- Saves vertical space in tight mechanical assemblies
- Allows easier wiring in compact robot chassis
- Improves mechanical durability by reducing strain on cables
3. Compatibility with Micro Metal Gearmotors
This encoder is specifically designed for Pololu micro metal gearmotors, ensuring:
- Perfect mechanical alignment
- Easy plug-and-play installation
- Minimal calibration effort
How It Works
The system operates using a magnetic sensing principle:
- A small magnet is attached to the motor shaft
- As the shaft rotates, the magnetic field changes periodically
- A Hall-effect sensor detects these changes
- The sensor outputs digital pulses corresponding to rotation
- The encoder board senses the rotation of the 6 pole magnetic disc and provides a resolution of 12 counts per revolution of the motor shaft when counting both edges of both channels. To compute the counts per revolution of the gearbox output shaft, multiply the gear ratio by 12.
By counting these pulses, a microcontroller can determine speed and position with high accuracy.
6. System power
Battery
In simple terms, if you have a 12V power source and need 5V for a microcontroller or sensor system, a buck converter performs this conversion efficiently without significant power loss.
Lithium Polymer (Li-Po) batteries are commonly used because they are:
- Lightweight
- Rechargeable
- High performance
A 9V rechargeable battery is used for main power of this DIY Micromouse robots at this time.
MP1482 DC-DC Buck Converter
The MP1482 DC-DC buck converter is a high-efficiency, compact switching regulator widely used in embedded systems, consumer electronics, and industrial power management. Designed for stable voltage conversion with minimal power loss, it is a popular choice for designers who need reliable step-down conversion from higher DC input voltages. The MP1482 is a monolithic step-down (buck) converter IC designed to convert higher input DC voltage into a lower, regulated output voltage. It operates using high-frequency switching technology, allowing efficient energy transfer with reduced heat dissipation. MP1482 DC-DC Buck Converter is commonly used in compact power supply designs where space, efficiency, and thermal performance are critical.
Key Features of MP1482
The MP1482 is designed to offer a balance of simplicity, efficiency, and performance.
- Wide input voltage range (suitable for various DC sources)
- High switching frequency for smaller external components
- Integrated power MOSFET for compact design
- High efficiency (typically above 90% in many applications)
- Adjustable output voltage using external resistors
- Built-in protection features (over-current, thermal shutdown)
These features make it especially suitable for modern PCB designs where size and efficiency matter. At this time , two converters were used for 5V system power and 6V motor power.
7. Chassis
The chassis is the robot body.
Materials used:
- Acrylic
- 3D printed parts
- Carbon fiber
- Aluminum
- PCB
A lightweight chassis PCB is used for an improves speed and efficiency.
Conclusion
DIY Micromouse making is an exciting robotics project that combines electronics, coding, sensors, and mechanical engineering into one intelligent system. Whether you are a beginner or an advanced robotics enthusiast, building a Micromouse robot provides valuable practical experience and helps develop real-world engineering skills. With proper planning, quality components, and continuous testing, you can create a fast and intelligent maze-solving robot capable of competing in Micromouse competitions worldwide.
Reference : YouTube Video







Comments
Post a Comment