基于单片机的交通灯控制系统设计本科毕业设计
- 格式:doc
- 大小:509.00 KB
- 文档页数:50
本科毕业设计基于单片机的交通灯控制系统设计摘要随着社会经济的发展,交通在人们的日常生活中占有重要的地位,城市交通问题越来越引起人们的关注。
人、车、路三者关系的协调,已成为交通管理部门需要解决的重要问题之一。
所以,如何采用合适的控制方法,最大限度利用好耗费巨资修建的城市高速道路,缓解主干道与匝道、城区同周边地区的交通拥堵状况,越来越成为交通运输管理和城市规划部门亟待解决的主要问题。
本设计采用MSC-51系列单片机STC89C52为中心器件来设计交通灯控制器,利用发光二极管和数码管实现了设置红、绿灯亮灭时间的功能,红绿灯循环点亮,绿灯倒计时结束为5秒的黄灯闪烁警示,利用按键使得系统具有倒计时,时间设置,紧急情况处理,根据具体情况手动控制和车辆违规检测等功能。
软件上采用KEIL C 编程,主要编写了主程序,数码管显示程序,中断程序,延时程序等。
经过PROTUES调试,实现了对十字路口交通灯的模拟。
经过对整个设计系统的测试,本系统倒计时每60秒显示误差为0.5秒以内,交通状态信号灯交替显示正常。
按下相应的功能按键,都能正常运行,执行相应的操作。
车辆违规检测当有车辆闯红灯会有1个违规信号输出。
本系统能够在不停的运行1个小时以上,稳定性够强。
总的来说,本系统能够很好地实现本次设计要求的功能,还拥有增减倒计时时间、南北通行、东西通行和紧急模式等5个功能,而且精确度够高、操作简单、稳定性较强。
关键词:交通灯单片机车辆违规检测模拟Traffic Light Control System Based on Single Chip DesignChen Wenxing(College of Engineering,South China Agricultural University,Guangzhou 510642,China) Abstract:With the development of social economy, the transportation is very important in People's Daily life, the urban transportation problem more and more aroused people's concern. People, cars, the road three relations coordination, has become a traffic management department needs to solve one of the important issues. So, how to adopt the suitable control method, make the best use of costly to build urban freeway, relieve the main road and on-ramp, urban traffic congestion and surrounding areas, increasingly become the traffic transportation management major problems to be solved and the urban planning department.This system adopts the MSC - 51 series microcontroller STC89C52 device for the center to design the traffic light controller, using digital tube LED and a set of red and green light will consume time function, traffic light cycle light, green light for 5 seconds of the end of the countdown yellow lights Flashing warning, using the button makes the system has a countdown, time Settings, emergency processing, manual control and vehicle violation detection based on the specific situation, and other functions.In the light of the KEIL C software programming, mainly to write the main program, LED digital tube display program, interrupt program delay procedures, etc. After PROTUES debugging, has realized the simulation of traffic lights at an intersection.After testing on the design of the whole system, this system the countdown display error is 0.5 seconds, traffic status lights alternate display normal. Press the corresponding function key, can run normally, perform the corresponding operation. Vehicle violation detection when vehicles running red lights will have a bad signal output. This system can constantly running more than one hour, stability is strong enough. In general, this system can well realize the design requirements of function, also has a countdown time increase or decrease, north-south traffic, traffic and four road ban and other five function, precision and high stability, simple operation, strong enough.Key words: traffic light single chip microcomputer vehicle violation detection simulation目录1 前言 (1)1.1 交通灯的研究背景 (1)1.2 交通灯的研究意义 (1)1.3 交通灯的发展前景 (2)1.4 交通灯的设计目的 (3)2 总体方案确定 (3)2.1 设计方案论证 (3)2.2 总体设计框图 (4)3 系统硬件设计 (4)3.1 系统硬件电路构成 (4)3.2 主要芯片器件介绍 (4)3.2.1 单片机STC89C52功能与引脚说明 (4)3.2.2 数码管 (7)3.2.3 发光二极管 (8)3.3 单元电路设计 (9)3.3.1 单片机最小系统 (9)3.3.2 车辆违规检测 (10)3.3.3 数码管显示 (10)3.3.4 发光二极管信号灯显示 (11)3.3.5 按键操作 (11)4 系统软件设计 (12)4.1 理论基础知识 (12)4.1.1 定时器原理 (12)4.1.2 软件延时原理 (12)4.1.3 中断原理 (13)4.2 系统程序设计 (13)4.2.1 主程序设计 (13)4.2.2 倒计时功能 (15)4.2.3 数码管显示 (15)4.2.4 交通灯的功能按键 (17)4.2.5 延时程序模块 (18)4.2.6 车辆违规检测 (19)5 系统的调试与结果 (19)5.1 硬件调试 (20)5.2 软件调试 (20)5.3 软硬联试 (21)5.4 性能测试结果 (22)6 结论 (23)6.1 设计总结 (23)6.2 改进与建议 (23)参考文献 (25)附录交通灯控制C 程序 (1)致谢............................................................................................................ 错误!未定义书签。
华南农业大学本科生毕业设计成绩评定表1 前言1.1 交通灯的研究背景随着城市经济的高速发展,机动化交通在城市交通中所占的比例不断增加。
但以机动车交通为主体的交通发展方式也给城市带来了诸多问题。
道路上汽车数量的增加,使得尾气污染、交通拥堵、交通事故等愈加严重,同时也降低了城市居民的出行安全保障(夏天,2010)。
城镇道路建设由于历史等原因的相对滞后,人们也越来越受到交通拥堵、交通事故频发等问题所带来的困扰,特别是街道的各十字路口,更成为交通网中通行能力的隘口和交通事故的多发源(覃娴,2012)。
交通安全问题不仅仅是交通领域的问题,它的严重程度已经成为社会问题。
根据联合国和世界卫生组织的有关报告,人们每天所而对的各种问题中,道路交通伤害是最复杂也是最危险的。
据估计,全世界每年约有120万人死于道路交通事故,受伤者多达5000万人。
如果不采取强有力的预防措施,今后20年中道路交通事故致死和受伤人数将增加65%左右。
交通安全已经成为一个波及社会各个部门的全球性问题。
世界卫生组织的报告指出,全世界每天有3000多人死于道路交通伤害。
因道路交通伤害引起的85%的死亡以及90%的伤残调整寿命年发生在中、低收入国家。
研究表明,2000到2020年,道路交通事故死亡人数在高收入国家将下降30%左右,而在中、低收入国家则会大幅度增加,如果不采取适当措施,到2020年,道路交通伤害预计将成为全球疾病与伤害负担的重要原因(王笑京,2008)。
交通问题是世界各国面临的共同问题。
交通拥挤造成了巨大的时间浪费,加大了环境污染。
我国大多数城市的平均行车速度已降至20km/h以下,有些路段甚至只有7-8km/h;由于车辆速度过慢,尾气排放增加,使得城市的空气质量进一步恶化。