fuzzy based traffic light con troll err
TRANSCRIPT
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
1/12
FUZZY BASED SMART TRAFFIC LIGHT
Submitted By:
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
2/12
INTRODUCTION
As the number of vehicles and the needs for greater transportation has grown in recent years, city
streets and highways frequently face serious road traffic congestion problems. Due to this factor,
traffic signals now become a common feature of cities controlling heavy traffic. Careful planning
of these signals is important to increase the efficiency of traffic flow on road. Controlling traffic
on oversaturated intersections is a big issue.
Conventional methods for traffic signal control based precise models fail to deal efficiently with
the complex and varying traffic situations. They are modeled based on the preset cycle time to
change the signal without any analysis of traffic situation. Due to fixed cycle time, such systems
do not consider that which intersection has more load of traffic, so should kept green more or
should terminate earlier then complete cycle time. In case of intersections, conventional control
systems only consider waiting time of signals on different directions but not the vehicle
directions. Such situations can be seen in various areas of Delhi and NCR where traffic flow
varies in different hours and heavy traffic flows in morning and evening timings because of large
number of offices on that route. Also, in different intersections, traffic flow abruptly changes in
schools timings then other daily hours. Preset Cycle Time Controllers fail in such scenarios
because they could not get complete information of vehicles earlier.
Fuzzy based controllers are proved to be well manager of traffic system in such scenarios. Fuzzy
Logic based controllers have the ability to take decision even with incomplete information. More
and more sophisticated controllers are being developed for traffic control.
These algorithms are continually improving the safety and efficiency by reducing the waiting
delay of vehicles on signals. This increases the tempo of travel and thus makes signals moreeffective and traffic flow smooth. The key motivation towards Fuzzy Logic in traffic signal
control is the existence of uncertainties in signal control. Decisions are taken based on imprecise
information and the effect of evaluation is not well known.
METHODOLOGY:
The fuzzy logic controller determines whether to extend or terminate the current green phase
based on a set of fuzzy rules. The fuzzy rules compare traffic conditions with the current green
phase and traffic conditions with the next candidate green phase. The flow diagram of a
controller is shown in figure 1.
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
3/12
FIG 1. Fuzzy Traffic Signal Control
Fuzzy
Interference
System
Fuzzification Defuzzi-fication
Traffic
Situatio
n
Model
Signal
Control
Action
Detection Traffic Situation
Signal
Status
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
4/12
A BRIEF INTRODUCTION TO 8051 MICROCONTROLLER:
When we have to learn about a new computer we have to familiarize about the
machine capability we are using, and we can do it by studying the internal hardware design
(devices architecture), and also to know about the size, number and the size of the registers.
A microcontroller is a single chip that contains the processor (the CPU), non-volatile memory for
the program (ROM or flash), volatile memory for input and output (RAM), a clock and an I/O
control unit. Also called a "computer on a chip," billions of microcontroller units (MCUs) are
embedded each year in a myriad of products from toys to appliances to automobiles. For
example, a single vehicle can use 70 or more microcontrollers. The following picture describes a
general block diagram of microcontroller.
89s52: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with
8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels
high-density nonvolatile memory technology and is compatible with the industry-standard 80C51instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed
in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit
CPU with in-system programmable Flash on a monolithic chip, the Atmel's AT89S52 is a
powerful microcontroller which provides a highly-flexible and cost-effective solution to many
embedded control applications. The AT89S52 provides the following standard features: 8K bytes
of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip
oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for
operation down to zero frequency and supports two software selectable power saving modes. The
Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt
system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the
oscillator, disabling all other chip functions until the next interrupt
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
5/12
The hardware is driven by a set of program instructions, or software. Once familiar with
hardware and software, the user can then apply the microcontroller to the problems easily.
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
6/12
The pin diagram of the 8051 shows all of the input/output pins unique to microcontrollers:
The following are some of the capabilities of 8051 microcontroller.
Internal ROM and RAM
I/O ports with programmable pins
Timers and counters
Serial data communication
The 8051 architecture consists of these specific features:
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
7/12
16 bit PC &data pointer (DPTR)
8 bit program status word (PSW)
8 bit stack pointer (SP)
Internal ROM 4k
Internal RAM of 128 bytes.
4 register banks, each containing 8 registers
80 bits of general purpose data memory
32 input/output pins arranged as four 8 bit ports:P0-P3
Two 16 bit timer/counters: T0-T1
Two external and three internal interrupt sources
Oscillator and clock circuits
For any electronics project the power supply plays a very important role in its properfunctioning.
In this project we are using external A.C supply (220 v) as input , this high voltage is
converted into 12 Volts A.C by step down transformer , then we use voltage regulators and
filters with bridge rectifier to convert the A.C into D.C voltage .
For voltage regulation we are using LM 7805 and 7812 to produce ripple free 5 and 12 volts
D.C constant supply.
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
8/12
IR SENSOR
INFRARED LED'S:-
Gallium arsenide is a direct-gap semiconductor with an energy gap of 1.4eV at room
temperature. A typical GaPs LED is made by solid-state impurity diffusion with zinc as the p-
type impurity diffused into an n-type substate doped with tin, tellurium or silicon. The external
efficiency at room temperature is typically 5 percent.
A GaAs diode can also be fabricated by liquid-phase epitaxy with silicon as both its n and
p dopants. If a silicon atom replaces a Ga atom, it provides one additional electron, thus the
resulting GaAs in as n-type. If a silicon atom replaces arsenic atoms, an electron is missing and
the resulting GaAs is a p-type. In Si doped GaAs diode, the emission peak shifts down to
1.32eV. Since the emission is in infrared region, GaAs light sources are suitable for application
such as the optical isolator. The high switching speed, with a recovery time between 2 and 10ns,
makes them ideal for data transmission.
The disadvantages of the GaAs emitter are emitted wavelength and the associated
attenuation an dispersion. A critical issue of using an LED for the fibre optics is the coupling oflight from the semiconductor to the fibre. Because of the larger refractive index of GaAs relative
to air, the internal efficiency of LED can be quite low.
PHOTO SEMICONDUCTOR
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
9/12
A Germanium or silicon diode or transistor, which has a transparent encasing, can serve
as a photodiode or transistor because the light photons can initiate conduction in the p-n-
junction region. Early devices such as the OCP 71 were Ge-devices. Later, silicon types became
available with lower leakage current and better light sensitivity. In a phototransistor, the base
lead is not used; but, if a resistor is connected form base to emitter it reduced the light sensitivity.
Darlington connected photo transistors (two transistors together in one case) such as the 2N5777
are very sensitive with a hFE of 2.5K, a dark current of 100nA and a light current of 0.5-2.0mA
for light flux density H=2mW/cm2. The device is rated 200mW and voltage of 25V maximum.
SCRs with a light window are also available, called as LASCR, which are very sensitive
and can turn mains power ON and OFF, with light.
The switching speed of phototransistors far exceeds those of LDRs, made of CdS. The
rise time for the 2N5777 is 75 s and fall time is 50 s. Maximum switching speed is 1KHz.
Photo devices are useful in optical encoding, intrusion alarms, tape readers, level control,
character recognition etc.
Nowadays packing containing an LED and a photodiode, called opto-coupler is used for
switching on power or control circuits. Because the light source (LED) and photodiode are
physically kept separated (with 2mm) in the package, isolation upto 2500V can be had.
555 timer
The buffer circuit's input has a very high impedance (about 1M ) so it requires only a few A,
but the output can sink or source up to 200mA. This enables a high impedance signal source
(such as an LDR) to switch a low impedance output transducer (such as a lamp). It is an
inverting buffer or NOT gate because the output logic state (low/high) is the inverse of the input
state:
Input low (< 1/3 Vs) makes output high, +Vs
Input high (> 2/3 Vs) makes output low, 0V
When the input voltage is between 1/3 and2/3 Vs the output remains in its present state. This
intermediate input region is a deadspace where there is no response, a property called hysteresis,it is like backlash in a mechanical linkage. This type of circuit is called a Schmitt trigger.
If high sensitivity is required the hysteresis is a problem, but in many circuits it is a helpful
property. It gives the input a high immunity to noise because once the circuit output has switched
high or low the input must change back by at least 1/3 Vs to make the output switch back.
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
10/12
LIGHT EMITTING DIODE
Light emitting diode (LED) is basically a P-N junction semiconductor diode particularly
designed to emit visible light. There are infrared emitting LEDs which emit invisible light. The
LEDs are now available in many colours red, green and yellow. A normal LED emits at 2.4V
and consumes MA of current. The LEDs are made in the form of flat tiny P-N junction enclosed
in a semi-spherical dome made up of clear coloured epoxy resin. The dome of a LED acts as a
lens and diffuser of light. The diameter of the base is less than a quarter of an inch. The actual
diameter varies somewhat with different makes. The common circuit symbols for the LED are
shown in Fig. It is similar to the conventional rectifier diode symbol with two arrows pointing
out. There are two leads- one for anode and the other for cathode.
LEDs often have leads of dissimilar length and the shorter one is the cathode. All
manufacturers do not strictly adhere this to. Sometimes the cathode side has a flat base. If there
is doubt, the polarity of the diode should be identified. A simple bench method is to use the
ohmmeter incorporating 3-volt cells for ohmmeter function. When connected with the ohmmeter:
one way there will be no deflection and when connected the other way round there will be a large
deflection of a pointer. When this occurs the anode lead is connected to the negative of test lead
and cathode to the positive test lead of the ohmmeter.
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
11/12
If low range (Rxl) of the ohmmeter is used the LED would light up in most cases because
the low range of ohmmeter can pass sufficient current to light up the LED.
Another safe method is to connect the test circuit shown in Fig. 2. Use any two dry cells
in series with a current limiting resistor of 68 to 100 ohms. The resistor limits the forward diode
current of the LED under test to a safe value. When the LED under test is connected to the testterminals in any way: if it does not light up, reverse the test leads. The LED will now light up.
The anode of the LED is that which is connected to the A terminal (positive pole of the
battery). This method is safe, as reverse voltage can never exceed 3 volts in this test.
ELECTRICAL CHARACTERISTICS OF LEDS: -
Electrically, a LED is similar to the conventional diode in that it has relatively low
forward voltage threshold. Once this is exceeded the junction has a low slope resistance and
conducts current readily. An external resistor must limit this current. Forward voltage drew
across red LED is nominally 1.6 V but spread with commercial diodes, it may be as high as 2
volts or so, while the Green LED drops 2.4V. This difference accounts for use of lower limiting
resistor used with the Green LED.
Another important parameter of the LED is its maximum reverse voltage rating. For typical Red
device it is of the order of 3 volts. But for Green LED it is somewhat higher- 5 to 10 volts.
The LED produces light only when a d.c. current is passed in the forward direction and the
amount of light emitted by a LED is proportional to the forward current over a broad range. It
means that light intensity increases in an approximately linear manner with increasing current.
BLOCK DIGRAM:
-
8/3/2019 Fuzzy Based Traffic Light Con Troll Err
12/12
As shown in the circuit a microcontroller is programmed to automatically ON and OFF the
LEDs (traffic light). The crystal oscillator provides the necessary clocking for the
microcontroller to work properly. The four traffic lights, shown as 4 groups of 3 LEDs (Red,
Green, Yellow), is actually installed at each of the four roads.
The necessary stabilized power source is designed by the use of LM7805, as shown above (in the
lower figure). The whole circuit will be implemented on a zero PCB. The programming of the
Microcontroller can be done either in C or in Assembly, using a programmer.
8051MAX
232
Tx
Rx
RS232
PORT1
PORT2
Sensor Input
MATLAB PROGRAM
RUNNING ON COMPUTER