摘 要
本次设计自动避障小车就是基于单片机这一系统开发而成的。此外本设计还加入了液晶显示部分。同时本次设计可全面提高个人对单片机技术、传感器技术智能控制技术、计算机控制技术知识的综合应用能力。掌握从系统级、电路级到芯片级各层次的设计和实现手段。在此设计过程中,将会用到多门学科的理论知识,是对以前所学知识的一个全面的复习和巩固,更重要的是培养自我分析问题和解决问题的能力,还增强了实际的动手能力。
设计采用STC89C52作为控制电路,把两个红外信号接到单片机上,通过单片机对信号的接收和处理,控制外围电路使小车转向,来避开障碍物。通过H桥驱动电路来控制电机的转向和前进。通过为微控制芯片对数据进行处理,处理速度远远满足小车的运行和避障的需求。也可以通过编写不同的程序,增加模块来增加小车的功能。它通过红外线传感器获知前方的障碍物情况,若不存在障碍物,小车直线前进;若左前方发现障碍物,左前放的红外传感器将信号传给单片机,单片机作出处理后控制小车向右转弯以躲开障碍物;若右前方发现障碍物,右前放的红外传感器将信号传给单片机,单片机作出处理后控制小车向左转弯以躲开障碍物;若正前方发现障碍物,则两个红外传感器将信号传给单片机,单片机作出处理后控制小车倒车至合适距离后,通过传感器传来的信号决定转弯方向,以躲开障碍物。检测使用的红外传感器是专业的红外避障传感器,当有障碍物时,它能够反映出电平高低的变化,而且更加廉价易得,适合简单的避障。
关键词:自动避障;单片机;小车;红外线
Abstract
This design of automatic obstacle avoidance car is based on the single-chip microcomputer this system is developed. In addition, this design also added liquid crystal display part. At the same time, this design can improve the comprehensive application ability of single-chip computer technology, sensor technology intelligent control technology, computer control technology knowledge in an all-round way. Master all levels of design and implementation from system level, circuit level to chip level. In this design process, the theoretical knowledge of many subjects will be used, it is a comprehensive review and consolidation of the knowledge learned before, more important is to cultivate the ability of self-analysis and problem-solving, but also to enhance the practical ability of hands-on.
The design adopts STC89C52 as the control circuit, two infrared signals are connected to the single-chip microcomputer, the signal is received and processed by the single-chip microcomputer, and the peripheral circuit is controlled to turn the car to avoid the obstacle. The H-bridge driving circuit is used to control the steering and advance of the motor. By processing the data for the micro-control chip, the processing speed can meet the demands of the running and obstacle avoidance of the car. You can also add modules to increase the function of the car by writing different programs. If there is no obstacle, the car goes straight ahead; if the obstacle is found in front of the left, after the single-chip processor makes the processing, controls the car to turn to the right to avoid the obstacle; If the obstacle is found in front of the right, the infrared sensor in front of the right will transmit the signal to the single-chip microcomputer. After the single-chip processor makes the processing, the control car will turn to the left to avoid the obstacle; If the obstacle is found in front, the two infrared sensors transmit the signal to the single-chip microcomputer. After the single-chip microcomputer makes the processing, the car is controlled to the appropriate distance, and then the turning direction is determined by the signal from the sensor in order to avoid the obstacle. The infrared sensor used in the detection is a professional infrared obstacle avoidance sensor. When there are obstacles, it can reflect the change of the level. It is easy to get and easy to get. It is suitable for simple obstacle avoidance.
Key words: automatic obstacle avoidance; single chip microcomputer; car; infrared ray
目 录
1 绪论 1
1.1 课题研究背景及意义 1
1.2 国内外研究现状 1
1.2.1国外智能车辆研究现状 2
1.2.2发展前景 3
1.3 课题主要研究内容 4
2 工作原理及总体设计 5
2.1 工作原理 5
2.2 总体设计 5
3 硬件设计 7
3.1 小车车体设计 7
3.2 电源模块 7
3.3 电机驱动模块 8
3.4 电机模块 9
3.5 检测模块 9
3.6 最终方案 9
4 硬件实现及单元电路设计 11
4.1 主控制模块 11
4.2 单片机的复位电路与振荡电路设计 11
4.3 电源设计 13
4.4 驱动电路 14
4.5 E18-D50NK光电开关避障模块 15
4.6 红外光电开关传感器的安装 17
4.7 小车车体总体设计 17
5 软件设计与仿真调试 18
5.1 主程序流程 18
5.2 Keil uVision3环境 19
5.3 单片机程序烧写 22
5.4 系统的安装与调试 23
结束语 24
致 谢 25
参考文献 26
附录 28
附录A 整体电路图 28
附录B 部分源程序 29