You are on page 1of 8

An Automated Zebra Crossing using Arduino-UNO

Abstract— In many underdeveloped and developing countries, the custom and laws of
crossing the roads are not very strict, in which case an automated road crossing system is much
needed. Besides, the amount of risk being taken every other day around us, only makes the case
for an automated zebra crossing system stronger. This paper presents a cost effective and easy
solution to this problem using a simple system based on Arduino- UNO. The system is entirely
autonomous and can effectively measure the parameters expected of an Automated Zebra
Crossing system. Measurements of the parameters required in the system has been done by
ultrasonic sensors, and the experiments done on the system show that it has a chance of being
outsmarted 1 out of 200 times, which is an efficiency rate close to 99.5%.

Keywords— Arduino; Ultrasonic Sensor; Electrical Devices; Sonar; Servo Motor;


Automated Zebra Crossing, LED.

1. INTRODUCTION

In the 21st century, traffic control systems all over the world are becoming more and more
technology oriented and the development of such technology has reached the point of
automation. That being said, the automation process is only limited to the already developed
countries or to some developing countries. Although technology based, many developing and
underdeveloped countries still rely a tremendous amount on the physical and tactical services of
the traffic management officials. It goes without saying that the task of orienting and managing
traffic can be extremely bleak and hard for a human being to focus on 24/7 and should be
managed by automatic systems to get the best output. It is also necessary to mention that the
traffic systems of the latter mentioned countries fail to commit people to the laws and customs
of traffic, especially road crossing. Bangladesh is one of the most reliable example of people’s
apathetic behavior towards following traffic rules.
Other than the fact that people are unwilling to abide by the rules, it should also be noticed
that crossing roads at random is risky and may result in untimely and accidental deaths. So, to
bring forward a simple solution to this day-to-day and controvertibly burning question, this
paper presents an automated system, that takes in some valuable parameter to calculate the
necessity and frequency of a zebra crossing to be active and inactive [2]. For the system to be
cost effective and easy to build and maintain, Arduino-UNO and ultrasonic sensors have been
used. Ultrasonic sensors take in the measurement required for the system to understand the
number of people that need to cross at a particular time and the Arduino processor calculates
this measurement alongside other important parameters, such as, time, characteristics of the
road etc. The proposed system is very easy to install and is very cheap, and this point is
accented because it is proposed especially for underdeveloped and developing countries with
low budget on hand to walk on the path of automation in traffic control system.
The rest of the paper is organized as follows: Section II describes the background study
behind the realization of this project. Section III gives an overall idea of the proposed model
and the components used. Section IV details the prototype structure, how it was implemented
and how the entire system functions, and finally section V concludes the paper.

2. Literature Review
The area of automation in traffic control systems has been significantly explored throughout the
years. One significant such work has been done back in 2013; the system had the capability to
check for violation of traffic rules committed by vehicles, especially how vehicles are not
supposed to cross the zebra crossing mark when the red light is on [3]. Works on disabled
individuals, especially blind travelers have also been done in some of the works where the
automations main target was to develop a system that was safe for people like them [4]. Similar
work has been done for blind people using bipolarity segmentation and projective invariant
based recognition [5]. Most of the works done with embedded systems have followed some sort
of genetic algorithms, and genetic algorithms are thought to be the next evolution of programs .
Road traffic monitoring has indeed been a very touched topic in statistical computing work
and has been one of the inspirations of this paper. But, what inspired the most is the work of
automatically identifying inaccessible sidewalks using Google street view.

3. PROPOSED MODEL
Prior to implementation in a real life scenario, the proposed system had to be properly scaled
in order for the system to give out the perfect output in a controlled environment. For the
prototype that has been developed for the showcasing of the capabilities and potential of the
system, a miniature model has been created. Fig. 1 shows the outlining block diagram of the
system.

Fig. 1. Block Diagram of the System


For the prototype model of Automated Zebra Crossing system Arduino-UNO (R3) has been
used as the computational device and for input and output the following devices have been
used: Two HC-SR04 Ultrasonic Sensors, One SG90 Micro Servo, several LED Lights, Male-
Female Jumper Wires and a Standard Breadboard. Below is a short description of the important
modules used in the system.
Arduino is an open-source hardware which has many important and easy to implement
functionalities. There are several versions of Arduino, such as Arduino-Mega, Arduino- Uno.
It was a rather easy decision when it came to the question of choosing the type of Arduino for
the project. Arduino-UNO can store 32KB of flash memory onto it, which can be easily kept
track via the open source IDE used for implementing the software instructions onto the SRAM
of it. The IDE can be easily downloaded from the arduino.cc website and which makes the
manipulation of the system much easier using an Arduino as a computational device for the
project. The Arduino-UNO board has 14 advanced input/output pins (of which 6 might be
utilized as PMW outputs), 6 simple inputs, an USB connection, an energy jack and a reset
catch [9]. It has all the components required for a simple system to develop. The Arduino-
UNO can be powered through the USB link via a PC or a Laptop, or can be plugged onto a
batter using an AC- to-DC connector The ultrasonic sensor is one of our main components and
serves wonderfully to provide perfect input data to measure the required parameter for our
system. The sensor model that we used, basically use an ultrasonic sound to measure a
distance or depth like a bat would do. It has an ultrasonic transmitter and a receiver module.
The sensor sends out a sonar and tries to catch the echo and using the timing in between of the
two measures the distance in front [10].
For the gate on the footpath side to control a servo motor was needed. But it is necessary to
mention that the servo used in the prototype will not be sufficient for the real life scaled model
as the SG90 Micro servo has a very low torque (2.5 KG- cm) and a weight of (14.7g) which is
conspicuously not enough to withstand the weight of a gate in real life model. The Micro
Servo has 3 pins, the one labeled 5V is connected to the high point of the power source and the
GND to the ground [11]. The micro servo can rotate 180 degrees approximately.
For the hardware implementation, at first the proposed model had been sketched onto a
circuit diagram and later following the diagram we implemented the entire hardware system.
We have tried to keep the circuit as simple as possible for better maintenance in the future.
The proposed model is a real life archetype and a prototype, which is a miniature scaled model
of the real life system, has been built for understanding and showcasing the capabilities of our
intended system. The above mentioned apparatuses have been used to implement the entire
system, and PVC boards and color papers have been used to model the prototype structure of
the automated Zebra Crossing system.

A. Circuit detail of the proposed model


First off, the hardware elements were joined together based on the sketched circuit diagram
and was tested for accuracy. After that, the field test was done using actual persons. Later we
added the components onto the miniature prototype model. Fig. 2 shows the circuit diagram of
the prototype.
Fig. 2. Circuit Diagram

B. Hardware implementation of proposed model


The hardware implementation of the model has been done according to the circuit diagram
given above. All the power pins of the modules (Ultrasonic Sensor, Servo) were connected on
to the breadboard which took the power input pins in from the Arduino 5V pin and GND pin.
The miniature model of the
prototype was made accordingly and Fig. 3 shows the prototype miniature model of the system.

Fig. 3. Prototype miniature model of the system

C. Flow diagram of proposed model


The way the system works is that the first sonar will let the system know whenever there is a
person getting ready to cross the road and the second sonar will confirm his/her presence and
increase the people count by 1. After a certain amount of count, which will be learnt by the
characteristics of the road and place, the system will let the traffic signal know that it is time for
the signal to go yellow and in turn to red and the gate to open for the people to cross the road.
The intelligent part of the system is that it will recognize whenever a person leaves the
lobby, be it because he/she no longer requires to cross the street/road, or be it because she/he
thinks that the system can be outsmarted by crossing the sonar several times and increasing the
counter for people present. In other words, whenever there is a situation that the second sonar
gets a reading and consequently the first sonar gets a reading the system will automatically
decrement the value of people present by 1. The same will happen even if someone just crosses
the first sonar and never crosses the second sonar.
After “n-r” (where, n is the desired people for red light prompt and r is the number of
desired people for yellow light prompt) number of people pass the sonars and wait in the lobby
the system will turn on the yellow light, and subsequently additional “r” number of people
crossing and waiting in the lobby will trigger the red light. Fig. 4 shows when there is less than
“n-r” number of people.

Fig. 4. Green light and closed gate


The system will also wait “t1” number of time according to the traffic regulations of the
country for “r” more people to come and after timeout it will turn on the red light and signal
the servo to rotate 90 degrees for the gate to open for the passerby(s) to cross the street. Fig. 5
shows the scenario of opened gate and red light turned on.

Fig. 5. Red light and opened gate


Fig. 6. Flowchart of the entire system
The next intelligent part of the system is that if there is only a little number of people waiting
for the gate to open and the number is not the set value that triggers the system to open the gate
then the system will wait a minimum amount of time to see if the people count gets increased,
if not, the gate will automatically open for the already few people waiting to cross the street.
Fig. 6 presents the flowchart of the system.

4. Research Methodology
To test the precision of the proposed system we built the prototype miniature model
mentioned above. In a single run of the system (no reset) we tested the setup for an encounter
of 50 events of people waiting in the lobby where we fashioned stick figures out of cardboards.
The amount of people required for the yellow light to turn on (n-r) had been set as 5 and the
amount of additional people required to ignite the red light had been set to 3. The timeout value
had been set as 20 sec. for yellow light and an additional 10 sec. for red light. After testing the
system for the miniature model we tried to inspect the system for real life situation when a
person would walk by in front of the sonars. The Table 1 represents the accuracy comparison of
the movement reading from real life situation and miniature model.

TABLE I. ACCURACY OF MOVEMENT READING

Accur
Case
acy
Incrementing Decrementing
counter counter
Miniatur 97.5% 98.51%
e
model
Real-life 96.5% 99.1%
scenario

From the Table I it can be observed that the inaccurate results given by the sensors is purely
random, as incrementing and decrementing variations in different scenarios are not consistent,
we can only assume that these inaccuracies are related to the quality of the ultrasonic sensors,
but can conclude by saying that regardless of the inaccuracies the system should still be a
viable option for real time use for its cost effective side and convenient installment process.

5. CONCLUSION
In the proposed automated zebra crossing system, one would have a very hard time
outsmarting it to get the benefit of the system towards his/herself. The automation of this
particular system relies entirely upon the characteristics of the road and area, which in the
upgraded versions will be estimated automatically as well. The system removes the risky
business of road crossing to a minimum and the cost effective and simplicity of the system
gives value to it to the point that it becomes a demanding project for developing and
underdeveloped countries where traffic laws are hardly followed [12]. The implementation of
ultrasonic sensors in the system adds to its cost effectiveness, when in comparison with
existing automation of such system. It is hoped that the problems and risks involved during
road crossing will be removed due to the implementation of this project in busy roads
throughout developing and underdeveloped countries.
REFERENCES
[1] R. Sundar, S. Hebbar and V. Golla, “Implementing Intelligent Traffic Control System for
Congestion Control, Ambulance Clearance, and Stolen Vehicle Detection,” IEEE Sensors
Journal, vol. 15, no. 2, pp. 1109-1113, 2015.
[2] Varaprasad, G., and R. S. D. Wahidabanu “Flexible routing algorithm for vehicular area
networks,” In Proc. IEEE Conf. Intell. Transp. Syst. Telecommun., Osaka, Japan, pp. 30-
38. 2010.
[3] J. Sampathkumar and K. Rajamani, “Automatic Detection of Zebra Crossing Violation,” In
Proc. Fourth International Conference on Signal and Image Processing, ICSIP 2012, Dr.
N.G.P. Institute of Technology, Kalapatti, Coimbatore, 2012, pp.499-509.
[4] D. Ahmetovic, C. Bernareggi, A. Gerino and S. Mascetti, “ZebraRecognizer: Efficient and
Precise Localization of Pedestrian Crossings,” in Proc. 22nd International Conference on
Pattern Recognition, 2014, pp. 2566-2571.
[5] M. Uddin and T. Shioyama, “Detection of Pedestrian Crossing using Bipolarity and
Projective Invariant,” in IAPR Conference on Machine VIsion Applications,, Tsukuba
Science City, Japan, 2005, pp. 132-135.
[6] Z. Michalewicz, Genetic Algorithms + Data Structures = Evolution Programs. 3rd edition,
Springer-Verlag, Berlin, Heidelberg, 1996.
[7] C. Setchell, “Applications of computer vision to road traffic monitoring,” Ph.D thesis,
Computer Vision Group, Bristol University, 1997.
[8] K. Hara, V. Le, J. Sun, D. Jacobs and J. Froehlich, “Exploring early solutions for
automatically identifying inaccessible sidewalks in the physical world using google street
view,” Cs.umd.edu, 2013. [online].
http://cs.umd.edu/~jonf/publications/Hara_ExploringEarlySolutionsFor
AutomaticallyIdentifyingInaccessibleSidewalksInThePhysicalWorldUsi
ngGoogleStreetView_HCIC2013.pdf. [Accessed: 28- Nov- 2017].
[9] “What is an Arduino? - learn.sparkfun.com,” Learn.sparkfun.com, 2015. [online].
https://learn.sparkfun.com/tutorials/what-is-an-arduino. [Accessed: 29- Nov- 2017].
[10] “Ultrasonic Sensor What is an Ultrasonic Sensor?,” Education.rec.ri.cmu.edu.
[online].
http://education.rec.ri.cmu.edu/content/electronics/boe/ultrasonic_sensor
/1.html. [Accessed: 29- Nov- 2017].
[11] “Servo Motor SG90,” Ee.ic.ac.uk. [online].
http://www.ee.ic.ac.uk/pcheung/teaching/DE1_EE/stores/sg90_datasheet
.pdf. [Accessed: 29- Nov- 2017].
[12] J. Ahsan, “What traffic rules?,” Dhaka Tribune, 2017.

You might also like