MANAGEMENT OF TRAFFIC LIGHTS FOR EMERGENCY SERVICES

Professional paper Currently, the evolution of wireless technologies has allowed researchers to design communication systems where vehicles are used as first entities to participate in the communication networks using the infrastructure present in cities. In this paper, the development of a new application under the Android operating system as an effort to improve road safety is presented. A new concept, such as Smart Cities includes intelligent traffic management in which data from the Traffic Information Centre infrastructures could be reachable at any point. The goal of this proposal is to manage the traffic lights from inside of the emergency vehicles (as ambulance, fire truck, etc.) in order to minimize the response time in case of an emergency, therefore, reducing the stop time in the intersections due to red lights. Presented in this work is the development of an application for the management of traffic lights, the objective is to provide the control to drivers over the traffic light in the emergency route. Finally we discuss the requirements for the real development of the application. This project obtained the best prototype award in the regional and national science fair in Mexico ExpoCiencias 2013 with which the project was prize winning to participate in the London International Youth Science 2014 (LIYSF).


Introduction
In recent years, the evolution of wireless communications has opened new fields of research, providing network connectivity in environments where the wired solutions are almost impossible.Thus, ad hoc wireless networks (decentralized wireless networks that do not depend on a pre-existing infrastructure) have attracted great attention due to the promising applications that they offer, from road safety to traffic control and entertainment for the passengers of the vehicles The integration of wireless networks in cities makes way for the concept of "Smart Cities" [1,2] defined by IBM as the use of Information and Communication Technologies (ICT) to obtain, analyse and integrate key data to systems that are running in the city.At the same time, the smart cities may respond to different daily needs, including environmental protection, security and public services [3].The main objective in the smart cities has focused on providing more efficient and safe routes.Today, thanks to the development and advancement of wireless technologies and their applications can be found the concept of Intelligent Transportation System (ITS) [4], which completely changes our concept of transportation, improving in terms of safety on the streets and helping the emergency services.
In the context of the emergency services, mainly focused on health care and road safety, as well as the daily accidents that require immediate attention by the appropriate public services, the response time to these phenomena is a crucial factor because a few minutes can make the difference between life and death [5].For this reason, emergency services must always remain in a state of alert to arrive in the shortest possible time at the scene of the accident.Unfortunately, there are a number of factors that make this a difficult task.Out of these factors, the most important one is traffic and the lack of automated infrastructure in cities of non-developed countries.
This paper presents an approach to minimize this problem through a mobile application for the manipulation and synchronization of traffic lights.The application was developed for the Android platform [6] and controlled via a mobile device, with access to GPS GPS technology (Global Positioning System) and Internet.The direct user of the application is the co-pilot of the emergency vehicle, who can control the change of the traffic lights from a distance calculated using the GPS.
This work is structured in the following sections: Section 2 describes the work related to this research.Section 3 presents a summary of the proposal to control traffic lights for emergency services.In Section 4 a proof of concept of the system is detailed.The characteristics and requirements for the actual implementation of the proposal are specified in Section 5. Finally, the conclusions and future works are presented in Section 6.

Related work
At present, there is a lot of research related to road safety and the services that can be offered in a city thanks to the technological development focused on wireless telecommunications.
At [1], the authors present the idea of the development of an intelligent transport system that takes advantage of the idea of "Internet of Things" to establish a management system that includes smart traffic lights control to accommodate the traffic flow throughout the day.Moreover, with regard to mobile networks, at [7] are discussed the new approaches to provide for the cities an infrastructure that is supported by communications with the purpose of providing intelligent services that use these networks and allow a developer-operator interaction to share the platform.Within relation to road safety, specifically the emergency services, in [5], the authors describe the main aspects to consider, such as accident prevention, assistance in lane change, obstacle detection, notice of violation of traffic signals, etc., while considering the management of traffic lights.There is also a discussion of how the use of technologies and automation improves the response time for emergency services.A very interesting work is presented in [8], which shows the applications developed in the United States of America by the initiative of Cooperative Intersection Collision Avoidance Systems [9].These applications combine the infrastructure of sensors and wireless communications to detect dangerous situations, such as when a car violates a red light it could potentially collide with other vehicles; under this situation, the traffic light will be red in all its lights to alert drivers about a scenario of imminent danger and avoid a chain reaction of accidents.In this context, in the work presented in [10], a protocol called VTL-Priority Intersection Control (VTL-PIC) is proposed that allows the traffic lights to detect the presence of an emergency vehicle and prioritization at intersections which, in their evaluations, decreases the travel time compared to other vehicles, based on the premise that the traffic lights are virtual agents that perform a self-support in local priority rules.At [11], the authors present an interesting work on the simulation of a road segment with a bottleneck, for which it is exposed to a reduction in the maximum speed of the vehicles in the simulated area, based on the average rate of arrival (feedforward) calculating the average duration of traffic with the stop and go in queue time; this model was done with the "Arena software".In [12] was described the architecture for routing protocols that supports the movement of vehicles on a large scale simulated in the city of Málaga, Spain, but its implementation involves a significant investment in infrastructure.
Currently there are a lot of proposals for wireless vehicular networks with applications in emergency services.Unfortunately, these proposals are usually addressed to large metropolis with automated infrastructure, therefore, its implementation is usually quite costly and complex for small cities, where we found a technological backwardness in regard to road infrastructure that is far from the concept of Smart Cities.In this sense, this article provides a low cost solution to a system of emergency services through a mobile application for handling/synchronization of traffic lights, thus reducing road accidents and optimizing the assistance of emergency vehicles such as ambulances and fire trucks.

Traffic lights management system for emergency services
This section describes the proposal of the management system of traffic lights for emergency services.The main idea of the implementation presented in this article is to provide the co-pilot of the emergency vehicle, a device with Android technology that communicates with the traffic lights of the city, allowing the co-driver to have control over them, by manipulating the light change to optimize the response time in an emergency, therefore, the emergency vehicle will not have to slow down to get a cruise regulated by traffic lights.In this way a number of benefits are provided including the prevention of accidents caused by careless drivers of other vehicles on the road and achievement of a decrease in the response time of the emergency vehicle.
Later the use of shafts for the development of the proposal is explained.

Infrastructure
The infrastructure consists of connecting the traffic lights to a Web server, an "Arduino with Ethernet Shield" [13] (Fig. 1) platform was used for testing with a scale model.An Arduino is an open hardware platform based on a microcontroller board and a development environment that allows you to receive environmental data through its input pins and sensors, which enables controlling lights, motors, and other actuators.The Ethernet Shield allows the Arduino to establish connection to the Internet thanks to an RJ45 port included in the device.The Arduino Ethernet Shield connected to the Internet allows you to send and receive data from anywhere in the world with an Internet connection.This platform has been used to control robots remotely through a Web page.

Software development
For the development of the Management Software of traffic lights controlled by a mobile device it was necessary to use different tools and technologies.We developed a Web application and an application for mobile devices.Phonegap was implemented, a framework that allows to develop applications for any mobile device using HTML [14]; JavaScript [15]; and the API (Application Programming Interface) of Google Maps, an application server of maps available on the Internet for images and satellite photographs of the globe.This API in particular provides information such as latitude, longitude, elevation, among others, that facilitates the development of programs [16,17]; and a GPS device used to determine the geographical position of an object, a person or a vehicle with a precision of up to a one meter (if differential GPS is used).With regard to the management of the database the PHP language [18] was used and the database management system of MySQL [19] for the storage of the same, which must be constantly updated due to the fact that the location of traffic lights and emergency vehicles will be located with them.The mobile application was developed for implementation on the Android platform; an operating system for mobile devices developed on GNU/Linux, this platform was selected for its use in over 80 % of all cell phones [20].
As stated before, the Ethernet Shield is the electronic device that allows a connection to the Internet and the open hardware platform Arduino.The Ethernet Shield functions as a network adapter.In each traffic light model is connected an Arduino Ethernet Shield; the first, through the second, sending and receiving data through the network (it can be the Internet or a local network).
With the data managed by the Ethernet Shield, the Arduino controls the traffic lights, altering one of them to change a red light into a green light and the rest of the traffic lights are automatically synchronized according to the state of the traffic light modified by the Arduino.
The data used by the Arduino to make modifications to a traffic light is sent by the mobile operator that accompanies the driver of the ambulance or emergency vehicle, and transmitted by the software developed during this project.
Approaching the coverage area of an Arduino (the cruise where there are traffic lights incorporated), the presence of the emergency vehicle is detected, the software activated on the mobile device can initiate communication between the Arduino software installed on the mobile device.

Software-hardware interaction
For the software-hardware interaction, Arduino Ethernet Shield microcontrollers were used to manipulate traffic lights.The Ethernet Shield is based on the Ethernet Wiznet chip W5100 [21] that provides the implementation of a stack of IP network (Internet Protocol) and the use of the protocols TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).We decided to use Ethernet Shield after an exhaustive analysis, which highlighted its main advantages such as support for up to four simultaneous socket connections through a library, allowing synchronization between the traffic light and the mobile device for the co-pilot.

Proof of concept
In this section an assessment as proof of concept is presented to demonstrate the functioning of the proposal.
A simulation test on a scale prototype of intersecting streets and avenues, with the presence of simulated traffic signals using light emitting diodes (LED) was performed (see Fig. 2).This allows to emulate a cruise with traffic lights.The prototype, including the 16 traffic lights emulated, is controlled with a mobile device with Android operating system, which simulates the control of the traffic lights by the application developed.The prototype was assembled over a protoboard and handled by a microcontroller PIC16F84A [22], which in turn receives commands via an Arduino with Ethernet Shield (Fig. 1) to provide connectivity to the network.The output signals are 16 LEDS that correspond to the four traffic lights for each intersection.The placement is equal to conventional traffic lights with 4 lights, and is distributed in the following way: 1 Red LED to simulate the "Stop" light, 1 yellow LED to represent the light of "Caution" and 2 green LEDs, one of them to represent the light of "Front" and the other to indicate "Turn" to the left.The LED change cycle was programed into the microcontroller, which is always waiting for a signal from the Arduino connected to the network and mobile device.Possible directions of the mobile device corresponding to the following options available in the graphical interface of the application (Fig. 3) are: "Left", Turn to left (Green light)."Go", continue straight on (Green light).The mobile device sends the signal to the traffic light in accordance with the choice that the user designates.
Regarding the Graphic User Interface (GUI), the application consists of two buttons that indicate "Go" or "Left", in this case, because it is a proof of concept.The application contains selectors, and traffic light guidance, so that the user (co-driver of the emergency vehicle) can select the traffic lights he wants to control and the direction to take the vehicle.
To start the simulation it is necessary to select the check box for "Enable" to represent that the vehicle approaches an intersection and is located in the area within which it is possible to manipulate the traffic lights; the interface buttons change colour to red for the user to select the desired option (depending on the direction of the destination).Subsequently, the application sends the signal to the Arduino via the Internet to take control of the corresponding cruise, prioritizing traffic lights using warning lights (yellow) required to prevent accidents.Finally, the cruise remains in that state until the user disables the check box "Enable" to indicate that the vehicle has already crossed the traffic lights and they continue with normal operation.It is important to mention that in order to achieve a real implementation it is necessary to amend certain aspects of the infrastructure of the city's traffic lights, even though the investment is minimal, since only they will be added to an Arduino with Ethernet Shield programed to synchronize and modify the sequence of the lights and communicate with the application via the Internet.
For each traffic light there will be a detection zone, divided into quadrants, composed by coordinates (latitude and longitude) that will define the shape of the street considering the proper distance according to the city in which it is applied (Fig. 4).It is recorded to determine the sense and direction of the vehicle and traffic lights to control.All this will work automatically, by locating the quadrants by means of a GPS that will provide the data of latitude and longitude (coordinates) with which you can determine the location of the emergency vehicle.
It is important to emphasize that each traffic light will have an identifier called IMEI (International Mobile Equipment Identity), which is a unique identifier contained in each GSM module which will be used to determine the traffic lights to check with your mobile device.
This control is based on handling one of the traffic lights of the cruise, because the four traffic lights are synchronized with each other by the Traffic Department, and the fact that manipulating one of them causes the others to act in response to that change.
The co-pilot of the emergency vehicle will have a mobile device with Android OS, GPS and Internet connectivity.When an emergency occurs the following sequence is used: a) The emergency is reported to the central.b) The co-driver starts the application and it proceeds to track the vehicle's location via GPS, c) Once the vehicle is close to a cruise and puts you in a detection zone, the application automatically enables the buttons to indicate where it's headed the emergency vehicle, d) Once done, the application will send the signal requested via Internet to Arduino in the corresponding traffic light, which will receive it through the Ethernet Shield and order the change of priority to the traffic light colour required according to the indication of the co-pilot; thus the set of traffic lights in the cruise will interrupt their sequence of lights safely, making the lights turn yellow when necessary and not drastically causing an accident, and as well clear the traffic before the emergency service accesses to the area, e) The corresponding traffic light will remain in green light, while the rest will stay red until the vehicle is detected outside of the area and then return to normal state.
In the case of the presence of more than one emergency vehicle on the cruise, coordination is proposed based on priorities, where the vehicle with the shortest distance to the traffic lights to control has priority 1; therefore the traffic lights will be manipulated by that ambulance, for example.Subsequently, if still necessary, the control is passed to the ambulance with priority 2 and so on.

Conclusions
In this paper the preliminary note of a proposal of low cost of a traffic light management system for emergency services is presented.The advantage of this proposal is the economy of its implementation.And the main contribution is a prototype (patent-pending) to manage vehicular cruises through traffic light control via a mobile application developed for the Android platform and with Arduino hardware.
Also, the mobile application can be manipulated by an operator of a mobile device to accompany the driver of the emergency vehicle, for example an ambulance.The software interface is very friendly, as shown above and does not need a prior exhaustive training.The application allows reducing the response time to a disaster or emergency call, thanks to the management of traffic lights in the path of the vehicle, resulting in decreased casualties.
Due to the medium of communication being wireless, there is a possibility of becoming a victim of various attacks on the network causing unauthorized entries to control the lights; therefore, as a future work will be done in-depth analysis on these potential attacks as well as the techniques to avoid them.We will seek to implement security measures that restrict the use of the application to registered users only.Only a traffic light will be controlled at a time to avoid conflicts and will include a confirmation of completion of management of traffic lights before granting the permission to control the next set of traffic lights.Finally a GSM module is added the purpose of this proposal is to remain low cost and increase reliability and maintainability, which is expected to increase its quality.This will allow the infrastructure change to be accessible and therefore be installed in locations with high traffic flow anywhere in the world.
Our proposal is a first step for the implementation of the prototype of low cost of emergency vehicles traffic control on signalized intersections.As future work we will present visible results including the presence of pedestrian in calculations of minimum green light time.

Figure 1
Figure 1 Arduino with Ethernet Shield used in the project To attach the Arduino to the Ethernet Shield only needs to connect the pins of the Ethernet Shield to the inputs of the Arduino.This allows the Arduino to be controlled (send and receive data) from the Internet.

Figure 2
Figure 2 Prototype model of intersections

Figure 3
Figure 3 App graphic user interface 5 Actual deployment

Figure 4
Figure4 The application developed on the Android platform using the city map divided into quadrants to locate the traffic lights in each cruise (detection zones in green)