Based on uCOS-II embedded system, STM32 controller, and MEMS sensor, a two-wheeled self-balancing vehicle system composed of hardware and software was designed. The hardware system was composed of processor module, motor drive module, attitude detection module, bluetooth communication module and power-supply module. The processor module PID control of self-balancing vehicle system, and process of data fusion algorithm. The motor drive module control the motor rotation and speed. The Bluetooth communication module was adopted to achieve communication with cellular phone APP terminal. The attitude detection module was used to collect data of acceleration and angular velocity of vehicle system in real time. Hardware driver and user application consisted of the software system. The results showed that when a person stood on the balancing vehicle, it could achieve self-balancing; when the body lent forward or backward, it could go ahead or back off; when the handle deflected to the fight or left, it could achieve rightward rotation of lefthanded rotation. The self-balancing vehicle system is of good dynamic quality, simple structure, easy implementation, and has good engineering practical value.