Вы находитесь на странице: 1из 27

I.

DECLARATION

We, the undersigned, declare that this project work is our original work, has not
been presented for a degree in this or any other universities, and all sources of
materials used for the project work have been fully acknowledged.

Abebe Alemu Wendimu _____________________


Name Signature
Yohannes Fitsum Gabisse _____________________
Name Signature

Place: Addis Ababa Institute of Technology, Addis Ababa University, Addis


Ababa
Date of Submission: February 19, 2015

This project has been submitted to School of Electrical and Computer Engineering
with our approval as a university advisor.

Andinet Negash Hunde (Msc) ______________________


Advisor‘s Name Signature
II. ACKNOWLEDGMENT

We would like to express our sincere gratitude to our advisor, Mr. Andinet Negash
(MSc), for his guidance, support and encouragement during the course of the project
work. He has been an excellent advisor demonstrating good patience and enormous help
throughout our project study.

We would like to thank God for his merciful and endless guidance through our life and
for giving us a supportive and loving family and friends that are always there through all
our success and failure, supporting, cherishing and lifting us up morally and financially.

We would also like to thank the academic staff of Electrical and Computer Engineering
Department, colleagues included, for their vital comments during formal and in other
informal discussions. Honestly, their involvement was undeniably so vital to play a
significant role in shaping the content of the project in its final form.

Finally, we have a great thanks and love to our friends and partners who helps us in
every activities of my project.

_______________________

Abebe Alemu Wendimu

_______________________

Yohannes Fitsum Teferi


III. TABLE OF CONTENTS

I. DECLARATION ....................................................................................................................................... 1
II. ACKNOWLEDGMENT .......................................................................................................................... 2
III. TABLE OF CONTENTS ........................................................................................................................ 3
VI. ABSTRACT ........................................................................................................................................... 5
CHAPTER 1 ................................................................................................................................................. 6
INTRODUCTION ........................................................................................................................................ 6
1.1 BACKGROUND ................................................................................................................................ 6
1.1.1Traffic Control Systems ................................................................................................................ 7
o Manual Controlling ....................................................................................................................... 7
o Automatic Controlling .................................................................................................................. 7
1.2 PROBLEM DESCRIPTION ............................................................................................................... 8
1.2.1 Heavy traffic jams ........................................................................................................................ 8
1.2.3 Green Light for an empty road ..................................................................................................... 8
1.2.3 No traffic, but the pedestrians still need to wait........................................................................... 8
1.3 OBJECTIVE ....................................................................................................................................... 9
1.3.1 General Objectives ....................................................................................................................... 9
1.3.2 Specific Objectives ...................................................................................................................... 9
CHAPTER 2 ............................................................................................................................................... 10
LITERATURE REVIEW ........................................................................................................................... 10
2.1 TRAFFIC LIGHT SYSTEMS .......................................................................................................... 10
CHAPTER 3 ............................................................................................................................................... 12
METHODOLOGY & IMPLEMENTATION ............................................................................................. 12
3.1 LABVIEW for designing the traffic light ......................................................................................... 12
3.2 Proteus for Controlling Camera Mounted Stepper Motor................................................................. 15
3.2.1 Stepper motor control and camera adjustment ........................................................................... 15
Figure 3: Camera mounted on a stepped motor ...................................................................................... 16
3.3 COMMUNICATION PORT............................................................................................................. 16
CHAPTER 4 ............................................................................................................................................... 17
4.1 SIMULATION RESULT.................................................................................................................. 17
4.2 DISCUSSION ................................................................................................................................... 19
CHAPTER 5 ............................................................................................................................................... 20
CONCLUSIONS & FUTURE WORK ....................................................................................................... 21
5.1 CONCLUSIONS............................................................................................................................... 21
5.2 FUTURE WORK .............................................................................................................................. 22
REFERENCE.............................................................................................................................................. 22
APPENDIX ................................................................................................................................................. 24
VI. ABSTRACT
Traffic is the major problem which every country faces because of the increase in number of
vehicles throughout the world, particularly in large urban areas. As the problem of urban traffic
congestion spreads & occurrence of road accidents increase, there is a pressing need for the
introduction of advanced technology and equipment to improve the traffic control algorithms to
better accommodate this increasing demand. The simplest way for controlling a traffic light is
using timer for each phase. Another way is to use electronic sensors in order to detect vehicles,
and produce signal that cycles. In this paper we propose the LABVIEW simulation model for
controlling the traffic lights based on time interval. This simulation model can extended to control
the time interval of the traffic light based on traffic density system for controlling the traffic light
by image processing. The system will detect vehicles through images instead of using electronic
sensors embedded in the pavement. A camera will be installed alongside the traffic light. It will
capture image sequences. The image sequence will then be analyzed using digital image
processing for vehicle detection, and according to traffic conditions on the road, traffic light can
be controlled.
CHAPTER 1

INTRODUCTION
1.1 BACKGROUND

As the population of the modern cities is increasing day by day due to which vehicular
travel is increasing which lead to congestion problem. Traffic congestion has been causing many
critical problems and challenges in the major and most populated cities. Due to this traffic
congestion there is more wastage of time. The steady increase in the number of automobiles on
the road has amplified the importance of managing traffic flow efficiently to optimize utilization
of existing road capacity. High fuel cost and environmental concerns also provide important
incentives for minimizing traffic delays. Road accident is another main problem in modern world.
If we observe seriously the causes of road accidents, we found that narrow roads and rapid increase
of means of transport are the main reasons behind increasing number of road accidents.

Traffic Rules & Laws, Road Signs and Traffic Control Systems are used to solve the
previously mentioned traffic problems. Traffic laws are the laws which govern traffic and regulate
vehicles, while rules of the road are both the laws and the informal rules that may have developed
over time to facilitate the orderly and timely flow of traffic. Traffic signs or road signs are signs
erected at the side of roads to provide information to road users.
1.1.1Traffic Control Systems
o Manual Controlling
Manual controlling the name instance it require man power to control the traffic. Traffic
polices are allotted for a required area or city to control the traffic. The traffic polices will have
things like sign board, sign light and whistle to control the traffic. In the manual controlling system
we need more man power. As we have poor strength of traffic police we cannot control traffic
manually in all area of a city or town. So we need a better solution to control the traffic.

o Automatic Controlling
Automatic traffic light is controlled by timers and electrical sensors. In classical traffic
light system each phase has a constant numerical value loaded in the timer. The lights are
automatically getting ON and OFF depending on the timer value changes.

Since, the classical traffic light system is very prone to traffic congestion, intelligent traffic
light systems are needed i.e. instead of a defined timer, the density of the vehicles is computed
then the timer is set. The most common mechanism is usage of electrical sensors embedded in the
pavement. This system will detect vehicles, and produce signal for the timer based on the density
of vehicles. Traffic congestion also occurred while using the electronic sensors for controlling the
traffic. Usage of electronic sensors is not that much efficient because it has high tendency to be
affected by noise & it is expensive. All these drawbacks are supposed to be eliminated by using
image processing.

Traffic light system using image processing:


The system will detect vehicles through images instead of using electronic sensors
embedded in the pavement. A camera will be installed alongside the traffic light. It will capture
image sequences. Image processing is a better technique to control the state change of the traffic
light. It shows that it can reduce the traffic congestion and avoids the time being wasted by a green
light on an empty road. It is also more consistent in detecting vehicle presence because it uses
actual traffic images. It visualizes the reality so it functions much better than those systems that
rely on the detection of the vehicles’ metal content.
1.2 PROBLEM DESCRIPTION
In Ethiopia, all of the traffic light systems used are the classical ones. These systems encounter
many limitations i.e. timing is not based on number of vehicles due to this we have the following
draw backs:

1.2.1 Heavy traffic jams

With increasing number of vehicles on road, heavy traffic congestion occurs substantially
in major cities. This happened usually at the main junctions commonly in the morning before office
hour and in the evening after office hours. This causes an increased time wasting of the people on
the road.

1.2.3 Green Light for an empty road


There are these times where there are no vehicles on a junction but the green light is on
for that junction. Whereas, on the other junction there exists a queue of waiting vehicles but the
red light is on for that junction.

1.2.3 No traffic, but the pedestrians still need to wait

At certain junctions, sometimes even if there is no traffic, pedestrians have to wait.


Because the traffic light remains green for the preset time period, the road users should wait until
the light turn to red.
1.3 OBJECTIVE
1.3.1 General Objectives
The general objectives of this project are:

i. To develop integrated traffic light control system based on image processing to


calculate the density of vehicle on the road and set the timer

1.3.2 Specific Objectives


The specific objectives of this project are:

i. To design a control traffic light system based on the proposed methodology


ii. To make the traffic light system to accept signal from the image processing output
iii. To select a stepper motor that is used to rotate the camera
iv. To integrate the image processing part with the traffic light & stepper motor
CHAPTER 2

LITERATURE REVIEW
2.1 TRAFFIC LIGHT SYSTEMS
A traffic light system is an electronic device that assigns right of way at an intersection or crossing
or street crossing by means of displaying the standard red, yellow and green colored indications.
An addition, it also works in conjunction with pedestrian displays to assign pedestrian crossing
right of way. A traffic light, also known as traffic signal, stop light, stop-and-go lights, is a
signaling device positioned at a road intersection, pedestrian crossing, or other location in order to
indicate when it is safe to drive, ride, or walk using a universal color code (and a precise sequence,
for that are colors blind).
Nowadays, a red light meant traffic in all directions had to stop. A yellow light meant cross-town
traffic would have to slow and a green light would to go or proceed. The difficulty in understanding
this confusing color sequence was compounded by neighboring towns using another system. The
development of an intelligent control structure ensures an optimal solution for all participants in
the transportation and road traffic system.
There are different ways controlling road intersections. In the simplest cases the right-hand rule
or, if the traffic is higher, a roundabout or the signal of a policeman can help steer the traffic.
However, especially in big cities, in the complicated cases when the roads in the intersection have
several lanes, the use of traffic lights cannot be avoided. An additional issue arises when in the
intersection not only roads but also railroad tracks take part, what often occurs in suburban traffic
situations. The most common way to handle this type of intersection is the conventional cyclic
lights control.
In more enhanced control, the traffic in different directions is monitored by sensors and the
signals thus obtained control the traffic lights. In this method the control is adapting to the traffic.
The general problem is the huge number of variables and the need for large computing efforts.
To simplify this problem a possible way is the use of fuzzy techniques. In the last couple of years
a lot of simulations were done and also practical control systems were built based on simple
fuzzy rules.
However in the most complicated cases where the numbers of lanes are large and maybe not only
one but more road intersections and railroad take part, it does make sense to use fuzzy methods
containing hierarchy and apply interpolation to decrease the complexity.
Benefit of Traffic Light Controller
When properly used, traffic control signals are important devices for the control of vehicular in
road. They assign the right-of-way to a choice of traffic movements and there by deeply
influence traffic flow. Traffic control signals that are properly designed, located, operated, and
maintained will have one or more of the following advantages:
I. Provide orderly movement of traffic
II. Minimize completing movement
III. Coordinated for continuous movement
IV. Provide driver confidence by assigning right way
Traffic control signals are often considered a cure for all traffic problems at intersections. This
belief has led to traffic control signals being installed at many locations where they are not
needed, adversely affecting the safety and efficiency of vehicular, bicycle, and pedestrian traffic.
Traffic control signals, even when justified by traffic and roadway conditions, can be ill-
designed, ineffectively placed, improperly operated, or poorly maintained. While traffic signals
can help in locations where they are justified and installed properly, they also have
disadvantages. There will always be some disadvantages even if the signal is justified.
MATLAB tools can also perform any type of computation, read and write data files,
communicate with other GUIs, and display data as tables or as plots.
CHAPTER 3

METHODOLOGY & IMPLEMENTATION


3.1 LABVIEW for designing the traffic light
In this section, we concentrate on design of the Traffic light using LABVIEW. The methodology
which we followed in the simulation model is clearly given in the figure below. At instant of
time only traffic from one direction is allowed and flow of traffic in remaining three directions is
restricted. Here flow of traffic in all the directions is based on the density of vehicles
Case 1: Green light towards east direction is enabled, whereas red lights are enabled in north,
south and west directions.
Case 2: Green light towards north is enabled and red lights are enabled in remaining directions.
Case 3: Green light towards west is enabled and red lights are enabled in remaining directions.
Case 4: Green light towards south is enabled and red lights are enabled in others.
• As we have assumed a flow of traffic in all the directions is based on the density of
vehicles, a definite time interval is allotted for each case. Instead of constant time
intervals to all the cases, variable time intervals can also be set depending on the real time
situation. This cycle continues to repeat.
• The signaling is direction starting from first road, through fourth sequentially.
• The timing calculation is based on estimated density with the help of image processing
technique on the captured image.
• First we have taken a survey at KIDIST MARIAM four highway roads. We have tried to
simulate the exact road light pattern observing the timing and then we developed it to a
working algorithm and based on the algorithm we write block diagram code using lab
view.
• A traffic light control system lies at an intersection with two streets (2 lanes each) that
cross right angles in Figure (2). Direction for one street goes only north and south and
the other street can only go east and west.
• Traffic lights consist of 3 lights: green, yellow and red. Traffic lights depending on
orientation can be viewed from either direction North/South (N/S) and East/West (E/W).
Pedestrian crossing signals (walk/stop) are positioned in the middle of the street and
depending orientation can be viewed from either direction (N/S and E/W).
• The traffic lights cycle by allowing traffic to move on one street to another. The cycle
time depend on the density of the vehicles. The traffic lights operate as follows:
• Traffic Lights and Pedestrian Crossing Timing

Road 1 Road 2 Road 3 Road 4


Red Green Red Red
Green Red Red Red
For Vehicles Red Red Red Green
Red Red Green Red
Case for pedestrians
Stop stop stop Walk
For Pedestrians Stop Stop Walk Stop
Walk Walk Stop Stop
Walk Walk Stop Stop

Table 1: Traffic Lights and Pedestrian Crossing Timing

If traffic light is green, traffic can continue onto the intersection. If traffic light is yellow,
traffic must in transition state and the transition state depends on the previous state of traffic
light. If traffic light is red, traffic must stop.
If pedestrian crossing light is 'WALK', the pedestrian is allowed to walk across the street. If
pedestrian crossing light "STOP", the pedestrian should not enter the intersection or should
increase pace to clear the intersection. If pedestrian crossing signal is "STOP", the pedestrian
should not enter the intersection and pedestrians wait the next light change include the
“WAlk” option.
Intersection Overview

Figure: 2 Layout of Intersection with Traffic Light System Control and Pedestrian
3.2 Proteus for Controlling Camera Mounted Stepper Motor
3.2.1 Stepper motor control and camera adjustment
Since camera is mounted on stepper motor and rotates 90 degree in four junctions. We simulate
the position control stepper motor on proteus.
Why we use stepper motor?
Computer controlled stepper motors are one of the most versatile forms of positioning systems,
this projects presents the micro stepping technique which overcomes the problem of instability
and at the same time provide high accuracy for micro stepping applications.
The advantages of Stepper Motors are the followings:
o Can be used in an open circuit;
o Can be used in large control frequencies;
o Fine precision and resolution (number of steps on rotation), which simplify the
kinematic mechanism;
o Can memories the position;
o Are compatible with numerical control techniques.

The motor considered in this paper is a two phases stepping motor and assumptions for the motor
parameters is as follows.
1. Uniform air gap is present and poles are non salient poles.
2. Distribution of flux is sinusoidal.
3. Losses or iron and saturation is negligible.
4. Self inductance of windings is constant.
The movement of the camera will be very precise and repeatable as the stepper motor
moves step by step.
Figure 3: Camera mounted on a stepped motor

3.3 COMMUNICATION PORT


For creating well integrated system for our simulation, we have used VIRTUAL SERIAL PORT
EMULATOR.
HERE IS HOW IT WORKS
First we pair two ports such as COM1 and COM2.
We Assign COM1 to MATLAB and COM2 for proteus and LABVIEW. The MATLAB
Graphical User Interface will be the host and Proteus and LABVIEW will be Clients.
MATLAB and LABVIEW communication is done to send image processing timing results to
LABVIEW such that based on the timing LABVIEW will work showing the traffic lights
pattern. MATLAB and PROTEUS communication is done to command the steeper motor such
that the stepper motor holding the camera rotates and captures each highway road.
CHAPTER 4
4.1 SIMULATION RESULT

Figure 4: Proteus Simulation Result


Figure 5: LabView Simulation Result
4.2 DISCUSSION
The results in both LABVIEW and Proteus is works very well as indicated above. At the same time needs
more testing conditions before implementing on the hardware. In general, the result was as good as
expected.
CHAPTER 5
CONCLUSIONS & FUTURE WORK
5.1 CONCLUSIONS
“Traffic control using image processing” technique that we propose overcomes the limitations
of the earlier (in use) techniques used for controlling the traffic. Earlier in automatic traffic control
use of timer had a drawback that the time is being wasted by green light on the empty. The
technique we proposed avoids this problem. Upon comparison of various edge detection
algorithms, it was inferred that Canny Edge Detector technique is the most efficient one. The
project demonstrates that image processing is a far more efficient method of traffic control as
compared to traditional techniques. Also it is more effective than the density based system based
on since it is cost effective and less prone to error. The use of our technique removes the need for
extra hardware such as sound sensors & magnetic loop embedded in pavements. The major
advantage is the variation in signal time which control appropriate traffic density using Image
matching. The accuracy in calculation of time due to single moving camera depends on the
registration position while facing road every time.

Output of GUI clearly indicated some expected results. It showed matching in almost every
interval that were decided as boundaries like 10%, 35%, 68% etc.

The study showed that image processing is a better technique to control the state change of the
traffic light. It shows that it can reduce the traffic congestion and avoids the time being wasted by
a green light on an empty road. It is also more consistent in detecting vehicle presence because it
uses actual traffic images. It visualizes the reality so it functions much better than those systems
that rely on the detection of the vehicles’ metal content. Overall, the system is good but it still
needs improvement to achieve a hundred percent accuracy.

The hardware implementation would enable the project to be used in real-time practical conditions.
In addition, we propose a system to identify the vehicles as they pass by, giving preference to
emergency vehicles and assisting in surveillance on a large scale. The handling of emergency with
the help of assigning priority has an advantage since safety human is maintained.
5.2 FUTURE WORK
The focus shall be to implement the controller using DSP as it can avoid heavy investment in
industrial control computer while obtaining improved computational power and optimized system
structure. The hardware implementation would enable the project to be used in real-time practical
conditions.

REFERENCE
[1] N. J. Ferrier, S. M. Rowe, A. Blake, “Real-time traffic monitoring,” Proceedings of the
Second IEEE Workshop on Applications of Computer Vision, pp.81 -88, 1994.
[2] V. Kastrinaki, M. Zervakis, and K. Kalaitzakis, "A survey of video processing techniques
for traffic applications, “Image and Vision Computing, vol. 21, pp. 359-381, Apr 1 2003.
[3] Choudekar P, Banerjee S, Muju M.K, “Implementation of image processing in real time
traffic light control” International Conference on Electronics Computer Technology, vol.2, pp.94
-98, 2011.
[4] Digital image processing by Rafael C. Gonzalez and Richard E. Woods.
[5] Traffic light control system simulation through vehicle detection using image
processing By Mac Michael B. Reyes and Dr Eliezer A. Albaccea
[6] Ms.PromilaSinhmar, “Intelligent Traffic Light and Density Control using IR Sensors and
Microcontroller”, International Journal of Advanced Technology & Engineering Research
(IJATER) ISSN NO: 2250-3536 VOLUME 2, ISSUE 2, March 2012.
[7] Ahmed S. Salama, Bahaa K. Saleh, Mohamad M. Eassa, “Intelligent Cross Road Traffic
Management System (ICRTMS),” 2nd Int. Conf. on Computer Technology and Development,
Cairo, Nov 2010, pp. 27-31.
APPENDIX
Camera Mounted on Stepper Motor proteus code
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;

sbit LCD_RS_Direction at TRISD2_bit;


sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;

char uart_rd;
int cycle=0;
void main() {
UART1_Init(9600);

TRISB.B0=1;TRISB.B1=0;TRISB.B2=0;TRISB.B3=0;TRISB.B4=0;TRISB.B
5=0;
//TRISC=0;
TRISA=1;/
PORTB=0;
PORTA=0;
//TRISB.B0 = 1;
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
while(1){
if(UART1_Data_Ready()&&UART1_Read()=='R'){
Delay_ms(100);
//uart_rd=UART1_Read();
if(cycle==0){

PORTB.B5=1;
PORTB.B1=0;
PORTB.B2=0;
PORTB.B3=0;
PORTB.B4=1;
delay_ms(200);
PORTB.B5=0;
Lcd_Out(1,1,"Road 1 Captured");
Lcd_Out(2,1,"90 degree");
}
if(cycle==1){

PORTB.B5=1;
PORTB.B1=0;
PORTB.B2=1;
PORTB.B3=0;
PORTB.B4=0;
delay_ms(200);
PORTB.B5=0;
Lcd_Out(1,1,"Road 2 Captured");
Lcd_Out(2,1,"180 degree");
}
if(cycle==2){

PORTB.B5=1;
PORTB.B1=0;
PORTB.B2=0;
PORTB.B3=1;
PORTB.B4=0;
delay_ms(200);
PORTB.B5=0;
Lcd_Out(1,1,"Road 3 Captured");
Lcd_Out(2,1,"270 degree");
}
if(cycle==3){

PORTB.B5=1;
PORTB.B1=1;
PORTB.B2=0;
PORTB.B3=0;
PORTB.B4=0;
delay_ms(200);
PORTB.B5=0;
Lcd_Out(1,1,"Road 4 Captured");
Lcd_Out(2,1,"360 degree");
}
cycle++;
if(cycle==4)cycle=0;
}

Вам также может понравиться