摘要:主要分析了基于 STM32 的小车控制系统的设计过程,此系统主要包括 STM32 控制
器、按键控制电路、电机驱动电路、红外探测电路等。以 STM32 为主控芯片及其外围扩展电
路实现系统整体功能,用红外探测电路实现小车循迹功能,小车速度由 PWM 波控制,控制电
动小车的速度及转向,从而使小车顺利通过直线,虚线,十字路口,S 弯,实现循迹功能。
在硬件设计的基础上实现了电机控制功能,LED 显示功能,以及小车简单循迹的软件设计方
案。
关键字: STM32 电机 传感器 PWM KEIL
Design of intelligent tracking car based on STM32
Abstract:. Mainly analyzes the design process of the car control system based on STM32, this
system mainly includes the STM32 controller, button control circuit, motor drive circuit, infrared
detection circuit, etc. STM32 as main control chip and extend the peripheral circuit to realize the
whole system function, the function of infrared detection circuit is used to implement the car
tracking, vehicle speed is controlled by a PWM wave, control the speed of the electric car and
steering, which makes the car pass straight line, dotted line, intersection, S bending, realize the
tracking function. On the basis of the hardware design to realize the function of motor
control, LED display function, and software design scheme of simple car tracking.
Keywords:STM32、 The motor、 The sensor、 PWM、 KEIL.
一、 引言
智能车辆作为智能交通系统的关键技术之一,是许多高新技术综合集成的载体。
它体现了车辆工程、人工智能、自动控制及计算机技术于一体的综合技术,是未来汽
车发展的趋势。本文提出了一个基于 STM32 芯片为控制核心,附以红外传感器采集外
界信息的智能小车系统设计方案。充分利用该芯片高速运算、处理能力,来实现小车
自动识别路线按迹行走,自带的 PWM 输出功能,调节占空比来调节电机的转速。通过模糊控
制和 PWM 脉宽调制技术的结合,提高了对车位置控制精度。
智能循迹小车组装
组装步骤:
一、 第一步:电路部分基本焊接
二、 电路焊接部分比较简单,焊接顺序按照元件高度从低到高的原则,首先焊接 8 个电阻,
焊接时可用万用表确认阻值是否正确,焊接有极性的元件如三极管、LED 指示灯、电解电
容、芯片务必分清楚极性尽量参考图片的元件方向焊接,焊接时间不能太长否则容易焊
坏。初步焊接完成后请务必细心核对,防止粗