1、城市交通灯毕业城市交通灯毕业设计设计 摘 要:对基于单片机的城市交通灯控制系统进行了设计。 系统功能为: 以 MCS-51 系列单片机作为控制核心,设计并制作交通灯控制系统,东西南北四个方向具有左 拐、右拐、直行及行人 4 种通行指示灯,用计时器显示路口通行转换剩余时间,在 特种车辆如 119、120 通过路口时,系统可自动转为特种车辆放行,其他车辆禁止 通行状态。 在对系统功能分析的基础上,提出了三种设计方案,经比较,选择性能较优的 LED 动态循环显示方案进行了设计。设计包括硬件和软件两大部分。硬件部分包括 单片机最小系统、时间显示、交通灯显示三部分。选用 Atmel 公司的 AT89S5
2、2 单片 机作为控制核心,东西南北四个方向设置了 LED 时间显示和交通灯显示,时间显 示采用三位 LED 显示器,交通灯显示则采用红绿双色高亮发光二极管来模拟。软 件采用了模块化的设计方法,主要分为主程序、定时器中断服务子程序、倒计时显 示子程序、交通灯模拟显示子程序四部分。 在实验板上制作了基于单片机的交通灯控制系统样机,对硬件和软件部分分别 进行了调试,再进行了软硬件联调,得到的交通灯控制系统样机实物,可圆满地完 成毕业设计任务书所要求的功能。 关键词: 交通灯;单片机;AT89S52 Design of traffic light control system based on SCM
3、 Abstract: Traffic light control system based on SCM (Single Chip Microcomputer) is designed in this paper. System requires that MCS-51 series SCM is used as CPU. Traffic light control system should be designed and made .There are four groups light which indicate to turn left, turn right, and go str
4、aight ahead and pedestrian access in east, west, north and south four directions. Timer shows traffic conversion remainder time. When special vehicles, such as 119,120 go through, the system can automatically allow special vehicles running and other vehicles is prohibited. Based on analysis of the s
5、ystem functions, three schemes are put forward .By comparison, LED dynamic cycle display scheme has better functions and it is selected to be designed. The design includes hardware part and software part. Hardware has three parts .They are SCM system, LED time display, traffic lights. AT89S52 SCM is
6、 selected as control CPU. LED display and traffic lights are set in east, west, north and south four directions. Three LED monitors are used to show time. Highlight and red-green two color traffic lights are used as traffic lights. Software is designed by module. It is divided into main program, timer interrupting service subroutine, LED display subroutine, traffic display subroutine. The model of traffic lights control system is made in experiment board. Hardware and software is debugged respe