学校代码 14199 学号 01116043 分 类 号 密级
本科毕业论文(设计)
基于单片机的十字路口交通灯设计 教 学 部 创业学院信息工程部 专业名称 电子信息科学与技术 年 级 2011级 学生姓名 吕娟 指导教师 那顺
2015年3月15日
本科毕业论文(设计)
基于单片机的十字路口交通灯设计
摘要:知道了交通灯的重要性,而对于交通灯最重要的是单片机。跟随
单片机的应用正在不断深入,同时带动传统控制检测技术日益更新。在实时检测和自动控制的单片机应用系统中,单片机通常作为一个核心部件来使用,仅凭对单片机简单了解是不够的,应该根据具体硬件结构并且软硬件结合,实现自己想要达到的目的。单片机自问世以来,性能不断提高和完善,所以实用许多场合。单片机具有集成度高、功能多、速度快、体积小、功耗低、使用方便、性能可靠、价格便宜,其易于产品化、抗干扰能力强、可以在恶劣的情况下坚持工作。特别是它强大的面向控制能力,使它在工业控制领域,智能仪表、外设控制、家用电器、机器人、军事装置等方面得到了广泛的应用。 考虑到单片机具有物美价廉、灵活方便、还有各种优秀的特点,所以我们从中选择用MCS-51系列单片机AT89C51单片机来实现十字路口交通信号灯的控制。单片机系统的实体和装置,通常由运算器、控制器、存储器、输入接口电路和输入设备、输出接口电路和输出设备等组成。单片机实质上是一个硬件的芯片,在实际应用中,通常很难直接和被控对象进行电气连接,必须外加各种扩展接口电路、外部设备、被控对象等硬件和软件,才能构成一个单片机应用系统。该交通灯拟系统的硬件部分主要由键盘、显示和运算部分组成,再根据实际车流量通过8051芯片的P3口设置红、绿灯燃亮时间的功能;红绿灯循环点亮,倒计时剩5秒时黄灯闪烁警示(交通灯信号通过P1口输出,显示时间通过P0口输出至双位数码管)。本系统设计周期短、可靠性高、实用性强、操作简单、维护方便、扩展功能强。
关键词:单片机、MCS-51系列单片机AT89C51、交通灯
本科毕业论文(设计)
Intersection traffic light design based on single chipmicro computer
Abstract Know the importance of traffic light, for the traffic light is the most important single chip microcomputer. With MCU application there is a growing, at the same time, drive traditional control test technology is becoming more and more updates. In real-time detection and automatic control of microcomputer application system, the single chip microcomputer often as a core component to use, with only the microcontroller simple understanding is not enough, should according to the specific hardware structure and software and hardware combination, realize the they want to achieve. SCM since its advent, constantly improve and perfect performance, so many practical occasions. Single-chip microcomputer is characterized by a high level of integration, function, high speed, small volume, low power consumption, easy to use, reliable performance, the price is cheap, it is easy to transition, strong anti-interference ability, can stick to work in bad situation. Especially it powerful to control ability, make it in the field of industrial control, intelligent instrument, peripherals, household appliances, robots, aspects and so on military equipment has been widely used. Considering the single chip microcomputer is inexpensive, flexible and convenient, there are various kinds of excellent characteristics, so we choose with MCS - 51 series microcontroller AT89C51 single chip microcomputer to realize the intersection traffic signal control. Single chip microcomputer system entities and device, usually by arithmetic unit, controller, memory, input interface circuit and input devices, output interface circuit and output devices, etc. SCM is essentially a hardware chips, in practice, it is often hard to direct electrical connection and the controlled object, must plus various extensions interface circuit, external equipment, such as hardware and software of the object, and to form a single chip microcomputer application system. The traffic light hardware part of the proposed system is mainly composed of keyboard, display and operation part, according to the actual traffic by 8051 chip P3 mouth set function of red and green light burning time; Traffic light cycle light, countdown with 5 seconds left yellow lights flashing warning (traffic light signal through P1 port output, display time by P0 port output to a digital tube). This system design cycle is short, high reliability, strong practicability, simple operation, convenient maintenance, strong extended functionality.
Keywords Single chip microcomputer、The MCS - 51 series microcontroller AT89C51、traffic lights
本科毕业论文(设计)
目录
第一章 绪论..................................................................1
第一节 交通灯的历史.....................................................1 第二节 交通灯对人类生活的影响...........................................2
第二章 AT89C51单片机........................................................ 3
第一节AT89C51单片机的概述......................................... . .. 3 第二节 硬件设计........................................................7
第三节 设计要求.......................................................11 第三章 基于单片机的交通灯软件设计.......................................... 11
第一节 单片机交通系统通行方案设计..................................... 13 第三节 软件设计........................................................12 第三节 总体设计与电路图.............................................. .14 第四章 仿真测试、数据和结果分析........................ ....................23 第五章 总结.................................................................25
致谢............................................................ ....26 参考文献.............................................................27
本科毕业论文(设计)
第 1 页
第一章 绪论
最早的交通灯出现于一八六八年英国伦敦。那时的交通灯只有红、绿两色,经改良后,再增加一盏黄色的灯,红灯表示停止,黄灯表示准备,绿灯则表示通行。中国最早的马路红绿灯,是于1928年出现在上海的英租界。
第一节 交通灯的历史
(1) 历史
在十九世纪初期,英国的约克城中红装和绿装分别代表的是女性中不同的身份,其中红装女性代表已经结婚,绿装女性则是未婚,后来由于在伦敦的议会大厦前经常发生马车撞人的交通事故,交通设计者就受到红绿装的启发设计出了信号灯家族,信号灯家族正式设立的实践为1868年的12月10日,地点在伦敦的议会大厦前广场,设计师为德·哈特,该信号灯高为七米,柱子上悬挂着红色和绿色两个煤气灯为交通信号灯,这个信号等就是世界上第一个交通信号等,在信号灯的下面,一位警察手提长杆可以牵动皮带控制灯的颜色。后来通过改进,信号灯的中心安装上煤气罩,从而实现每期前面两块红色和绿色玻璃的相互交替。虽然该交通灯在面世的第23天突然爆炸自灭,更是让一位执勤的警察因此送命,但是由于交通信号灯起到了良好的只会交通作用,在因为安全问题被取缔了一段实践之后又重新被美国的利夫兰市克恢复,通过改进,这时候的交通信号灯已经变为电气信号灯,其安全系数大大增高,后来由于效果良好,在美国的纽约和芝加哥市相继出现。
(2)变革
随着城市工业化的发展和科技的创新,交通工具越来越多,这时候交通指挥的作用便越来越重要,1918年,第一盏真正意义上的三色灯诞生,它的设计是三色圆形四面投影仪,该投影仪被安装在纽约市五号街的高塔上,三色灯的诞生改善了城市的交通环境。
黄色信号灯的发明者是中国的胡汝鼎先生,当年他到美国深造,后来到爱迪生为董事长的美国通用电器公司任职,在偶然的一天他在大街上的十字路口等红绿灯,当看到红灯亮了之后想要穿过马路的时候忽然一辆转弯的汽车呼啸而过,惊魂稍定的他在回到宿舍的时候不断的琢磨当前信号灯的缺陷,后来终于想到了在红绿灯中间加上一个黄色信号灯的办法,这样可以有效的提醒行人注意危险。胡汝鼎的建议得到了当地政府的肯定和采纳,于是红黄绿三色灯便诞生了。 (3)关联
从最早的手牵皮带到20世纪50年代的电气控制,从采用计算机控制到现代化的电子定时监控,交通信号灯在科学化、自动化上不断地更新、发展和完善。