Intelligent Ambulance Traffic Assistance System

With the increase in traffic road density, several causalities occur due to delay in taking a patient to the hospital in an ambulance. In this paper, we have developed an algorithm to find the shortest path to reach the required destination. As required the software will identify the present location of the vehicle and ask the user for the destination. Then it will show all the available paths, highlighting the shortest one or in several cases the most optimum one. Further we made the traffic signals automated for special vehicles like an ambulance or a fire-engine such that the signals will go green for the ambulance as it comes in the vicinity of the traffic signal, thus providing them with a clear path to reach its destination. The original signal is restored as soon as the ambulance goes undetected by the Bluetooth scanner of the traffic signal.


MOTIVATION
In India rapid growth of population coupled with high rate of industrialization has resulted in unmanageable increase in traffic volume, especially in metropolitan cities and urban areas.Due to this increase in traffic density several valuable lives are lost due to delay in receiving medical attention.So we designed a system which prioritizes emergency vehicles like ambulances, fire engines and provide them with a congestion free path to reach its destination as soon as possible.

PROBLEMS
One of the most challenging problems of urban civilization is directly or indirectly related to population explosion.Traffic congestion being one of the most persistent one.Not only it wastes our valuable time but also in some cases situations can go critical.
 Traffic congestion hampers the speed of vehicles which also include emergency vehicles like ambulances, police van and fire engines whose delay can put life of many at risk.
 Unnecessary waiting at the traffic signals due to unequal traffic density  Absence of knowledge about the routes of a city.
 Handling huge traffics can get daunting at times.
It's the emergency services which pay the maximum price when caught in traffic jams especially the ambulance services where situations can be very critical.To solve this problem we have come up with the solution of Intelligent Ambulance Traffic Assistance system using secure wireless networks.
Using this technology we make traffic signals automatically green as any ambulance comes in its vicinity, thereby minimizing the unnecessary time spent in traffic jams.As a result it gets a clear path to carry the patient to a nearby hospital which can be at times quite vital to save one's life.Moreover we find all the available paths from the current position of the vehicle to the hospital, highlighting the shortest or optimal path., this facility can also make up for the meagre knowledge of routes of the driver.It also solves the problem of language barrier which is experienced by many drivers who are new to a completely cultural diverse location where our program proves to be quite useful.
Since the changing of signals is completely automated we make the task of traffic operators quite hassle free and comfortable.
This facility further enables us to deal traffic according to its density.It's unnecessary to keep a whole lot of vehicles waiting at a 'red' signal for 60secs than letting few vehicles pass through 'green' signal for that equal amount of time.The path which has higher traffic density faces 'red' signal for www.ijacsa.thesai.orglesser time and more of green signal and vice versa.This greatly enhances the mobility of the vehicles As automated systems are taking over the manual ones due to their increased efficiency and human error free nature, introduction of this technology takes it to an advanced level.

I.
INTRODUCTION We aim to develop an automatic traffic control system which can function independent of any outside help.Our traffic control system is equipped with a distinct feature especially for ambulance through which it is being assigned priority in terms of getting a green signal ahead of normal vehicles.Along with that we are also determining the optimum path between any source and destination.But the most crucial point is that we are providing all these facilities with the help of very cheap and widely available technologies, which makes us distinct from others.
We implemented the following technologies in this project:  Python (as coding language)  Bluetooth(as a mode of communication)  Cryptography(to enhance system security)

What is Python?
 Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability.Python language stands out in comparison with respect to other programing languages as it:  Is compact.
 Can be packaged into standalone executable file which can cater to our several needs by using third party tools  Provides a simpler and better way to represent data in graphical form- Modules like matplotlib, visual provides us with the facility of mapping data in 2-D and 3-D form.
 Is an interpreted language, that allows for rapid, flexible, exploratory software development

Why python?
Python language stands out in comparison with respect to other programing languages in terms of its vast array of standard library and code readability.We chose it over other languages as it is more compact and also by using third party tools python code can be packaged into standalone executable file which can cater to our several needs.We have used third party modules like Bluetooth, matplotlib, pysqlite, cipher and visual.Bluetooth module helps us to perform the scanning and tracking operation.Python provides a simpler and better way to represent data in graphical form, in comparison to any other programing language.We did the implementation of the above with the help of module matplotlib.We have connected database to python with the module pysqlite as we need database connection in our project to bring coordination between the traffic signals.To provide security to the files used in the project from unscrupulous elements, we used the module cipher.By this module, we can easily form a sphere or other known figure in only a single statement, which in comparison, takes several steps in other programming language to accomplish.

Python over Java:
 Concise Coding style: The code in Python is typically much more concise than that of Java, with much lesser verbosity.
 Dynamic Typing: No requirement of declaring data types in Python making sure that the inheritance hierarchies especially for all the interfaces and implementations are well laid out.
 Built in language capabilities: Python has more built in language capabilities than Java.Items such as list comprehensions, ability to deal with functions as first class objects gives a broader vocabulary to work with.

What is Bluetooth?
 Bluetooth is a wireless technology standard for exchanging data over a short distance in a very efficient and lucid way.It is a technology standard for exchanging data over short distances (using shortwavelength radio transmissions in the ISM band from 2400-2480 MHz) from fixed and mobile devices, creating personal area network (PANs) with high levels of security.Created by telecom vendor Ericson in 1994 it was originally conceived as a wireless alternative to RS-232 data cables.

Why Bluetooth?
 It is very cheap and easily available-A Bluetooth adapter costs very less (around 200 INR) and can be found easily in the market.Therefore its maintenance can be done easily.
 It can connect several devices, overcoming problems of synchronization.
 It is very easy to install-Unlike its other connecting devices it consumes very less power so it can operate without an external source.
 Limited area of access proves to be quite an advantage for our project.
 Does not interfere with normal signalling of devices.
 Since our project mainly deals with ambulance and other emergency vehicles which can contain sophisticated and sensitive devices .These devices can get easily affected by the interference of an external signal and Bluetooth just avoids that.

Why better than Wi-Fi?
 Cost effective- Cost of setting a Bluetooth in comparison to Wi-Fi is much less.www.ijacsa.thesai.org Interferes with external signalling of devices- At the time of functioning, Wi-Fi devices tend to interfere with signalling of surrounding devices which can prove quite harmful in several cases when dealing with certain sophisticated and life saving devices.
 Lower power consumption and easy to maintain- A portable device's primary need is that it should consume less amount of power, but Wi-Fi devices require larger amount of power to function properly which makes it quite inappropriate within the context of our project.

What is cryptography?
Cryptography is the science of information security.It is about construction or formation of some basic protocols to overcome the influence of adversaries.Modern cryptography concerns itself with the following four objectives:  Confidentiality -the information cannot be understood by anyone for whom it was unintended.
 Integrity -the information cannot be altered in storage or transit between sender and intended receiver without the alteration being detected.
 Non-repudiation -the sender of the information cannot deny at a later stage his or her intentions in the creation or transmission of the information.
 Authentication -the sender and receiver can confirm each other's identity and the origin & destination of the information.What is the need of cryptography?
Our project deals with full automation of traffic signals which is vulnerable to any kind of anti-social activities which can prove quite troublesome.At the time when database is edited through scanner which is the deciding factor in management of the traffic lights any interference from any foreign unscrupulous element will make the whole situation more chaotic and can disrupt the whole traffic system.So by securing it we are trying to avert or avoid any such activities.

II. RELATED WORK
In this section we mention about previous works which have motivated us in implementing this project.We have seen a number of projects which used Bluetooth Scanning devices for various purposes.Coding of various projects is also done using python.The combination of Bluetooth and python has helped in developing different types of projects.In the paper 'WRife:a' wireless epidemic data collection protocol suitable for medical monitoring' by students of Texas University, we see that patient's health related data is collected using medical sensors.Fixed and mobile radio devices are used for disseminating information from medical sensors to the servers.In this project Wi Fi could have been used but RF radiation emitted by it interferes with medical devices and may also cause health hazards.The bandwidth requirement of Bluetooth is much less than that of Wi fi and is also low power consuming device, thereby reducing interference and safety concerns.Moreover in this project poisoning where attackers inject corrupted data causing the loss or modification of original message sample, various cryptographic ciphers have been used.sowe have also encrypted our database file before sending it to the client.The client can decrypt the file using the key.In another project 'A deadline driven epidemic data collection protocol suitable for tracking inter personnel rendezvous' we can see the application of Bluetooth for peer to peer wireless data collection algorithm.
In our project we have three components-ambulance which acts as the client, scanners which act as Bluetooth access points and master servers.When the ambulance sends signal to the scanner in order to get the database for finding the shortest path leading to the hospital, the scanner sends the database to the ambulance in an encrypted format.This similar approach is observed in another work 'In-Building Location using Bluetooth'.In this project the location of any mobile device can be detected using Bluetooth scanners.The received signal strength from each coordinate is sent to the server by the scanners.The server has a map of RSSI (Received Signal Strength Indication) at different coordinates.Thus it gives the deduced location of the mobile device by the use of the received RSSI and triangulation technique.
Step 2: Read the destination and the port number through which you want to communicate.
Step 3: Scan the nearest node/traffic signal scanner.
Step 4: Connect to the node scanner with the chosen port number, and send it a message.www.ijacsa.thesai.org Step 5: Receive the node and distance tables (database) in encrypted form from the scanner node, along with the name of the scanner.
Step 6: Decrypt the tables to get the actual values.
Step 7: Calculate the path using the procedure Calculate Path (source node name, destination node name and path).Initially variable path contains the destination node.

//PROCEDURE CALCULATE PATH
Step 8: For every neighbouring node to the current destination node, carry out the following steps.
Step 9: If this node is already present in the path: Go to step 8 and continue execution with the next value.Else: Go to step 10.
Step 10: Add the neighbouring node to the path.
Step 11: If this neighbouring node is the source: Go to step 12. Else: Go to step 15.
Step 12: Store the path.
Step 13: From the path, remove the last node traversed.
Step 15: Go to procedure CALCULATE PATH with only the destination node parameter being replaced by the neighbouring node.
Step 16: Remove the node just being added to the path.
Step 17: Return from the procedure CALCULATE PATH, fetching all the paths possible to go from the source to the destination.
Step 18: For all paths obtained between the source and the destination through the above procedure, calculate their respective distances with the help of the database.
Step 19: Store these distances in a list for later usage.
Step 20: Calculate the minimum distance of all the distance of the paths and store its position.
Step 21: Display all the paths, along with its distances in the window, where the paths are searched.
Step 22: Using the modules matplotlib (pyplot) and visual, plot the two dimensional and three dimensional views of the paths with respect to the co-ordinates of the nodes obtained from the database.The minimum distance path is differentiated by colouring it red while the rest are blue.
Step 23: End.Encryption: We can increase the level of security of our system by making the encryption key even more secure because only the secrecy of the key provides security and it's better to assume that the intruder knows the system.We can make the system even more secure by encoding the encryption key.We can do it by using a separate key (second level key) to encrypt the basic encryption key.Hence to www.ijacsa.thesai.orgdecrypt the file containing the information we have first decrypt the basic key using second level key and then decrypt the file using the decrypted basic key.This is known as second level encryption-decryption.Similarly we can increase the level of encryption-decryption by increasing the number of keys, each key, barring the final key, is encrypted.

IV. RESULTS
2) If we use AES instead of DES it will enhance the level of security of the system.We can also increase the size of the key from 128 to 256 bits but it will require higher hardware configuration which in turn increases the cost of the project.
3) Tracking of vehicles: we can track any vehicle as every vehicle will have an inbuilt Bluetooth device having unique MAC id.The Bluetooth scanners installed in the traffic signals will monitor the vehicle and the vehicle's path can be derived by fetching the time and the position of the Bluetooth scanners which are scanning the vehicle.Hence, we can derive the path of the vehicle by comparing the scanning time of the different Bluetooth scanners.

4)
Generalizing the ambulance concept: In our project the system give special preference to ambulance, where the signal allows its smooth mobility, blocking other signals.This concept can also be applied to fire engines and for the vehicles of VVIP's.The work load of traffic police is substantially reduced, thereby, less number of traffic police can be deployed.

5)
Stoppage time: We often encounter road blocks during maintenance, special occasions, procession etc.To avoid this kind of trouble we can introduce a new concept of "stoppage time", which is the time difference between the actual time and the ideal time taken by a vehicle to cover a certain path.We can incorporate this stoppage time concept along with the shortage path algorithm to find the real time optimal path.

VI. CONCLUSION
From a proper analysis of positive points and constraints of the system it is inferred that the system is working as per the objectives of the project.Installation and maintenance of the system is cost effective and takes less time.The systemuser interface is user friendly and does not require specialized training or skills to operate it.
The project has been designed to substantially enhance the performance by ensuring smooth mobility of emergency services (like ambulance, fire engines, etc.).The implementation of the algorithm is done in such a way that it not only paves way to emergency vehicles but it's auto reinstatement of the older status of traffic light helps in smooth transition of traffic along the road.The system also reduces the workload of traffic personnel as it totally automates the whole prospect of traffic signalling which also greatly reduces the domain of error.We have also equipped it with an algorithm which provides the user with the shortest possible path between destination and source which is the biggest asset in this era where people consider time as money.
Being an automated signalling system it eliminates the chances of human error which often results in road accidents and mishaps.
As discussed earlier, this project transforms the shortcomings (in terms of range and scanning time) of Bluetooth Technology into its strength thereby consolidating its applicability as the time lag between detection of two vehicles has to be wide enough to avoid any complications.A scan time of usually 8 seconds also provides us with adequate time for reinstating of older status of traffic lights.Thus this project is practically feasible, economically viable, and reliable in nature.It's robust as well as easy to handle mechanism makes it easy and quite simple to be understood and brought in use by the masses.Summing up we can say that this project with its ready to apply technology and cheap installation charges invariably finds its application in our traffic signalling system.
An improvisation of the project and subsequent modification of the system can serve our purpose as and when needed in near future.

VII. ACKNOWLEDGEMENT
The satisfaction that accompanies that the successful completion of any task would be incomplete without the mention of people whose ceaseless cooperation made it possible, whose constant guidance and encouragement crowned all efforts with success.
We are grateful to our project guide Mr. Avranil Tah and Mr. Abhishek Mallik for the guidance, inspiration and constructive suggestion that helped us in the preparation of this project.

Fig. 5 .
Fig. 5. Every possible path with distance along with the shortest path separately.

Fig. 7 .
Fig. 7. Every path along with shortest path in 3D plot V. FUTURE WORK Our project can be enhanced by working in the following area,  Encryption  Tracking of vehicles  Generalizing the ambulance concept  Stoppage time 1)Encryption: We can increase the level of security of our system by making the encryption key even more secure because only the secrecy of the key provides security and it's better to assume that the intruder knows the system.We can make the system even more secure by encoding the encryption key.We can do it by using a separate key (second level key) to encrypt the basic encryption key.Hence to