0% found this document useful (0 votes)
91 views4 pages

Smart Traffic Light Control System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views4 pages

Smart Traffic Light Control System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Smart Traffic Light Control System

Nicole Dı́az Jorge Guerra Juan Nicola


Facultad de Ingenierı́a Facultad de Ingenierı́a Facultad de Ingenierı́a
en Electricidad y Computación en Electricidad y Computación en Electricidad y Computación
Escuela Superior Politécnica del Litoral Escuela Superior Politécnica del Litoral Escuela Superior Politécnica del Litoral
Guayaquil, Ecuador Guayaquil, Ecuador Guayaquil, Ecuador
[email protected] [email protected] [email protected]

Abstract—This paper describes the design and implementation II. METHODOLOGY


of an autonomous traffic light system, with traffic-based timing
for improving traffic flow efficiency in urban roads. The A. City of study
importance of changing light timing lengths of current traffic According to the National Institute of Statistics and Cen-
lights to timing lengths that vary depending on the number of
suses[1], the province of Guayas, Ecuador, where our city of
vehicles in the avenues, and of how the proposed smart traffic
light system would help to constantly update these times of interest, Guayaquil, is located, has more tan 362.857 vehicles
automatic way is presented. To achieve this, an IoT system based on its streets in 2015, representing a 57% increase in respect
on the Raspberry Pi platform and PIR sensor will be designed, to 2010.
with expandability in mind, as the design for implementing
camera-related functions will be layed out. Table I
R EGISTERED CARS IN E CUADOR , 2015
Keywords— Traffic control system, Smart traffic lights, Rasp-
berry Pi, PIR sensor, Internet of Things.
Province Number of vehicles
Pichincha 492.568
I. INTRODUCTION Guayas 362.857
Manabı́ 152.231
Transportation is one of the fundamental anthropogenic
activities for the development of societies. Modern terrestrial
transportation is achieved thanks to all types of vehicles such According to the information shown in Table 1, we note
as cars, motorcycles, bicycles or public transport. The use that, as of 2015, Guayas is the province with the second-
of these is subject to rules or regulations established by the highest number of registered vehicles, bringing a number of
government institutions based on the place where they are issues, particularly traffic congestion. Traffic lights have been
located. Traffic regulations were designed with the aim of implemented around the world since 1868 to try to mitigate
safeguarding the life and integrity of people whether they are this problem, with the most representative implementations
drivers or pedestrians, as well as organizing and controlling shown below:
pedestrian traffic. Traffic Lights are common devices which
used to control the flow of traffic, as well as providing B. Traffic congestion
pedestrians a safe way to cross streets. However, traffic lights Traffic congestion is a condition on transport networks that
are not perfect and the may cause additional delays in traffic. occurs as use increases, and is characterized by slower speeds,
longer trip times, and increased vehicular queuing. When
A. Justification traffic demand is great enough that the interaction between
Due to the exponential growth of ground travel, the number vehicles slows the speed of the traffic stream, this results in
of cars traveling on each street is increasing. Considering that some congestion.
traffic lights installed on different roadways were configured
to handle a fixed amount of traffic, it it clear that they do C. Traffic lights as traffic control devices
not adequately serve modern day traffic loads. This is because In recent years, technology has constantly evolved, bringing
the light timing lenghts that were initially programmed are improvements to people’s lives. Traffic control is one example
not efficient enough to handle today’s traffic patterns. Light of that. Traffic lights were designed with gas-based lightning,
timing lengths should be dinamically updated in response to but it did not take too long for it to become a fully electrical
live traffic loads. In this paper, we will propose the use of system. Nowadays, conventional traffic lights are LED-based,
Smart traffic lights that do so, depending on the number of due to its low energy requirements [2]. The 3 colors that signal
vehicles located near each intersection where traffic lights are the right of way allocated to users follow a universal color
located. code:
978-1-5386-6657-9/18/$31.00 c 2018 IEEE

Authorized licensed use limited to: Ontario Tech University. Downloaded on July 11,2024 at 16:08:46 UTC from IEEE Xplore. Restrictions apply.
• Red: Forbids passing of vehicular traffic and permits The Raspberry Pi 2 microcontroller handles the LED light-
pedestrian crossing. Lasts between 28 to 40 seconds. ing of the traffic light according to the times previously
• Amber: Warns that the light is about to change from green set with Python code. Depending on the output of the Pir
to red. Lasts between 2 to 5 seconds. motion detector sensor which, when detecting the infrared
• Green: Allows vehicular traffic to pass and indicates radiation change through its line of sight, sends a HIGH to the
and forbids pedestrian crossing. Lasts between 28 to 40 microcontroller. On the PCB board all the red-colored LEDs
seconds. are solded in parallel. They will flash when the traffic light
This system has prevailed since its introduction, due to changes from red to green. The common cathod RGB LED
its relatively low cost. Guayaquil is a city still maintains display, solded in parallel on the PCB board, consists of 4
traditional traffic lights. Traffic congestion is generated at terminals. The longest terminal corresponds to the common
intersections due to the waiting times for each way. The cathod while the other 3 terminals correspond to the emission
system described below will solve this problem, dynamically of red, green light and blue respectively. The microcontroller
allocating time to each way according to the realtime traffic will send PWM signals to each of these terminals and depend-
situation. ing on the work cycle that is applied to the PWM signal of
Traffic lights color timing shouldn’t be fixed, but allocated each terminal, the RGB LED of a will light up with the correct
dynamically following some variables such as actual traffic color. A resistance of 100 ohms was used for each terminal
flow, average speed of crossing, distance between vehicles, per color of the RGB LED display, to avoid excess current
etc. Taking this into account, a more useful light timing could that could burn these components. To connect the components
be determined and thus avoiding excess vehicles queuing at of the PCB with the Raspberry, a 40-pin data bus welded on
intersections for an extended period of time. The system the PCB was used. On this bus, the male-female jumpers are
proposed will build on realtime traffic data collected on-site, to connected to the Raspberry Pi 2.
achieve the installation of “Smart” traffic light on city streets.
IV. D ESIGN OF P ROPOSAL
D. Communication technologies in IoT In Guayaquil, one-sided traffic lights are ubiquitous. They
Automation is one of the main growth areas of technology, normally consist of 3 lenses, however there are traffic lights
due to the constant increase in industrial production. In the vast that have up to 4 faces due to the number of intersections.
majority of automation developments, the Internet is essential The traffic control system described in this paper, in addition
for their operation. to having additional functions and actions to the traditional
Sensors and actuators are fundamental components of IoT traffic lights.
applications, because information is constantly obtained to be
processed, stored or sent to other devices through wireless
networks. [3].
Large number of devices are connected to the Internet, via
TCP/IP. This model can be used for large networks, like the
Internet, or small ones like a personal area network. However,
energy consumption varies per application. [4]
The aforementioned project is based on the application of
IoT design principles: a motion sensor is at the heart of
the solution. It measures the infrared light radiated from the
objects located in its field of vision [5], which in this case
are the vehicles. Through the TCP/IP protocol, the traffic
lights communicate with each other, and with the information
obtained by the PIR sensor, the behavior of the traffic lights
is determined, as it will be explained in this article.

III. D ESIGN & I MPLEMENTATION


For the development of this project, we made use of the Figure 1. Traffic light
following parts:
• Raspberry Pi 2 Model B The design that shows in the Figure 1 proposes the use
• 5 mm red-color LED of 1 lens consisting of a single circumference of RGB LEDs
• 40-pin data bus that varies their color according to the traffic color codes (red,
• 3 ohms resistor amber, or green)[6]. The center of the lens displays the number
• Common cathod RGB LED display of seconds remaining in its current state, before a transition
• PCB from red to green happens, with the purpose of accelerating
• PIR motion detector sensor traffic flow.

Authorized licensed use limited to: Ontario Tech University. Downloaded on July 11,2024 at 16:08:46 UTC from IEEE Xplore. Restrictions apply.
This design also incorporates a bar of red LEDs that indicate tested with two traffic lights that communicate with each other
the countdown of the completion of the waiting stage of the connected to the same network either by ethernet cable or with
vehicles, which is signaled as a red traffic light. This design a wifi module. When the traffic light 1, in red, detects the
will also have a PIR sensor, which will be located towards the arrival of a vehicle through the PIR sensor, it sends a message
vehicles that pass in the street controlled by that traffic light. to the traffic light 2, in green, indicating that it finishes its
The functionality of the system is described below: time and goes to yellow to later be red, while the traffic
• The traffic light initially operates like any other traffic light 1 starts a countdown through the array of LEDs and
light, with usual fixed times for each state. the indicator of the red LED bar. Upon ending the red light
• At an intersection of two traffic lights, both are constantly of traffic light 1, it sends another message to traffic light 2 to
communicating with each other as they are connected to tell it to turn yellow and then red, while traffic light 1 turns
the same network. green, with the respective delays necessary to avoid accidents.
• Each traffic light receives information from the corre- All of these times can be configured by programming in
sponding PIR sensors, during the normal operation of the Python according to the needs of each intersection. All this
traffic light. was achieved successfully through the first prototype and for
• When the PIR Sensor of a traffic light captures a vehicle, the next prototype it is expected to implement artificial vision
it transmits a message to the other traffic light, making it and achieve correct vehicle counting.
change its state to red. The traffic light that captured the The prototype that has been built consists of several parts:
car and sent the message proceeds to change its state to PCB, Circuit Schematic, Python Code and Basic design of the
green. traffic light housing.
• Each traffic light has a minimum duration of green state,
that is, if the other traffic light receives a vehicle through
its way, but the traffic light that is in green state has not
yet elapsed its minimum time, the other traffic light will
have to wait that minimum time for changing its color
and it will not do so instantaneously.
• While a traffic light is in red, the matrix of red LEDs
display the number of remaining seconds before changing
to green.
• With the design of this system there are a number of pos-
sibilities regarding the operation of the LED Matrix that
can be configured according to the needs or preferences
desired by the customer, or the intersection in which it
will be placed.
V. C AMERA SYSTEM
The PIR sensors will be replaced by video cameras as
initially planned [7], which will process the images with the
Figure 2. Prototype
OpenCV open source library using Python to determine the
number of vehicles, speed, distance between vehicles, and
other important variables [8]. Thanks to this, the traffic lights A. PCB design
in turn will generate data-based statistical reports, so that the The components were layed out in the PCB in a cyclops-
colors of the traffic lights will be dinamically set. In this type form traffic light with a 5x7 array of leds at its center
way the traffic lights will be set up with the best timing to write 2-digit numbers and different shapes and symbols
based on data for each time slot per weekday. Additionally, such as X, seen, circle, ”ok” , among others. These forms are
image recognition function will be added to capture the license configurable in Python code. Below the circle of LEDs is the
plates of the vehicles circulating in the traffic light location, bar of red LEDs. The plate was printed on both sides. The
and also to be able to determine which vehicles violate dimensions of the plate are 145mm x 105mm. The diameter
traffic laws either by passing the Red, speeding, or any other of the semaphore circle is 100 mm. The LED bar is 12.5mm
contravention. x 60mm.
VI. R ESULTS B. Design in PCB
This first prototype of the intelligent traffic light manages to The circuit basically consists of the connection between the
speed up the intersections in which one avenue is not transiting Raspberry GPIOs to the female data bus soldered on-board, in
vehicles in a moment of time while in the other street there such a way that the Raspberry feeds the RGB LEDs which are
are cars waiting, since when not detecting vehicles in the first, connected in parallel. The LED bar is powered with a single
it automatically gives way to the second. The operation was GPIO. The color displayed is controlled by the PWM pulses

Authorized licensed use limited to: Ontario Tech University. Downloaded on July 11,2024 at 16:08:46 UTC from IEEE Xplore. Restrictions apply.
timing of each color, delay times between colors, IP address of
each traffic light, count to be made in the array of LEDs, must
be previously configured in a user-friendly interface. All this
is easy to configure thanks to the distribution by functions of
the programming which is commented for easy understanding.

Figure 5. Lighting

Figure 3. Design in PCB D. Case basic design


The case of the traffic lights was made with white acrylic
sent to the RGB LEDs. In this prototype we used a common and molded by a heat gun, in such a way that the shapes
resistance of 330 ohms for each color of the RGB, that is, 3 presented in Figure 5 were obtained.
resistors. This is not ideal since with this configuration a lower VII. CONCLUSIONS
intensity in the LEDs is achieved. In the next prototype this
will be improved. This article serves as a foundation for a larger project
involving total traffic control automation using the intelligent
traffic lights. This first prototype as shown which will be
enhanced with more functions and improving it over time to
meet traffic demands. Some of the functions that will be added
to the future in this project is the vehicle counting by artificial
vision with Raspberry Pi and OpenCV, detection of vehicle
plates, detection of vehicle speeds and sending data obtained
by traffic lights to the cloud.
R EFERENCES
[1] El Telégrafo, ”INEC: parque automotor de Ecuador creció 57% en 5
años”, 2016.
[2] V. Valencia Alaix, ”Principios sobre Semáforos”, PhD, Universidad
Politécnica de Valencia, 2000.
[3] A. González Garcı́a, ”IoT: Dispositivos, tecnologı́as de transporte y
aplicaciones”, Msc, Universitat Oberta de Catalunya, 2017.
[4] J. K. and A. Desai, ”IoT: Networking Technologies and Research
Challenges”, International Journal of Computer Applications, vol. 154,
no. 7, pp. 1-6, 2016.
[5] ”Application of Raspberry Pi and PIR Sensor for Monitoring of Smart
Surveillance System”, International Journal of Science and Research
(IJSR), vol. 5, no. 2, pp. 736-737, 2016.
[6] K. Choi, ”Visible Light Communication with Color and Brightness
Control of RGB LEDs”, ETRI Journal, vol. 35, no. 5, pp. 927-930,
2013.
Figure 4. Schematic of the device. [7] P. N R, ”Smart pi cam based Internet of things for motion detection using
Raspberry pi”, International Journal Of Engineering And Computer
Science, 2016.
[8] B. Gupta, A. Chaube, A. Negi and U. Goel, ”Study on Object Detection
C. Python Code using Open CV - Python”, International Journal of Computer Applica-
The Raspberry was programmed using the Python. At the tions, vol. 162, no. 8, pp. 17-21, 2017.
time when the traffic lights are installed at the intersections, the

Authorized licensed use limited to: Ontario Tech University. Downloaded on July 11,2024 at 16:08:46 UTC from IEEE Xplore. Restrictions apply.

You might also like