基于proteus的交通信号灯设计与仿真
基于proteus的交通信号灯设计与仿真

宁波理工学院专业综合课程实习课程论文题目基于proteus的交通信号灯设计与仿真项目成员沈毅专业班级电气101指导教师裘君分院信息完成日期20013. 7.14目录一、题目及要求 ......................................1.1实验目的 ............................................1.2实验原理图 ..........................................二、软件设置 .............................................三、硬件原理图 ...........................................四、软件流程图 ...........................................五、设计结果(仿真+实物).................................5.1状态一...............................................5.2状态二...............................................5.2状态三...............................................5.2状态四...............................................六、个人心得 .............................................七、附件.................................................基于proteus的交通信号灯设计与仿真一、题目及要求实现一个如下基本功能的交通灯:按照常规我们假设一个十字路口为东西南北走向。
(完整word版)基于Proteus仿真交通灯

Proteus班级:电信13—2姓名:段学亮邓成智崔俊杰邓石磊陈亮高金玉成绩:电子与信息工程学院信息与通信工程系1.设计要求单片机的P3口的P3.0~P3。
7连接4×4矩阵键盘,P0口控制一只数码管,当4×4矩阵键盘中的某一按键按下时,数码管上显示对应的键号.例如,1号键按下时,数码管显示“1", 14号键按下时,数码管显示“E”等等.2.仿真电路图仿真电路图,如图一图1:4*4键盘控制数码管显示3。
仿真C51程序#include<reg52。
h>#define uchar unsigned char#define uint unsigned intsbit dula=P2^6;sbit wela=P2^7;uchar disnum,temp,key;void delay(uchar i){uchar j,k;for(j=0;j<i;j++)for(k=0;k〈200;k++);}uchar code table_du[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0x7f8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0xff};void main(){disnum=16;wela=0;while(1){P3=0xf0;temp=P3;temp=temp&0xf0;if(temp!=0xf0){delay(10);if(temp!=0xf0){temp=P3;temp=temp|0x0f;P3=temp;key=P3;switch(key){case 0xee :disnum=0;break;case 0xde :disnum=1;break;case 0xbe : disnum=2;break;case 0x7e :disnum=3;break;case 0xed :disnum=4;break;case 0xdd : disnum=5;break;case 0xbd : disnum=6;break;case 0x7d :disnum=7;break;case 0xeb : disnum=8;break;case 0xdb : disnum=9;break;case 0xbb : disnum=10;break;case 0x7b :disnum=11;break;case 0xe7 : disnum=12;break;case 0xd7 :disnum=13;break;case 0xb7 :disnum=14;break;case 0x77 :disnum=15;break;}}}P0=table_du[disnum];}}3.电路图仿真效果当按下键盘时,所显示的效果如图3—1至图3—4图3—1:当按下K0键时,数码管显示数字‘0’图3—2:当按下K4键时,数码管显示数字‘4'图3—3:当按下K8键时,数码管显示数字‘8’图3—4:当按下KF键时,数码管显示数字‘F' 5.总结电路设计方面,根据书本上还是课堂上老师所讲的知识,很快设计出来此仿真电路。
基于Proteus的数字交通灯电路设计与实现

基于Proteus的数字交通灯电路设计与实现要基于Proteus进行数字交通灯电路的设计与实现,可以按照以下步骤进行操作:
1. 打开Proteus软件,创建一个新的工程。
2. 在工程中选择一个适当的微控制器模型,例如Arduino UNO。
3.在工程中选择一个合适的LED灯模型,用于表示交通灯的红、黄、绿三种状态。
4.将LED灯模型拖放到电路图中,并与微控制器的相应引脚连接。
5.在电路图中添加一个电阻,用于限流保护LED灯。
6. 编写Arduino程序代码,实现交通灯的控制逻辑。
例如,可以使用if语句和延时函数来控制LED灯的亮灭。
7. 将编写好的Arduino程序代码上传到微控制器中。
8.保存并仿真运行电路图,观察交通灯的工作状态。
9.可以通过更改程序代码中的延时时间和控制逻辑,来模拟不同的交通灯工作模式,如红绿灯交替、黄灯闪烁等。
完成以上步骤后,即可实现基于Proteus的数字交通灯电路设计与实现。
交通灯proteus仿真设计

交通灯proteus仿真设计交通灯是城市交通管理中非常重要的一部分,它们用于控制车辆和行人的流动,确保交通的安全和顺畅。
在这篇文章中,我们将使用Proteus软件来设计一个交通灯的仿真模型。
在Proteus中,我们可以使用ISIS和Ares两个模块进行电子电路的设计和仿真。
首先,我们需要在ISIS中创建一个新的电路图。
我们可以将交通灯的每个部分视为一个独立的电路,包括信号发生器、计时器、红绿灯和行人信号等。
首先,我们需要一个信号发生器来模拟交通灯的计时控制。
我们可以使用Proteus中提供的脉冲发生器来生成一个方波信号作为计时器的输入。
我们可以设置方波的频率和占空比来模拟不同的交通灯状态,比如红灯、绿灯和黄灯。
接下来,我们需要一个计时器来控制交通灯的转换。
我们可以使用Proteus中提供的计时器元件,比如555定时器。
我们可以设置定时器的参数,比如时钟频率和周期,来控制交通灯的转换时间。
然后,我们需要设计红绿灯的电路。
对于红灯,我们可以使用一个LED来表示,可以选择红色的LED。
对于绿灯,我们也可以使用一个LED来表示,可以选择绿色的LED。
我们可以使用Proteus中提供的LED元件,并将其连接到计时器的输出引脚上。
最后,我们还可以添加一个行人信号来模拟行人通过的情况。
我们可以使用一个LED来表示行人信号,可以选择白色的LED。
我们可以将行人信号的LED连接到计时器的输出引脚上,并设置适当的延迟来控制行人信号的亮灭。
完成电路设计后,我们可以在ISIS中进行仿真。
在仿真过程中,我们可以观察交通灯的状态和行人信号的变化。
通过调整计时器的参数,我们可以模拟不同的交通灯时间间隔和行人信号的延迟时间。
除了电路设计和仿真,Proteus还可以进行PCB布局和打印板设计。
我们可以使用Ares模块来创建一个真实的交通灯电路板,并将其制作成实际的交通灯。
总而言之,通过Proteus软件的使用,我们可以方便地设计和仿真交通灯的电路,并进行交通灯的时间间隔和行人信号的延迟的调整。
基于Proteus的智能交通灯的仿真设计

摘要本智能交通灯系统的设计主要是利用单片机和C语言完成共同来完成。
首先,系统采用红、黄、绿两组共六个LED发光二极管模拟十字路口东西和南北两个方向的交通信号灯,配有7SEG-MPX6-CC(六位八段共阴极数码管)数码构成倒计时牌,其的控制核心为AT89C51芯片。
其次,系统具有处理紧急情况的功能,可以使东西和南北双向红灯,禁止普通车辆通行。
最后,系统利用Proteus软件进行了软、硬件的的仿真。
关键词:AT89C51单片机倒计时牌中断数码管目录毕业设计任务书 (I)中文摘要............................................................................................... .II 1 引言. (1)1.1设计目的及意义 (1)1.2设计的内容 (1)2 设计原理 (2)2.1总体设计方案 (2)2.2硬件设计原理 (2)2.2.1硬件原理图 (2)2.2.2主要模块电路 (3)2.2.2.1控制核心——AT89C51单片机芯片 (3)2.2.2.2 LED数码管显示 (6)2.2.2.3六路交通灯的模拟 (8)2.2.2.4其它电路 (8)2.3 软件设计原理 (9)2.3.1软件流程图 (9)2.3.1.1主流程图 (9)2.3.1.2主要子程序流程图 (10)2.3.2软件源程序 (11)3 基于Proteus的仿真调试及排故 (11)3.1 Proteus的仿真软件的介绍 (11)3.2 主要调试过程 (11)3.2.1硬件测试 (12)3.2.2软件调试 (12)3.2.3连调 (12)3.3调试时出现的问题及解决方法 (12)4 结论 (14)致谢 (15)附录 (16)附录1 硬件连接图 (16)附录2 源程序 (17)附录3 共阴极LED数码管字段码表 (21)参考文献 (22)1 引言1.1 设计目的及意义交通是一个城市经济的命脉,它不但体现了一个城市的发展活力,也直接与老百姓的生活息息相关。
基于Proteus模拟软件的交通灯系统设计说明书

3rd International Conference on Mechanical Engineering and Intelligent Systems (ICMEIS 2015)Design of Traffic Light System Based on Proteus SimulationXuexuan CaiNorth China Electric Power University, Baoding, 071000, ChinaKeywords: proteus simulation software,traffic light systemAbstract. Based on the proteus simulation software, the paper realizes the individual timing and separated control on the transportation of Channel A and B with the 8254 counter and 8255 programmable parallel interface. The method of timing plus interruption control is adopted to count the passing time of vehicles in two directions separately, which enables the convenient change of passing times in two directions.1.Design Scheme1.1 Display of traffic lights under normal operationThe intel 8255A opening is used for display, leaving the PA7 and PA6 unused. The PA0, PA1 and PA2 respectively control the green light, yellow right and red light of Channel A, while the PA3, PA4 and PA5 differently control the green light, yellow right and red light of Channel B. Then, situation 1: when green light is in Channel A and red light in Channel B, 00100001B should be output in the 8255A opening; situation 2: when yellow light is in Channel A and red light in Channel B, 00100010B should be output in the 8255A opening; situation 3: when red light is in Channel A and green light in Channel B, 00001100B should be output in the 8255A opening; situation 4: when red light is in Channel A and yellow light in Channel B, 00010100B should be output in the 8255A opening.As to the time control, the frequency generator of counter 0 and working method 2 is used in the counter/ timer 8253. As the CLK0 pin receipts the 1MHz clock signal and the A8253 inputs 50000 (note: it is stipulated that the lower eight ones should be input before the higher eight ones in the programming), the result after calculation is just 0.05 seconds. The output of counter 0 is received by the clock signal of counter 1, which is working on the method 0: the counting will stop until the counter 0 finishes the method of outputting the jumping signals. As the counter 0 and 1 are counting in concatenation, the intended time can be controlled only by writing the value of counter 1 into the main program and the output of counter 1 will be received by PC0. For example, the situation 1 will maintain 25s without outside interruption and the B8253 should be input 500, namely 01100100B, with 0 in the higher eight ones. Situation 3 is the same with situation 1, while situation 4 is the same with situation 2. The query working method is adopted in timing. In the ending of the counting, the output 1 of PC0 means entering into the next working condition and 0 means continuing the query.1.2 Breaking off the switch in the state of emergencyDuring the process of simulation design, the emergency state of the switch simulation should be connected to PC1. In the state of emergency, PC1 will be low. The query working method is adopted in the foregoing situations of the display lights of the counter. The examination on whether the situation of the PC1 is 0 is added in the process. If the output is 1, the query will be continued; if the output is 0, the interrupt program will be conducted. If the interrupt program shows that red light is in both Channel A and Channel B, the query working method will unceasingly check out the situation of PC1 to find out whether it has recovered to be 1. If the situation becomes 1, the state of emergency has been relived and the primary state can be carried on by returning the scene; if the situation is still 0, the state of emergency isn’t relived and the lights should be kept red.2.Debug ResultsAfter the debug, the light display will be in cycle operation. If the green light of Channel A is interrupted, the red light of Channel A and B will be bright after the switch is pressed. The primary operation situation will be recovered when the switch is regained to Channel A and Channel B.The results of debug are as follows:Figure 1 Green light in Channel A and red light in Channel BFigure 2 Yellow light in Channel A and red light in Channel BFigure 3 Red light in Channel A and green light in Channel BFigure 4 Red light in Channel A and yellow light in Channel B Brief description on the debug results:(1)Figure 1 means Channel A is allowed to pass as there is green light but it is forbidden to pass Channel B as there is red light.(2)Figure 2 means that the 25s for green light in Channel A is up, the green light turns into yellow light reminding the coming of red light in the direction and red light is still in Channel B to forbid passing.(3)Figure 3 means that the 5s for yellow light in Channel A is up, it will turn into red light to forbid passing and there is green light in Channel B to allow passing.(4)Figure 5-4 means that the 25s for green light in Channel B is up, it turns into yellow light reminding the coming of red light in the direction and red light is still in Channel A to forbid passing.(5)The 5s is up and the system recovers to the primary state, namely, green light in south-north direction to allow passing and red light in Channel B to forbid passing, as shown in the following Figure. Based on the 60s cycle, the working functions of traffic lights are realized.(6) In case of emergencies, the button can be pressed to make red light on in both Channel A and Channel B, which is shown as follows:Figure 5 Red Light in both Channel A and Channel B3.SummaryThe paper conducts examination and simulation on the designed traffic system based on the proteus simulation software. By the simulation exercises, the functions of pins in 8086 chips can be understood more profoundly, such as how to use 8255 programmable parallel interface chips, how to take advantage of 8253 to make timing or output the pulses of certain frequency and how could the 8259 produce maskable interruption, etc. After the comparison between the simulation and the practical wirings and some slight adjustments on the program, the simulative traffic light system is easily built on the experiment box.References[1] Hong Yongquan. Microcomputer Principles and Interfacing Techniques [M]. Beijing: Science Press, 2009[2] Xu Zeming. Control Traffic Lights by Microcomputer [J]. Software Guide, 2007 (5)[3] Xiang Xinjian. Microcomputer Traffic Light Control System [J]. ASPT Source Journal, 1997 (09)。
基于Proteus的智能交通灯的仿真设计

基于Proteus的智能交通灯的仿真设计智能交通灯是一种基于现代科技的交通管理设备,通过智能化的控制系统和传感器,能够根据交通流量和道路情况,自动调整交通信号灯的时间和模式,以提高交通效率和安全性。
Proteus是一种功能强大的电子设计自动化(EDA)软件,它可以用于电路仿真和PCB设计。
在智能交通灯的仿真设计中,Proteus可以帮助我们建立交通信号灯的电路模型,并模拟不同情况下的交通流量和信号控制策略。
首先,我们需要设计交通信号灯的电路模型。
在Proteus中,我们可以使用元件库中的数字逻辑元件和LED元件来构建交通信号灯的电路。
通过连接适当的电源和控制信号,我们可以模拟交通信号灯的工作状态。
接下来,我们可以使用Proteus的仿真功能来模拟不同情况下的交通流量和信号控制策略。
通过设置不同的输入信号和参数,我们可以观察交通信号灯在不同条件下的工作效果。
比如,我们可以模拟高峰时段和低峰时段的交通流量,观察交通信号灯的调整情况以及车辆通过的效率。
在仿真设计中,我们还可以使用Proteus的调试功能来分析交通信号灯的电路和控制逻辑。
通过设置断点和监视变量,我们可以观察电路中各个信号的变化情况,以及控制逻辑的执行过程。
这有助于我们发现潜在的问题并进行调整和改进。
除了仿真设计,Proteus还可以用于PCB设计和实际制造。
通过将电路设计转化为PCB布局,我们可以将交通信号灯的电路制作成实际的电子板,并安装在实际的交通信号灯中进行测试和调试。
总之,基于Proteus的智能交通灯的仿真设计可以帮助我们模拟不同情况下的交通流量和信号控制策略,并分析交通信号灯的电路和控制逻辑。
这有助于我们优化交通信号灯的设计,提高交通效率和安全性。
同时,Proteus还可以用于PCB设计和实际制造,使我们的设计能够实际应用于交通管理中。
基于Proteus的智能交通灯设计与仿真实现

基于Proteus的智能交通灯设计与仿真实现智能交通灯是一种通过传感器和智能控制系统实现交通信号灯的智能化管理,能够根据交通流量和道路状况进行智能调控,以提高交通效率和减少交通堵塞。
本文将基于Proteus软件进行智能交通灯的设计和仿真实现。
首先,我们需要明确智能交通灯的基本功能和设计要求。
智能交通灯主要需要实现以下功能:1.根据交通流量进行智能控制。
通过传感器检测道路上的交通流量,智能交通灯可以根据实时的交通情况智能地调整信号灯的时间,以提高交通效率。
2.考虑不同道路的优先级。
在交叉路口附近,智能交通灯需要根据不同道路的优先级来调整信号灯的时间,以确保交通的顺畅和安全。
3.考虑行人的过马路需求。
智能交通灯需要合理地安排行人的过马路时间,以保证行人的安全和顺畅。
接下来,我们将使用Proteus软件进行智能交通灯的设计和仿真实现。
Proteus是一款电子电路设计和仿真软件,可以用来模拟和验证电子电路的性能和功能。
首先,我们需要设计智能交通灯的硬件电路。
在Proteus中,我们可以使用元器件库中的LED灯和开关等元件来构建交通灯的电路。
同时,我们还需要添加传感器来检测交通流量和行人的需求。
在设计电路的过程中,我们需要考虑不同道路的优先级和行人的过马路需求。
根据道路的优先级,我们可以设置不同道路对应的信号灯的亮灭时间。
同时,我们还可以设置传感器来检测行人的需求,以在需要的时候提供行人过马路的时间。
完成电路设计后,我们可以使用Proteus中的仿真功能来验证电路的性能和功能。
在仿真过程中,可以模拟不同道路的交通流量和行人的过马路需求,以观察交通灯是否能够根据实时情况进行智能调控。
在仿真过程中,我们可以观察交通灯的状态变化和信号灯的亮灭时间,以评估交通灯的性能和效果。
如果发现问题,我们可以对电路进行调整和优化,以提升交通灯的智能化管理能力。
总结起来,基于Proteus的智能交通灯设计和仿真实现是一种高效且可靠的方法。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
专业综合课程实习
课程论文
题目基于proteus的交通信号灯设计与仿真项目成员沈毅
专业班级电气101
指导教师裘君
分院信息
完成日期20013. 7.14
目录
一、题目及要求 (3)
1.1 实验目的 (3)
1.2 实验原理图 (3)
二、软件设置 (4)
三、硬件原理图 (5)
四、软件流程图 (6)
五、设计结果(仿真+实物) (7)
5.1状态一 (7)
5.2状态二 (7)
5.2状态三 (8)
5.2状态四 (9)
六、个人心得 (9)
七、附件 (9)
基于proteus的交通信号灯设计与仿真一、题目及要求
实现一个如下基本功能的交通灯:按照常规我们假设一个十字路口为东西南北走向。
初始状态为状态1,南北方向绿灯通车,东西方向红灯。
经过一段时间(25S)转换状态2,南北方向绿灯闪几次转亮黄灯,延时5S,东西方向仍然红灯。
再转换到状态3,东西方向绿灯通车,南北方向红灯。
过一段时间(25S)转换到状态4,东西方向绿灯闪几次转亮黄等,延时5S,南北方向仍然红灯。
最后循环至南北绿灯,东西红灯。
在这些状态下,有时钟倒数计时。
(35分)
附加功能得分(15分)
如按键、蜂鸣器等
1.1 实验目的
●掌握MCS-51单片机定时器/计数器、外部中断、LED数码管显示及I/O口的综合
应用。
●了解交通灯的工作原理及设计方法。
●掌握单片机应用系统分析、设计、调试方法。
1.2 实验原理图
图1 交通灯电路原理图(1)
图2交通灯电路原理图(2)二、软件设置
图3 软件仿真
三、硬件原理图
图4 硬件模块
图5硬件连接
四、软件流程图
五、设计结果(仿真+实物)
5.1状态一
状态1:南北方向绿灯通车,东西方向红灯。
经过一段时间(25S),倒计时。
图6 状态一
5.2状态二
状态2,南北方向绿灯闪几次转亮黄灯,延时5S,东西方向仍然红灯。
图7 状态二
5.2状态三
状态3,东西方向绿灯通车,南北方向红灯,过一段时间(25S)倒计时。
图8 状态三
5.2状态四
状态4,东西方向绿灯闪几次转亮黄等,延时5S,南北方向仍然红灯。
图9 状态四
六、个人心得
通过keil与proteus和硬件的联合使用,对交通灯综合考虑,实现了红灯30s,绿灯25s,3s绿灯闪烁,2s黄灯亮的交通功能设计。
七、附件
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
//uint FUNC = 1 ; //0:数码管功能, 1:红绿灯功能
uint T_Count= 0;
uint number=0;
uint a=0,a1=0,a2=0;
uint b=0,b1=0,b2=0;
sbit LED=P1^0;
int LEDSHOW[10] = {0xC0,0xF9,0xA4,0xB0,0X99,0X92,0X82,0XF8,0X80,0x90}; //#define LED P1^0
//延时
void DelayMS(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}
//主程序
void main()
{
//定时器0中断初始化代码
TMOD=0x00; //定时器0 工作方式0
TH0=(8192-5000)/32; //5ms 定时
TL0=(8192-5000)%32;
IE=0x82; //允许T0 中断
TR0=1;
//开始循环
while(1)
{
if(number<=25&&number>0)//状态一
{
//南北绿灯,东西红灯东西红黄绿南北红黄绿
P1=0xde;
//显示倒计时
b=30-number+1;
b1=b/10;
b2=b%10;
a=25-number+1;
a1=a/10;
a2=a%10;
P2 = 0X01; //00001110 //南北1
P0 = LEDSHOW[a1];
DelayMS(5);
P2 = 0X02; //00001101 //南北2
P0 = LEDSHOW[a2];
DelayMS(5);
P2 = 0X04; //00001011 //东西1
P0 = LEDSHOW[b1];
DelayMS(5);
P2 = 0X08; //00000111 //东西2
P0 = LEDSHOW[b2];
DelayMS(5);
}
if(number>25&&number<=30)//状态2
{ //南北绿闪烁几次转黄灯,东西继续红灯东西红黄绿南北红黄绿if(number>25&&number<=28)
{
if(number%2==1)
P1=0xde;
else P1=0xfe;}
if(number>28&&number<=30)
P1=0Xee;
a=30-number+1; //显示
a1=a/10;
a2=a%10;
P2 = 0X01;
P0 = LEDSHOW[a1];
DelayMS(5);
P2 = 0X02;
P0 = LEDSHOW[a2];
DelayMS(5);
P2 = 0X04;
P0 = LEDSHOW[a1];
DelayMS(5);
P2 = 0X08;
P0 = LEDSHOW[a2];
DelayMS(5);
}
if(number>30&&number<=55)//状态3
{ //东西绿南北红
P1=0xf3; //东西红黄绿南北红黄绿
a=55-number+1; //显示
a1=a/10;
a2=a%10;
b=60-number+1;
b1=b/10;
b2=b%10;
P2 = 0X01;
P0 = LEDSHOW[b1];
DelayMS(5);
P2 = 0X02;
P0 = LEDSHOW[b2];
DelayMS(5);
P2 = 0X04;
P0 = LEDSHOW[a1];
DelayMS(5);
P2 = 0X08;
P0 = LEDSHOW[a2];
DelayMS(5);
}
if(number>55&&number<=60)//状态4
{ //东西方向绿灯闪几次转亮黄等,延时5S,南北方向仍然红灯东西红黄绿南北红黄绿
if(number>55&&number<=58)
{
if(number%2==1)
P1=0xf3;
else P1=0xf7;}
if(number>58&&number<60)
P1=0Xf5;
a=60-number+1; //显示
a1=a/10;
a2=a%10;
P2 = 0X01;
P0 = LEDSHOW[a1];
DelayMS(5);
P2 = 0X02;
P0 = LEDSHOW[a2];
DelayMS(5);
P2 = 0X04;
P0 = LEDSHOW[a1];
DelayMS(5);
P2 = 0X08;
P0 = LEDSHOW[a2];
DelayMS(5);
}
}
}
//T0 中断函数
void LED_Flash() interrupt 1
{
TH0=(8192-5000)/32; //恢复初值
TL0=(8192-5000)%32;
if(++T_Count==200) //1s 开关一次LED {
number++;
if(number>60)
number=1;
//FUNC = ++FUNC % 2;
//LED=~LED;
T_Count=0;
}
}。