Implementation Of Fuzzy Logic to Identify Accident Categories In SMS-Based Two-Wheeled Vehicles

— Two-wheeled vehicle is the most popular means of transportation in Indonesia. As a result, it would cause several issues. One of them is an increased possibility of an accident to happen. In the event of an accident, quick aid from the public to the victim can reduce the risk of severe injury suffered by him. The person who provides aid to the injured victim may ask for money from the victim's family whose amount is not proportionate with the severity of the accident. In light of this, a system has been devised to identify and categorize the different types of accidents and send the formation to a family phone number registered electronically. The accident level is categorized using the Sugeno-type fuzzy logic method. The parameters used to differentiate the accident categories are speed, slope, and duration of vehicle braking time. The information is then sent to the registered phone via SMS that contains the accident category and the coordinates of the accident location provided by the GPS Neo 6 module. The algorithm is based on the vehicle's tilt angles, which range from 45(to the right) and -45(to the left). The fuzzy logic then determines the category, which processes and produces the accident category based on the speed and vehicle braking duration parameters. The proposed algorithm in this research will be experimented with using a real motorbike. Based on the experimental results, it has been found that the performance of the fuzzy logic method has an accuracy of 88.89% when determining the category of accident (light or heavy) and the time taken to send the information to the family member via SMS is quite fast.


I. INTRODUCTION
Two-wheeled transportation is the most popular transportation in Indonesia.In 2020, 115 million motorbikes were registered [1] [2].Data provided by the Directorate General of Land Relations stated that 149.000 accidents occurred involving motorcycles.It has the highest number of accidents compared to other types of vehicles [3].
When an accident happens, a quick response from the public is critical to save the victim first, especially in a quiet area.Due to this, we need information technology to report the accident location accurately.However, wrong information about the accident might be sent by a perpetrator who acts as the informer to the victim's family by phone, SMS, or WhatsApp.Then, the perpetrator would ask for money to provide information about the victim [4] [5].
Identifying the victim's condition using information technology has been widely used.As in [6], a Gyroscope sensor measured accident detection based on the tilt angle.The tilt angles from an accident range from 10 o -50 o (left) and 130 o -170 o (right).When the tilt angle of the motorbike reaches the limit, the notification will be sent to the victim's family by SMS.As in [7], it explained that the status of an accident was indicated by the tilt angle of the motor, and in addition, sent the accident's location by telegram and using the Exponential Smoothing method to reduce the error of the MPU6050 sensor.The tilt sensor cannot give an accurate location, and the tilt angle does not always indicate an accident.As demonstrated by [8][9], the severity of an accident was measured by the vibrations and change of speed in accelerometer sensors.It sends the latitude and longitude via SMS to share the information about the accident location to the victim's family.In [10], accelerometer and GPS (Global Positioning System) sensors are used to detect acceleration and coordinates of an accident with four categories: normal drive, sudden braking, and collision (front and side).The results show that 80% of accidents are frontal collisions, and 100% are side crashes.The accident was tested on a toy car as a model.[11] proposed an accident detection system that is measured using gyro and accelerometer sensors, and information on the accident location was sent automatically to the nearest hospitals and police stations.Accident detection is based on vibrations or speed changes and the driver's heartbeat [12] [13].
Based on the description above and the latest research findings, it can be concluded that the existing systems could only detect and send information off accident locations.However, in this research, a system that can detect and send accident information to phone numbers via SMS is proposed.Its purpose is to help the victims for a speedy recovery and minimize the fear of victim's family member when received by the accident information through SMS.To determine the category of accident levels, we will use the following parameters: (i) changes in speed, (ii) tilt angle, and (iii) braking duration.This paper did not use a toy motorbike as has been used by other researchers before but used a real bicycle to provide information regarding the accident level.This research uses the fuzzy logic method to get accurate results [14] [15].The CNN-Fuzzy method has also been used to predict the possibility of an accident [16].

II. RESEARCH METHODOLOGY
The research methodology begins with identifying the accident categories, designing the hardware and software that includes fuzzy logic while estimating the accident categories, and procedure testing.

A. Identify the Accident Category
Identification is a critical way to determine and design the algorithms.Referring to [17] [18], if we want to investigate an accident of a vehicle, we can obtain it from the tilt angle.Besides that, the accident can be estimated from vehicle vibration, as this variable can be measured from disturbances (rough and smooth surfaces).The methods proposed by [19] [20] are based on several cases to classify the accident categories related to the vehicle's speed and braking duration.

B. Block Diagram's System
Figure 1 is a diagram that shows the hardware design for identifying the accident category.This research uses several parameters to determine the vehicle's change of speed and tilt angle by using the MPU6050 type sensor and gyroscope sensor.Meanwhile, the limit switch is used to identify when the driver is braking.The accident information will be sent via SMS using the SIM800L module, while the GPS module has a function to find the coordinates of the accident location and justify the speed.

C. Fuzzy Logic Design
Overall, the flowchart of the proposed system is shown in Figure 2. The flowchart begins with the Arduino microcontroller reading the vehicle conditions, such as speed, tilt angle, and vehicle location coordinates, in real time, as the block diagram in Figure 1 depicts.If the tilt angle of the vehicle is put off the limit, the fuzzy logic will determine the accident category based on the speed and braking duration.Then, the results will be sent to a registered number via SMS to give information about the accident, such as the accident category and the accident coordinates.
The fuzzy logic has been designed to have a fuzzy system to classify whether the accident is light or heavy.In this design, the variables (input and output) will be used as the data, as shown in Figure 3.The inputs are the speed at the braking duration and the interval at the braking moment until it falls.Finally, the output will determine the type of accident (light or heavy).Variables such as speed, duration of braking, and accident level categories are shown in Figures 4, 5, and 6, respectively.The maximum speed to obtain the data was up to 30 km/hour.Meanwhile, the speed categories were also divided into four, namely very slow (VS), slow (S), normal (N) and fast (F).The membership function of braking duration is shown in Figure 5. Generally, the force will be ignored when the driver brakes the bicycle.The duration of braking time is classified into four: very fast (VF), fast (F), medium (M), and long (L).
This research uses Sugeno fuzzy, where the round values give the output.From the output curve shown in Figure 6, a light accident happens when the output is 50 and a heavy accident when the output is 100.The variables have a membership function of determining the values used to decide the inference process.As a result, a rule has been determined from the sensor as follows: This rule is used to determine the rule in fuzzy logic.The fuzzy rules are listed in Table I.

D. Testing Procedures and Stages
This process aims to measure the performance of each subsystem used.In this research, several tests have been performed which are: 1)Tilt angle sensor: Tilt angle testing is done by reading the sensor values rest and moving and testing the tilt angle compared to the angle on the arc.

2)Speed from GPS:
The speed is measured by riding a bicycle to get a speed value.The speed value will be compared to the speedometer.
3)Coordinates from GPS: This step is done to obtain the accuracy from GPS measurement works this step.The collected data will be compared using the Google Maps application on Android.

4)Send SMS via SIM800L:
This test is a program that is executed by sending a message to the family phone's number.

5)System integration:
It is a test that decides the overall system performance.The accident will be simulated by pressing the brake before the accident happens.This test used GPS and SMS to ensure the system functions properly.

III. RESULT AND DISCUSSION
The hardware has been designed and developed as shown in Figure 7(a).From Figure 7a, all electronic components are packaged into a box to make placing them on the bicycle easy, as seen in Figure 7 (b).The fuzzy logic algorithm designed for this research was embedded in the Arduino microcontroller.Each sub-system must be examined to obtain the findings, including the tilt sensor, the GPS Neo 6 module, and the precision of the fuzzy logic algorithm used to define accident types.

A. Tilt Sensor Testing
This test is performed to measure the accuracy of the tilt angle produced by the MPU6050 accelerometer sensor, as seen in Figure 8 (a).The angle ranges from 10-180 o with an average error value of 1.38%.The largest error occurred at an angle of 10 o , which corresponds to 3.9% (Figure 8b).From this experiment, it can be said that the MPU6050 accelerometer sensor has quite good accuracy.The next step is to test the sensor when installed perfectly on the bicycle, as shown in Figure 7 (b).Figure 9 shows the reading of the tilt angle of the bicycle in normal conditions.We assumed that the tilt angle is negative, it means the bicycle moves to the left, and vice versa.The results show that the tilt angle of the bicycle are typically between -10 o and 10 o .

B. Speed and Acceleration Sensor Testing
The GPS Neo 6 module measures the bicycle's speed and acceleration.We used a digital speedometer on a motorcycle to check the module performance, as seen in Figure (9).Meanwhile, there are a few categories for the tested speeds: low, medium, and fast, as shown in Table II.After the speed performance using GPS is obtained, the next step is to test the acceleration using a speedometer.In this test, the bike's speed increases from a rest condition (0 km/hour) to 30 km/hour, then back to rest.
In the acceleration test shown in Figure 10, it is concluded that the higher the speed is, the larger the difference between the GPS and the speedometer.The highest difference at the speed of 8.37 km/hour.A different scenario occurs when the bicycle decreases the speed from 30 to 0 km/hour.There is not much difference in speed between the GPS and the speedometer readings; the average difference is when it decelerates at 1.24 km/hour.This means that the speed reading by GPS is very responsive to the deceleration.

C. Testing Location Readings by GPS Neo 6 Module
The test is done by setting the tool in a certain location and displaying the latitude and longitude coordinates on the LCD.The coordinates will be input into the Google Maps application to see whether the tool's location matches the location displayed on the Google Maps application.In this test, latitude and longitude data were collected at several different points.
From Table III, the results of GPS accuracy testing show that, from 2 tests in different places, the coordinates measured on the GPS module when read on the Google Maps application match with the place where the GPS is located when seen from the photo and display from Google Street View.This means that GPS has quite a good accuracy.This implies that when an accident occurs, the system will be able to send information about the accident and the location of the accident with high accuracy.

D. Overall Testing
This test was carried out to determine the performance of decision-making carried out using fuzzy logic.As depicted in Figures 4-6, the designed membership function is converted into C language, which is then embedded into the Arduino mega 2560 microcontroller by Arduino IDE.Fuzzy Sugeno was used for decision-making to determine the type of accident.Fuzzy logic relies on two input parameters-the vehicle's speed and the amount of time it takes to brake-to make judgments.The fall condition is indicated when the bicycle suffers a tilt of more than 45 degrees for a right tilt and more than -45 degrees for a left tilt.This particular circumstance is illustrated in Figure 8.When the bicycle is declared to have fallen, the fuzzy logic will process two input parameters to determine the accident level category and categorize it into a light or heavy accident, then send this information and the location of the accident to the registered number via SMS.Testing was carried out on ideal roads with smooth road surfaces.The test was carried out at different speeds by pressing the brake button before the simulated accident.An accident simulation is carried out by dropping the bicycle or standing the bicycle as if an accident had occurred because the bicycle fell.The test was carried out several times in different conditions.A comparison will be made between all of the condition reading results and the actual conditions.
From the data in Table IV of the fuzzy test, it was found that the actual values did not match 3 times out of 27 tests, resulting in an error of 11.11%.The ability of fuzzy to read the conditions of accidents is 88.89%.The error value is obtained from the conditions that should occur in an accident based on the rules that have been created.Figure 11 shows that all test conditions can be sent to the destination number via SMS with information delivery accuracy of 100%, and the delivery speed is also quite good.The location sent corresponds to the location where the accident occurred.So, the algorithm built with fuzzy logic shows and determines accident categories based on speed and braking time to fall quite well.

IV. CONCLUSION
Based on the result, it was found that the simulation for creating a detection system that detected accidents and identified the accident category using the fuzzy logic method had quite good accuracy, which is 88.89%.When it detects an accident, good accuracy can be obtained if the tilt angle is 45 o and -45 o .However, the tilt sensor was less stable when used on a bicycle.A filter will be applied to solve this problem for the next project.

Figure 1 .
Figure 1.Block Diagram Of Proposed System

Figure 3 .
Figure 2. Flowchart Of The Proposed System

Figure 4 .Figure 6
Figure 4. Speed Membership Function (a) Tilt Sensor Testing (B) Tilt Sensor Relative Error Graph Figure 8. Model Performance

Figure 9 .
Figure 9. Reading Of The Tilt Angle Of The Bicycle When Used For Walking

TABLE IV FUZZY
LOGIC TEST RESULTS IN DETERMINING ACCIDENT CATEGORIES