Intelligent Traffic Control System Design Based on SingleChip MicrocomputerXu Lei, Ye Sheng, Lu Guilin, and Zhang ZhenSchool of Mechanics and Civil Engineering, China University of Mining and Technology,Xuzhou(221008), Jiangsu, Chinaxukeixulei@Abstract. This paper mainly introduces microcontroller of counter toimplement an intelligent traffic control system. The system uses an externaltriggered pulses to simulate, through traffic to timing/counter car collection, soas to realize the flow of traffic information digitization. Meanwhile, accordingto historical stored data and automatic detection to car traffic information,microcontroller will be compared, and the control model algorithm controlscheme by setting proper signal ratio, realizing the intelligent control trafficsignals.Keywords: microcontroller, intelligent control system, timing ⁄ counters.1 IntroductionUrban traffic control system is mainly used in city traffic data monitoring, traffic light control and traffic persuation computer integrated management system, it has become the most important part of the modern urban traffic control command system. Therefore, each intersection installation traffic lights has become the most relieves traffic vehicles and pedestrians most common and most effective management means, and how to use advanced information technology transform urban traffic system has become the consensus of urban traffic management.2 System CompisitionThe traffic light control system is used to receive, processing intersection traffic data system, and according to the traffic flow conditions to be intelligent to adjust the traffic lights light destroy time length. The purpose of the design of the control system has two main function: Firstly ,finishing crossing the east-west and south-north two directions of traffic flow detection based on experimental data, so as to provide data modeling method; Secondly, by using the control system for intelligent control of traffic lights.Considering the actual feasibility, this system uses LED to replace the actual traffic lights, and the traffic flow with external input data is simulated the pulses. From the function can be mainly the whole control system points of traffic flow control module, inspection module and traffic light control module. The traffic lights control system of general function structure is as shown in figure 1.Intelligent Traffic Control System Design Based on Single Chip Microcomputer 233 As can be seen from the figure, and conventional traffic control system, this system mainly compared with the following features:•Control module by a single chip micro-controller, every function modules in IC chips are based on development, each module and IC chips from bus way between connected nearly;•Control system, signal and data flow is one-sided. Counter system provides traffic data, after micro controller operational treatment, become the traffic lights control instructions, the output to light control system;•Micro controller can be timely to various signal processed;•Between each device with bus way share data, system structure compact, data security good;•It can be used as more intelligent control system hardware foundation.Fig. 1. Composition of regulation system3 System DesignThis system hardware components selection is mainly made by ATMEL company in the United States, the Intel company AT89S52 SCM 8255 programmable general parallel interface and programmable timing/counter 8253. AT89S52 SCM is low power, high-performance CMOS 8-bit microcontroller. Slice the Flash memory with 8KB within, allowing within the system with programmer programming rewrite the or. AT89S52 instruction system and 80C52 fully compatible with pins, 256B RAM pieces (and the I/O, 32 mouth line, 316 timing/counters, the watchdog, six interrupt source, a full-duplex serial port, etc, and can meet the practical needs of the system. 3.1 CounterAdopting single external count chips, such as 82C53, 82C54 as special counter to external input pulse signal as count chips, to realize the count of external pulse pulse digital. Thus making road traffic flow into SCM, it can identify the pulse count for the single-chip computer completes control procedures and the output of the control order to provide basic data.234 X. Lei et al.Using external counter concrete process of realizing count as follows:Using external crystals produce a certain frequency counts circuit impulse;Make this frequency as the count of the count to measuring pulse signal, as an external counter count pulse, external chip in door control cycle count to count pulse; In count ends, external chip output produces low level would trigger MCU disruptions, the special chip microcontroller will read back the count value, and control algorithm of computing.Counting pulse frequency rely on external crystal frequency, although external crystals has the higher frequency of the more help to improve the accuracy of pulse count, but eventually input to external counter pulse frequency had better not exceed 10MHz.Using single chip external counter to realize pulse count method has two main inside let: the first is the hardware circuit design, including the microcontroller each port connection, the interrupt signal design etc; Once again, is MCU count program, mainly responsible for control each interrupt and the timer complete corresponding pulse count process.3.2 Traffic Signal Control ModuleThe traffic lights control module drives traffic lights and kills bright by receiving to traffic light controller microcontroller issued instructions according to the requirement of the module, microcomputer in the flow of traffic information obtained through control algorithm, after the treatment, do to the current vehicle out after information correctly judge, according to each direction of flow of traffic lights make optimization of adjustment, and displayed on the LED on simulation of the actual situation.In this control system, using LED to simulate realistic traffic lights, the east, west, north and south, four directions each have three lamp that LED; Color is red olivine, total is 12 lamp; Respectively represent four intersection traffic lights. Each direction from the traffic light through 8255 driver to command four intersection traffic. Realizing the traffic lights of intelligent adjustment is the core of this control system, but also key points of control program.Getting the right about microcomputer in the east-west and south-north direction crossroads vehicle traffic data, using east-west and south-north direction intersection traffic data to compare, and then will larger values as its benchmark, the adjustment of the historical information in cars for comparison, the final again according to the result of the comparison to adjust the length of time signal light out. Figure 2 attaches this intelligent traffic control system's double circuit board PCB figure.4 System Control Scheme4.1 Timing Signal Control PlanIf we want to effectively overcome timing control of single zone can't adapt to the control of traffic flow of change, and use many sections of control method to setting difficult disadvantages and it will timing control, thus effectively improved betterIntelligent Traffic Control System Design Based on Single Chip Microcomputer 235 control method, this method is called "induction - timing signal control", this kind of traffic control machine in induction signal control mode, general record each cycle, each phase of the actual green time, and carries on the effective statistics. If in the measurement of time, finds the actual green large variation, says this time the intersection of traffic is not very stable, can use inductive signal control methods for effective control.Fig. 2. Intelligent traffic control system PCB figureBut if found within prescribed number of cycles in measure of actual green time in a given range, this explains this period of time in a relatively stable state cars, can use the timing signal control method, at this time control machine can immediately switch to the system operating mode, the present each phase of the best green time is the actual average statistical income. Meanwhile, continue to records and statistics actual green time, when the statistical results more than a given allow range, and switch to another new operation mode or state. This control method overcame many shortcomings, effective adapted to different time traffic characteristics.4.2 Traffic Lights Fuzzy ControlUnder normal conditions, inductive control is used in the detection of vehicle data, and through effective analysis to make the next moment pairing solutions and not236 X. Lei et al.real-time control the current traffic signals, must go through a period of delay. This may cause empty waiting situation, still need to prepare more and more complex calculation program. Therefore, in the design, can draw up 1 set of traffic lights, according to the fuzzy control scheme of the intersection of two directions, to make the dynamic vehicle, and the corresponding adjustments with the biggest since cars, to guarantee to prevent traffic jams happen, so as to achieve the best control traffic.In addition, in order to be able to accurately collection green direction, can be in the vehicle amount each side intersection set pressure sensor, generally in each side have set up 2, in order to get effective data.4.3 Overall SchemeIn control, timing control though it is not very suitable for traffic flow changes, especially in the empty box above intersections, but digital display can display the current light color the remaining time which allows the driver to effectively control of your driving action, timely start and stop. Although sensors can adapt to all kinds of intersection control, but can't control, united cannot be convenient digital display to show the rest of the time when the light color. Therefore, in order to enable control machine that adapt to the intersection, and effectively online control in the system, can by two control method.In phase aspect, as four phase control have high security, but four phase control function of the intersection of driveway separation in the use, in light of the traffic flow situation traffic low efficiency. But two phase control although security is low, but it can be used on any intersection, make traffic efficiency is higher, therefore, when facing different actual situation, you can combine two phase and four phase control two ways to achieve effective control.5 The Mathematical ModelWe'll build traffic bypath mathematical model of the traffic flow:=∂∂+∂∂xq t n (1) ),(t x n : car number through the unit length (namely density)),(t x q : car number through the unit time (namely flow) If0=∂∂x q , then it means the number of cars into the number of cars is equal to open out; If 0>∂∂xq , then it means the number of cars into the number of cars less than the open out; If0<∂∂xq , then it means the number of cars into the number of cars more than the open out;Intelligent Traffic Control System Design Based on Single Chip Microcomputer 237 Red light, only car wheels and no car exit0<∂∂xq ,then car density increases. Green, yellow light, both cars into and exit, generally speaking, the car density decreased . The green light, to ensure the vehicles stranded at a red light and a part of the green into when vehicles have enough time through a bypath. So the green time including driver reaction time and car start-up time, the team through the time needed for crossing.Set for legal speed 0v , red car captain for stranded is r l ,g l is the captain part when the car go into a green light , crossroads length is L , auto acceleration is a, the driver's response time and start time for 1T . So long as the g T green, 1002T v L l l a v T q r g ++++=(2)Yellow light, has crossed the vehicle can stop line without stop, continued stop line bans continue to pass. For drivers, into stop line after he saw after the yellow light signal decision will be: is parking or through the intersection. When deciding parking there must be sufficient stopping distance; When the decision by crossroads must have enough through the intersection between. So the yellow light time including driver reaction time, the car through crossroads and the time required braking distance.Set for legal speed 0v , body long for 0l , crossroads length is L, automobile braking tires when the friction coefficient and the road for μ, gravity acceleration for g, the driver's response time for 0T .So the duration yellow light10002T v L l g v T y +++=μ (3)Assuming 0T = 0.5 s, 0l = 4.5 m, L = 10m, μ = 0.2, 0v = 30km/h, y T = 4.32 sfrom experience to y T = 3s. Asher 0v =30km/ h, g l = 50m, L =10m, a = 4m/2s ,the driver's response time and start-up time for 1T = 0.8 s, we can draw a verdict as table 1 shows.Table 1. The approximate relationship between distance and time238 X. Lei et al.6 SummaryThis paper is mainly through the use of American ATMEL company 8-bit microcontroller, relating settings, forming a simple intelligent traffic control system, the purpose is: When under the environment of the university have experiment, for students to do some design type experiment, it can be the verification or innovative, to provide students with a simulated environment platform; Also it can give related transportation management departments to provide some intelligent control ideas, and thereby more effective and reasonable to regulate the traffic. Need explanation is, although at present the most using 32-bit SCM in related research and application based on this system, but the actual need, 8-bit microcontroller enough to satisfy the design needs, so with this ATMEL8 a single-chip computer completes the entire system construction design, also can save the hardware cost, if function set more or data processing is bigger, we can consider to use 16 or 32 bits single-chip computer completes.References1.Chen, F., Zhu, Y., Shen, Y.: Microcontroller and PLC Application Technology, pp. 1–273.Electricity Son Industry Press, Beijing (2003)2.Single Chip Microcomputer Application Director System Design and Practical Technology,pp. 21-319. Machinery Industry Publication Clubs, Beijing (2004)3.Shen, G.: Based on Single-Chip Microcomputer Intelligent System Design and Realization,pp. 1–335. Electronic Industry Publication Clubs, Beijing (2003)4.Fu, X.: The Single Chip Computer and Electromechanical Interface Technology. NationalDefense Industry Publication Clubs, Beijing (2002)。