红绿灯自动识别小车的设计与实现(软件)The traffic light automatic recognition ofcar design and Implementation (software)目录摘要 (I)关键词 (I)Abstract (I)Key words.......................................................... I I1 前言 (1)2 设计方案选择与论证 (4)2.1 设计要求 (4)2.2 总体设计方案选择 (4)2.2.1 智能小车模型设计方案 (4)2.2.2 电机方案的选择 (5)2.2.3 控制单元方案 (6)2.2.4 小车循迹模块方案 (7)2.2.5 红绿灯信号识别方案 (8)2.2.6 短距离通信方案 (8)3 系统设计功能分析 (9)3.1.2 L298N驱动逻辑功能分析 (9)3.1.3 L298N内部功能及引脚分布 (10)3.2 一体化红外接收探头HS0038功能分析 (11)3.2.1 HS0038介绍 (11)3.2.2 HS0038内部电路及参数分析 (12)3.2.3 HS0038接收信号原理 (13)3.3 红外对管ST188功能分析 (14)3.3.1 ST188介绍 (14)3.3.2 ST188光电特性与检测分析 (14)3.3.3 ST188红外循迹原理分析 (16)3.4单片机控制红绿灯功能分析 (17)3.4.1 红绿灯路口设计规划 (17)3.4.2 红绿灯功能实现简要分析 (18)3.5 基带信号红外发射调制功能分析 (19)3.5.1 红外发光二极管发射原理分析 (19)3.5.2 波特率分析 (20)4 系统总体硬件设计及单元电路实现 (21)4.1 小车模块系统组成及框图 (21)4.2 红绿灯系统控制模块组成及系统框图 (21)4.3 各个单元电路硬件设计实现 (22)4.3.1 小车控制各部分电路实现 (22)4.3.2 红绿灯系统各部分电路实现 (25)5 软件设计分析与实现 (27)5.1 软件设计思想 (27)5.2 红绿灯系统软件实现与分析 (28)5.2.1定时器中断系统 (29)5.2.2 红绿灯显示与数码管动态显示 (29)5.2.3 数据发送模块 (31)5.3 小车模块软件实现与分析 (35)5.3.1 小车软件框架分析 (35)5.3.2 数据接收处理模块 (36)5.3.2 电机控制模块 (39)5.4 小车整体工作过程...........................错误!未定义书签。
6 软件调试试验 (41)7 总结 (44)参考文献 (46)致谢 (47)附录A:整体系统硬件电路图 (48)附录B:源程序代码 (49)红绿灯自动识别小车的设计与实现摘要现今是一个走过了工业时代、信息时代跨入知识经济的时代,这个时代对信息高速化,控制智能化的要求越来越高。
而智能化同样已经延伸到生活中,如:智能冰箱,智能热水器,智能空调等等,其发展速度之快,从身边的这些例子很容易体会到。
其发展前景可谓是相当可观。
因为他实现了无人管理,为人类生活带来了方便。
本设计以智能小车为核心模块,实现对红绿灯的自动识别,从而模拟生活当中的红绿灯交通系统,实现对过往车辆的流通控制。
采用AT89S51单片机作为小车控制的核心芯片。
小车采用的是直流电机来进行驱动,于此同时,为方便小车行走,还采用了红外对管模块来实现寻迹的功能,从而控制小车行走的路线。
之所以小车能识别红绿灯,这主要是依靠了单片机之间的通信,即红绿灯系统,它同样也是使用了一块AT89S51单片机作为中枢控制,产生3组红绿灯信号,分别对应前进,左转,右转信号,同时利用单片机串口通信,与小车之间进行通信,这个过程是利用红外发射模块将数据码发射出去,对应的小车上接收头讲接收到的信息返还到单片机中进行判决,控制。
本设计使用性很强,对于模拟控制研究有很大的帮助,相信未来必能很好的为我们的社会服务。
关键词智能小车;红绿灯;自动识别;循迹;红外通信The traffic light automatic recognition ofcar design and ImplementationAbstractToday is a walk of the industrial age, information age into the knowledgeeconomy era, this era of increasingly high requirements of the information superhighway, intelligent control. Intelligent the same has been extended to the life, such as: smart refrigerators, smart water heater, intelligent air-conditioning, etc., is growing faster than from the side of these examples it is easy to understand. Prospects for its development can be described as considerable. Because he realized the lack of management, in order to bring the convenience of human life.Smart car, the design for the core modules, automatic identification of traffic lights, traffic lights to simulate life transport system, control the flow of passing vehicles. AT89S51 micro-controller as the core chip of car control. The car is a DC motor to be driven Meanwhile, for the convenience of car walking, infrared tube module tracing, in order to control the routes of trolley travel. The reason why the car can recognize traffic lights, mainly rely on the communication between the micro-controller and the traffic light system, it is also used a AT89S51 micro-controller as the central control, resulting in a set of traffic lights signal, corresponding to forward, turn left and right turn signal , while the use of single-chip serial communication, and to communicate between the car, which is mainly infrared transmitter module launched, the data code corresponding to the small car to receive the first to talk about the information received judgments, control returned to the micro-controller. This design uses a very strong analog control study of great help, I believe the future will be able to be very good for our social services.Key wordsSmart car; traffic lights; automatic identification; tracking; Infrared communication1 前言随着科学技术不断发展,机器人的研究也越来越深入,机器人技术的发展,是一个科学技术发展共同的一个综合性的结果,也同时,为社会经济发展产生了一个重大影响的一门科学技术。
智能小车作为机器人的一种,其发展也是很迅速的,具有很高的研究价值。
智能车辆作为智能交通系统的重要组成部分,能够提高驾驶安全性,大幅改善公路交通效率,降低能源消耗量,该技术的研究日益受到国内外学者的关注。
其研究的主要目的在于降低日趋严重的交通事故发生率,提高现有道路交通的效率,在某种程度上缓解能源消耗和环境污染等问题。
智能车辆利用各种传感技术获取车体自身和车外环境的状态信息,经过智能算法对其进行分析、融合处理,将最终的决策结果传递给驾驶者,在危险发生之前,提醒驾驶员做出必要的回避动作,避免事故发生;在紧急状况下,驾驶者无法做出反应时,智能车辆则自主完成规避危险任务,帮助驾驶人员避免危险发生。
美国开始组织实施智能车辆先导( intelligent vehicle ini2tiative, IV I) 计划 , 欧洲提出公路安全行动计划( road safety action program, RSAP) ,日本提出超级智能车辆系统。
我国科技部则于2002年正式启动了“十五”科技攻关计划重大项目 ,智能交通系统关键技术开发和示范工程,其中一个重要的内容就是进行车辆安全和辅助驾驶的研究。
预计在2020年之前进入智能交通发展的成熟期,人、车、路之间可以形成稳定、和谐的智能型整体。
而一些发达国家开发和研制智能车辆已经有10余年的时间,特别是欧美已有相对成熟的经验。
本次设计的红绿灯自动识别小车就是遵循智能小车中的自动驾驶系统理念:自主驾驶系统是智能车辆研究的最高级阶段,车辆能够通过车内的传感器感知车身和环境信息,利用各种智能算法进行决策控制,并以此作为依据,实现自主行驶任务。
其中,如何使智能车辆与普通车辆共同行驶在现有道路之中也是有待于攻破的难题之一。
智能小车的发展主要是在自动化控制领域,一些大中专院校为了培养学生动手及编程能力,同时提高学生的兴趣,为智能小车控制领域提供了环境。