Overview
The STM32 self-balancing robot car is a robot car learning and experimentation platform based on the STM32 microcontroller for robotics and control systems exploration. It integrates an STM32F103RCT6 main control, a 6-axis IMU attitude sensor (accelerometer + gyroscope), high-power reduction motors, and a metal chassis, enabling real-time tilt sensing and balance stabilization using PID control. The platform supports a maximum load of 4KG and provides an OLED display plus a mobile APP for debugging and control (only supports Android, not iOS). Multiple expansion styles are supported to combine with various sensors.
Key Features
- Equipped with STM32F103RCT6 chip
- AB phase speed encoder
- High power DC motor
- With battery protection box
- Adjust parameters on APP
- PID and LQR control
- 6-axis IMU attitude sensing
- Low voltage warning
- Balance car mathematical model
- Ultrasonic avoiding/following functions (via ultrasonic module)
- OLED data display (supports displaying current mode and voltage)
- Posture recognition (6-axis IMU can start balance when placed on ground; can shut down balance when lifted vertically in an upright state)
- Climbing capability: slopes of about 30°
Optional expansion functions (depending on kit/modules)
- Lidar walking along the wall (Optional)
- Lidar avoiding/following (Optional)
- Lidar guard (Optional)
- K210 QR code control (Optional)
- K210 color line patrol (Optional)
- K210 color following (Optional)
- K210 self-learning (Optional)
- K210 number recognition (Optional)
Specifications
Main controller (MCU)
| Model | STM32F103RCT6 |
| Core | Cortex M3 R1P1 |
| Internal Flash | 256KB |
| SRAM | 48KB |
| GPIO number | 51 |
| Timer | 8 |
| Pin package | LQFP64 |
| Interface resources | 2 x SPI, 3 x USART, 2 x I2C, 2 x I2S, 1 x CAN, 51 x I/O, 2 x DAC |
| Voltage range | External voltage: 2.0~3.6V; Core voltage: 1.8V |
| Compilation tool | KEIL MDK, STM32CubeMX |
STM32F103RCT6 is described as a high-performance 32-bit MCU with up to 256KB Flash and 48KB SRAM, providing 51 programmable input/output pins for complex applications such as robot control systems and self-balancing robot car control systems.
Chassis
| Metal plate thickness | 2mm |
| Surface | Painted and frosted surface |
| Drive | High-power reduction motor with AB phase encoder |
Motor parameters
| Motor model | MD520Z30_12V |
| Motor rated voltage | 12V |
| Motor type | Permanent magnet brush |
| Output shaft | D-type eccentric shaft with 6mm diameter |
| Rated power | <=4W |
| Rated current | 0.3A |
| Gear set reduction ratio | 1:30 |
| Speed before deceleration | 11000rpm |
| Speed after deceleration | 333±10rpm |
| Stall torque | 4.8kg·cm |
| Rated torque | 3.3kg·cm |
| Stall current | 3A |
| Interface type | PH2.0 6Pin |
| Single motor weight | 150g±1g |
| Function | Built-in pull-up shaping, the microcontroller can directly read the signal pulse |
Encoder parameters
| Encoder type | AB phase incremental Hall encoder |
| Encoder line number | 11ppr |
| Type | Magnetic induction |
| Power supply range | 3.3V~5V |
| Encoder protection | Exposed (magnetic encoder is more stable and does not require a back cover) |
| Suitable MCU | Almost all microcontrollers |
Load capacity
| Maximum load | 4KG |
Control & posture algorithms (as provided)
- Control algorithm: PID/LQR
- Posture algorithm: Kalman filter / complementary filter / DMP
Encoder motor wiring (PH2.0 6Pin)
| 1 | Motor power supply line + |
| 2 | Motor power supply line - |
| 3 | Sensor signal-negative |
| 4 | Sensor signal-positive 3.3V |
| 5 | Sensor signal line-B phase |
| 6 | Sensor signal line-A phase |
APP Control (Android only)
The APP control program has been written before shipped. It contains up to 20 functions and gameplays. No need to download the program; it can be used right away. Turn the wheels gently to switch the robot car to different function modes.
Main control interface (labels)
- Bluetooth switch
- Gravity display
- Motor speed display
- Ultrasonic distance display
- Main control interface button
- Battery voltage display
- Rotate right
- Rotate left
- Left-right motor speed display
- Three control method: button, gravity, rocker
- Button control: Press up, down, left, and right to activate, release to stop.
- Gravity sensor: Control robot car to move forward, backward, left, and right according to the phone's posture.
- Rocker control: Push the circle in the middle to different directions to control robot car movement.
PID debugging interface (labels)
- Balance loop parameter D
- Balance loop parameter P
- Speed loop parameter I
- Speed loop parameter P
- Steering loop parameter D
- Steering loop parameter P
- PID debugging interface button
- Restore default
- Update steering loop PID
- Update speed loop PID
- Update balance loop PID
- Query PID
The PID debugging function can update the car PID data and display it on the APP interface, and can also adjust the PID parameters and restore the default parameters with one click.
Waveform display interface
Supports simultaneous display of multi-channel waveforms. Waveform details can be zoomed in and out, and the motion status of the robot car can be observed on a mobile phone.
Function modes list (as provided)
| Serial number | Function mode | Description |
|---|---|---|
| 1 | Standard Mode | Standard mode: APP control |
| 2 | UT Follow | Ultrasonic following mode |
| 3 | UT Avoid | Ultrasonic obstacle avoidance mode |
| 4 | Load Movement | Load mode: APP control |
| 5 | Handle Control | PS2 Wireless handle control mode |
| 6 | IR Track | 4-channel infrared line tracking mode |
| 7 | Adv IR Track | Advanced 4-channel infrared line tracking mode |
| 8 | K210 QR Rec | K210 QR code recognition mode |
| 9 | K210 Track | K210 line tracking mode |
| 10 | K210 Follow | K210 following mode |
| 11 | K210 Self Learn | K210 self-learning mode |
| 12 | K210 Num Rec | K210 number recognition mode |
| 13 | LiDAR Avoid | LiDAR obstacle avoidance mode |
| 14 | LiDAR Follow | LiDAR following mode |
| 15 | LiDAR Guard | LiDAR guard mode |
| 16 | LiDAR Patrol | LiDAR patrol mode |
| 17 | LiDAR StrLine1 | LiDAR straight line-1 mode |
| 18 | LiDAR StrLine2 | LiDAR straight line-2 mode |
What's Included
Various kits are available. The following kit contents are provided as stated.
Standard Kit
- STM32 self-balancing robot car
- Ultrasonic module
- OLED display
- BT 5.0 module
Standard Kit functions description: PID parameter adjustment, posture recognition, load balancing, climbing, mobile phone APP remote control, ultrasonic obstacle avoidance and following functions.
Line Tracking Kit
- Standard Kit
- 4-channel tracking module
- Wire + screw package
Line Tracking Kit notes: Suitable for black line tracking with a width of 1.6~2CM, and supports high-difficulty line tracking such as right-angle turns and intersections.
Handle Control Kit
- Standard Kit
- PS2 handle
- AAA battery
- PS2 adapter board
- PS2 handle receiver
- Wire + screw package
Handle Control Kit notes: Can realize 2.4G wireless handle remote control.
K210 Vision Kit
- Standard Kit
- K210 vision module
- Hinge mounting plate
- Damping hinge plate
- K210 adapter
- Screw package
- TF card
- Card reader
K210 Vision Kit notes: Can realize visual recognition and interactive functions such as visual following, visual line tracking, QR code control and other functions.
Lidar Kit
- Standard Kit
- T-MINI PLUS lidar
- Wire + screw package
Lidar Kit notes: Based on lidar ranging functions, lidar guarding, obstacle avoidance, following, patrolling and other gameplay can be realized.
For help choosing the right kit and accessories, contact support@rcdrone.top or visit https://rcdrone.top/.
Applications
- Robotics education and classroom demonstrations
- Control algorithm learning (PID / LQR) and parameter debugging
- Sensor expansion experiments (ultrasonic, infrared line tracking, 2.4G wireless handle, K210 vision module, lidar)
Manuals
Tutorial link
STM32 Self-balancing Robot Car
Code analysis video tutorial with English subtitles (as listed)
-
Environment construction and development
- 1.1 MDK-ARM installation.mp4
- 1.2 STM32CubeIDE installation.mp4
- 1.3 Common driver installation.mp4
- 1.4 Download the program.mp4
- 1.5 MDK-ARM project usage.mp4
- 1.6 Program simulation.mp4
- 1.7 VSCode install.mp4
-
STM32 expansion course
- 3.1 Battery voltage detection (ADC).mp4
- 3.2 Ultrasonic module-measuring distance (TIM).mp4
- 3.3 Motor drive+encoder (TIM).mp4
- 3.4 OLED Data-Display(I2C).mp4
- 3.5 MPU6050-Data Read (I2C).mp4
- 3.6 Bluetooth module-Data reading (USART).mp4
- 3.7 2.4G handle-control module reading (SPI).mp4
- 3.8 Tracking module-Read status (GPIO).mp4
- 3.9 CCD module-Reading data (ADC).mp4
- 3.10 Electromagnetic module-Reading data (ADC).mp4
- 3.11 K210 module-Serial communication (USART).mp4
- 3.12 Tmini-Plus lidar-Reading data (USART).mp4
-
Robot car PID control course
- 4.1 PID basic concept.mp4
- 4.2 PID example analysis.mp4
- 4.3 P, PI, PD controller theory.mp4
- 4.4 Position PID.mp4
- 4.5 Incremental PID.mp4
- 4.6 Cascade PID.mp4
- 4.7 Balance principle of car.mp4
- 4.8 Car upright control (PD).mp4
- 4.9 Car speed control (PI).mp4
- 4.10 Car steering control (PD).mp4
- 4.11 Got angle and angular velocity (DMP algorithm).mp4
- 4.12 Got angle and angular velocity (Kalman filter algorithm).mp4
- 4.13 Got angle and angular velocity (Complementary filter ...)
-
Robot car basic course
- 5.1 Car parameter adjustment.mp4
- 5.2 Ultrasonic obstacle avoidance.mp4
- 5.3 Ultrasonic follow.mp4
- 5.4 Bluetooth remote control.mp4
- 5.5 Load balance.mp4
-
Robot car advanced course
- 6.1 4-channel tracking.mp4
- 6.2 4-channel tracking avoid.mp4
- 6.3 2.4G handle control.mp4
- 6.4 CCD tracking.mp4
- 6.5 CCD tracking avoid.mp4
- 6.6 Electromagnetic tracking.mp4
- 6.7 K210-QR code recognition.mp4
- 6.8 K210-Color line tracking.mp4
- 6.9 K210-Color follow.mp4
- 6.10 K210-Self learning.mp4
- 6.11 K210-Number recognition.mp4
- 6.12 Lidar avoid.mp4
- 6.13 Lidar guard.mp4
- 6.14 Lidar follow.mp4
- 6.15 Lidar patrol.mp4
- 6.16 Lidar wall tracking-straight line.mp4
- 6.17 Lidar wall tracking-multiple walls.mp4
- 6.18 DIY Automatic driving car.mp4
Details

A compact STM32-based self-balancing robot platform designed for control-system learning, tuning, and sensor expansion.

An overview of the platform’s control hardware, sensors, and core balancing features, plus a market comparison for quick selection.

Step-by-step learning resources cover environment setup, expansion lessons, PID tuning, and progressive robot courses.


Choose the standard kit for core balancing plus ultrasonic functions and on-device status display.

Add the line-tracking kit to follow black tape routes and handle right-angle turns and intersections.

The handle control kit enables wireless PS2-style remote driving and speed control.

The K210 vision kit opens up AI-style interactions such as QR control, color tracking, and visual following.

Upgrade to lidar for advanced navigation behaviors like following, obstacle avoidance, and guarding modes.

Built around an STM32F103RCT6 MCU to support real-time balance control and rich peripheral expansion.

A rigid metal chassis and encoder motors provide stable feedback for balance control and speed measurement.

Motor construction details and wiring guidance help with assembly, troubleshooting, and control experiments.

An Android app supports parameter adjustment and switching among multiple motion and sensor modes.

Control, PID tuning, and waveform visualization are organized into dedicated app screens for faster debugging.

Core functions include posture recognition, up to 4 kg load capacity, climbing ability, ultrasonic avoidance, and OLED readouts.




The Yahboom STM32 self-balancing robot car supports LiDAR-based wall following, obstacle avoidance, patrol, guard, and follow behaviors.

The Yahboom STM32 self-balancing robot car supports line tracking, color following, QR code control, and visual recognition tasks for interactive projects.

The Yahboom STM32 self-balancing robot uses a modular controller board with Bluetooth, ultrasonic sensing, OLED display, and an MPU6050 gyro module for tuning and PID learning.

The Yahboom STM32 self-balancing robot kit supports add-on sensor accessories and includes a two-wheel chassis, camera module, and gamepad-style controller.

Mathematical modeling notes and PID/LQR control source code support tuning and control development for the STM32 self-balancing robot.

The Yahboom STM32 self-balancing robot is paired with downloadable source code folders, including library function and HAL versions for development.

The Yahboom STM32 self-balancing robot includes a detailed function development manual and BSP driving database document to support coding and setup.

Yahboom STM32 self-balancing robot code supports DMP, Kalman filter, and complementary filter options for angle acquisition and tuning.

The Yahboom STM32 self-balancing robot course materials outline step-by-step lessons on assembly, STM32CubeIDE programming, and PID tuning.

Yahboom STM32 self-balancing robot documentation includes organized tutorial folders and video lessons to guide setup and programming.

The STM32 self-balancing robot uses a metal chassis with an enclosed battery box, anti-skid wheels, and modular expansion and sensor boards for easy assembly.

The STM32 robot expansion board uses clearly labeled connectors for power, motors, sensors (MPU6050, ultrasonic, lidar), and programming to simplify wiring and setup.

The Yahboom STM32 self-balancing robot uses an STM32F103C8T6 controller and lists a 7.4V 2200mAh battery along with key dimensions for fit planning.

The Yahboom STM32 self-balancing robot kit includes line tracking accessories, a PS2 wireless handle set, K210 vision module parts, and T-MINI PLUS LiDAR accessories for expansion.
