1、 0 目录目录 摘要摘要. 1 第一章第一章 绪论绪论 . 2 第二章第二章 方案设计与论证方案设计与论证. 3 一 外部环境明暗的检测单元 3 二 路况的检测单元 3 三 处理器的选择 3 第三章第三章 硬件设计硬件设计 4 一 80C51 单片机硬件结构 . 4 1 微处理器 . 4 2 数据存储器. 4 3 程序存储器. 4 4 中断系统 . 5 5 定时器/计数器 5 6 串行口 5 7 特殊功能寄存器 5 二 最小应用系统设计 . 5 1 时钟电路 . 6 2 复位电路 . 6 3 通用的晶振电路 7 三 显示电路 . 8 四 LED 灯电路构成. 9 第四章第四章 软件设计软件设计
2、 12 一 主程序设计. 12 二 延时子程序设计 14 三 按键扫描子程序设计. 14 四 中断子程序设计 15 五 显示子程序. 16 六 声光报警子程序 19 七 交通情况检测子程序. 20 八 路灯控制子程序设计. 21 参考文献:参考文献: .24 附录:附录: 25 附附 1:元器件明细表:元器件明细表: 25 附附 2:仪器设备清单:仪器设备清单.25 附附 3:电路图图纸:电路图图纸 .26 附附 4:程序清单:程序清单26 1 摘要摘要 STC89C52RC 单片机是一款八位单片机,他的易用性和多功能性受到了广大 使用者的好评。本系统以毕业设计的题目要求为目的,采用 8051
3、 单片机为控制 核心,利用光电传感器出检测环境的明暗变化以及路灯的工作状态,利用对射式 红外线检测交通的情况,通过在硬件的基础上进行编程,利用软件达到路灯模拟 系统的支路控制器有时钟功能,能设定、显示开关灯时间,并控制整条支路按时 开灯和关灯;支路控制器能根据环境明暗变化,自动开灯和关灯;支路控制器能 根据交通情况自动调节亮灯状态; 支路控制器能分别独立控制每只路灯的开灯和 关灯时间;当路灯出现故障时(灯不亮) ,支路控制器发出声光报警信号,并显 示有故障路灯的地址编号。整个系统的电路结构简单,可靠性能高。实验测试结 果满足要求。 采用的技术主要有: (1) 通过编程来路灯的状态。 (2) 传
4、感器的有效应用; (3) 新型显示芯片的采用. 关键词:关键词:STC89C52RCSTC89C52RC 单片机单片机 光电传感器光电传感器 红外传感器红外传感器 A Abstractbstract STC89C52RC monolithic integrated circuits is one of eight monolithic integrated circuits, his ease and functional by the users. this graduation design system to the subject of the requirements for the
5、 purpose of a monolithic integrated circuits to control the 8051,Photo electric sensors to the detection of the environment and the work of the state to shoot in the traffic in the infrared detected by the hardware on the basis of programming,Used software to the system of control is the way, can se
6、t in, displaying switch the light of time, and control all of the road and turn off the light of the turn on the light; the road to environmental change, A way to control traffic can automatically adjust the light of the state ; way to each separate independent control the lights and the time when the faults occur ;audible and visible warning signals,And that there was failure, the address numbers. the entire circuit of the system simple, reliable performance. the test results to meet the r