SANJYOT – WE SAVE LIFE Using Big Data-Apache Spark

With its high importance in the Indian economy, roadways are one of the major forms of transportation in India that cannot be avoided. There is a public safety problem with roadways and a significant number of injuries in our minds. Due to lack of proper real-time monitoring of the accident details that could be transferred to the nearest police station, hospitals, the percentage of incidents in the country is rising to such a high level that leads to loss of human life. Paper helps to provide a solution to this issue by providing information on the location of accident and the severity of the victim during the accident, which will be instantly shared with the police station, hospitals with details such as images, location, video and impact of the accident for quicker decision making, will improve the chances of saving the lives of the sufferers. It is a system which is fully automated. Therefore, protecting the lives of individuals will be a huge contribution to humanity.


Introduction
An accident is not unavoidable, and not intentionally caused, which result in multi-causal (like an injury) to large numbers of people across the world every year. There are various reasons for road accidents such as carelessness and inexperience of drivers, defective and obsolete vehicles, paucity of roads and narrow roads, overtaking tendency, lack of dividers in roads, violating traffic rules, reckless driving, lack of implementation of strict traffic laws, and so on [24]. This in turn has an adverse effect on the economy of the country as well as the loss of the valuable lives [5]. Road accidents are mainly results of factors, those can broadly be grouped as: 1.
Due to human error.

2.
Due to the road environment 3.
Due to vehicular conditions.
Each year nearly 1.3 million people die as a result of a road traffic collision, more than 3000 deaths each day and more than half of these people are not travelling in a car [16]. In a country like India, there are many places which have poor road facilities which leads to a large number of accidents and leads to a higher death rate due to accident and also sometimes damage of property.     lack of on-time medical facilities to suffer/s, it increases the chance of death.

Valuable life of a person is lost:
When the accident takes place there may be chances that due to the high impact of the accident, the injury of the victim is such that he/she may lose their valuable life.
3. Lack in contacting to Family Members: Sometimes the victim is not in a condition that he/she could contact their family member to inform about the accident because suffer is not in a state to inform.
There is, therefore, an immediate need for such a device that can assist in transmitting the accident details to the nearest authorities. This automatic detection of vehicle collisions is a life saving technology that is important for high-speed motorways today [3]. in danger and require immediate help, by sending the voice message to their family members and authorities [9]. The system SANJYOT assures that the information of the accident spot is given to the nearest police station and hospital. The system provides the current GPS location, images, and video streaming of the accident spot which will help to make faster decisions. The system automatically calculates the Impact Force when the person is driving the car, thus when the accelerometer reading is increased above the limit and hence the impact force is not in the given range then the chance of accident is increased and at that time the information from the database is been send to the authorities This system has an advantage from the earlier developed system, as it could provide information like image, location, and voice recording of the accident spot even if no network is available. If an injured victim does not receive any emergency medical care at that very moment or at the earliest which can make a large difference in his/her chances of survival, as every single minute matters then. In case of highway accidents, acknowledgement to the proper authorities is highly needed [17] so the system SANJYOT would help save life of people suffering an accident. The work presents and automated accident detection device which is saviour of life, after keeping the human life in mind [2].

Benefits of SANJYOT
1. Notify about the impact force, when an accident occurs: If an accident occurs then the reading of mass, velocity and distance will be calculated through the load sensor, Accelerometer, and Ultrasonic sensor respectively. These parameters calculate the impact force and notify that an accident had taken place.

Significant decrease in death caused in Road
Accidents: The notification to the nearest hospital and police station is supplied by our device. The emergency service will then be immediately given to the victim to save the life, minimising the mortality rate caused by a road accident. The information is easily transmitted via the image and video when the internet connection is available, but when the internet connectivity is not available, the system sends the SOS message to the concerned person with the exact location of the crash using GSM [2].

3.
To communicate or inform about the accident even if network availability is not available: In some scenarios, when the Internet is not available then sending information is difficult. So to overcome this issue, the SMS alert is sent to the Police Station by SOS using GSM [26].
4. Fast alert notification by a message to emergency care centres like the police station and hospital etc, to intimate about the accident: System will work in real-time and if the accident occurs then the system, sends the location, images and video using Apache Spark if the internet is available and if it's not available then it would send the only location.

5.
To provide utmost aid or support even in deserted or isolated areas : In case of Accidents, the victims require aid and proper treatment if not provided on time then it may lead to death. To solve this issue the device would be in continuous connection with the sensor attached in it, providing useful information in worst situations and scenarios also where people hardly stop to help the victim.
Furthermore, the paper includes the problem statement, experimental setup, working procedure including algorithm, use case, then the conclusion and possible scope (future scope).

Problem Statement
The transportation industry roughly contributed 6 mobility across India, would take lesser travel time and free up time for people. At the same time, a large number of road accidents take place, with no proper management system available to cater to such accidents which increases the chances of loss of life. At the spot of the incident, the sufferer does not need to receive immediate medical attention (first aid). As there is a lack of communication system establishment and also tell the impact force, which would convey the incident occurred to the nearby/local hospitals or authorities who could take necessary immediate actions [32]. To improve road safety, it is important to determine all the risk factors that associated with the road traffic accident and accident severity [6].The system SANJYOT will be there as the solution to such problems and its main aim is to provide alert about accidents, by streamlining time in speeding up reporting to related parties (police, hospitals) [1].

GPS: Global Positioning System
GPS is used in vehicles for both tracking and navigation [18]. It provides information about location and time. This can be accessed from any place on earth. The location that GPS provides will be pictured (visualized) by using Google Earth and this will help in tracking the vehicle's movement and its location. GPS does not require any input, it takes location automatically.

GPS consist of three components-
• Satellite: They send the signal to track the locations automatically [14].
• Ground Station: They consist of the Radars, which ensures that the location provided is correct [14].
• Receiver: They are the signals received on the phone to track the person's location [14].
GPS module will require a 10Hz update rate, with 14 channel tracking which gives exact location. Having two serial ports, UART (Universal Asynchronous Receiver Transmitter) which provides communication between microprocessor and GPS module and SPI (Serial Peripheral Interface) interfaces which is used to send data between a micro controller and peripheral devices. The GPS provides latitude and longitude information about vehicle location to control section through GSM [20]. It requires 28 mA operating current and high sensitivity. GPS would track the car to get its correct location so that help can be provided immediately.

GY-521 Accelerometer
This device measures the acceleration by a change in capacitance, which is the rate of change of the velocity of an object. The SI unit of Acceleration is meter per Second Square (m/s2). The GY-521 has an Invent Sense MPU6050 chip which contains a 3-axis accelerometer (range is ±2, ±4,±8, ±16g) and a 3-axis gyro meter (range is ±250, ±500, ±1000, ±2000 °/s) [25].
• SCL (Serial clock Line) and SDA (Serial Data Line): Responsible for primary I2C communication.
• ADO: It is a slave or master interface.

ESP8266 WIFI
Wi-Fi is Wireless Fidelity, which is one of the most used wireless networks [12]. Internet connectivity. It will be used to transfer data like location, images, and video to the database [26].

Figure 4. Wi-Fi Module
Wi-Fi module will act as an Access point (can create hotspot) and as a station (can connect to Wi-Fi) as well. This eases in fetching the data and at the same time will upload it on the database, it will also fetch data like images, location, and videos from the database using spark APIs.

Arduino Uno Microcontroller
Arduino is an open-source computer hardware and software company. The Arduino community design and utilizes microcontroller-based development boards known as Arduino Modules. Arduino Uno is a microcontroller board based on an 8-bit ATmega328P microcontroller [15].

Figure 5. Arduino Uno Module
The ATmega328 has 32 KB memory (with 0.5 KB used for the boot loader) (Badamasi, Abdullahi , 2014). It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library). In our system, Arduino Uno helps in communication between sensors on a single circuit board (platform).

Ultrasonic Sensor
An ultrasonic sensor is used to measure the distance to an object using ultrasonic sound waves. An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that relay back information about an object's proximity. The ultrasonic meter measures the height of a vehicle body from the Ground. The ultrasonic pulse is generated using a piezoelectric transducer and the echo reflected by the ground is received by another piezoelectric transducer. The two transducers are mounted close to each other to make up the measuring head i.e. the time between the transmission and the reflected signal. The distance of the object from ultrasonic sensors determines the accuracy of measurement [8] and is calculated by the following formula [30]:

ESP32-CAM
The ESP32 is a low-cost system-on-chip (SoC) series created by Express if Systems. ESP32-CAM is a very small camera module with the ESP32-S chip, OV2640 camera, and several GPIOs to connect peripherals, it also has a micro SD card slot which is used to store images taken with the camera which can be used to store information. It has both Wi-Fi and Bluetooth capabilities, which make it an allrounded chip for information transfer. ESP32-CAM has 160MHz clock speed and built-in 520 KB SRAM, external 4MPSRAM and requires an external 5V power source for its proper functioning.

Load Cell Sensor
The load sensor is one of the sensors which is used to measure the mass of an object and transmit the readings into the electrical signals. In other words, a load cell sensor is a transducer which helps to convert the load or force into the output signals. In the load cell, the strain gauge's physical determination is used in the conversion. And it is also connected with the Wheatstone bridge. It is connected with four Gauges to make a complete bridge. DC supply is required to excite the circuit. If any stress is applied, then the Wheatstone bridge is unbalanced and gives an output signal which is measured through the stress value. It is designed based on the type of output signals i.e. hydraulic, electrical, etc. And they measure the load in the form of tension, shear, etc. There are various types of load cells designed such as Compression Load cell, Tension Load cell, Miniature load cells, Bending Beams Load cell, etc. It is used in many fields like crane safety monitoring, weighs platforms, lifting, seawater load cells, etc.  [21] . GSM is used to reduce and digitize the data which is sent to the other network using the two different streams of a channel at the particular time slot. Micro, Pico, Macro, and umbrella cells are the different cell sizes used in GSM networks for implementation and it varies with their implementation domain. It can easily carry the data at a rate of 60 Kbps to 120 Mbps, used to send the Short Message Service (SMS) at a high speech quality. GSM also makes the phone calls secure using encryption techniques and support new services, it has high compatibility with the integrated services digital network (ISDN) which improves the efficiency of Spectrum. To achieve the major end-toend security, the secrecy of GSM is ensured on the radio channel. GSM modems like SIM 900 produce the output TTL for Arduino using PCB, in which a GSM module is connected with the Arduino which then sends and receives signal and gives the output in form of TTL .

Working Procedure
This system Sanjyot will provide real-time information about accident spots which would include its location using Global Positioning System (GPS), images, and videos of the accident spot.
The device is installed in the car, which would continuously record the videos and pictures of the road using ESP32-CAM, which would be sent to the cloud (database) using ESP8266 Wi-Fi.

EAI Endorsed Transactions on
Cloud Systems 09 2020 -12 2020 | Volume 6 | Issue 19 | e6 The accelerometer would provide information about the acceleration [29], 3-axis accelerometer (angle), and 3-axis gyro meter (angle), and the ultrasonic sensor provides information about the distance between the objects. The ultrasonic sensor and accelerometer would be used to detect whether the accident took place or not, i.e. if the acceleration of the vehicle is greater than 2.5g (>2.5 g) and the presence of any object is detected then the alert would be sent that the accident had taken place.
The pictures and the videos of the accident spot will be shared with the nearby police station and the hospital and also with their family members, informing them about the accident. If there is no Internet connectivity, then SOS (Save our Soul) will be sent to the police station so that they could take necessary action. In any of the situations, the notification about the accident would be reached to police or/and hospitals near the accident spot.

Algorithm
There are many algorithms which help us in analysing data [28]. Machine learning and data analytics techniques are a boon in this field so we were using the clustering algorithm [11].
Step 1: When the driver drives his/her car. The device has a camera (ESP32-Cam) installed in it and it is positioned in such a way that it records the front scenario of the road in the moving direction of the car. The recorded data is then uploaded into the database with the help of WiFi.
Step 2: The device has sensors which are placed in it, to detect the accident. Sensors like GPS, Accelerometer, Load Cell sensor and Ultrasonic sensor all these measure their readings ( i.e. location of the car, acceleration, mass and distance between two vehicles respectively ) and give it to Arduino UNO Microcontroller, which would be use to gather the readings taken by sensor for decision making.
Step 3: All the readings are updated into the database and then the condition is checked. If the Acceleration is greater than or equal to 2.5 g and the time gap between the two vehicles is less than 2 sec then the accident had occurred. Otherwise no accident occurred and step 1 and 2 continued.

8
Step 4: If the Accident has occurred then the next thing would be to send the information about the accident to the nearest police station and hospitals. Alongside the Impact of accidents is calculated using mass, velocity and distance measured through the sensors. All this information would be sent, depending on the Internet availability. If the internet is available then step 5 follows otherwise step 6 follows.
Step 5: The internet connectivity is available then all necessary recorded data (like audio, video, images, location and impact of the accident ) is taken from the database and streamed to the nearest police station and hospital, using Apache Spark.
Step 6: If the Internet connectivity is not available then our device would send information like location of accident (Latitude and longitude) and SOS. It would be sent using the GSM module to the nearest Police Station only.
Step 7: Once the information about the accident is received by the nearest police station or hospital, then they could take necessary actions and save valuable live/s.

Impact Force
The clusters are classified according to speed but to find the impact of the accident i.e impact force which will be calculated using the following equation[27]: F = m * v² / (2 * d) where 'F' is the impact force that is calculated using this equation, 'm' is the mass of the car, the readings are taken with the of load cell sensor, 'v' is the velocity/speed of the car, the reading is taken from the speedometer, 'd' is the distance between the cars or object which is taken from the ultrasonic sensor.
Position,speed of the vehicle (car) and velocity values of the vehicles have been collected and the vehicles which are showing different behavior from others have been detected [13] and we have classified 4 clusters based on the speed of the vehicle (car). Once the impact force is calculated by substituting the values in the above equation, we can easily segregate the impact of the accident [31]. The impact force will enhance decision making since it will tell the intensity of the accident so that the necessary action can be taken on an urgent basis because a slight delay may even cause death.

Figure 12. Working flow diagram
The impact force is calculated from the values present in our database, for example:

Cluster 1: Speed >30kph
If a car moving with the speed 28 km/h, and the mass of the driver is 70 kg and the collision distance is 20 m and the time duration is 3 seconds. Then the impact force is calculated and produces 105.864 N impact force and peak impact force is 211.728, so we have classified the impact force into cluster 1, concluding that there is very little impact.

Cluster 2: Speed < 30kph and Speed > 60kph
If the car is moving with speed 50kph, the mass of the driver is 70 kg and the collision distance is 20m and the time duration is 2 seconds, then the average impact force is calculated to be 337.577 N and peak impact force is 675.154, this shows that the condition belongs to the cluster 2, concludes that there is less impact of the accident.

Cluster 3: Speed < 60kph and Speed > 90kph
If the car is moving with speed 85 kph, the mass of the driver is 70 kg and the collision distance is 20m, then average impact force is calculated to be 975.598 and peak EAI Endorsed Transactions on Cloud Systems 09 2020 -12 2020 | Volume 6 | Issue 19 | e6 impact force is 1951.196 N, this shows that the condition belongs to the cluster 3, concludes that there is the moderate impact of the accident .

Cluster 4: Speed < 90kph
If the car is moving with speed 100kph, the mass of the driver is 70 kg and the collision distance is 20m, then impact force is calculated to be 1.350 KN and peak impact force is 2.701 KN, which shows the condition belongs to the cluster 4, concludes that there is high impact of the accident.
When all the readings are recorded from the sensors like distance is measured using the ultrasonic sensor, acceleration from the accelerometer, the mass of a car from the load cell sensor, location using the GPS, speed from the speedometer and timespan between two cars will be calculated with the readings of distance and speed. All the readings recorded will determine the impact of the accident, which will further help in determining the accident-prone area. If the reading of the accelerometer shows a threshold greater than 2.5 g where 'g' is the gravitational acceleration and its value is 9.80665 m/s2. The location of the car is then recorded and also checks the time gap between the cars. If the time-span is in the range of 2 to 5 sec, then speed is checked to categorize the impact of the accident i.e. severity of Accident. The speed is then categorized into the different clusters according to the cluster condition which places it in a suitable cluster and helps in easy classification of impact force. Clusters are set out based on the speed of the vehicle like if the speed is less than 30 Km/h then the impact force of accident would have less impact if speed is in the range between 30 Km/h-60 km/h, then the accident would be placed in less impact category, and if the speed is greater than 60 Km/h and less than 90 kph then the accident would have moderately impact and if speed is above 90 km/h then the accident has high impact, which might even let to death. Table   Table 3. Clusters are classified into four parts on the basis of the speed limit.

Cluster
Hence the segregation of the speed into the different clusters will find the impact force, which will help in deciding to prevent the accident in the future.

Conclusion
The number of accidents is increasing day by day in today's time, and people's live are at higher risk. In several situations, because of no timely information about the accident, the victim does not get on-time medical facilities. This leads to a high mortality rate (road injury) due to lack of medical treatment on time. This raised the need for a system to provide on-time information about the accident site, in which the victim can receive medical attention and adequate treatment on time depending on the seriousness of the accident. Proposed system SANJYOT is an ideal solution to this battle of life problem by notifying the accident using the proposed algorithm for this system to measure the total impact. It will help to provide the survivor with the right care and will also strengthen the decision making. The low-cost alert system is proposed to provide accident victims with immediate medical assistance by alerting the nearby hospital and police station with the exact location of the accident spot and the victim details [4].
Since the system provides real-time data to be uploaded to the database as it captures the moment of the accident using a camera and sharing the accident information to the nearest police station and hospital. If the network is not available, then the SOS alert will be sent using the GSM module to the nearest police station, otherwise the information is sent via Wi-Fi when the internet is available, along with the location of the accident detected using the GPS module, it will provide information on the severity of victim, i.e. the impact of the accident on the victims [26]. This will provide the victims with medical facilities on time, thus reducing the likelihood of death. Through this research, we have proposed an accident notification device to make the world EAI Endorsed Transactions on Cloud Systems 09 2020 -12 2020 | Volume 6 | Issue 19 | e6 a better place to live and drive safely. Also, at the same time, the system is more user-friendly and reliable. Thus this will provide the vital information about the accidents even in unpopulated area. So, the emergence care center could be able to serve to the victims with better efficiency and thus they could plan to have important first aid kits which have to be brought along with them to the accident spot [19].

Future Scope
The information provided by SANJYOT can be used to indicate which area has the maximum probability of an accident, as well as the impact force of accident, it will also assist the Government to take necessary measures to reduce any future losses, based on the data available.