SMART TRAFFIC SIGNALING SYSTEM BASED ON ULTRASONIC DISTANCE MEASUREMENT SENSOR

Currently, in Baghdad, vehicles driver still depends on the police of traffic to regulate the traffic system according to the density of traffic. There has been made a lot of researches on making the traffic signals automated by using image processing techniques, infra-Red Sensor


INTRODUCTION
The whole World is technologically growing and Iraq is no exception from that. And by using the huge growth in information technology IT and many other technologies, people used to employ a comfortable way of living like Smart Television, electrically charged Vehicles, etc., transportation is no exception from that, people head to use their cars for stepping out instead of waiting in crowded public transportation. The situation of traffic congestion happens because of a large number of cars driver and is recognized by slowing down the speed, long time of trip and vehicle queuing become longer than usual. Traffic Signals tend to regulate the condition of traffic on road intersections. The traffic system nowadays in Iraq still relies on the human for controlling it depends on traffic density.
The traffic system currently is old fashioned and sometimes manually controlled where the Traffic police officer is in charge of organizing the passage of cars based on the traffic density. This situation is very unreliable because most of the time you don't see the police officer personally controlling the traffic which will be the reason for traffic congestion on the roads.
So, for the sake of solving these problems, a lot of researches has been done by using communication strategy and information technology for organizing the system of traffic signaling.

LITERATURE SURVEY
This section is a brief discussion of different available literature concerning about the system of traffic signaling that has been done before 1) R. Weil, J. Wootton, and A. Garcia Ortiz, 1998, [1] introduce Peripheral Interface Controller (PIC) Microcontroller as an intelligent system of traffic signaling based on traffic density. This system saves in real-time the overall number of cars in the memory. The aggregate of the captured data is sent through the microcontroller to a computer. The person who has full access to the computer at the main station will be informed about all the conditions of the traffic concerning any available traffic light of the nearby street which leads to traffic jams reduction. In future, this system will be capable of giving useful information to drivers about the situation of traffic in different places but also it needs a human interaction to decide on which road to be opened and that will be done at human estimation 2) " K. Thatsanavipas, N. Ponganunchoke, et al ", 2010, [2] introduces research on traffic system according to traffic density it's built upon the technique of image processing such as edge detection to identify the density of traffic that results from the current traffic signaling system. The main advantage of creating a smart system for traffic controlling is congestion reduction, operational cost, give a substitute road to the driver, and finally to build an infrastructure with High capacity. Generally, its complicated system and also too expensive due to the use of high-quality camera and the operation of installing it on roads beside the need of high computing machine if comparing with the proposed sensors prices and installing method. 3) Wanjing MA and Xiaoguang YANG,2008, [3] here the traffic control system based on traffic density will be built using infrared [IR] sensor that will define the green light time interval by using microcontroller. The sensor will be installed on the sides of the road and it will discover the existence of cars and then the resulted data will be sent to the microcontroller. The microcontroller will decide the time interval that will be assigned to red and green light. So here the traffic light timing will be set according to car density. 4) Moch Agung Prasetyo, Roswan Latuconsina, and Tito Waluyo Purboyo , 2018, [4] introduce Another system which is close to our work but it's quite different in the mean of cost the proposed system made of processing unit presented by the microcontroller that will control the system process, and 3 ultrasonic sensors at each road that will detect the level of congestion in each road, which report the traffic jam situation to the microcontroller consequently 1st sensor light traffic 2nd senor normal traffic jam 3rd represent heavy traffic which causes the traffic light to change to reduce the Traffic Jam (TJ).
From the previous literature reviewed, the existing systems has used an Infrared (IR) sensor or many of the ultrasound sensors for the system of traffic controlling that has a drawback or a challenge. The challenge in using many ultrasonic sensors to detect the level of congestion in the road, which report the traffic jam situation to the microcontroller consequently 1st sensor represent light traffic 2nd senor represents normal traffic jam 3rd represent heavy traffic which causes the traffic lights to change to reduce the traffic jam (TJ) And another challenge of using three ultrasound sensor for each road its cost (the type of ultrasound sensor used in the simulating board is a cheap one because of the distance it covers and its reliability. The one that should be used in the real world should be more reliable and cover the desired distance).
The challenge in using [IR] is that the cars must be near these sensors for detecting the existence of a vehicle so without controlling the distance or the zone between the car and the sensor which is not always possible this method may be unreliable.

THE PROPOSED SYSTEM
Accordingly, the proposed system is a smart traffic controlling system where an Ultrasonic sensor installed on one side of road 500 meters down the road (which represent heavy traffic zone) and another set of magnetic field senor that detect the presence of ambulance in the road and both of them send signals to the first microcontroller, the one that controls the sensors which in turn communicate to the second microcontroller, the one that manipulates the traffic light to take the appropriate action.
Another feature has been proposed for the emergency case like (ambulance) this kind of car does not need to wait for the traffic light queue because a life of human may depend on time so in this case, another sensor (magnetic effect hall) sensor will be used which is so sensitive to the magnetic field at a specified degree. A magnet will already place at the emergency cars to be detected. In other words, only one (effect hall) sensor will be placed on one side of the road that can sense the assigned degree of the magnetic field that we install at the ambulance Then all the changes that will be applied to the traffic system will be gathered by a data acquisition software Parallax Data Acquisition tool (PLX-DAQ) software which is simply an add-in for Microsoft Excel that acquires up to 26 data channels from any microcontrollers and put the numbers into columns as they arrive. (PLX-DAQ) collect the data from all the sensors, the traffic light status along with the date and time, and finally send a report in the shape of a spreadsheet to the authorized people to make analysis and control the system.
When a car is completely stopped in the zone of the ultrasonic sensor a signal will be sent to Arduino no.2 where a counter of 30 seconds (in our simulation board) will be started to ensure that this car is completely stopped. Arduino no.2 will take an action accordingly it will send a control signal to the Arduino no.1 which controls the traffic light to grant a green light to the jammed road for a specified time interval that assigns by the administrator.
The connection between the two microcontrollers will be done by using SSR solid state relay that will serve here as a signal converter because the input signal is 5v and if it's directly connected to the other Arduino will cause damage so the SSR will convert it to GND signal and by this mean the Arduino no.2 will inform Arduino no.1 about the traffic congestion and then the latter will be able to send a 5v signal to the appropriate road traffic light.
When the time is over the traffic light will return to its queue before the ultra-sonic sensor sends the signal for that congestion. The connection between the two microcontrollers will be illustrated by fig.1: The same thing will happen with the other type of sensor (effect hall sensor) that will detect the degree of the magnetic field that has been already installed at the ambulance (a magnet with a unique magnetic field). a signal to the Arduino will be sent that will directly (without starting a counter) communicate to the other microcontroller and give the road with the ambulance a green light but the difference between the two sensors is the priority that will assign to the ambulance case is higher than congestion case. Fig.2 illustrates the proposed system layout.

MATERIALS AND METHODS
The components of hardware used in the proposed system for the implementation of the simulation board are demonstrated below

ULTRASONIC SENSOR
In the proposed system ultrasonic sensor will perform a very vital role. This sensor will detect the density of Traffic jam and the system will work accordingly. Ultrasonic waves are created by a device named a piezoelectric at a specified frequency. Piezoelectric will generate ultrasonic waves to an area or a target, and when the wave touches the surface of the target, it will reflect the sensor. The sensor has a timer that can easily calculate the distance traveled by the sound An ultrasonic sensor is a well-known and very popular sensor to be used, because the distance it covered is up to 400 cm / 4 meters jet and at a relatively low price, and also it is easy to install [4] as shown in fig.3. These sensors are widely used like in construction sites, parking of the car, measuring tapes, and so on. Also in danger zones of working machines or any other places that cannot be reached by a human or it's too risky [5]. Ultra-sonic sensor

ARDUINO MICROCONTROLLER
The Arduino Mega 2560 is a microcontroller which is a computer-on-a-chip that is economically designed for dealing with many specific functions, such as using PORTs for receiving information or control devices remotely and processing it moreover to produce an appropriate result for which it is programmed [6]. It has 54 digital input/output pins, 16 analog inputs, 4 UARTs A universal asynchronous receiver-transmitter is a computer hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable (hardware serial ports), a USB connection, a power jack, an ICSP header, in-circuit serial programming (ICSP),( is the ability of some programmable logic devices, like microcontrollers, and other embedded devices to be programmed while installed in a complete system, rather than requiring the chip to be programmed before installing it into the system), and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started. Arduino Mega can be programmed with Arduino Software IDE stands for Integrated Development Environment [7], figure 4 illustrates Arduino Microcontroller.

HALL EFFECT SENSOR
A Hall Effect sensor is a device for measuring the magnetic field magnitude. Its output voltage is directly proportional to the detected magnetic field strength [8]. Hall Effect sensors are used for closeness sensing, positioning, and speed detection.it has 2 output one for digital reading and the other for analog readings and one input for power (Vcc) and ground (G). Figure 5 illustrates the Hall Effect sensor

SOLID-STATE RELAY
Solid-State Relay (SSR) is an electronic switching device that has three terminals: control, VCC, ground. SSR Turns on or off as an external voltage is spread to the control terminals. SSRs consist of a sensor that reacts to the correct input (control signal), a solid-state electronic switching device that switches power to the load circuitry, and a connecting mechanism that allows the control signal to trigger the switch without mechanical components. The relay may be constructed to turn either AC or DC to the load. [9]. It serves as an intermediate device between the two microcontrollers in the proposed system because both of the microcontrollers operate with 5 Vcc so the interconnection between them will cause damage. Figure 5 illustrates the Solid-state relay.

IMPLEMENTATION PROTOTYPE
The entire hardware prototype of the proposed traffic control system has been constructed by using two Arduino as microcontroller or processing unit. Also, the ultrasonic sensor and effect hall sensor both of them are connected to one Arduino microcontroller. And the second microcontroller for manipulating the signals of the traffic based on the received information about the traffic density. Figure 6 is a flowchart to illustrate the mechanism of the proposed prototype. On the other hand, the second Arduino unit is connected to an excel sheet database that' Used for reviewing what happened on the roads (intersection) with time and date along with the kind of congestions that occurred at each of the roads.
These gathered data will be used for analyzing the traffic congestion as normal and heavy traffic for each road. The results will be documented for future work. Figure 8 illustrates the simulation board.

EXPERIMENTAL RESULT AND DISCUSSION
When the proposed prototype has been implemented, several cases that result from applying the proposed system to the traffic signaling system, these cases based on the reading from the sensors simultaneously. An example of such cases that have been applied to the simulation bored and the reading table of every case. 1) When there is a traffic jam in tow roads of the intersection at the same time and both of the ultrasonic sensors at both roads will send a signal to the microcontroller to open the green light. the Arduino will give the priority to the very first signal that reaches it and cause the traffic light of the first road to be changed as illustrated in the table 2) when there is a traffic jam in three roads at the same period the microcontroller will open the roads by queue according to the first signal received (FIFO) first come first served the same as case 2 but here there are 3 roads engaged in the traffic jam and when the all of the three roads take an extra green light time the system will return to its queue before all of this happen this is illustrated in table 2. 3) Same of cases 2 with all of the four roads will be jammed at the same time so the same operation will be repeated here with four congested roads.  When both sensors engaged in the same case so there are a traffic jam and an ambulance in any of the four roads the microcontroller will always open the road for an ambulance first over the traffic jam because the emergency case has high priority over the traffic jam that's mean the effect hall sensor has higher priority than the ultrasonic. Generally, the emergency case may have a life of humans depend on time so it's quite understood why the emergency has a higher priority. When the road with an ambulance is open and it takes its assigned time slot then the jammed street will be opened secondly. Table 5 presents the results of case 5.

CONCLUSIONS AND RECOMMENDATIONS
Classic systems of traffic signals depend mainly on a traffic police officer for regulating and controlling the traffic according to the density of traffic. So much researches have been done for the sake of calculating or estimating the traffic density and using a sensor to manipulate the traffic signals based on that density information furthermore there's some traffic control system that employs image processing as a tool for calculating the traffic density.
Accordingly, with the approaching technique of Machine to Machine Communication using information technology, Traffic Signaling System Based on the ultrasonic sensor is developed, where this sensor is deployed on one side of road 500 down the road where the traffic jam is heavy and need to be solved.
The use of one sensor per road is innovated idea for implementing this system if a comparison with another system will be made the previously proposed system for controlling the traffic jam will have the benefit of reducing the cost that's without a doubt is clear because of a single sensor for detecting the traffic jam is made also a single one for the emergency case will be used.
The ease of using this system is more than other proposed system the database it's used is excel sheet which is very popular software that can be used by any traffic police in the traffic police department to take report and analysis can be made easily so the user of the system is taken into the consideration Also, the data gathered from the sensor readings can be used for allotting more green light time for the road With high traffic density in a unique time of the day (Peak hour) or at a unique date of the year. This will be done as future work of the proposed system, in this case, the interaction of human to the system will be reduced

SOURCES OF FUNDING
None.