学 号 2010041127 密 级____________
哈尔滨工程大学本科生毕业论文
城市交通灯模拟与控制系统设计
院(系) 名 称: 自动化学院
专 业 名 称: 自动化 学 生 姓 名: 支茂峰 指 导 教 师: 吕淑平 教授 孙 伟 讲师
哈尔滨工程大学
2014年6月
城市交通灯模拟与系统设计 支茂峰 哈尔滨工程大学
学 号 2010041127 密 级___________
城市交通灯模拟与控制系统设计
Simulation and control system design of city traffic
lights
学 生 姓 名:支茂峰 所 在 学 院:自动化学院 所 在 专 业:自动化 指 导 教 师:吕淑平,孙伟 职 称:教授,讲师 所 在 单 位:哈尔滨工程大学 论文提交日期:2014年6月14日 论文答辩日期:2014年6月22日 学位授予单位:哈尔滨工程大学
摘 要
本论文的主要任务是设计一个基于单片机的城市交通灯模拟与控制系统。整体思想是采用STC89C52单片机最小系统作为控制部分,控制数码管显示各个路口的通行或禁止通行剩余时间数,同时用发光二极管显示每个路口的通行状态,通过按键使整个系统工作在三种工作状态,夜间模式状态,禁行模式状态以及正常通行模式状态。
本设计结合了多种控制技术,通过对不同方案的比较、分析,确定了采用STC89C52单片机为控制器的整体设计方案。本系统的硬件模块主要包括:STC89C52单片机最小系统模块,按键电路模块,数码管显示电路模块以及发光二极管电路模块。根据硬件设计编写了相应软件模块。软件模块主要包括:系统初始化模块,开机LOGO模块,数据处理模块,按键扫描模块,数码管显示模块,二极管点亮模块。
本系统具体完成了对城市交通灯的模拟与控制,再现了实际城市交通灯的工作流程。该设计硬件电路简单,软件编写简单易懂,容易修改。在传统红绿灯的基础上增加了夜间模式,禁行模式使交通灯更加人性化。通过对系统进行多次测试,得出系统稳定,软硬件工作正常,本系统符合设计要求。
关键词:STC89C52单片机;工作状态;城市交通灯
ABSTRACT
The main task of this paper is to design a microcontroller-based urban traffic light simulation and control system. The whole idea is to use the smallest STC89C52 SCM system as a control part, control the digital tube to display the allow passage remaining time or the no thoroughfare remaining time. Simultaneously with the light-emitting diode displays the status of each intersection traffic. Button to make the whole system work by the three working state, night mode state, the state of the forbidden line mode and normal traffic patterns state.
The design incorporates a variety of control techniques by comparing the different programs, analysis, determined using STC89C52 microcontroller overall design of the controller. The system's hardware modules include: STC89C52 SCM minimum system module, key circuit module, the digital display circuit module and a light emitting diode circuit module. According to the hardware design of the preparation of the corresponding software modules. Software modules include: system initialization module, boot LOGO module, data processing module, key scan module, LED display module, LED light module.
The specific design of the system is completed the city simulation and control of
traffic lights, traffic lights to reproduce the actual city of workflows. The design of the hardware circuit is simple, software development, easy to understand, easy to modify. On the basis of the traditional traffic light on the increase in night mode, the forbidden line mode enables traffic lights more humane. The system through several tests, draw system stability, hardware and software to work properly, the system meets the design requirements.