0% found this document useful (0 votes)
317 views

Simulation of N-Way Traffic Lights Using Arduino Uno Environment

Traffic is a major challenge in many cities in the world today. In many instances traffic flow is dictated by certain devices such as traffic lights. Traffic lights have become an integral part of human day-to-day life. This work focuses on the simulation of traffic light system with a microcontroller programmed on the Arduino Uno board. This system was designed to handle road traffic control as well as assisting pedestrians to move freely without auto crashes. The traffic lights simulation system was implemented using an Arduino Uno microprocessor connected to electronic circuit board. The programming platform for the simulation of the traffic light system was done using C++ programming language while the electronic circuit used was designed with some semiconductor components such as transistors, microprocessor, resistors and light emitting diodes (LEDs) to achieve optimal performance of the traffic lights.

Uploaded by

ATS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
317 views

Simulation of N-Way Traffic Lights Using Arduino Uno Environment

Traffic is a major challenge in many cities in the world today. In many instances traffic flow is dictated by certain devices such as traffic lights. Traffic lights have become an integral part of human day-to-day life. This work focuses on the simulation of traffic light system with a microcontroller programmed on the Arduino Uno board. This system was designed to handle road traffic control as well as assisting pedestrians to move freely without auto crashes. The traffic lights simulation system was implemented using an Arduino Uno microprocessor connected to electronic circuit board. The programming platform for the simulation of the traffic light system was done using C++ programming language while the electronic circuit used was designed with some semiconductor components such as transistors, microprocessor, resistors and light emitting diodes (LEDs) to achieve optimal performance of the traffic lights.

Uploaded by

ATS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

International Journal of Computer Applications Technology and Research

Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656

Simulation of N-Way Traffic Lights Using Arduino


Uno Environment
Ogwo Eme
Department of
Computer Science,
Akanu Ibiam Federal
Polytechnic Unwana,
Ebonyi State, Nigeria

Chibuike .E.
Madubuike
Department of
Computer Science,
Akanu Ibiam Federal
Polytechnic, Unwana,
Ebonyi State, Nigeria

Joseph .O. Idemudia


Department of
Computer Science,
Akanu Ibiam Federal
Polytechnic Unwana,
Ebonyi State, Nigeria

Akaninyene Udo
Ntuen
Department of
Computer Science,
Akanu Ibiam Federal
Polytechnic
Unwana,Ebonyi State,
Nigeria

Abstract: Traffic is a major challenge in many cities in the world today. In many instances traffic flow is dictated by certain
devices such as traffic lights. Traffic lights have become an integral part of human day-to-day life. This work focuses on
the simulation of traffic light system with a microcontroller programmed on the Arduino Uno board. This system was
designed to handle road traffic control as well as assisting pedestrians to move freely without auto crashes. The traffic lights
simulation system was implemented using an Arduino Uno microprocessor connected to electronic circuit board. The
programming platform for the simulation of the traffic light system was done using C++ programming language while the
electronic circuit used was designed with some semiconductor components such as transistors, microprocessor, resistors
and light emitting diodes (LEDs) to achieve optimal performance of the traffic lights.
Keywords: Embedded System, Light Emitting Diode (LED), Microcontroller, Simulation, Traffic Light.

1.0 INTRODUCTION
The tremendous increase of the number of vehicles on our
roads and the over-whelming array of pedestrians on road
side ways call for great concern. The numerous avoidable
accidents at intersections be it T-junction or 4-way-junction
is acknowledged not only by government but also other
users of the roads. This situation calls for remedy or
assistance of some sort not only to save lives but also to
ensure orderliness in our everyday life. Electronic devices,
which can do services round the clock, throughout the
whole season of the year, are call to play this indispensable
role.

road users by displaying lights of a standard color (red,


yellow/amber, and green) following a universal color code.
In the typical sequence of color phases:

Traffic is a problem in many urban areas worldwide. In


more civilized cities, traffic flows are mostly dictated by
certain devices such as traffic lights. These traffic lights are
often held on poles at intersections of road.
Furthermore traffic light has become an integral part of
human day to day life. With the advancement in
semiconductors technology and a parallel rise in innovation,
embedded technology has brought about a lot of change in
lighting engineering. With this motivation in mind, this
work aims at designing and implementing a running model
of traffic light controller which will help to control the
density of vehicular movements on the road.
Traffic lights - also known as traffic signals, traffic lamps,
traffic semaphore, signal lights, stop lights, and (in technical
parlance) traffic control signals- as signaling devices
positioned at road intersections, pedestrian crossings, and
other locations to control flows of traffic [1]. Traffic lights
alternate the right of way accorded to

www.ijcat.com

The green light allows traffic to proceed in the


direction denoted, if it is safe to do so and there is
room on the other side of the intersection.
The amber (yellow) light warns that the signal is
about to change to red. In a number of countries
among them the United Kingdom a phase
during which red and amber are displayed
together indicates that the signal is about to
change to green. Actions required by drivers on
an amber light vary, with some jurisdictions
requiring drivers to stop if it is safe to do so, and
others allowing drivers to go through the
intersection if safe to do so.
A flashing yellow indication is a warning signal.
In the United Kingdom, a flashing amber light is
used only at pelican crossings, in place of the
combined redamber signal, and indicates that
drivers may pass if no pedestrians are on the
crossing.
The red signal prohibits any traffic from
proceeding.
A flashing red indication is treated as a stop sign.

In some countries traffic signals will go into a flashing mode


if the controller detects a problem, such as a program that
tries to display green lights to conflicting traffic. The signal
may display flashing yellow to the main road and flashing
red to the side road, or flashing red in all directions. Flashing
operation can also be used during times of day when traffic

543

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656
is light, such as late at night. This is the case in many
American States [2].

engineers learned rapidly to pay careful attention to


ergonomics, the interface between people and machines.

This work focuses on the simulation of traffic light system


with a microcontroller programmed on the Arduino Uno
board. This system was designed to handle road traffic
control as well as assisting pedestrians to move freely
without auto crashes. The traffic lights simulation system
was implemented using an Arduino Uno microprocessor
connected to electronic circuit board.

Reference [6], advocated for the use of clever traffic light as


a solution for traffic control for pedestrian crossing.
According to them the sequence of switching signals of
usual traffic light simplistically may be represented in the
following ways:
drivers go;
both (drivers and foot-passengers) wait;
foot-passengers go;
both (drivers and foot-passengers) wait;
repeating cycle.

2.0
REVIEW
LITERATURE

OF

RELATED

This section discusses related literature and contributions of


other authors as it relates to the topic under consideration.
The first electric traffic light was developed in 1912 by
Lester Wire, a policeman in Salt Lake City, Utah, who also
used red-green lights. On 5 August 1914, the American
Traffic Signal Company installed a traffic signal system on
the corner of East 105th Street and Euclid Avenue in
Cleveland, Ohio [3]. It had two colors, red and green, and a
buzzer, based on the design of James Hoge, to provide a
warning for color changes. The design by James Hoge
allowed police and fire stations to control the signals in case
of emergency. The first four-way, three-color traffic light
was created by police officer William Potts in Detroit,
Michigan in 1920.
Los Angeles installed its first automated traffic signals in
October 1920 at five locations on Broadway. These early
signals, manufactured by the Acme Traffic Signal Co.,
paired Stop and Go semaphore arms with small red and
green lights. Bells played the role of today's amber or yellow
lights, ringing when the flags changeda process that took
five seconds. By 1923 the city had installed 31 Acme traffic
control devices. The Acme semaphore traffic lights were
often used in Warner Bros. Looney Tunes and Merrie
Melodies cartoons for comedic effect due to their loud bell
[4].
According to [5], the first interconnected traffic signal
system was installed in Salt Lake City in 1917, with six
connected intersections controlled simultaneously from a
manual switch. Automatic control of interconnected traffic
lights was introduced March 1922 in Houston, Texas.
According to [1], traffic control systems are the most visible
element of the urban infrastructure. They are not just
physical systems like telephones or sewers or streets,
although their technological elements, traffic lights, signs,
and painted pavements, fit that description. Rather, they are
systems that attempt to impose a strong social control over
the most fundamental of human behaviors, whether to move
or be still. Traffic engineers must control police, drivers,
and pedestrians. For most other elements of the urban
infrastructure, controlling the behavior of users did not
constitute the primary goal of designers. For traffic
engineers, understanding and manipulating the behavioral
patterns of drivers and pedestrians (a group that included not
just walkers, but people using the street for play, social
gatherings, and commerce) proved to be a more important
problem than the control mechanisms themselves. Traffic

www.ijcat.com

Clever traffic-light works not in the least like that its


possession of information about cars on the road and footpassengers on pedestrian crossing. In presence of some footpassengers and cars, traffic-light works like common
traffic-light. If there are no cars, but foot-passengers are
waiting on pedestrian crossing, it will indicate the green
light for the pedestrian until at least one car appears, and
vice versa. If there is neither car no foot-passengers, green
light will be indicated for cars because they need more time
to slow down and to pick up speed to continue the motion.
Reference [7] viewed optics and lighting as traditionally
incandescent and observed that halogen bulbs where used in
constructing traffic light. Because of the low efficiency of
the light output and a single point of failure (Filament
burnout) municipalities are increasing retrofitting traffic
signals with LED arrays. Unlike incandescent and halogen
bulbs, which generally get hot energy and melt, LEDs
consume less power which have increased light output and
in the event of an individual LED failure, still operate with
a reduced light output. With the used of optics, the light
pattern of LED array can be comparable to the pattern of an
incandescent or halogen bulb.
According to [8], the conventional light system such as
traffic signal lighting which is still common in some areas,
utilizes a standard light bulb typically 67 watts, 69 watts or
115 watts medium-based light bulbs (house hold lamp in the
US). Light bulb provides the illumination light then bounces
off a mirrored glass or polished aluminum reflector bowl,
and out through a polycarbonate plastic or glass signal lens.
In some signals, these lenses were cut to include a specific
refracting pattern. Crouse-Hinds is one notable company for
this practice between the 1930s and 1950s, they utilized a
beaded prismatic lens with a Smiley pattern embossed
into the bottom of each lens.
Traffic light design in the United States, that traffic lights
are currently designed with lights approximately 12 inches
(300mm) in diameter. Previously the standard has been
8inches (200mm), however, those are slowly being out in
favor of the larger and more-visible 12inch lights.
Variations used have also include a hybrid design which had
one or more 12inch light alone with one or more lights of
8inch (200mm) on the same light for example, those 12-88 (along with 8-8-8) light are standard in most jurisdictions
in Ontario, Manitoba and British Columbia (i.e., the red
light is 12 and others 8, making the read more prominent)
[9].
It had been observed that as technological advancement
with technologies in developed countries continuing to

544

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656
advance, there is now an increasing move to develop and
implement smart traffic light on the roads. These are
basically intelligent systems that try to communicate with
cars to alert drivers of impending light changes and reduce
motorists waiting time considerably. Trails are currently
being conducted for the implementation of these advanced
traffic light but there are still many hurdles to widespread
use that need to be address, one of the fact that not a lot of
cars yet have the required system to communicate
intelligently with these lights [10].
A microcontroller (abbreviated with C or MCU) is a small
computer on a single integrated circuit containing a
processor core, memory and programmable input and
output peripherals. The program memory in the form of
NOR flash or EPROM is also included on the chip, as well

as a typically small amount of RAM. Microcontroller is


designed for embedded application, in contrast to the
microprocessor used in personal computers or other general
purpose applications. Microcontrollers are used in
automatically controlled products and devices, such as
automobile engine control system, implantable medical
devices, remote controls, office machines electronic
appliances, power tools, toys and other embedded systems.
By reducing the size and cost compared to a design that use
a separate microprocessor, memory input and output
devices, microcontrollers make it economical to digitally
control even more devices and processes. Mixed signal
microcontrollers are common integrating analog
components needed to control non-digital electronic system
[11].

.
Fig.1: Block Diagram of a microcontroller
Source: [12]

As advancement in embedded systems and microcontroller


continues to improve the existing road traffic system, it has
become imperative for different regions and countries to
develop their low cost indigenous system which will support
their local traffic policy and will be easy to maintain. The need
to integrate local content in traffic light system has necessitated
this Arduino uno microcontroller based traffic light simulation.

3.0

METHODOLOGY

In this work, Arduino Uno microcontroller was used to


simulate the flow of signals in the traffic light. Arduino, in

www.ijcat.com

general is an open source platform targeting hobbyists. An open


source is a method where the developers of a
software/hardware give the end user access to their end
products design and implementation. This means that the end
users have right to modify/change the way the software
looks/works and redistribute it. Examples of open source
software are Linux operating system, free PBC, and open BSD
etc. Furthermore, Arduino is an open source hardware and
software platform which uses Atmel microcontroller as core
hardware component and C or C++ as core software language
and which is used to control LEDs, motors, displays and any
hobby projects.

545

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656

Fig.2: Pin Diagram of an Arduino Uno Board


Source: [13]

Starting clockwise from the top center:

Analog Reference pin (orange)


Digital Ground (light green)
Digital Pins 2-13 (green)
Digital Pins 0-1/Serial In/Out - TX/RX (dark green)
- These pins cannot be used for digital i/o
(digitalRead and digitalWrite) if you are also using
serial communication (e.g. Serial.begin).
Reset Button - S1 (dark blue)
In-circuit Serial Programmer (blue-green)
Analog In Pins 0-5 (light blue)
Power and Ground Pins (power: orange, grounds:
light orange)
External Power Supply In (9-12VDC) - X1 (pink)
Toggles External Power and USB Power (place
jumper on two pins closest to desired supply) - SV1
(purple)
USB (used for uploading sketches to the board and
for serial communication between the board and the
computer; can be used to power the board) (yellow)

A red, yellow and green LED.


A breadboard.
Resistors for the LEDs (220 Ohms).
Connecting wires.
A pushbutton switch.
A high value resistor (10k).

The output terminal can either be the source or the sink current.
The maximum sink or source current is about 40MA. The high
output is about 0.5v below Vcc while the low output voltage is
about 0.1V about ground for load current below 25mA. The
positive voltage supply terminal can take any voltage between
+5v and +18v.

4.0 SYSTEM DESIGN


This is aimed at producing a specification that will enable the
controller to keep accurate implementation of the new system.
The design is based on the simulation of a workable traffic light
control system using an Arduino Uno Microcontroller as
illustrated by the schematic diagram in Fig. 2.

4.1

Input Design

The Arduino software consists of two parts: Arduino BootLoader and Arduino IDE. Arduino Boot-Loader is a piece of
code residing inside the microcontroller which make the
controller special and gives it the power of integration to the
Arduino IDE and the Arduino board. The Arduino IDE has a
compiler, serial monitor etc. Arduino language is a variant of
C++ at least it looks like C++ Programs.

The input to the system is through sending of digital signals in


the Arduino IDE. This is done by implementing digital write
and the delay of signals using the delay time in milli-seconds
since the Arduino understands this. Therefore, the Green was
delay for 30,000ms (i.e 15s), then the yellow will blink for about
five times each in 250ms (i.e. 0.25s) which will display at the
N- cross Intersection.

Apart from the basic Arduino, other tools that were used
include:

The Assembly was done by programming the Arduino board


which is used to display the LEDs at each function. The LEDs
were soldered on a PBC which are hung on the plastic with
connectors passing through to the Arduino output pins.

www.ijcat.com

546

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656

Fig.3: The schematic design of the Arduino uno microcontroller traffic system

4.2

Simulation of the Traffic Light LEDs

For purpose of the design, the display panel is made up of Light


Emitting Diodes (LEDS). The display is used to indicate the
status of the decoded counter and for performing the purpose
for which it is meant to perform i.e. controlling the movement
of traffic. Each status of the display contains three LEDs. Each
lane has one status facing it, the RED indicting STOP the
yellow means READY and the Green means MOVE or
GO.
The duration of the various sections of the simulated traffic
lights was done through the programming of the Arduino Uno
embedded microprocessor using C++ programming language.
The sample codes below show the sample source codes for the
LEDs of the traffic lights.

www.ijcat.com

547

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656

4.3

Results of the Simulation

After the assembling of the various components and the


programming of the microcontroller traffic light control
system, the following results were achieved:
(1)
Automatic ON and OFF operation of the traffic light
at the specified time
(2)
Movement assignment to the busiest lane.
The performance evaluation of the traffic system was
carried out, the model testing was performed at different
occasions of light changing and the results below were
achieved.
Initial time of operation of all the lanes = 550000ms
(i.e. 65 seconds)
Red duration
=15,000ms
Yellowing duration of blinking ten times
each of = 10,000ms
Green duration
=30,000ms

1
=
ON
0
=
OFF
Key: R = Red, Y = Yellow, G = Green, N = North, E = East,
W = West

Table 1: North Lane evaluation


N

Fig.4: North Lane evaluation

Table 2: West lane evaluation

Fig.5: East lane evaluation


Table 3: East lane evaluation

Fig.6: East lane evaluation

Table 4: Pedestrians lane of evaluation


N

Fig.7: Pedestrians lane of evaluation

www.ijcat.com

548

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656

Fig.8: Output stand from the east (stand three)

Fig. 9: Output view from the north (stand one)

5.0 CONCLUSION
This work showed the practical application of simulation of
traffic lights to improve traffic conditions. Traffic is a
challenge in many cities of the world. Traffic flow is dictated
by certain devices such as traffic lights. These traffic lights
signal when each lane is able to pass through the intersection.
The purpose of this work was to find a way to make
intersections to be easily controlled with traffic lights. This
goal was accomplished through the simulation of traffic lights
using Arduino Uno environment and programmed with C++

www.ijcat.com

programming language. From the design and construction of a


simulated N-way traffic light controller carried out in the
course of this work, it is obvious that such a system which if
fully implemented will reduce the human stress of standing
under favourable or unfavourable weather condition and
controlling the movement of vehicles and pedestrians at N-way
traffic intersections. Generally, this work also encourages the
producing of an indigenous traffic control system which is easy
to maintain,affodable and efficient in operation.

549

International Journal of Computer Applications Technology and Research


Volume 5 Issue 8, 543 - 550, 2016, ISSN:- 23198656

REFERENCES
[1]

Mcshane, C (1999). The Origins and Globalization of


Traffic Control Signals, Journal of Urban History /
March,
1999.
Retrieved
from
http://sites.tufts.edu/carscultureplace2010/files/2010/0
9/McShane-traffic-signals-1999.pdf

[2]

Anonymous (2014). Driving In America. Retrieved


from http://whatisusa.info/driving-in-america/

[3]

Bellis, M (2014). "The History of Roads and Asphalt".


Retrieved
from
http://inventors.about.com/od/rstartinventions/a/Histor
y-Of-Roads.htm

[4]

Masters, N (2013). CityDig: Should I Stop or Should I


Go? Early Traffic Signals in Los Angeles, Los
Angeles Magazine.

[5]

Robert L., Gordon, P.E and Warren Tighe, P.E (2005).


Traffic Control Systems Handbook,Office of
Transportation Management Federal Highway
Administration Room 3404 HOTM 400 Seventh
Street Washington, D.C. 20590.

[6]

Magomedov, T. G and Ostrovskiy, A. B (2006).


Simulation of Smart Traffic Lights, Saint-Petersburg
State University of Information Technologies,
Mechanics and Optics Computer Technologies
Department.

[7]

Ferando, E. (2009). Microcontrollers Fundamentals


and Applications, New York: CRC Press & Francis
Group.

[8]

Greenfield, J. (2000). Digital Design using Integrated


Circuits, New York: Willey and Sons Incorporation.

[9]

Mehta, V. (2008). Principles of Electronics. New


Delhi: Chand Company.

[10]

Morris, M. (2007). Digital Logic and Computer


Design, New Delhi: Practice Hall of India.

[11]

Mayank (2011). Getting Started, Microcontrollers,


http://maxembedded.com/2011/06/mcu-vs-mpu/

[12]

http://maxembedded.com/2011/06/mcu-vs-mpu/

[13]

https://www.arduino.cc/en/Reference/Board

www.ijcat.com

550

You might also like