-
i
DEVELOPMENT OF AN INTELLIGENT TRAFFIC CONTROL SYSTEMS
USING ARDUINO MICROCONTROLLER
NORFATIN MURSHIDA BINTI MOHAMAD NORDIN
A project report submitted in partial fulfilment of the
requirements for the award of the degree of
Master of Science (Advanced Manufacturing Technology)
Faculty of Mechanical Engineering
Universiti Teknologi Malaysia
JANUARY 2016
-
iii
Bismillahirahmanirahim
I strongly dedicated this project to my beloved father (Mohammad
Nordin Bin
Hashim), mother (Sarina Binti Din) and my siblings (Mohamad
Nabil, Mohamad
Najib, Nafeesa, and Nuha Fahada), with their sincere prayers and
endless support
afforded me to successfully accomplish this thesis.
-
iv
ACKNOWLEDGEMENT
First and foremost, I would like to thank Allah Almighty for
blessing and giving
me strength to accomplish this thesis. Sincere appreciation to
my supervisor Prof.
Madya Dr. Izman Sudin and also my co-supervisor Dr. Norizah
Redzuan who constant
support during my study at UTM and greatly helped me until this
project completed.
Other than that, the lecturer and technician who help me in
completing the project, Dr.
Maziah and Mr.Rahim.
Deepest gratitude to my beloved father, mother, brothers and
sister and all of my
family and friends for their real love, pray, spirit, continuous
encouragement and
patience within this study period.
-
v
ABSTRACT
Increasing number of vehicles on the road becomes a concern to
road users
since it causes massive traffic congestion especially at the
junction. It is not only
happen in Malaysia, but also around the world. Traffic
congestion has contributed to
low productivity, pollution and energy losses. In addition, user
loss time,
environment quality and road safety are also affected by traffic
congestions. Most of
the existing traffic control system installed in Malaysia is
proven not intelligent
enough to make smooth traffic flow in minimizing waiting time of
vehicles and
maximizing number of vehicles flow in the respective lane. In
this study, a new
design concept of traffic control system is studied. An
intelligent traffic control
system using Arduino Microcontroller and Infrared proximity (IR)
sensor are used
together to simulate the traffic flow at three junction road.
Program code in Arduino
Integrated Development Environmentally (IDE) software was used
to communicate
with the sensors. These systems use sensor to detect the absence
and presence of
vehicles and sent the signal to the microcontroller. The
decision was made based on
the queue length of vehicles at each road. A longer period of
green signals will be
given to the lane which have long queue of vehicles. WITNESS
software was used to
simulate and validate the performance of the proposed system.
The cycle time is
reduced allowing more vehicles flow through the traffic and
average waiting time of
vehicles for new system also decreased compare to current
system. Current traffic
light shows average waiting time for vehicle at Traffic 1,
Traffic 2 and Traffic 3 is
longer which are 10, 7 and 3 seconds compare to the new traffic
light system which
reducing the average waiting time to 5, 2 and 1 seconds.
-
vi
ABSTRAK
Semakin banyak kenderaan di jalan raya yang menjadi
kebimbangan
kepada pengguna jalan raya kerana ia menyebabkan kesesakan lalu
lintas terutama di
persimpangan. Ia bukan sahaja berlaku di Malaysia, tetapi juga
di seluruh dunia.
Kesesakan lalu lintas telah menyumbang kepada produktiviti yang
rendah,
pencemaran dan tenaga kerugian. Di samping itu, masa kerugian
pengguna, kualiti
alam sekitar dan keselamatan jalan raya juga dipengaruhi oleh
kesesakan lalu lintas.
Kebanyakan sistem kawalan lalu lintas sedia ada yang dipasang di
Malaysia terbukti
tidak cukup bijak untuk membuat aliran trafik yang lancar dalam
mengurangkan
masa menunggu kenderaan dan memaksimumkan jumlah kenderaan
mengalir di
lorong masing-masing. Dalam kajian ini, satu konsep reka bentuk
baru sistem
kawalan trafik dikaji. Sistem kawalan trafik bijak menggunakan
Arduino
mikropengawal dan kedudukan berhampiran inframerah (IR) sensor
digunakan
bersama-sama untuk simulasi aliran trafik di tiga jalan simpang.
Kod program dalam
Pembangunan Bersepadu Arduino alam perisian (IDE) telah
digunakan untuk
berkomunikasi dengan sensor. Sistem ini menggunakan sensor untuk
mengesan
ketiadaan dan kehadiran kenderaan dan menghantar isyarat kepada
pengawal mikro.
Keputusan itu dibuat berdasarkan tempoh barisan jenis kenderaan
di setiap jalan.
Tempoh isyarat hijau yang panjang akan diberikan kepada lorong
yang mempunyai
barisan panjang kenderaan. Perisian WITNESS digunakan untuk
mengsimulasikan
dan mengesahkan prestasi sistem yang dicadangkan. Masa kitaran
dikurangkan
membolehkan lebih banyak kenderaan mengalir melalui masa lalu
lintas dan purata
menunggu kenderaan untuk sistem baru juga menurun berbanding
dengan sistem
semasa. Lampu isyarat semasa menunjukkan purata masa menunggu
untuk
kenderaan di Traffic 1 , Trafik 2 dan Trafik 3 lebih panjang
iaitu 10 , 7 dan 3 saat
berbanding dengan sistem lampu isyarat baru yang mengurangkan
purata masa
menunggu hingga 5, 2 dan 1 saat.
-
vii
TABLE OF CONTENTS
CHAPTER TITLE PAGE
DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENT iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES x
LIST OF FIGURES xi
LIST OF SYMBOLS xiii
LIST OF APPENDICES xiv
1 INTRODUCTION 1
1.1 Project Background 1
1.2 Problem Statement 2
1.3 Project Objective 4
1.4 Problem Stcope 5
1.5 Significant of Research 5
2 LITERATURE REVIEW 6
2.1 Introduction 6
2.2 Traffic Light Control System 6
2.3 Current Installation of Traffic Light Control in Malaysia
7
2.3.1 Timer 7
2.3.2 Programmable Logic Controller (PLC) 8
2.3.3 Microcontroller 10
-
viii
2.4 Traffic Control System Problems 11
2.5 Sosial, Economic and Ethical Impacts of Traffic
Congestion 12
2.6 An Overview of Traffic Light Control System 13
2.7 Programmable Logic Controller (PLC) 16
2.7.1 Components of PLC 16
2.7.2 PLC Operation 18
2.7.3 Applications of PLC 19
2.7.4 PLC Current Research 21
2.8 Arduino Microcontroller 22
2.8.1 Components of Arduino Microcontroller 22
2.8.2 Types of Arduino Microcontroller 24
2.8.3 Applications of Arduino Microcontroller 27
2.8.4 Arduino Current Research 29
3 METHODOLOGY 30
3.1 Introduction 30
3.2 Overall Research Methodology 30
3.3 Case Study 32
3.4 An Electronic Circuit Model 32
3.5 Arduino Intregrated Developement (IDE)Software 34
3.6 Traffic Light Sequence Cycle 36
3.6.1 Traffic Signal Control Flowchart 38
3.7 Important Measure for Developing Traffic Light System 40
3.8 Traffic Light Model in Real Application 41
3.9 Performances Evaluation 42
4 RESULTS AND DISCUSSION 43
4.1 Introduction 43
4.2 Development of Hardware 43
4.2.1 Microcontroller 43
4.2.2 Sensor 46
4.2.3 Hardware Circuit Model 47
4.2.4 Intelligent System Block Diagram 48
-
ix
4.3 Input and Output Arduino Microcontroller 49
4.4 Programming Part for Traffic Control 53
4.4.1 Intelligent Traffic Light Control Program 53
4.5 Performances Validation 55
4.5.1 Simulation Modelling 56
4.5.1.1 Assumptions of Simulation Modelling 56
4.5.1.2 Operating Concditions of Traffic Control 57
4.5.1.3 Flow and Interface of the Model 57
4.5.2 Data Collection and Analysis 59
4.5.2.1 Average Waiting Time of Vehicles 59
4.5.2.2 Percentage of Idle Time 62
4.5.2.3 Percentage of Busy State 65
4.6 Discussion 68
5 CONCLUSIONS AND RECOMMENDATIONS 70
5.1 Introduction 70
5.2 Recommendation for Future Work 71
REFERENCES 72
APPENDICES 77- 100
-
x
LIST OF TABLES
TABLE NO. TITLE PAGE
2.1 Research on Traffic Light Control System 14
2.2 PLC current research in the traffic light system 22
2.3 Arduino current research project 30
3.1 List of components 35
3.2 Suggestion times for green signal depend on volume
of vehicle at the road 41
4.1 Technical specification for Arduino Uno microcontroller
46
4.2 Input connection between Arduino and sensor 51
4.3 Output connection between Arduino and LED 51
4.4 Volume of car at each lane for average waiting time 61
4.5 Average waiting time for Fixed Time traffic control 62
4.6 Average waiting time for Intelligent Traffic control system
63
4.7 Volume of car at each lane for percentage of idle time
64
4.8 Percentages of Idle time for Fixed Time traffic control
65
4.9 Percentages of Idle time for Intelligent Traffic control
66
4.10 Volume of car at each lane for percentage busy state 67
4.11 Percentages of Busy State for Fixed Time traffic control
68
4.12 Percentages of Busy State for Intelligent Traffic control
69
-
xi
LIST OF FIGURES
FIGURE NO. TITLE PAGE
2.1 Traffic light using timer 8
2.2 Common Traffic light using PLCs 9
2.3 Vehicle Actuation with use of microcontroller 10
2.4 PLC (Omron) 16
2.5 PLC operation block diagram 18
2.6 Bottle filing system 19
2.7 Batch mixing system 20
2.8 Arduino microcontroller board 23
2.9 Arduino Uno board 24
2.10 Arduino Mega board 25
2.11 Arduino Leonardo board 26
2.12 Arduino Nano board 26
2.13 Old School Air Conditioner (AC) Controller 27
2.14 iPhone Controlled Logging Robot 28
3.1 Overall step by step methodology 31
3.2 Prototype model of intelligent traffic light using
an electronic component 33
3.3 Arrangement of Sensor 33
3.4 Arduino Integrated development (IDE) software 36
3.5 Sequence of Green light turn ON at three junction 36
-
xii
3.6 Intelligent traffic phase flowchart 37
3.7 Traffic signal flowchart 39
3.8 Traffic light model 41
4.1 Arduino Uno microcontroller 44
4.2 Infrared sensor 46
4.3 Traffic light Electronic circuit Model 47
4.4 Intelligent System Block Diagram 48
4.5a Program code for Fixed Time traffic 51
4.5b Program code for Fixed Time traffic 51
4.5c Program code for Fixed Time traffic 52
4.5d Program code for Fixed Time traffic 52
4.6a Program code for Intelligent Traffic Control 54
4.6b Program code for Intelligent Traffic Control 54
4.6c Program code for Intelligent Traffic Control 55
4.7 Flowchart of the simulation model for Tarffic 1 58
4.8 Interface of WITNESS software for the simulation model
59
4.9 Graph of Average waiting time of vehicles for Fixed
Time traffic control 60
4.10 Graph of Average waiting time of vehicles for
Intelligent
Traffic control 61
4.11 Graph of Percentages of idle time for Fixed Time
traffic
control 63
4.12 Graph of Percentages of idle time for Intelligent
Traffic
control 64
4.13 Graph of Percentages of busy state for Fixed Time
traffic
control 66
4.14 Graph of Percentages of busy state for Intelligent
Traffic
control 67
-
xiii
LIST OF SYMBOLS
PLC - Programmable Logic controller
VA - Vehicel Actuation
CO2 - Carbon Dioxide
RFID - Radio Frequency Identification
I/O - Input/Output
CPU - Central Receiving Unit
GPS - Global Positioning System
USB - Universal
PWM - Pulse Width modulation
GND - Ground
AREF - Analog Reference
TX - Transmit
RX - Receive
IC - Integrated Circuit
AC - Alternating Current
DC - Direct Current
V - Voltage
-
xiv
LIST OF APPENDICES
APPENDIX TITLE PAGE
Appendix A Arduino Uno Rev 3 Schematic 77
Appendix B Schematic view for Arduino
with electronic part 79
Appendix C Arduino board 81
Appendix D Arduino website 84
Appendix E Arduino IDE 86
Appendix F Arduino program structure 93
Appendix G Programming code 95
Appendix H Arduino programming code for Intelligent
Traffic control system 97
-
CHAPTER 1
INTRODUCTION
1.1 Project Background
Traffic lights also called as traffic signals, traffic lamps,
stop lights and robots
[1]. Technically, traffic light acts as a traffic control
signals device that plays an
important role to the road users by giving signal at road
intersections, pedestrian
crossings and other locations [2]. This signal used to control
the traffic flows at the
road for smooth flow of vehicles.
Although traffic lights look simple and can be seen everywhere,
their
presence is important for ensuring the safety and minimize
waiting time for the road
users. It is proven that growing use of traffic lights to smooth
the traffic flow can
reduce the number of accidents [3]. Traffic lights usually
placed at town streets and
highways, and critically at the junctions. Functionality of the
traffic light is usually
based on the pre-set time cycle or control mechanism like timer
and computerized
system.
Traffic lights works by changing the light signal for the road
users either to
stop or move [4]. There are three colours normally used which
are green, red and
yellow [5]. Each colour gives difference meaning. The green
light means the road
user can continue driving pass through the traffic light if
there is no obstacle. The red
light means the road users need to stop their vehicle while
yellow light warn the road
-
2
users to prepare for stopping. Driving without stopping at the
red light is an offence
and the road user will be compound for that action [6].
There are three types of traffic light control commonly
installed in Malaysia
which is the Timer, Programmable Logic Controller (PLC) and also
Microcontroller
[7]. Timer is commonly used for controlling traffic flow at
small town which has low
traffic flow. PLC usually used for setting fixed cycle time of
traffic and
microcontroller is suitable for heavy flow traffic. The uses of
PLC and
microcontroller systems are more complicated than the timer.
However, there are several limitations with microcontroller
system such as it
requires more maintenance, higher installation cost by two or
three times of preset
cycle time and also needs more inspection. On the other hand,
PLC have some
disadvantages such as the need of skill programmer to program,
debugging the PLC
sometimes consumes a lot of time and also PLC is designed by
semiconductors,
which depends on thermal characteristics working condition [8].
This project focused
on Arduino technology which operates similar to the PLC and
microcontroller
system to control traffic light switching sequence. It has been
reported that Arduino
system is very much cheaper than PLC and microcontroller in
terms of initial cost as
well as in maintenance. However, its capability has not been
explored fully to control
traffic light.
1.2 Problem Statement
Traffic congestion has been one of the major problems
encountered in large
cities. Traffic congestion usually depends on parameters such as
season, weather,
time, day and also unpredictable situations such as construction
activities, special
events or accidents [9]. All these measure should be taken onto
the account so that
traffic congestion will not create bottleneck and delays such as
long waiting times,
loss of fuel and money to the road users.
-
3
As the cities become more developed, there will be more
difficult in
monitoring and controlling of city traffic [10]. Many methods
has been studied and
develop to reduce traffic congestion such as the construction of
a new roads and
flyovers in the middle of the city, building of several rings
such as inner ring road,
middle ring road and outer ring road, introduction of city
trains such as the light
rapid transit (LRT), and monorails, restricting of large
vehicles in the city during
peak hours, and also development of sophisticated traffic
monitoring and control
systems [11].However, traffic congestion still happen especially
in the bigr cities
during peak hour due to the limited infrastructure and
mismanagement of the traffic
control systems.
Currently, traffic light control system that commonly installed
in Malaysia
are timer, programmable logic controller (PLC) and
microcontroller. They are
installing on the street based on the situation of the road or
junctions. The problems
that usually faced by the current traffic light systems are
[11]:
i. Heavy traffic light in the morning, before office hour and in
the evening
Immediately, after office hour, increasing number of vehicles in
the road
causes heavy traffic jams. This situation usually happens at the
junctions on
main road. This causes long waiting time in the popular
direction. The timer
is not intelligent to sense the presence of vehicles and thus
the sequence of
traffic light remains the same following the preset time on the
timer.
ii. No traffic, but still need to wait
Traffic light control functions according to the time that has
been set in the
systems. At the certain junction sometime, when there is no car,
but the road
users still need to wait for the signal to change from red to
green. This
contributes to long waiting time for no reason.
-
4
iii. Emergency car stuck in the traffic jam.
During peak hour, the emergency vehicle also will stick in
traffic flow due to
the road user need to wait for the traffic signalto change from
red to green.
This problem is more critical and should be avoided since it
involves
with life and death issue.
From the above scenario, an alternative solution is needed to
solve or reduce the
above problems. The proposed system should be relatively cheap
to maintain and
yet reliable to handle traffic flows with minimum queue time/
length.
1.3 Project Objectives
The objectives of this project were as follows:
1. To develop a traffic control program based on Arduino
microcontroller
system.
2. To validate functionality of the developed program using a
physical circuit
model and confirm the performance via witness simulation
software.
-
72
REFERENCES
1. Lazarinis, F., Green, S., & Pearson, E. ,2011, Handbook
of Research on E-
Learning Standards and Interoperability: Frameworks and Issues.
Hershey,
New York.
2. Open Books for an Open World, 2015. Urban Traffic Operations/
Traffic
Light. Available from:<
https://en.wikibooks.org/wiki/>.[02 September
2015].
3. The Pew Charitable Trusts 2015, States and Cities Try Smarter
Signals to
Reduce Red Lights. Available from:<
http://www.pewtrusts.org>.[12 October
2015].
4. Traffic Signal Sign, 2008, London.
5. Subramaniam, SK., Esro, M, & Aw, FL 2012, ‘Self-Algorithm
Traffic Light
Controllers for Heavily Congested Urban Route’ in WSEAS
Transactions on
Circuits and Systems, New York pp. 115-124.
6. Road Transport Act 2015, Laws of Malaysia. Available
from:
.[25 November 2015].
7. Dutta, R, 2013, Study of PLC and its Application in a Smart
Traffic Control
System. Bachelor thesis, National Institute of Technology
Rourkela.
8. Programmable Logic Controller, 2002.Available from:<
http://www.coe
.montana.edu>. [24 September 2015].
9. Transport Research Centre, 2007, Managing Urban Traffic
Congestion.
Available from: . [15 October 2015].
10. Wen, W 2008, ‘A Dynamic and Automatic Traffic Light Control
Expert
System for solving the Road Congestion problem’, Journal Expert
Systems
with Applications, vol. 34, pp. 2370-2381.
11. Rana, JG, Deshpande, RS, and Chavan, SS 2010, ‘Design of
Intelligent
Traffic Light Controller using Embedded System’, 2nd
International
-
73
Conference on Emerging Trend in Engineering and Technology,
Ahmednagar, India. pp. 1086-1091.
12. Ranjini, K, Kanthimathi, A, & Yasmine, Y 2011, ‘Design
of Adaptive Road
Traffic Control System through Unified Modelling Language’,
International
Journal of Computer Applications, vol. 14,no.1,pp. 36-41.
13. Khattak, MA 2011, ‘PLC Based Intelligent Traffic Control
System’,
International Journal of Electrical & Computer Sciences, pp.
69-72.
14. Lee, R, Lee, K, Quayle, S, Beaird, S, & Urbanik, T 2008,
Traffic Signal
Timing Manual, Texas Transportation Institute, Washington,
DC.
15. Alzubaidi, JA, & Hassan, AAMA 2014, ‘Design of Semi-
Automatic Traffic
Light Control System’, International Journal of Scientific &
Technology
Research, vol. 3, no. 10, pp.84-86.
16. NationStates 2012. Traffic Light in your Country. Available
from:<
http://forum.nationstates.net >.[05 May 2015].
17. Machine Operation System 2007. How PLCs Work. Available
from:. [23 June 2015].
18. Lashin, MM 2014, ‘Different Applications of Programmable
Logic
Controller (PLC)’, International Journal of Computer Science,
Engineering
and Information Technology, vol. 4, no. 1, pp. 27-32.
19. Wikipedia 2014, Traffic Light. Available from: . [10 June
2015].
20. Federal Highway Administration Research and Technology,
2015, Traffic
Detector: Available from:.[18 July 2015].
21. Ganiyu, RA, Arulogun, OT, & Okerdiran, OO 2014,
‘Development Of A
Microcontroller-Based Traffic Light System For Road Intersection
Control’,
International Journal of Scientific & Technology Research,
vol. 3, no. 5, pp.
209-212.
22. Mathew, TM 2014, Vehicle Actuated Signals, lecture notes
distributed in
Traffic Engineering And Management on 5 August 2014.
-
74
23. Traffic Light. Available from: . [18 March 2015].
24. Traffic Detector Handbook 2006, United States.
25. Kumar, GR, & Mohan, DSR 2009, ‘Work Stress for Traffic
Police in
Chennai City’, Journal of Contemporary Research in Management,
vol. 4,
no. 2, pp. 107-115.
26. Litman, T 2001, ‘Generated Traffic: Implications for
Transport Planning’,
International Journal of Transportation, vol. 71, no. 4, pp.
38-47.
27. Stress Reduction and Management. Available
from:. [17 July
2015].
28. Mahmud, K, Gope, K, & Chowdhury, SMR 2012, ‘Possible
Causes &
Solutions of Traffic Jam and Their Impact on the Economy of
Dhaka City’,
International of Management and Sustainability, vol. 2, no. 2,
pp. 112-135.
29. Traffic Congestion Greenhouse Gases 2009. Available
from:. [30 May 2015].
30. Matthew, B, & Kanok, B 2009, Real-World CO2 Impacts of
Traffic
Congestion, USA.
31. Omron Industrial Automation 2015, PLC Omron. Available
from:. [12 August 2015].
32. Programmable Logic Controller 2007. Available from:<
http://www.coe.montana.edu//ee/courses/ee/ee367/pdffiles/aamunrud.pdf%22
>. [04 June 2015].
33. Gary, D 2002, Introduction to Programmable Logic Controller,
2th edn,
United States of America.
34. Kalaiselvi, T, Praveena, R, Aakanksha, R, & Dhanya, S
2012, ‘PLC Based
Automatic Bottle Filling and Clapping System With User Defined
Volume
Selection’, International Journal of Emerging Technology and
Advanced
Engineering, vol. 2, no. 8, pp. 134-137.
-
75
35. Okoli, FI, Onubogu, JO, Okezei, CC, & Okorogu, VN 2013,
‘The Simulation
of the Control of an Industrial Mixer using PLC’, International
Journal of
Inventive Engineer and Sciences, vol. 1, no. 2, pp. 25-29.
36. Palash, KB 2012, ‘Automatic Operation and Control of Air
Compressor
System using PLC’, Proceedings of the 6th International
Mechanical
Engineering conference, pp. 5-8. Available from: Researchgate.
[05 April
2015].
37. Arduino 2015, What is Arduino?. Available from:
. [22 March 2015].
38. Sparkfun 2015, What is an Arduino?. Available from:
. [30 December
2015].
39. Introduction to the Arduino Board 2015. Available from:
.[21 November
2015].
40. The Making of Arduino, 2011. Available form:
.[17
October 2015].
41. Arduino 2015, Arduino product. Available from:
. [10 October 2015].
42. Atmel|Bits & Pieces (2015). Retrofitting an old air
conditioner with Arduino.
Retrieved From Atmel website:
http://blog.atmel.com/2015/06/12/
Retrofitting-an-old-air-conditioner-with-arduino/
43. Rubens, M. 2013, 24 April 2013. Rmau tech: Blog. Available
from:
. [26 September 2015].
44. Xia & Shao 2005, ‘Modelling of traffic flow and air
pollution emission with
application to Hong Kong Island’, Journal of Environmental
Modelling &
Software, vol. 20, no. 9, pp 1175-1188.
45. Stathopoulos, A, & Papatzikou, E 2014, An Optimization
method for
sustainable traffic control in Urban areas, Greece.
-
76
46. Ranjini, K, Kanthimathi, A, & Yasmine, Y 2011, ‘Design
of Adaptive Road
Traffic Control System through Unified Modelling Language’,
International
Journal of Computer Applications, vol.14, no.7, pp. 36-41.
47. Najmeh, M, Haghighian, R, Kuan, YW, & Masoud, RG 2013,
‘Modelling
and Simulation of a Bank Queing System’, 5th International
Conference on
Computational Intelligent, Modelling and Simulation, pp.
209-215. Available
from: ACM Portal: ACM Digital Libarary. [05 December 2015].