With the increase in population worldwide, the number of vehicles in traffic is also increasing. This situation brings along many problems. One of the most important methods to reduce these problems is smart signaling systems. Many researchers have tried to make traffic smoother by developing various methods in this regard. Intelligent signaling systems prevent traffic density, accidents, etc., as well as minimize time losses. Time loss is an important problem that needs to be addressed, especially for emergency vehicles traveling in traffic. Every second counts for emergency vehicles. Traffic jams on signalized roads greatly hinder the speed of emergency vehicles. Although these vehicles have the advantage of running red lights, they are not safe and heavy traffic prevents them from doing so.
2. Installation of Traffic Lights and Mobile Application
2.1. Traffic Light Materials
Arduino UNO board, four-channel 5 V relay board, SIM808 GPS/GPRS/GSM module, triple traffic lights powered by 12/24 V, 12 V adapter, 9 V adapter, and 8 V adapter, a jumper for connection cable and female and male DC power supply cables are used in the installation of traffic lights in the signaling system. The properties and intended use of the materials used are given below, respectively.
2.1.1. Arduino UNO
Among Arduino boards, the most useful and well-known Arduino Uno model
[11][26]. All Arduino Uno models have 14 digital inputs (D0–D13), six analog inputs (A0–A5), a USB port, and an adapter port. The original models of the board have an Atmega328p microcontroller (
Figure 18).
Figure 18.
Arduino UNO original and Arduino UNO clone.
Arduino Uno can be operated by connecting to a computer via a USB cable, or it can be powered by an external power supply (battery, adapter)
[12][27].
2.1.2. SIM808 GPS/GPRS/GSM Development Module
The SIM808 card is a device that can be used for data communication between cellular network systems. This module supports quad-band GSM/GPRS communication operating at frequencies of 850 MHz, 900 MHz, 1800 MHz, and 1900 MHz
[13][14][28,29]. It provides ease of use in projects thanks to its small size and lightweight. There are SMA connectors on the board for antenna connections. Separate antennas must be used for GSM, GPS, and Bluetooth. To initialize the board, press and hold the “start” button for 2 s after connecting the power. The network connection status of the card can be monitored from the LEDs on the board. It has a 1.25 V, 3.3 V, and 5 V compatible TTL serial connection (UART) for connecting development boards such as Arduino and Raspberry Pi
[15][30].
2.1.3. Four-Channel 5 V Relay Board
A relay is a programmable electrical switch controlled by an Arduino board or any microcontroller (
Figure 29). It is used to programmatically control or operate devices with high voltage and/or current. It is a bridge between Arduino and high-voltage devices
[16][31]. There are three connections on the relay, usually labeled NO (normally open), NC (normally closed), and COM (common). The normally open connection is a common-ended open circuit when the relay is not energized, so no conduction occurs. When the coil of the relay is energized, the NO and COM terminals are short-circuited, allowing electric current to flow. The NC terminal works in the opposite direction to the NO terminal, i.e., when the coil is not energized, the NC and COM terminals are shorted. When energized, they form an open circuit. COM (Common) is the common input. To this input
[17][32], the voltage source that the relay will switch is connected.
Figure 29.
Four-channel 5 V relay board.
2.1.4. 12/24 V Traffic Light
Developed in 1912, traffic lights are signaling devices designed to control traffic flow at road intersections, pedestrian crossings, railway trains, and other places. There are four different outputs in traffic lights used in signaling construction. These are the control outputs of red, yellow, and green LEDs and the ground (GND) output (
Figure 310).
Figure 310.
Traffic light and pinouts.
2.2. Prototype
Before the physical installation of the signaling system, a prototype of the system is created. This prototype reflects the similar operation of the real system.
Errors in the software were eliminated in the trials made on the prototype. Arduino Uno, Sim808 GSM/GPRS/GPS card, and traffic light module were used to prototype the system. Since the supply voltage of the traffic light modules is 5 volts, no relay was used in the prototype. The traffic light module has three pins (red, yellow, and green) and one ground (GND) pin. A visual representation of the module is given in
Figure 411.
Figure 411.
Traffic light modüle.
The top view of the prototype is shown in
Figure 512, and the side view is shown in
Figure 613.
Figure 512.
Top view of the prototype.
Figure 613.
Side view of the prototype.
2.3. Hardware Design
Circuit designs were made using Fritzing software in the setup of the system. Fritzing is open-source software that enables the original development of electronic circuits using Arduino boards. Fritzing users can prepare prototypes of the circuits and circuit elements they develop, share them with others, and use their outputs. It is possible to use experimental circuit boards, schematics, printed circuits, and code related to Arduino in the Fritzing program. The circuit elements are divided into sections and are categorically accessible
[18][33].
2.3.1. Connection of Arduino UNO and SIM808 GSM/GPRS/GPS Board
When connecting the Sim808 GSM/GPRS/GPS board to Arduino UNO, the UART TTL interface on the Sim808 board is used. Three pins are used for connection in this section. These pins are RX, TX, and GND pins. A connection diagram and the actual connection are given in
Figure 714.
Figure 714.
Connection circuit design and actual connection.
2.3.2. Connection of Relay and Traffic Lights
There are four cables in the traffic lights used in the installation of the system. Three belong to colors, and one to ground (GND). The lights work between 12 and 24 volts. Since there are three LEDs to be controlled in traffic lights, four-channel relays are used. When connecting the lights with the relay, the cables to which the LEDs are connected are connected to the NO pin of the channels on the relay. The COM pins of the relay to which the LEDs are connected are also connected to each other and connected to the power supply with the help of a terminal. The GND cable from the light is connected to the power supply used. The connection diagram is given in
Figure 815.
Figure 815.
Traffic light and relay connection.
If the proposed system is to be installed at real traffic lights for a long time, it needs to be fed with a constant power supply. This will be provided by a solar panel mounted on the pole.
2.3.3. Arduino Uno and Relay Connection
By using a relay module with an Arduino board, it is possible to turn on and off devices operating with AC or DC voltage
[19][34]. Relay modules are sold with 5 V or 12 V power supply. In this project, since a maximum of 5 volts of power can be obtained from an Arduino UNO, a relay with an operating voltage of 5 volts was used. When connecting the relay to the Arduino UNO, the VCC, GND, and signal pins on the front of the relay module are used. The 5 V relay module is powered by the 5 V pin on the Arduino UNO. At the signal end, the lights are controlled by sending a signal from Arduino UNO according to the incoming message information. The connection of the relay with Arduino UNO is given in
Figure 916.
Figure 916.
Arduino UNO and relay connection.
The most important point to be considered when connecting Arduino and relay is the connection of signal pins. The ones corresponding to the channels connected with the signal pins should be used. The connections of K2, K3, and K4 channels are made in the connection diagram in
Figure 916. The K2 channel corresponds to the IN2 pin, the K3 channel corresponds to the IN3 pin, and the K4 channel corresponds to the IN4 pin.
2.4. Mobile Application
The developed mobile application is designed for the person using the emergency vehicle. The use of the application belongs only to the relevant person. The mobile application has a login screen, user registration screen, map screen, and traffic light control screen. The necessary information to access the application is given to the person using the vehicle by the organization they are affiliated with. This login information is saved in the Firebase real-time database.
It is possible to create a new account by logging in from the login screen and switching to the next screen or another screen. On this screen, the person logs into the system using the ID and password information given to them or the information they create themselves. The login information of authorized personnel is previously saved in the Firebase database. The user’s login information is verified with Firebase Authentication. After the login information is verified, the message “Login Successful” appears on the screen. The login screen is given in
Figure 107.
Figure 107.
Login page and information entered.
If the login information is not given to the person, they can go to the registration screen in
Figure 118 by clicking the “Create Now” button at the bottom of the login page. After the user enters the required information on this screen, the user is automatically directed to the login page after the “Contact Registration Successful” notification message appears on the screen.
Figure 118.
Person registration screen.
After logging in to the account, the screen in
Figure 129 welcomes the person. On this screen, the person can create a route between the destination location and the current location. As soon as you log in to the system, the current location is marked on the map with a red marker. If the location is not marked automatically, the current location can be marked on the map with the button on the top right corner of the interface. On the other hand, the destination location can be selected from the drop-down list by entering the name of the location in the search tab at the top of the interface.
Figure 129.
Route creation screen.
The Google Directions API is used in Android applications to create routes between two specified points. To create a route, the API key information and the latitude and longitude information of both the current location and the destination location are sent via a URL to the Google Maps Directions web service. When a new destination is entered, the previously plotted route is deleted, and a new route is created. In
Figure 1320, a new location is entered, and a new route is created. A close-up view of the traffic lights placed on the roads is also given by zooming in on the map.
Figure 1320.
New route creation and traffic lights on the map.
After creating the route on the previous page, the traffic light in the direction of the vehicle must be selected in order to pass the first signalization encountered. When this traffic light is selected, the page where the light will be controlled opens (
Figure 214).
Figure 214.
Traffic light control page.
This screen contains the name of the light to be passed, the number of the module to which it is connected, and buttons to control the light. With the “Activate” button on the interface, SMS information is sent to all lights in the signaling area about what their status should be during the passage of the vehicle. The “ON” message is sent to the traffic light module that the vehicle will pass, and the “OFF” message is sent to the traffic lights in other directions. The numbers to send the message are retrieved from the database. If SMS sending is successful, the “SMS sent” information message is printed on the screen (
Figure 1522). When SMS sending is unsuccessful, the information message “SMS could not be sent” is printed on the screen. If there is an error with permissions, “General Error” appears on the screen; if there is no service on the phone, “No Service”; if there is a failure because a PDU (Protocol Data Unit) is not provided, “No PDU;” and if the phone has airplane mode, “Airplane Mode On” is printed on the screen.
Figure 1522.
Printing the “SMS sent” message on the screen.
In order to send messages, SMS sending permission must be added to the AndroidManifest.xml file. In addition, in order for the application to send SMS automatically, SMS sending must be allowed in the mobile application.
3. Smart Signalization for Emergency Vehicles
- Results and Discussion
In this section, the operation of the developed traffic lights was tested. In addition, the number of emergency vehicles passing through the signaling system, the total number of vehicles passing through the signaling system, and the distance that other vehicles should travel during the arrival of the emergency vehicle in case of failure of the developed system were determined.
Field Test
With the module installed using Arduino Uno, SD card module, DS1302 RTC module [20][35], and MZ80 infrared sensor [21][36], the number of vehicles passing through the routes determined in the field study was counted. The installed devices and their installed state are given in Figure 16 Figure 23. In the module installed for vehicle counting, the MZ80 infrared sensor is used to detect obstacles and objects in front of it. DS1302 RTC module is used to attain time information. Data obtained are written to the SD card inserted in the SD card module.
In this section, the vehicles used in the existing signaling system are examined in order to study the operation of the signalization system installed in the field test in Mugla˘ province of Turkey. Investigations were carried out on the Mugla˘-Fethiye and Fethiye-Mugla˘ routes of Mu˘gla Province, including the signalized intersection shown in Figures 17 Figures 24 and 1825.
Figure 1623.
Vehicle counter modules.
Figure 1724.
Mugla-Fethiye route.
Figure 1825.
Fethiye-Mugla route.
The field tests were carried out on Thursday between 08:30 and 10:30 on the busiest day of the week. Data obtained during these hours are given in Table 1Table 2.
Table 12.
Field test data.
Route |
Total Number of Passing Vehicles |
Total Number of Emergency Vehicles Passed |
Muğla-Fethiye |
550 |
Ambulance:1 |
Fethiye-Muğla |
611 |
Ambulance:3 Police:2 Firefighter:1 |