Design and Implementation of Two-Wheel Self-Balancing Vehicle Based on STM32
DOI: https://doi.org/10.62517/jes.202602318
Author(s)
Mingming Ye, Wei Zhang*, Yue Shen, Yibo Wang, Juan Zhang
Affiliation(s)
School of Computer, Xianyang Normal University, Xianyang, Shaanxi, China
*Corresponding Author
Abstract
By deeply exploring the STM32 microcontroller, we successfully launched the design and implementation of a dual-wheel self-balancing scooter based on it. Through the real-time data collection of the sensor of the MPU6050, the powerful processing capability of the STM32F103 microcontroller, the motor driver of TB6812FNG, and the motor of GB37 were combined for precise closed-loop control, thus achieving excellent dynamic balance performance of the dual-wheel self-balancing scooter. Moreover, through the precise dynamic control of the system, it can always maintain good balance stability even under various external disturbances. At the same time, the system also provides good support for Bluetooth communication, allowing users to remotely control the system's forward, backward, left turn, right turn, and rotation through the mobile app. The design, debugging, and other aspects of the system have been well promoted and applied. The experimental results of this system also fully verified that the PID algorithm adopted in the system has a good regulating effect on dynamic balance control, and has a good guiding significance and great practical application value for the design of the system.
Keywords
STM32; PID Algorithm; Two-Wheel Self-Balancing Vehicle
References
[1]Zhou Xiangyang, Shi Yanjun. Adaptive Composite Control and Parameter Optimization of a Single Neuron/PID for an Inertial Stabilized Platform Journal of Instrumentation and Measurement, 2019, 40(11): 189-196
[2].Lan X Y, Tan C P, Liang F Z, et al. Design and Implementation of Self-Balancing Car Control System Based on PID and Kalman Filter Security Science and Technology, 2024(21):78-83.
[3]Yu Chenji, Pan Zecai, Hu Haiyang, et al. Design of Two-Wheel Self-Balancing Vehicle Control System Based on STM32 Information Technology and Informatization, 2023, (08): 12-15.
[4]Gao Xue, Liu Yongxin, Li Yiwen. Design and Research of Two-Wheel Balance Vehicle Electronic Testing, 2022, 36(04): 5-9. DOI: 10.16520/j.cnki.1000-8519.2022.04.051.
[5]Cao Yanjing, Wang Feng, Fang An, et al. Design and Implementation of Two-Wheel Self-Balancing Vehicle Based on STM32 Electronic Technology and Software Engineering, 2022, (01): 101-104.
[6]Yang Junwei. Balance Vehicle Control System Based on PID Algorithm and Kalman Filtering Electronic Technology and Software Engineering, 2021, (06): 65-67.
[7]Kang Y S, Chen Q X, Luo X Q. Hardware and Program Design of STM32 Self-Balancing Car Automation Application, 2024(22):65-68.
[8]Nie Ru. Design of Two-Wheel Self-Balancing Vehicle System Based on STM32F103C8T6 Microcomputer Application, 2021, 37(01): 10-12+22.
[9]Pan Erwei. Design and Implementation of Two-Wheel Self-Balancing Vehicle Based on STM32. Heilongjiang University, 2018.
[10]Li Zhihao, Si Yongkang, Qu Zhiyang, et al. Research on Two-Wheel Self-Balancing Small Vehicle Based on PID Control Science and Technology Innovation, 2021, (14): 187-188.
[11]Zhang Yanwen. Design of Balance Vehicle Control System Based on PID Algorithm and Kalman Filtering Papermaking Equipment and Materials, 2022, 51(01): 41-43.
[12]Qin Yingchun, Liu Guidong, Zhu Jiachun, et al. Theoretical Analysis and Model Establishment of STM32 Balance Vehicle Modern Computer, 2022, 28(06): 107-111.
[13]SAKETOS V, XIAO M. The Kalman Evolve: Closing the Gap in Kalman Filtering via Interpretable Algorithm Discovery arXiv preprint arXiv:2605.26830, 2024.
[14]Hu T Z, Ma C L. Design of Self-Balancing Car Based on Kalman Filter and PID Modern Information Technology, 2025(19):182-187.
[15]Zhang Q Z, Huang J X, Zhang M, et al. Intelligent Balancing Vehicle Based on STM32 and PID Control Internet of Things Technologies, 2025,15(24):78-82