当前位置:文档之家› 外文翻译---基于单片机的十字路口交通灯控制器的设计

外文翻译---基于单片机的十字路口交通灯控制器的设计

外文翻译---基于单片机的十字路口交通灯控制器的设计
外文翻译---基于单片机的十字路口交通灯控制器的设计

附件1:外文文献原文

BASED ON MCU INTERSECTION TRAFFIC LIGHTS THE CONTROLLER DESIGN

Because of the rapid development of our economy resulting in the car number of large and medium-sized cities surged and the urban traffic, is facing serious test, leading to the traffic problem increasingly serious, its basically are behaved as follows: traffic accident frequency, to the human life safety enormous threat, Traffic congestion, resulting in serious travel time increases, energy consumption increase; Air pollution and noise pollution degree of deepening, etc. Daily traffic jams become people commonplace and had to endure. In this context, in combination with the actual situation of urban road traffic, develop truly suitable for our own characteristics of intelligent signal control system has become the main task.

Preface

In practical application at home and abroad, according to the actual traffic signal control application inspection, planar independent intersection signal control basic using set cycle, much time set cycle, half induction, whole sensor etc in several ways. The former two control mode is completely based on planar intersection always traffic flow data of statistical investigation, due to traffic flow the existence of variable sex and randomicity, the two methods have traffic efficiency is low, the scheme, the defects of aging and half inductive and all the inductive the two methods are in the former two ways based on increased vehicle detector and according to the information provided to adjust cycle is long and green letter of vehicle, it than random arrived adaptability bigger, can make vehicles in the parking cord before as few parking, achieve traffic flowing effect In modern industrial production,current,voltage,temperature, pressure, and flow rate, velocity, and switch quantity are common mainly controlled parameter. For example: in metallurgical industry, chemical production, power engineering, the papermaking industry, machinery and food processing and so on many domains, people need to transport the orderly control. By single chip microcomputer to control of traffic, not only has the convenient control, configuration simple and flexible wait for an advantage, but also can greatly improve the technical index by control quantity, thus greatly improve product quality and quantity. Therefore, the monolithic integrated circuit to the traffic light control problem is an industrial production we often encounter problems.

In the course of industrial production, there are many industries have lots of traffic equipment, in the current system, most of the traffic control signal is accomplished by relays, but relays response time is long, sensitivity low, long-term after use, fault opportunity increases greatly, and adopts single-chip microcomputer control, the accuracy of far greater than relays, short response time, software reliability, not because working time reduced its performance sake, compared with, this solution has the high feasibility.

About AT89C51

(1)function characteristics description:

AT89C51 is a low power consumption, high performance CMOS8 bit micro-controller, has the 8K in system programmable Flash memory. Use high-density Atmel company the beltpassword nonvolatile storage technology and manufacturing, and industrial 80S51 product instructions and pin fully compatible. Chip Flash allow program memory in system programmable, also suitable for conventional programmer. In a single chip, have dexterous 8 bits CPU and in system programmable Flash, make AT89C51 for many embedded control application system provides the high flexible, super efficient solution. A T89C51 has the following standard function: 8k bytes Flash, 256 bytes RAM, 32-bit I/O mouth line, the watchdog timer, two data pointer, three 16 timer/counter, a 6 vector level 2 interrupt structure, full-duplex serial port, piece inside crystals timely clock circuit. In addition, AT89C51 can drop to 0Hz static logic operation, support two software can choose power saving mode. Idle mode, the CPU to stop working, allowing the RAM, timer/counter, serial ports, interruption continue to work. Power lost protection mode, RAM content being saved, has been frozen, microcontroller all work stop, until the next interruption or hardware reset so far. As shown in figure 1 for the AT89C51 pins allotment.

Figure 1 the A T89C51 pins allotment

(2)interrupt introduction

AT89C51 has six interrupt sources: two external interruption, (and), three timer interrupt (timer 0, 1, 2) and a serial interrupts. Each interrupt source can be passed buy bits or remove IE the relevant special register interrupt allow control bit respectively make effective or invalid interrupt source. IE also includes an interrupt allow total control bit EA, it can be a ban all interrupts. IE. Six is not available. For AT89C51, IE. 5 bits are also not be used. User software should not give these bits write 1. They AT89 series for new product reserved. Timer 2 can be TF2 and the T2CON registers EXF2 or logical triggered. Program into an interrupt service, the sign bit can be improved by hardware qing 0. In fact, the interrupt service routine must determine whether TF2 or EXF2 activation disruption, the sign bit must also by software qing 0. Timer 0 and 1 mark

a timer TF0 and TF1 has been presented in the cycle count overflow S5P2 074 bits. Their value until the next cycle was circuit capture down. However, the timer 2 marks a TF2 in count overflow of the cycle of S2P2 074 bits, in the same cycle was circuit capture down

Table 1

Table 2

About 8255 chip

1.8255 features:

(1)A parallel input/output LSI chips, efficacy of I/O devices, but as CPU bus and peripheral interface.

(2)It has 24 programmable Settings of I/O mouth, even three groups of 8 bits I/O mouth to mouth, PB mouth and PA PC mouth. They are divided into two groups 12 I/O mouth, A group including port A and C mouth (high four, PC4 ~ PC7), including group B and C port B mouth (low four, PC0 ~ PC3). A group can be set to give basic I/O mouth, flash control (STROBE) I/O flash controlled, two-way I/O3 modes, Group B can only set to basic I/O or flash controlled the I/O, and these two modes of operation mode entirely by controlling registers control word decision.

2. 8255 pins efficacy:

(1). RESET: RESET input lines, when the input outside at high levels, all internal registers (including control registers) were removed, all I/O ports are denoting input methods.

(2). CS: chip choose a standard lamp line 1, when the input pins for low levels, namely/CS = 0, said chip is selected, allow 8255 and CPU for communications, / CS = 1, 8255 cannot with CPU do data transmission.

(3). RD: read a standard lamp line 1, when the input pins for low levels, namely/RD = 0 and/CS = 0, allow 8255 through the data bus to the CPU to send data or state information, namely the CPU 8255 read from the information or data.

(4). The WR: write a standard lights, when the input pins for low levels, namely/WR = 0 and/CS = 0, allows the CPU will data or control word write 8255.

(5). D7: three states D0 ~ two-way data bus, 8255 and CPU data transmission channel, when the CPU execution input/output instruction, through its realization 8 bits of data read/write operation, control characters and status information transmitted through the data bus.

(6). PA0 ~ PA7: port A input and output lines, A 8 bits of data output latches/buffers, an 8 bits of data input latches.

(7). PB0 ~ PB7: port B input and output lines, a 8 bits of I/O latches, an 8 bits of input and output buffer.

(8). PC0 ~ PC7: port C input and output lines, a 8 bits of data output latches/buffers, an 8 bits of data input buffer. Port C can through the way of working setting into two four ports, every 4 digit port contains A 4 digit latches, respectively with the port A and port B cooperate to use, can be used as control standard lights output or state standard lights input ports.

(9). A0, A1: address selection line, used to select the PA 8255 mouth, PB mouth, PC mouth and controlling registers.

When A0=0, A1= 0, PA mouth be chosen;

When A0=0, A1 = 1, PB mouth be chosen;

When A0=0, A1 = 1, PC mouth be chosen;

When A0=1, A1= 1, control register is selected.

Concerning seven section LED display introduction Through light emitting diode chip appropriate link (including series and parallel) and appropriate optical structure. May constitute a luminous display light-emitting segments or shine points. By these luminous segments or shine point can be composed digital tube, symbols tube, m word pipe, tube, multilevel matrix display tube etc. Usually the digital tube, symbols tube, m word tube were called stroke display, but the stroke displays and matrix tube collectively referred to as character displays.

1. The LED display classification

(1) by word high marks: stroke monitors word high least 1mm (monolithic integrated type more digital tube word high in commonly 2 ~ 3mm). Other types of stroke display tiptop 1.27 mm (0.5 inch) even up to hundreds of mm.

(2) color-coded score red, orange, yellow, green and several kinds.

(3) according to the structure points, reflecting cover type, a single point-elastic and monolithic integrated type.

(4) from the luminous section electrode connection mode of points of anode and cathode two kinds.

2. LED display parameters

Due to the LED display is LED based, so its light, and the electrical characteristics and ultimate meaning of the parameters with most of the same light emitting diode. But because the LED monitor containing multiple light emitting diode, it must has the following specific parameters:

(1) the luminous intensity ratio

Due to the digital tube paragraphs in the same driving voltage, each are not identical, so positive current each different. The luminous intensity All segments of the luminous intensity values the ratio of the maximum and minimum values for the luminous intensity ratio. The ratio between 2.3 in 1.5 ~, the maximum cannot exceed 2.5.

(2) pulse positive current

IF each segment of typical strokes displays for positive dc working current IF, then the pulse, positive current can be far outweigh.someotherwordpeopledontthinkoffirst. Pulse 390v smaller, pulse positive current can be bigger.

Traffic signal control type

The purpose of the traffic signal control are three: first,in time and space space intersection traffic in different directions,control traffic operation order; Second, make on planar cross the road network on the people and objects of transport at the highest efficiency, Third, as the road users to provide necessary information, and help them to effectively use the traffic facilities. Road traffic signal control of basic types have many points method.

According to the control geometry characteristic is divided into: single intersection control - point control, the traffic trunk lines of coordinated control - wire, traffic network coordination control surface controlling; -- According to the control principle differentiates: timing control, induced control and adaptive control.

About watch-dog circuit

By single-chip computers.the micro computer system, because of single chip work often can be affected by external electromagnetic interference, causing program run fly while into dead circulation, the program's normal operation be interrupted by single chip microcomputer control system was unable to work, can cause the whole system of come to a standstill, happen unpredictable consequences, so out of microcontroller running status real-time.according consideration, they generate a specially used for monitoring microcontroller program running state of the chip, commonly known as "watchdog" (watchdog).

MAX692 was slightly system monitoring circuit chip, have back-up battery switching, power lost discriminant functions monitoring, the watchdog. The encapsulation and pin instructions as figure2shows.

Figure 2 MAX692 encapsulation and pins

Watch-dog circuit application, make SCM can in no condition to achieve continuous work, its working principle is: the watchdog chip and MCU an I/O pins are linked together, the I/O pins through program control it regularly to the watchdog of the pins on into high level (or the low level), this program statement is scattered on SCM other control statements, once among single-chip due to the interference makes application run into a fly after the procedures section into dead circulation state, write the watchdog pins program cannot be executed, this time, the watch-dog circuit will be without microcontroller sent signals, then at it and MCU reset pin connected pin reset signal give out a a, make SCM reposition occurs, namely the program from program memory splittext started, so we realized the MCU automatic reset.

Infrared detection circuit

The infrared radiation photon in semiconductor materials stimutes the non-equilibrium carriers (electronic or holes), cause electrical properties change. Because carrier does not escape in vitro, so called within the photoelectric effect. Quantum photoelectric effect high sensitivity, response speed heat detectors much faster, is optional detectors. In order to achieve the best performance, generally need worked in low temperature. Photoelectric detector can be divided into:

(1) optical type: also called photoconductive resistance. The incident photon stimulate the valence band uniform semiconductor electronic across forbidden band into the conduction band and left in valence band, cause cavitation increases, for electric conductance eigen light conductivity. From the band gaps of impurity level also can stimulate light into the conduction band or born carriers valence band, and for impurities light conductivity. The cutoff wavelength by impurity ionization energy (ie) decision. Quantum efficiencies below eigen optical and require lower working temperature.

(2) photovoltaic type: mainly p - n knot of light born volts effect. Energy more than the

width of infrared photonic band gaps in "area and its nearby of electrons cavitation. Existing "electric field make hole into p area, electronic into n area, two parts appear potentials. Deoxidization device have voltage or current signal. Compared with optical detectors, pv detector detect rate more than forty percent of figure limit, Don't require additional bias electric field and load resistance, no power consumption, having a high impedance. These characteristics of preparation and use of the focal plane array bring great benefits.

(3) light emitting - Schottky potential barrier detector: metal and semiconductor contact, typically include PtSi/Si structure and form was Schott potential barrier, infrared photon through Si layer for PtSi absorption, electronic Fermi level, obtain energy leap over left cavitation potential barrier into the Si substrate, PtSi layer of electronic was collected, complete infrared detection. Make full use of Si integration technology, facilitate production, with lower cost and good uniformity wait for an advantage, but make it mass (1024 x 1024 even greater) focal plane array to make up for the defect of quantum low efficiency. Have strict low temperature requirements. With this kind of detector, both at home and abroad has already produced as qualitative good thermography. Pt Si/Si structure made of FPA is the earliest IRFPA.

Timing counting and traffic calculation

Using MCS - 51 internal timer/counter for timing, cooperate software delay realizes the timer. This method hardware cost saving, cut allows the reader in timer/counter use, disruptions and programming get exercise and improve. Computation formula is as follows: TC = M - C

Type in, M for counter touch value, the value and the counter working way concerned.

For a traffic intersection, it can in the shortest possible time to achieve maximum traffic, even reached the best performance, we call in unit of time to achieve the maximum flow multi-energy for cars.

Use the equation: (traffic = traffic/time) to represent.

Intersection traffic lights used to create the general thoughts Cross the road traffic is traffic laws of the silent commands, is drivers and pedestrians standards of behaviour. Cross the road traffic lights control is the guarantee of traffic safety and the roads of the key. At present, the domestic most cities are adopting "automatic" red and green lights, it has fixed "red light - green" conversion interval, and automatic switching. They generally by "transit and prohibit time control display, red yellow green lights and direction indicator" three parts. In the traffic light transit and prohibit time control and display, usually either east-west and south-north direction every 50 seconds; two Either according to the traffic rules, things direction 60 seconds, north-south direction 40 seconds, time control are fixed. The traffic light time control and display, with a fixed time value in advance "petrification" in the SCM, every time only in certain period changing alternately. But, in fact, of different time vehicles is very complex

circulation conditions, is highly nonlinear, random, also often be think influences. Adopt timing control often causing road effective application waste of time, there is less, the red light green direction vehicle direction vehicle backlog. It regardless of the current number of road traffic due to the actual situation of change, its biggest flaw is that when the road conditions change, cannot satisfy the driver and passers-by's actual need, light person cause time wasted, the person that weigh directly lead to traffic jams, bring about urban traffic the decline in efficiency. At present, there is a use of "fuzzy control" technology control method of traffic lights. According to crossroads in both directions vehicle dynamic status, automatic judgment traffic lights to ensure maximum time intervals, traffic, reduce road traffic jams. But unlike timing control, can use digital display the current light color remaining time, so that the driver grasps his driving action, to stop in time or start.

Figure 3 crossroads driveway shape figure

Figure 4 for histograms, writes for north crossroads lamp, the right of the east crossroads lamp, underneath for south crossroads lamp, left for west crossroads lamp. Figure 5 shows the traffic rules for a state chart, set up separately for S1, S2, S3 S4, in this traffic lights, four state for a cycle, circular execution.

Figure 4 vehicle histogram

Please note that figure S2 state and S4 state, they in a given time interval in four directions can open to traffic, this state can within certain time to an even larger traffic, particularly high efficiency. Outer ring is the north for direction state circulation and inner circle is east for direction state cycle.

Figure 5 vehicle state chart

Based on the above the vehicle of a state chart, can list each intersection of logic table lamp, due to opposite of light of a state chart is same, so we only write adjacent intersections of light of logic table, According to the operation diagram can be seen, the adjacent intersections lamp their status in phase differences 180 °. So ultimately just write a group of S1, S2, S3, S4 logic state list. As shown in table 3 shows:

List of "1" representative lights (also represent logic 1), "0" represents the lamp (also represent logic 0), in accordance with the above, can send to the corresponding port logic values.

附件2:外文文献译文

基于单片机的十字路口交通灯控制器的设计由于我国经济的快速发展从而导致了汽车数量的猛增,大中型城市的城市交通,正面临着严峻的考验,从而导致交通问题日益严重,其主要表现如下:交通事故频发,对人类生命安全造成极大威胁;交通拥堵严重,导致出行时间增加,能源消耗加大;空气污染和噪声污染程度日益加深等。日常的交通堵塞成为人们司空见惯而又不得不忍受的问题。在这种背景下,结合我国城市道路交通的实际情况,开发出真正适合我们自身特点的智能信号灯控制系统已经成为当前的主要任务。

前言

在实际应用上,根据对国内外实际交通信号控制应用的考察,平面独立交叉口信号控制基本采用定周期、多时段定周期、半感应、全感应等几种方式。前两种控制方式完全是基于对平面交叉口既往交通流数据的统计调查,由于交通流存在的变化性和随机性,这两种方式都具有通行效率低、方案易老化的缺陷,而半感应式和全感应式这两种方式是在前两种方式的基础上增加了车辆检测器并根据其提供的信息来调整周期长和绿信比,它对车辆随机到达的适应性较大,可使车辆在停车线前尽可能少停车,达到交通流畅的效果。

在现代化的工业生产中,电流、电压、温度、压力、流量、流速和开关量都是常用的主要被控参数。例如:在冶金工业、化工生产、电力工程、造纸行业、机械制造和食品加工等诸多领域中,人们都需要对交通进行有序的控制。采用单片机来对交通进行控制,不仅具有控制方便、组态简单和灵活性大等优点,而且可以大幅度提高被控制量的技术指标,从而能够大大提高产品的质量和数量。因此,单片机对交通灯的控制问题是一个工业生产中经常会遇到的问题。

在工业生产中,有很多行业有大量的交通灯设备,在现行系统中,大多数的交通控制信号都是用继电器来完成的,但继电器响应时间长,灵敏度低,长期使用之后,故障机会大大增加,而采用单片机控制,其精度远远大于继电器,响应时间短,软件可靠性高,不会因为工作时间缘故而降低其性能,相比而言,本方案具有很高的可行性。

关于AT89C51

(1)功能特征描述:

AT89C51是一种低功耗、高性能CMOS8位微控制器,具有8K 在系统可编程Flash 存储器。使用Atmel 公司高密度非易失性存储器技术制造,与工业80S51 产品指令和引脚完全兼容。片上Flash允许程序存储器在系统可编程,亦适于常规编程器。在单芯片上,拥有灵巧的8 位CPU 和在系统可编程Flash,使得AT89C51为众多嵌入式控制应用系统提供高灵活、超有效的解决方案。AT89C51具有以下标准功能:8k字节Flash,256字节RAM,32 位I/O 口线,看门狗定时器,2 个数据指针,三个16 位定时器/计数器,一个6向量2级中断结构,全双工串行口,片内晶振及时钟电路。另外,AT89C51 可降至0Hz 静态逻辑操作,支持2种软件可选择节电模式。空闲模式下,CPU停止工作,允许RAM、定时器/

计数器、串口、中断继续工作。掉电保护方式下,RAM内容被保存,振荡器被冻结,单片机一切工作停止,直到下一个中断或硬件复位为止。如图1为8051引脚分配图。

图1 8051引脚分配图

(2)中断介绍

AT89C51有6个中断源:两个外部中断(INT0和INT1),三个定时中断(定时器0、1、2)和一个串行中断。每个中断源都可以通过置位或清除特殊寄存器IE 中的相关中断允许控制位分别使得中断源有效或无效。IE还包括一个中断允许总控制位EA,它能一次禁止所有中断。IE.6位是不可用的。对于AT89C51,IE.5位也是不能用的。用户软件不应给这些位写1。它们为AT89系列新产品预留。定时器2可以被寄存器T2CON中的TF2和EXF2的或逻辑触发。程序进入中断服务后,这些标志位都可以由硬件清0。实际上,中断服务程序必须判定是否是TF2 或EXF2激活中断,标志位也必须由软件清0。定时器0和定时器1标志位TF0 和TF1在计数溢出的那个周期的S5P2被置位。它们的值一直到下一个周期被电路捕捉下来。然而,定时器2的标志位TF2 在计数溢出的那个周期的S2P2被置位,在同一个周期被电路捕捉下来。

(3)外部时钟驱动特性

表1

表2

关于8255芯片

1. 8255特性:

(1) 一个并行输入/输出的LSI芯片,多功效的I/O器件,可作为CPU总线与外围的接口.

(2) 具有24个可编程设置的I/O口,即使3组8位的I/O口为PA口,PB口和PC口.它们又可分为两组12位的I/O口,A组包括A口及C口(高4位,PC4~PC7),B组包括B口及C口(低4位,PC0~PC3).A组可设置为基本的I/O口,闪控(STROBE)的I/O闪控式,双向I/O3种模式;B组只能设置为基本I/O或闪控式I/O两种模式,而这些操作模式完全由控制寄存器的控制字决定.

2. 8255引脚功效:

(1).RESET:复位输入线,当该输入端外于高电平时,所有内部寄存器(包括控制寄存器)均被清除,所有I/O口均被置成输入方式。

(2).CS:芯片选择旌旗灯号线,当这个输入引脚为低电平时,即/CS=0时,表示芯片被选中,允许8255与CPU进行通讯;/CS=1时,8255无法与CPU做数据传输。

(3).RD:读旌旗灯号线,当这个输入引脚为低电平时,即/RD=0且/CS=0时,允许8255通过数据总线向CPU发送数据或状态信息,即CPU从8255读取信息或数据。

(4).WR:写入旌旗灯号,当这个输入引脚为低电平时,即/WR=0且/CS=0时,允许CPU 将数据或控制字写入8255。

(5).D0~D7:三态双向数据总线,8255与CPU数据传送的通道,当CPU执行输入输出指令时,通过它实现8位数据的读/写操作,控制字和状态信息也通过数据总线传送。

(6).PA0~PA7:端口A输入输出线,一个8位的数据输出锁存器/缓冲器,一个8位的数据输入锁存器。

(7).PB0~PB7:端口B输入输出线,一个8位的I/O锁存器,一个8位的输入输出缓冲器。

(8).PC0~PC7:端口C输入输出线,一个8位的数据输出锁存器/缓冲器,一个8位的数据输入缓冲器。端口C可以通过工作方式设定而分成2个4位的端口,每个4位的端口包含一个4位的锁存器,分别与端口A和端口B配合使用,可作为控制旌旗灯号输出或状态旌旗灯号输入端口。

(9).A0,A1:地址选择线,用来选择8255的PA口,PB口,PC口和控制寄存器。

当A0=0,A1=0时,PA口被选择;

当A0=0,A1=1时,PB口被选择;

当A0=1,A1=0时,PC口被选择;

当A0=1,A1=1时,控制寄存器被选择。

有关七段LED显示器的介绍

通过发光二极管芯片的适当连接(包括串联和并联)和适当的光学结构。可构成发光显示器的发光段或发光点。由这些发光段或发光点可以组成数码管、符号管、米字管、矩阵管、电平显示器管等等。通常把数码管、符号管、米字管共称笔画显示器,而把笔画显示器和矩阵管统称为字符显示器。

1. LED显示器分类

(1)按字高分:笔画显示器字高最小有1mm(单片集成式多位数码管字高一般在2~3mm)。其他类型笔画显示器最高可达12.7mm(0.5英寸)甚至达数百mm。

(2)按颜色分有红、橙、黄、绿等数种。

(3)按结构分,有反射罩式、单条七段式及单片集成式。

(4)从各发光段电极连接方式分有共阳极和共阴极两种。

2. LED显示器的参数

由于LED显示器是以LED为基础的,所以它的光、电特性及极限参数意义大部分与发光二极管的相同。但由于LED显示器内含多个发光二极管,所以需有如下特殊参数:

(1) 发光强度比

由于数码管各段在同样的驱动电压时,各段正向电流不相同,所以各段发光强度不同。所有段的发光强度值中最大值与最小值之比为发光强度比。比值可以在1.5~2.3间,最大不能超过2.5。

(2) 脉冲正向电流

若笔画显示器每段典型正向直流工作电流为IF,则在脉冲下,正向电流可以远大于IF。脉冲占空比越小,脉冲正向电流可以越大。

交通信号控制类型

交通信号控制的目的有三点:第一,在时间上和空间上分隔交叉口不同方向的车流,

控制车流的运行秩序;第二,使在平面交叉的道路网络上人和物的运输达到最高效率;第三,为道路使用者提供必要的信息,帮助他们有效地使用交通设施。道路交通信号控制的基本类型有多种分法。

按控制区几何特性划分为:单个交叉口的控制——点控、交通干线的协调控制——线控、交通网络的协调控制——面控;按控制原理划分:定时控制、感应控制、自适应控制。

关于看门狗电路

在由单片机构成的微型计算机系统中,由于单片机的工作常常会受到来自外界电磁场的干扰,造成程序的跑飞,而陷入死循环,程序的正常运行被打断,由单片机控制的系统无法继续工作,会造成整个系统的陷入停滞状态,发生不可预料的后果,所以出于对单片机运行状态进行实时监测的考虑,便产生了一种专门用于监测单片机程序运行状态的芯片,俗称"看门狗"(watchdog)。

MAX692是微系统监控电路芯片,具有后备电池切换、掉电判别、看门狗监控等功能。其封装和引脚说明如图2所示。

图2 MAX692封装和引脚

看门狗电路的应用,使单片机可以在无人状态下实现连续工作,其工作原理是:看门狗芯片和单片机的一个I/O引脚相连,该I/O引脚通过程序控制它定时地往看门狗的这个引脚上送入高电平(或低电平),这一程序语句是分散地放在单片机其他控制语句中间的,一旦单片机由于干扰造成程序跑飞后而陷入某一程序段进入死循环状态时,写看门狗引脚的程序便不能被执行,这个时候,看门狗电路就会由于得不到单片机送来的信号,便在它和单片机复位引脚相连的引脚上送出一个复位信号,使单片机发生复位,即程序从程序存储器的起始位置开始执行,这样便实现了单片机的自动复位。

红外检测电路

红外辐射光子在半导体材料中激发非平衡载流子(电子或空穴),引起电学性能变化。因为载流子不逸出体外,所以称内光电效应。量子光电效应灵敏度高,响应速度比热探测器快得多,是选择性探测器。为了达到最佳性能,一般都需要在低温下工作。光电探测器可分为:

(1) 光导型:又称光敏电阻。入射光子激发均匀半导体中的价带电子越过禁带进入导带并在价带留下空穴,引起电导增加,为本征光电导。从禁带中的杂质能级也可激发光生载流

子进入导带或价带,为杂质光电导。截止波长由杂质电离能决定。量子效率低于本征光导,而且要求更低的工作温度。

(2) 光伏型:主要是p-n结的光生伏特效应。能量大于禁带宽度的红外光子在结区及其附近激发电子空穴对。存在的结电场使空穴进入p区,电子进入n 区,两部分出现电位差。外电路就有电压或电流信号。与光导探测器比较,光伏探测器背影限探测率大于40%;不需要外加偏置电场和负载电阻,不消耗功率,有高的阻抗。这些特性给制备和使用焦平面阵列带来很大好处。

(3) 光发射-Schottky势垒探测器:金属和半导体接触,典型的有PtSi/Si结构,形成Schott ky势垒,红外光子透过Si层为PtSi吸收,电子获得能量跃上Fermi能级,留下空穴越过势垒进入Si衬底,PtSi层的电子被收集,完成红外探测。充分利用Si集成技术,便于制作,具有成本低、均匀性好等优势,可做成大规模(1024×1024甚至更大)焦平面阵列来弥补量子效率低的缺陷。有严格的低温要求。用这类探测器,国内外已生产出具有像质良好的热像仪。Pt Si/Si结构FPA是最早制成的IRFPA。

定时计数与车流量的计算

利用MCS-51内部的定时器/计数器进行定时,配合软件延时实现到计时。该方法节省硬件成本,切能够使读者在定时器/计数器的使用、中断及程序设计方面得到锻炼与提高。计算公式如下:

TC=M-C

式中,M为计数器摸值,该值和计数器工作方式有关。

对于一个交通路口来说,能在最短的时间内达到最大的车流量,就算是达到了最佳的性能,我们称在单位时间内多能达到的最大车流为车流量。

用公式:(车流量= 车流/ 时间)来表示。

十字路口交通灯设计中采用的一般思路

十字道口的红绿灯是交通法规的无声命令,是司机和行人的行为准则。十字道口的交通红绿灯控制是保证交通安全和道路畅通的关键。当前,国内大多数城市正在采用“自动”红绿交通灯,它具有固定的“红灯—绿灯”转换间隔,并自动切换。它们一般由“通行与禁止时间控制显示、红黄绿三色信号灯和方向指示灯”三部分组成。在交通灯的通行与禁止时间控制显示中,通常要么东西、南北两方向各50秒;要么根据交通规律,东西方向60秒,南北方向40秒,时间控制都是固定的。交通灯的时间控制显示,以固定时间值预先“固化”在单片机中,每次只是以一定周期交替变化。但是,实际上不同时刻的车辆流通状况是十分复杂的,是高度非线性的、随机的,还经常受认为因素的影响。采用定时控制经常造成道路有效应用时间的浪费,出现绿灯方向车辆较少,红灯方向车辆积压。它不顾当前道路上交通车辆数的实际情况变化,其最大的缺陷就在于当路况发生变化时,不能满足司机与路人的实际需要,轻者造成时间上的浪费,重者直接导致交通堵塞,导致城市交通效率的下降。目前,有一种使用“模糊控制”技术控制交通灯的方法。能够根据十字路口两个方向上车辆动态状况,自动判断红绿灯时间间隔,以保证最大车流量,减少道口的交通堵塞。但是却不像定时

控制,能用数字显示器显示当前灯色剩余时间,以便于驾驶员随时掌握自己的驾驶动作,及时停车或启动。

图3 十字路口车道形状图

图4为直方图,上边为北路口灯,右边为东路口灯,下边为南路口灯,左边为西路口灯。图5所示为一种红绿灯规则的状态图,分别设定为S1、S2、S3、S4,交通灯以这四种状态为一个周期,循环执行。

图4 车辆行驶直方图

请注意图S2状态和S4状态,它们在一个时间段中四个方向都可以通车,这种状态能在一定的时间内达到较大的车流量,效率特别高。外圈是北方为前进方向的状态循环,内圈是东方为前进方向的状态循环。

图5 车辆行驶状态图

依据上述的车辆行驶的状态图,可以列出各个路口灯的逻辑表,由于相向的灯的状态图是一样的,所以只需写出相邻路口的灯的逻辑表;根据行驶状态图可以看出,相邻路口的灯它们的状态在相位上相差180°。因此最终只需写出一组S1、S2、S3、S4的逻辑状态表。如表3所示:

表中的“1”代表灯亮(也代表逻辑上的1),“0”代表灯灭(也代表逻辑上的0),依上表,就可以向相应的端口送逻辑值。

基于51单片机的交通信号灯系统本科毕设论文

毕业设计 基于单片机的交通信号的灯控制系统 一. 综合实训的主要内容 1.设计任务 设计一单片机控制的交通信号灯系统,模拟城市十字路口交通信号灯功能。 2.基本功能要求 2.1 交通信号控制 直行车道红黄绿灯控制、左行车道绿灯控制、人行横道红绿灯控制。 2.2 通行时间显示 数码管倒计时显示通行时间。 2.3 时间参数设置存储 按键实现通行时间的设置,并存储到EEPROM (24C02)芯片中。 二. 硬件方案设计与论证 1. 显示模块设计 1.1倒计时时间显示 设计思想:由于该系统要求完成倒计时显示通行时间的功能,且考虑到实际的交通系统中车辆及行人通行时间不会超过一分钟,基于以上原因,我们考虑完全采用数码管显示,四个路口分别采用一个二位共阴极数码管进行显示。(其实物图见附录1图5.3) 图2.1 数码管原理图 原理图分析: 为了显示数字或字符,必须对数字或字符进行编码。七段数码管(a,b,c,d,e,f,g )加上一个小数点(dp),共计8段,构成一个字节,通过对这八段给予高低平使二极管 GND a b c d e f g dp g f e d c b a (a)

导通或截止,从而显示不同的数字或字符。系统中所使用的是2位共阴数码管(实物图见附录),其管脚从左上方起顺时针依次为1,a,b,e,d,2,g,f,dp,c。 1.2 状态灯显示 设计思想:由于该系统要求完成状态灯显示的功能,我们把各个路口的红灯和黄灯设成直行和左拐两个通行方式所共有,也就是说,一个路口只需四个状态灯,一个直行通行的绿灯,一个左拐通行的绿灯,一个共有的红灯,一个共有的黄灯,人行横道采用红绿灯控制,综上所述,我们共使用16个LED绿灯,12个LED红灯,4个LED黄灯来完成状态灯显示功能。 2.控制模块设计 2.1 设计思想 由于本系统结构简单,实现较容易,不需要大量的外围扩展,所以我们采用STC89C51单片机作为主控制器,STC89C51单片机具有体积小,功耗低,控制能力强,价格低、扩展灵活,使用方便等特点,其最小系统由振荡电路、复位电路构成。 2.2 最小系统原理图 图2.2 单片机最小系统原理图 原理图分析:51单片机最小系统由复位电路,振荡电路组成。振荡电路使用11.0592MHz高精度晶振,振荡电容选择30pF瓷片电容;复位电路采用RC电路。 3.存储模块 3.1 设计思想:系统掉电存储模块采用串行E2PROM,它是基于IIC总线的存储器件,遵循二线制协议,其具有接口方便,体积小,数据掉电不丢失等特点。 3.2 24C02芯片原理图

单片机控制交通灯系统设计

摘要 本系统由单片机系统、键盘、LED显示、交通灯演示系统组成。系统包括人行道、左转、右转、以及基本的交通灯的功能。系统除基本交通灯功能外,还具有倒计时、时间设置、紧急情况处理、分时段调整信号灯的点亮时间以及根据具体情况手动控制等功能。 本设计是单片机控制的交通灯控制系统。单片机即单片微型计算机。由RAM,ROM,CPU构成,其集定时、计数和多种接口与一体的微控制器。它体积小、成本低、功能强,广泛的应用于只能产业和工业自动化上。而51系列单片机是各类单片机中最为典型和富有代表性的一种。 关键字:单片机;交通灯;AT89S52;Proteus仿真

ABSTRACT This system by single chip microcomputer system, keyboard, LED display, traffic lights of the demo system. System including sidewalks, turn left, turn right, and the basic function of traffic lights. System in addition to the basic function of traffic lights, also has a countdown, time setting, emergency treatment, light time of period of time to adjust light and manual control based on the specific situation, and other functions. This design is a single-chip microcomputer control of traffic lights control system. SCM the single chip microcomputer. Formed by RAM, ROM and CPU, timing, count and various interface and the integration of the micro controller. It has small volume, low cost, strong function, widely used in industry and industrial automation. And 51 series microcontroller is the most typical and representative in all kinds of single chip microcomputer. Key words: Single chip microcomputer;Traffic lights;AT89S52;Proteus simulation

基于单片机的十字路口交通灯控制系统设计

长沙航空职业技术学院毕业设计(论文) 题目:基于单片机的十字路口 交通灯控制系统设计 学生姓名 系别航空电子电气工程系 专业应用电子技术专业 学号 指导教师 职称

目录 摘要 (2) 前言 (4) 第一章绪论 (5) 1.1背景 (5) 1.2 设计的目的及意义 (5) 1.3 交通灯控制系统设计的任务与要求 (5) 1.4 设计实现的主要功能 (6) 第二章交通灯的总体方案设计与论证 (7) 2.1 显示界面方案 (7) 2.2 输入方案 (7) 第三章交通灯原理分析 (8) 3.1 交通灯显示时序的理论分析 (8) 3.2 交通灯显示的理论分析 (9) 3.2.1倒计时显示的理论分析 (9) 3.2.2状态灯显示的理论分析 (10) 第四章交通灯系统硬件设计 (11) 4.1 交通灯系统设计芯片选择 (11) 4.2.1系统构成: (12) 4.2.2七段数码管介绍: (12) 第五章交通灯系统软件设计 (14) 5.1程序设计流程图 (14) 5.2 交通灯系统编程信息 (16) 第六章交通灯的仿真及调试 (17) 6.1 Proteus软件仿真 (17) 6.2功能调试 (18) 6.3 交通灯实物调试 (19) 结论 (21) 致谢 (22) 参考文献 (23) 附录 A(源程序) (24) 附录 B(电路原理图) (27) 附录 C(PCB图) (28)

摘要 近年来随着科技的飞速发展,单片机的应用正在不断深入,同时带动传统控制检测技术日益更新。在实时检测和自动控制的单片机应用系统中,单片机往往作为一个核心部件来使用,仅单片机方面知识是不够的,还应根据具体硬件结构软硬件结合,加以完善。 十字路口车辆穿梭,行人熙攘,车行车道,人行人道,有条不紊。那么靠什么来实现这井然秩序呢?靠的就是交通信号灯的自动指挥系统。交通信号灯控制方式很多。本系统采用MCS-51系列单片机AT89C51为中心器件来设计交通灯控制器,实现了能根据实际车流量通过8051芯片的P1口设置红、绿、黄灯燃亮时间的功能;红绿灯循环点亮,倒计时剩3秒时黄灯警示,显示时间通过P2口输出至双位数码管。本系统设计周期短、可靠性高、实用性强、操作简单、维护方便、扩展功能强。 关键词:单片机;交通灯;AT89C51

基于单片机交通灯课程设计

重庆三峡职业学院 课程设计 课题名称交通灯控制系统设计 交通灯控制系统设计 摘要:本系统由单片机最小系统、按键(开关)、LED显示等等组成交通灯演示系统。 系统用红、黄、绿三个发光二极管模拟交通灯的红灯、黄灯、绿灯的功能。系统除基本交通灯功能外,还具有倒计时(15秒)、时间设置、紧急情况(按键模拟传感器)处理等功能。 关键词:AT89C51,交通规则 弓I 言:随着日新月异的电子变革,电子产品发生了突飞猛进的巨变,而在其中AT89C51扮演着一个重要的角色,AT89C51单片机具有广泛性、工具性、基础性的几个特点。单片机应成为中等技术人员的重要技术知识层面。近年来,我国工程技术队伍的梯队建设有了很大的进展。各类高职、高专如雨后春笋,涉电专业普遍开设单片机类课程。直观性表现在尽可能让我们在学习基本原理时能直观地看到相关实物及实物表演,使基本原理能实现形象化的表达;实践性表现在我们要通过许多实际操作来理解与掌握单片机的本质与技能;综合性表现在最终能使我们达到运用知识与技能来完成一个应用系统开发的全过程,有助于大学生动手能力的培养和提高,课程设计就是一门应用性很强的课程。如何让我们在学好基础知识的同时,迅速掌握设计应用技术,其中,实验与课程设计环节起着非常重要的作用。对我们学习和掌握单片机设计技术起到积极的作用。

一、方案比较、设计与论证

(1)电源提供方案 为使模块稳定工作,须有可靠电源。我们考虑了两种电源方案 方案一:采用独立的稳压电源。此方案的优点是稳定可靠,且有各种成熟电路可供选用;缺点是各模块都采用独立电源,会使系统线路变复杂,且可能影响系统各模块的电路电平。 方案二:采用干电池提供电源。该方案的优点是系统简明扼要,线路易于梳理,节约成本;缺点是输出功率不高。 综上所述,我们选择第二种方案。 (2)显示界面方案: 该系统要求完成数码管倒计时(15s)、状态灯发光二极管(红、黄、绿)的显示功能。基于上述原因,我们考虑了二种方案: 方案一:东西南北四个方向分别采用两位数码管显示倒计时。这种方案只显示有限的符号和数码字苻,并且制作PCB图时有许多的线相交,线路十分的复杂,不易制作原理图与PCB图,无法胜任题目要求。 方案二:东西南北四面各自采用红、黄、绿三个发光二极管显示,采用一个两位数码管显示倒计时,主要优点是易于调整元件在硬制板上摆放的位置,同时也易于PCB图的制作。 综上所述,我们选择方案二。 (3)输入方案: 题目要求系统能即时的处理外部紧急情况产生的中断,我们讨论了两种方案: 方案一:采用矩阵键盘。该方案的优点是: 可提供较多I/O 口,实现更多的外部中断。直接站单片机的接口少的特点,但操作起来稍显复杂,而且编程也趋于复杂。 方案二:直接在IO 口线上接上按键开关。因为设计时精简和优化了电路。 由于该系统对于交通灯等发光二极管的控制,只用单片机本身的I/O 口就可实现,只要一个开关来模拟一个外部的紧急中断,且本身的计数器及RAM E经够用,故选择方案二。 (4)系统方案: 本系统的硬件采用模块化设计,以单片机控制器为核心,与LED信号灯电路等组成单片机控制信号系统? 单 片 机

基于51单片机的十字路口交通灯控制系统设计(含源码及仿真图)

课程设计任务书 专业计算机科学与技术 班级09计(嵌入式系统方向)姓名江海洋 学号0905101072 指导教师刘钰 金陵科技学院教务处制

摘要 本文介绍了一个基于MCS-51及PROTEUS的十字路口交通灯控制系统的设计与仿真,通过对现实路况交通灯的分析研究,理解交通控制系统的实现方法。 十字路口交通灯控制系统通常要实现自动控制和在紧急情况下禁止普通车辆,而让紧急车辆优先通行。本文还对MCS-51单片机的结构特点和重要引脚功能进行了介绍,同时对智能交通灯控制系统的设计进行了详细的分析。最后介绍了PROTEUS嵌入式系统仿真与开发平台的使用方法,利用Proteus 软件对交通灯控制系统进行了仿真,仿真结果表明系统工作性能良好。 关键字:单片机,proteus仿真,中断,十字路口交通灯控制系统

前言 1,十字路口的交通控制系统指挥着人和各种车辆的安全运行,对交叉口实行科学的管理与控制是交通控制工程的重要研究课题,是保障交叉口的交通安全和充分发挥交叉口的通行能力的重要措施,是解决城市交通问题的有效途径。交通灯信号灯的出现是人类历史上的一次重大改革,使人类的聚居生活,产生了深远的影响。使交通得以有效管制,对于疏导交通流量,提高道路通行能力,减少交通事故有明显效果。如何采用合适的控制方法,最大限度利用好耗费巨资修建的城市高速道路,缓解主干道与匝道、城区同周边地区的交通拥堵状况,越来越成为交通运输管理和城市规划部门亟待解决的主要问题。随着电子技术的发展,利用单片机技术对交通灯进行智能化管理,已成为目前广泛采用的方法。 2,此十字路口交通灯控制系统,分东西道和南北道,设东西道为A道,南北道为B 道。规定:A道放行时间为2分钟,B道放行1.5分钟;绿灯放行,红灯停止;绿灯转红灯时,黄灯亮2秒钟;若有紧急车辆要求通过时,此系统应能禁止普通车辆,而让紧急车辆通过。 3,应用单片机实现对交通灯的控制,在十字路口用红,黄,绿的指示灯,加上四个以倒计时显示的数码管来控制交通。考虑到紧急车辆,设计紧急车辆开关。

基于51单片机的智能交通灯课程设计

简易智能交通灯设计 1、设计背景 自从1886两个德国人发明了第一辆汽车交通灯改变了交通路况,交通问题也渐渐被人们所重视。从英国伦敦街头的第一个以燃煤气为光源的红,蓝两色的机械扳手式信号灯,到现在以电为光源的红黄绿三色交通灯,不知不觉中交通信号灯在人们日常生活中占据了重要地位。随着人们社会活动日益增加,经济发展,汽车数量急剧增加,城市道路日渐拥挤,交通灯更加显示出了它的功能,使得交通得到有效管制,对于交通疏导,提高道路导通能力,减少交通事故有显著的效果。 近年来,随着科技的飞速发展,电子器件也随之广泛应用,其中单片机也不断深入人民的生活当中。本次课程设计以模拟交通灯系统利用单片机AT89C51作为核心元件,实现了通过信号灯对路面状况的智能控制。在一定程度上解决了交通路口堵塞、车辆停车,特殊情况的交通灯等待时间不合理、急车强通等问题。在该次的设计系统具有结构简单、可靠性高、成本低、实时性好、安装维护方便等优点,有广泛的应用前景。 本模拟系统由单片机软件系统,两位8段数码管和LED灯显示系统。和复位电路控制电路等组成,较好的模拟了对交通路面的控制。 1.1 设计思路 (1)分析目前交通路口的基本控制技术以及各种通行方案,并以此为基础提出自己的交通控制的初步方案。 (2)确定系统交通控制的总体设计,包括,十字路口具体的通行禁行方案设计以及系统应拥有的各项功能,在这里,本设计除了有信号灯状态控制能实现基本的交通功能,还增加了倒计时显示提示,并基于实际情况,又增加了紧急状况处理和通行时间可调这两项特特殊功能。 (3)进行倒计时显示电路,灯状态电路,特殊情况按键电路的设计和对各器件的选择及连接,大体分配各个器件及模块的基本功能要求。 (4)进行软件系统的设计和仿真中,程序在KEIL软件中用单片机c语言编写,电路的搭建和仿真实现是在proteus软件中实现的。在本次课程设计中通过对单片机内部结构和工作情况做了一定的研究,充分了解定时器,中断以及延时原理,为本次智能交通灯的设计提供了理论基础。

基于51单片机的十字路口交通灯控制系统设计

课程名称单片机原理及应用课程设计 摘要 本文介绍了一个基于MCS-51及PROTEUS的十字路口交通灯控制系统的设计与仿真,通过对现实路况交通灯的分析研究,理解交通控制系统的实现方法。 十字路口交通灯控制系统通常要实现自动控制和在紧急情况下禁止普通车辆,而让紧急车辆优先通行。本文还对MCS-51单片机的结构特点和重要引脚功能进行了介绍,同时对智能交通灯控制系统的设计进行了详细的分析。最后介绍了PROTEUS嵌入式系统仿真与开发平台的使用方法,利用Proteus 软件对交通灯控制系统进行了仿真,仿真结果表明系统工作性能良好。 关键字:单片机,proteus仿真,中断,十字路口交通灯控制系统

前言 1,十字路口的交通控制系统指挥着人和各种车辆的安全运行,对交叉口实行科学的管理与控制是交通控制工程的重要研究课题,是保障交叉口的交通安全和充分发挥交叉口的通行能力的重要措施,是解决城市交通问题的有效途径。交通灯信号灯的出现是人类历史上的一次重大改革,使人类的聚居生活,产生了深远的影响。使交通得以有效管制,对于疏导交通流量,提高道路通行能力,减少交通事故有明显效果。如何采用合适的控制方法,最大限度利用好耗费巨资修建的城市高速道路,缓解主干道与匝道、城区同周边地区的交通拥堵状况,越来越成为交通运输管理和城市规划部门亟待解决的主要问题。随着电子技术的发展,利用单片机技术对交通灯进行智能化管理,已成为目前广泛采用的方法。 2,此十字路口交通灯控制系统,分东西道和南北道,设东西道为A道,南北道为B 道。规定:A道放行时间为2分钟,B道放行1.5分钟;绿灯放行,红灯停止;绿灯转红灯时,黄灯亮2秒钟;若有紧急车辆要求通过时,此系统应能禁止普通车辆,而让紧急车辆通过。 3,应用单片机实现对交通灯的控制,在十字路口用红,黄,绿的指示灯,加上四个以倒计时显示的数码管来控制交通。考虑到紧急车辆,设计紧急车辆开关。

基于单片机控制的交通灯毕业设计

基于单片机控制的交通 灯毕业设计 Company number:【WTUT-WT88Y-W8BBGB-BWYTT-19998】

基于单片机控制的交通灯毕业设计 目录 基于单片机控制的交通灯

摘要 十字路口车辆穿梭,行人熙攘,车行车道,人行人道,有条不紊。那么靠什么来实现这井然秩序呢靠的是交通信号灯的自动指挥系统。交通信号灯控制方式很多。本设计主要分为五大模块输入控制电路、时钟控制电路、片内外程序切换控制、显示电路。以MSC-51系列单片机IntelAT89C51为中心器件来设计交通灯控制器,实现了AT89C51芯片的P0口设置红、绿灯、黄灯燃亮时间的功能;为了系统稳定可靠采用了74LS14施密特触发器芯片的消抖电路,避免了系统因输入信号抖动产生误操作;显示时间直接通过AT89C51的P2口输出,由CD4511驱动LED数码管显示红灯燃亮时间。 关键字:AT89C51 LED显示交通灯

the traffic light based on the single-chip control Abstract The intersections vehicle wears shuttle, pedestrian Xi Rang, garage driveway, person's sidewalk, orderly. So depend what to carry out this well arranged order What to depend is a traffic sign light of automatic conductor system. The control method of the traffic sign light is a lot of. This design is mainly divided into five greatest molds a piece the electric circuit, clock of the importation control a control outside procedure inside the electric circuit, slice to cut over a control and shows electric circuit. Take single slice the machine IntelAT89 C51 of the serieses MSC-51s as a center spare part to design transportation light controller, carried out the AT89 C51's P's 0 people's constitution of the chips red, the function in bright time of green light, Huang2 Deng Ran2;For the sake of system stability the credibility adopted a 74 LS14 airtight trigger eliminate of machine chip to tremble electric circuit especially, avoided system because of importation the signal tremble movable property to living a mistake operation; The P 2 people who shows that time directly passes the AT89 C51 output, is driven LED figures a tube by the CD4511 to show red-light Ran bright time. Key word: The AT89 C51 LED show transportation light

基于单片机的智能交通红绿灯控制系统设计

1选题背景 今天,红绿灯安装在各个道口上,已经成为疏导交通车辆最常见和最有效的手段。 信号灯的出现,使交通得以有效管制,对于疏导交通流量、提高道路通行能力,减少交通事故有明显效果。在交通中管理引入单片机交通灯控制代替交管人员在交叉路口服务,有助于提高交通运输的安全性、提高交通管理的服务质量。并在一定程度上尽可能的降低由道路拥挤造成的经济损失,同时也减小了工作人员的劳动强度。 关键词:AT89C51;7448,LED 2方案论证 2.1设计任务 设计基于单片机的智能交通红绿灯控制系统,要求能通过按键或遥控器设置系统参数,系统运行时,“倒计时等信息”能通过数码管或点阵发光管显示,设计时应考虑交通红绿灯控制的易操作性及智能性。以单片机的最小系统为基础设计硬件,用汇编语言、或C语言设计软件。通过本设计可以培养学生分析问题和解决问题的能力,掌握Mcs51单片机的硬件与软件设计方法,从而将学到的理论知识应用于实践中,为将来走向社会奠定良好的基础。 东西(A)、南北(B)两干道交于一个十字路口,各干道有一组红、黄、绿三个指示灯,指挥车辆和行人安全通行。红灯亮禁止通行,绿灯亮允许通行,黄灯亮时车辆及行人小心通过。红灯的设计时间为45秒,绿灯为40秒,黄灯为5秒。 2.2 方案介绍 方案1设计思想: 采用分模块设计的思想,程序设计实现的基本思想是一个计数器,选择一个单片机,其内部为一个计数,是十六进制计数器,模块化后,通过设置或程序清除来实现状 态的转换,由于每一个模块的计数多不是相同,这里的各模块是以预置数和计数器计 数共同来实现的,所以要考虑增加一个置数模块,其主要功能细分为,对不同的状态输 入要产生相应状态的下一个状态的预置数,如图中A道和B道,分别为次干道的置数选 择和主干道的置数选择。 方案2 设计思想: 由两个传感器监视南北方向即A道与东西方向即B道的车辆来往情况,设开关K=1 为有车通过,K=0为没有车通过。则有以下四种情况: Ka=1时:Kb=0,表示A有车B没有车,则仅通行B道:

用51单片机控制交通灯汇编语言编写

基于51单片机的交通灯控制系统设计 摘要:在日常生活中,交通信号灯的使用,市交通得以有效管理,对于疏导交通流量、提高道路通行能力,减少交通事故有明显效果。交通灯控制系统由80C51单片机、键盘、LED 显示、交通灯延时组成。系统除具有基本交通灯功能外,还具有时间设置、LED信息显示功能,市交通实现有效控制。 关键词:交通灯,单片机,自动控制 一引言 当今,红绿灯安装在个个道口上,已经成为疏导交通车辆最常见和最有效的手段。但这个技术在19世纪就已经出现了。 1858年,在英国伦敦主要街头安装了以燃煤气为光源的红、蓝两色的机械般手势信号灯,用以指挥马车通行。这是世界上最早的交通信号灯。1868年,英国机械工程师纳伊特在伦敦威斯敏斯特区的会议大厦前的广场上,安装了世界上最早的煤气红绿灯。它由红绿两以旋转方式玻璃提灯组成,红色表示“停止”,绿色表示“注意”。1869年1月2日,煤气灯爆炸,是警察受伤,遂被取消! 电气启动的红绿灯出现在美国,这种红绿灯由红黄绿三色圆形的投光器组成,1914年始装于纽约市5号大街的一座高塔上。红灯亮表示“停止”,绿灯亮表示“通行”。 信号灯的出现,使得交通得以有效的管理,对于疏导交通流量、提高道路通行能力、减少交通事故有明显效果。1968年,联合国《道路交通和道路标志信号协定》对各种信号灯的含义作了规定。绿灯时通行信号灯,面对绿灯的车辆可以直行,左转弯和右转弯,除非两一种标志禁止某一种转向。左右转弯车辆必需让合法的正在路口内行驶的车辆和过人行横线的行人优先通行。红灯是禁行信号灯,面对红灯的车辆必需在交叉路口的停车线后停车。黄灯是警告信号,面对黄灯的车辆不能越过停车线,但车辆已经十分接近停车线而不能安全停车的可以进入交叉路口! 二概要设计 2.1 设计思路 利用单片机实现交通灯的控制,该任务分以下几个方面: a 实现红、绿、黄灯的循环控制。要实现此功能需要表示三种不同颜色的LED灯分别接在P1个管脚,用软件实现。 b 用数码管显示倒计时。可以利用动态显示或静态显示,串行并出或者并行并出实现。 C 实现急通车。这需要人工实现,编程时利用到中断才能带到目的,只要有按钮按下,那么四个方向全部显示红灯,禁止以诶车辆通行。当情况解除,让时间回到只能隔断处继续进行。 2.2总体设计框图 见图一:

(完整版)基于单片机的十字路口交通灯设计毕业设计

以下文档格式全部为word格式,下载后您可以任意修改编辑。 摘要 近年来随着科技的飞速发展,单片机的应用正在不断深入,同时带动传统控制检测技术日益更新。在实时检测和自动控制的单片机应用系统中,单片机往往作为一个核心部件来使用,仅单片机方面知识是不够的,还应根据具体硬件结构软硬件结合,加以完善。 十字路口车辆穿梭,行人熙攘,车行车道,人行人道,有条不紊。那么靠什么来实现这井然秩序呢?靠的就是交通信号灯的自动指挥系统。交通信号灯控制方式很多。本系统采用MCS-51系列单片机AT89C51为中心器件来设计交通灯控制器,实现了能根据实际车流量通过8051芯片的P3口设置红、绿灯燃亮时间的功能;红绿灯循环点亮,倒计时剩5秒时黄灯闪烁警示(交通灯信号通过P1口输出,显示时间通过P0口输出至双位数码管)。本系统设计周期短、可靠性高、实用性强、操作简单、维护方便、扩展功能强。 关键词:单片机;交通灯 Abstract In recent years, with the rapid development of science and technology, the application of SCM is going deep, driving the traditional detection techniques to renew day by day. In the real-time examination and in the automatic control monolithic

integrated circuit application system, the monolithic integrated circuit often took a core part uses. The monolithic integrated circuit aspect knowledge is only insufficient, but should also act according to the concrete , to be improved. The intersection vehicles shuttle, the pedestrian is bustling, car dealership traffic lane, person sidewalk, methodical. Then depending on what to realizes this orderly order? the traffic lights on the automatic control system. There are great number kinds of modes to control the traffic lights. The system uses a series of MCS-51 as the center AT89C51 single-chip device designed to control the traffic lights, so as to realize the function of setting red, green light time by 8051 chip’s P3 port according to the actual traffic flows, lighting the red-light and green-light by turn and lighting the yellow-light to warm while 5 seconds left(outputting the traffic light signal by P1,outpuing the time by P0 and showing the time on double-digits nixie tube). Short of the design cycle, , easy maintenance, the expansion of powerful is this system. Key words:SCM; MCU; traffic light 目录 中英文摘要························1 设计要求·························2设计目的·························3 方案比较、设计与论证···················

单片机设计方案——交通灯控制系统设计方案

单片机课程设计报告交通灯控制系统设计

摘要 本设计是针对交通灯系统的设计,由单片机AT89C51(实物用AT89S52)、键盘、LED显示、交通灯演示系统组成。单片机是把微型计算机的各功能部件集成在一块芯片中,构成的一个完整的微型计算机。AT89C51单片机是MC-51中的子系列,是一组高性能兼容型单片机,AT89C51是一个低功耗高性能的CMOS 8位单片机,40个引脚,片内含4KB Flash ROM和128B RAM,它是一个全双工的串行通行口,既可以用常规编程,又可以在线编程。 本设计中的数码管的选通采用的方法是动态显示,对每一位数码分时轮流通电显示,复位电路采用上电+按钮电平复位,时钟电路采用内部时钟产生方式。对特殊情况的处理采用中断处理方式,在中断处理程序中采用对管脚的状态查询扫描,已采取相应情况的处理。 对设计方案进行电路硬件设计,并将已编程的程序载入调试,可以得到理想的实验效果。系统包括人行道、左转、右转、以及基本的交通灯的功能.具体功能是假如 A 道和B道上均有车辆要求通过时,A、B道轮流放行。A道放行 25秒,B道放行20秒。一道有车而另一道无车,交通灯控制系统能立即让有车道放行。有紧急车辆要求通过时,系统要能禁止普通车辆通行,A、B道均为红灯,紧急车由K2 开关模拟。绿灯转换为红灯时黄灯亮 1秒钟。系统除基本交通灯功能外,还具有倒计时、时间设置、紧急情况处理、分时段调整信号灯的点亮时间以及根据具体情况手动控制等功能。

目录 1引言.......................................................................................................................................... - 1 - 1.1交通灯的重要作用........................................................................................................... - 1 -1.2该交通灯系统的特点....................................................................................................... - 1 -2系统总体方案及硬件设计 ......................................................................................................... - 2 - 2.1原理框图........................................................................................................................... - 2 -2.2设计功能........................................................................................................................... - 2 - 2.3交通灯控制系统各部分硬件组成................................................................................... - 2 - 2.3.1复位部分.................................................................................................................... - 2 - 2.3.2时钟电路部分............................................................................................................ - 3 - 2.3.3路口指示灯部分........................................................................................................ - 3 - 2.3.4显示部分.................................................................................................................... - 3 -2.4元器件清单....................................................................................................................... - 4 -3软件设计..................................................................................................................................... - 5 - 3.1交通灯控制系统软件流程图及程序分析....................................................................... - 5 - 3.1.1主程序流程图及程序模设计.................................................................................... - 5 - 3.1.2INT0中断服务程序流程图及程序模设计.............................................................. - 6 -3.2路口指示灯部分............................................................................................................... - 7 - 3.3显示部分........................................................................................................................... - 7 - 4. Proteus软件仿真 ..................................................................................................................... - 8 - 5 课程设计体会......................................................................................................................... - 10 -参考文献....................................................................................................................................... - 10 -附1:源程序代码 (13) 附2:系统原理图 (20)

基于单片机的红绿灯设计毕业设计

西安航空职业技术学院 毕业设计(论文)任务书 题目:基于单片机的红绿灯设计 任务与要求: 交通信号灯能够控制东西、南北两个方向的交通,红绿黄灯用对应颜色的发光二极管代替; 用四个2位数码管分别显示东、南、西、北方向的通行时间,东西或南北通行时间为30秒,红绿灯切换中间黄灯闪烁5秒时间:2013年9月1日至2013年11月1日共8周 所属系部:自动化工程系 学生姓名:学号: 11 专业:生产过程自动化 指导单位或教研室:计算机控制教研室 指导教师:职称:助教

毕业设计(论文)进度计划表

摘要 在日常生活中,交通灯作为管理交通、调协车辆的一个便捷的手段,起着很大的作用。各种交通工具、行人都要根据交通灯的变化来决定是否前行,通行的时间的规定协调了它们的步伐,极大的减少了由于交通混乱引起的各种事故的发生。因此,一个完善的交通系统中,交通灯是必不可少的设备,一个完善的交通灯程序会更有效的管理当前道路中出现的实际情况,使车辆、行人的行进变得更顺畅、更和谐。 随着我国国民经济的快速发展,我国机动车辆发展迅速,而城镇道路建设由于历史等各种原因相对滞后,交通拥挤和堵塞现象时常出现。如何利用当今计算机和自动控制技术,有效地疏导交通,提高城镇交通路口的通行能力,减少交通事故是很值得研究的一个课题。目前,国内的交通灯一般设在十字路口,在醒目位置用红、绿、黄三颜色的指示灯加上一个倒计时的显示器来控制行车。 关键字:交通灯;单片机;MSC-51;计时

Abstract In daily life , traffic lights as traffic management , co-ordination of the vehicle a convenient means , plays a big role . Various modes of transport , pedestrians should be based on the traffic lights change to decide whether to move forward, the passage of time coordinating their pace required , greatly reducing the traffic chaos caused by various accidents. Therefore, a comprehensive transportation system, traffic lights are essential equipment , a complete traffic lights would be more effective in the management of the current road situation occurs , the vehicle , a pedestrian road becomes smoother and more harmonious . With China's rapid economic development, China's rapid development of motor vehicles , while the urban road construction due to historical and other reasons is lagging behind, traffic congestion and jams often occur . How to take advantage of today's computers and automatic control technology, effective flow of traffic, improve urban traffic junction capacity and reduce traffic accidents is a topic worthy of study . At present , the domestic traffic lights generally located at the crossroads, prominently with red , green and yellow three color LED display with a countdown to control traffic. Key words:traffic light;SCM;MSC-51;timing

基于单片机的交通灯控制系统

基于单片机的交通灯控制系统 一、实验目的 1、了解交通灯的控制方法 2、掌握8051单片机基本操作 3、掌握keil和PrOteuS软件的使用 二、实验原理 通过对十字路口的观察,发现红绿灯的控制原理:首先南北方向右转加直行的绿灯亮起。此时,东西方向为红灯;当右转加直行绿灯倒计时进入最后5秒, 绿灯切换为黄灯并开始闪烁,东西方向红灯不变;接着南北方向切换为左转灯,东西方向依然是红灯;同样当倒计时进入最后5秒时,黄灯开始闪烁。东西方向为红灯。然后东西方向的右转加直行绿灯亮起,以此类推。 三、实验内容及程序 主程序: void main (VOid)

Busy_LED=O; SPeCiaLLED=O; ITO=1; //INTO 负跳变触发 TMOD=O X OI;//定时器工作于方式1 TH0=(65536-50000)∕256;// 定时器赋初值TL0=(65536- 50000)%256; EA=1; //CPU开中断总允许 ET0=1;//开定时中断 EX0=1;//开外部INTO中断 TR0=1;// 启动定时 while(1) { Flag_EW_Yellow=0; //EW关黄灯显示信号 Time_EW=EW; Time_SN=SN; WhiIe(Time_SN>=5) {P仁S[0]; /∕SN 通行,EW红灯 DiSPIay();} P仁0x00; WhiIe(Time_SN>=0 ) {Flag_SN_Yellow=1; EW_Red=1; /∕SN //SN开黄灯信号位 黄灯亮,等待左拐信号,EW红灯 DiSPIay(); } Flag_SN_Yellow=0; /∕SN关黄灯显示信号Time_SN=SNL; WhiIe(Time_SN>=5) {P仁S[2];//SN左拐绿灯亮,EW红灯 DiSPIay();} P仁0x00; WhiIe(Time_SN>=0 ) {Flag_SN_YeIIow=1; EW_Red=1; /∕SN //SN开黄灯信号位 黄灯亮,等待停止信号,EW红灯 DiSPIay(); }

相关主题
文本预览
相关文档 最新文档