Motorized Vehicle Diagnosis Design Using the Internet of Things Concept with the Help of Tsukamoto's Fuzzy Logic Algorithm

— There are many popular branches, including the Internet of Things (IoT) and Artificial Intelligence (AI), which have solved many problems. Same as that, the automotive field is also growing with the technology of OBD-II. Unfortunately, not many people are familiar with OBD-II even though the features offered are very varied to prevent vehicle damage. This proposed work uses an IoT and AI system to make a vehicle diagnosis system with a help of OBD-II technology. By using ESP32 to collect data in each vehicle and using one Mini-PC to run the diagnosis with Fuzzy Logic Tsukamoto for three or more vehicles, this work can decrease the research cost. This work also uses the Fuzzy Logic Tsukamoto to diagnose vehicle health which is considered very suitable in real-time data situations. The method that we proposed is using Iterative Waterfall because of its simplicity and because there is a feedback path in every step. Iterative Waterfall is divided into 4 stages, Requirement Gathering and Analysis, System Design, implementation of Development, and Testing. Numerical validation is included by using MAPE for the testing in the IoT system and AI system. According to the MAPE result for the IoT system, the engine off voltage is 0.9510789847% and the engine start voltage is 3.136217503% which is considered a very good result. The MAPE result for the AI system is quite high, which is 20.74364412%, and because of that, the AI system needed more research for better performance. Overall, the system that has been proposed is already successful in monitoring vehicle health based on the parameters that have been determined.


I. INTRODUCTION
Technological developments in this era have changed how computing and communication systems work. The internet has undergone a massive expansion in recent years, leading to its widespread use by people of all generations [1]. According to [1], the development of the internet has become a separate trend and has become very popular in recent years. There are 204.7 million Internet users in Indonesia, reaching 73.7 percent of the population in 2022 [2]. The use of the internet has become very popular in many fields in the last few decades [1].
One of the uses of the internet that is growing quite rapidly today is the Internet of Things (IoT) [3], [4] because the technology supports and allows a system to retrieve data through sensors and then connect to the internet. Because the system can connect to the internet and users directly, the IoT [5] system will always use a smart device to support its work system [6]. Therefore, IoT [7]- [12] is considered an alternative to many problems that can be found in today's developing industries [6]. Many smart tools see the success of IoT developments solutions to an existing issue, namely smart parking systems, smart garbage boxes, air pollution detectors and many others [13] However, the implementation of IoT is not just that. One example of the implementation of IoT in the automotive industry is to improve the quality and safety of existing motorized vehicles [14].
Like the internet, the automotive sector is also experiencing rapid progress, one of which is the development of the Electronic Control Unit (ECU), which almost 80% of vehicles have used [15]. In the ECU, a standard can assist a technician in diagnosing the vehicle's condition, namely the OBD-II standard. According to [16], this OBD-II standard has been arranged by CARB (California Air Resources Board), ISO (International Standardization Organization), EPA (Environmental Protection Agency), and SAE (Society of Automotive Engineers). According to [17], the use of OBD-II is beneficial for motor vehicle users and technicians, then OBD-II has also been widely sold in the market.
However, it is very adverse because just minor people or companies have used the OBD-II standard for monitoring vehicle health [17]. Using technology to assist people in maintaining vehicle health is a very good solution because using traditional fault detection methods is not efficient [18]. In the last decade, several studies focus on how to make a system for diagnosing a vehicle's health to help people maintain the vehicle more easily [14], [17], [18].
In connection with diagnosing vehicle health [19]- [25], there are many branches with many functions and uses in the world of computers. One of them is decision-making. Decision-making that has a close relationship with IoT is Fuzzy Logic [26]. Fuzzy Logic has a relatively light process, so it is very suitable to be combined with IoT, which has uncertain conditions and data that quickly changes [26]. Fuzzy Logic is so simple because the rule of Fuzzy Logic itself is just IF-THEN.
Other studies, such as by [37], explain how to handle overheating cases in large vehicles that occur in international mining contractors using the sensor DS18B20 to measure the engine temperature. The topics raised are similar, but not many have discussed how to apply the system in cases with many vehicles [17].
Moved by all of the studies that have been reported in this work, a diagnosis of vehicle health is designed a system using IoT as a data collector and AI to decide the vehicle health. The main contributions in this work are as follows: • In research that has been conducted by [14], the author uses a Mini-PC for data collection and processing of data using Machine Learning. However, this research can be very costly because if it is applied to 2 or more vehicles, more tools are needed. In this work, using ESP32 for data retrieval, then using a separate mini-PC as a place for processing AI using Fuzzy Logic Tsukamoto can cut costs incurred if you want to implement it into 2 or more motorized vehicles.
• Then studies [17], [37], [38] also use a similar concept, by displaying vehicle health results but there is no diagnostic process on vehicle health using a combination of several different parameters. In this work, a system is formulated using AI in the form of Tsukamoto's Fuzzy Logic which can display vehicle data along with vehicle health diagnosis results using 3 parameters, namely engine off voltage, engine start voltage, and engine coolant temperature.
Therefore, the authors wants to develop a solution in the form of an IoT-based system by utilizing technology, namely OBD-II which can retrieve existing data on motorized vehicle ECUs. From OBD-II and using ESP32 , the authors want to take 3 data, which are the vehicle engine off voltage, engine start voltage, and the engine coolant temperature. This research is also completed with Artificial Intelligence (AI) [39]- [45] in the form of Fuzzy Logic, which is the decisionmaking for vehicle health diagnosis results. By using Fuzzy Logic, the designed system can provide diagnostic results according to the limitations by experts. The result from Fuzzy Logic is a percentage on a scale from 0 (very bad) to 100 (very good). This research is expected to assist users in monitoring vehicles operating in large numbers and predicting the maintenance time for operating vehicles.

1) IoT
IoT [46]- [48]is one of the most famous paradigms in informatics fields that allow users to connect between electronic devices and sensors or actuators via the internet. IoT itself is a combined term of 2 words, namely "Internet" and "Things", and when combined with an item on the internet [49].
IoT [50]- [55] cannot stand alone, but by combining smart systems, frameworks, smart devices, and the internet, IoT becomes a complete system. Many parties have used IoT as a solution to existing problems because they use smart devices and the internet [6].

2) ECU
ECU or Electronic Control Unit is an embedded system that is already installed in a vehicle to regulate an electronic and mechanical system. The ECU will take data from sensors and ECUs in other systems as input and will issue output to actuators. Each sensor and actuator are connected with a specific bus, so each bus and read and send data to ECU [56] At present, most vehicles use ECU to facilitate the technician to monitor the vehicle.

3) Artificial Intelligence (Fuzzy Logic)
According to [57], Artificial Intelligence or AI [58]- [66] is one of many branches from computer science that is commonly used to fill an important role in a system. AI technology has many conveniences. Generally, what AI can do, is to make decisions, problems solving, language understanding, and or logical reasoning for a system.
One branch of AI's ability to make decisions is Fuzzy Logic. Fuzzy Logic is an advancement of Boolean Logic that show results other than true and/or false [67]. Three methods are used to achieve defuzzification Tsukamoto, Mamdani, and Sugeno [68]. Next, according to [69], the application of Fuzzy using the Tsukamoto method is considered very good and efficient in solving and simplifying problems whose context and scope are complex.
Four parts of the Fuzzy logic process must be carried out in the algorithm [69], namely: • Fuzzification, the initial stage of the Fuzzy method, converts the existing values from the expertise into Fuzzy variables with their respective membership degrees. The membership degrees can be divided according to the threshold that we use. For example, when there are 2 indicators like good or bad, there are 2 membership degrees that are formed by that. Let's say that the good one is linear up and the bad one is linear down, so the membership degree for the "good" indicator is shown in the Fig. 1.  After that the, the membership degree for "bad" indicator is shown in Fig. 2. • Define Fuzzy Rules: Defining Fuzzy rules is the stage that makes rules based on experts to achieve maximum control.
• Inference Process, the inference process is the calculation stage, where the main process is to search the alpha-predicate value (α-predicate1, -predicate2, ... -predicate). The alpha-predicate value is used to find the inference value or is usually announce as z ( 1 , 2 , ...., ). Implication functions in mathematics are used to complete this process, but it is conditional on the Fuzzy rules that are made, if the conjunction in the Fuzzy rules use "AND", then the implication function must be MIN. However, if the conjunction of the Fuzzy rules use "OR", then the implication function must be MAX.
• Defuzzification is the last step in the Fuzzy logic method. In this step, the writer uses the Tsukamoto Method instead of Mamdani Method, and Sugeno Method because of the simplicity of Tsukamoto Method. By using the average method to find the result of Fuzzy Logic. Therefor, the equation for Tsukamoto's Defuzzification is using the average [69]: Where is defuzzification value to , − is alpha predicate is inference value to-, is amount of fuzzy rules.

B. Testing with MAPE
The author wants to use the MAPE [70], [71] or Mean Absolute Percentage Error because MAPE is one of the few testing methods that really suits IoT and Fuzzy Logic [72]. This method aims to find the error rate of every testing data from the system that was designed. Therefore, to find MAPE is based on Error Rate, so the equations for Error Rate is [73]: Where is error rate ( ), is result value from a system, is predicted value.
After calculating the error rate, MAPE can be found by [73]: Where MAPE is Mean Absolute Percentage Error, is error rate ( ), is sum of tested data.
Therefore, an article says that MAPE are more advantageous than RMSE or MSE because of the result that MAPE and MAE yield is more natural [74]. The authors also say that with MAPE methods, the report will be easier foreaders [74].

C. Related Works
The previous research by [16] explains how to retrieve data from the vehicle to the MCU (Master Controller Unit) via OBD-II. The system described can provide additional features that do not yet exist in motorized vehicles such as GPS Tracking.
Previous research was also conducted by [75] who described retrieving and collecting OBD data on vehicles by communicating via Android phones with OBD and ELM327 Bluetooth modules. In this study, [75] used Android assistance to retrieve data on OBD so that the data could later be uploaded to the server. After uploading, the data obtained will be analysed and processed so that users can view vehicle information in real time.
Similar research [76], discusses how to retrieve data in the form of vehicle conditions and GPS from OBD-II and send it to FMS. This research also uses Message Queuing Telemetry Transport (MQTT) [77]- [80] to send data from IoT devices to servers.
Similar research was also conducted by [18], explaining how to create a system that can upload GPS data and OBD-II information via a wireless network using a 3.5G network module.
Another study conducted by [81] also discusses retrieving data from the ELM327 device, which will be processed by an Android phone to determine the condition of the motor vehicle from a predetermined threshold. In addition, [81] describes how to send the data to the back end, which the user can use via the web portal.
Based on previous research that already exists, we take topics related to vehicle diagnosis but by applying a different process, namely Fuzzy Logic with Tsukamoto Methods as an algorithm for vehicle health diagnosis for displaying management and monitoring of vehicle health conditions.  Waterfall model is that there is a feedback path to the previous step, which is very useful in solving problems in the software in particular phases. The following is a development method from this research [82]. The author uses this workflow method and can be divided as follows:

• Requirement Gathering and Analysis
Collecting and searching for the right problem formulation, topical information originating from scientific report sources, international journals related to OBD-II technical data, vehicle health, IoT, AI for decision making, MQTT protocol, platform Thingspeak, vehicle diagnostic algorithms, programming languages for software and hardware that can help strengthen the foundation of the chosen topic. The expected result in this phase is that the project has a strong knowledge base to proceed to the next stage.

• System Design
Create a hardware design for IoT system that includes an OBD-II Reader (ELM327) and microcontroller using ESP32 by creating a mock-up scheme or device flow, flowchart, wiring scheme, schematic diagram that will simplify the hardware system development process and will implement using C++ programming language. Design a software development using flowchart, block diagram, define the threshold, and designing every steps of Fuzzy Logic that will implement using Python programming language. The expected result in this phase is to have a strong design, both in software and hardware, that will facilitate the system implementation phase.
• Implementation of Development Carry out the system implementation process by assembling hardware and coding using the programming language based on the System Design that has been designed for each system, both hardware and software. The expected results in this phase are hardware and software that can be integrated into a complete system and complete their tasks properly.

• Testing
Conduct trials on hardware and software systems by carrying out manual tests with a predetermined number of frequencies. The testing methods is using MAPE or Mean Absolute Percentage Error for both IoT and AI system. For IoT system, the tested parameters are Engine Off Voltage and Engine Start Voltage. The expected results are data from manual testing that align with the system that have been design, which mean the MAPE result shows quit low value.

B. Data Collection from IoT
The author plans to take 3 data, namely the battery voltage when the engine is off, the battery voltage when cranking, and the engine coolant's temperature. Retrieval of these 3 data will be carried out by ESP32 [83], [84], which is connected directly to ELM327 as follows in Fig. 4. In the Fig. 4, it is explained how the system works. First, the system will initialize and start all the systems needed, like Wi-Fi, MQTT, and ELM327. Secondly, the system will check the engine condition. If the "Start Button" haven't pressed, the system will assume the engine is in off condition, then the system will read and upload the "voltage_off" data repeatedly to the IoT Platform.
After that, while the "Start Button" is pressed and the engine is cranking, the system will read the "voltage_start" and upload it to IoT Platform. After the engine is running and the "Start button" is not pressed, the system will read and upload "coolant_temp" to IoT Platform repeatedly and will not read "engine_off" and "engine_start" anymore until the system shut down when ignition keys is turned off. To complete for designing the IoT system, Fig. 5 is a device flow for IoT devices, starting from connect the ELM327 to OBD-II port in vehicle. After that, when ESP32 is powered on, that will connect to ELM327 using Bluetooth to collect the data. By requesting PID from ESP32, ELM327 can access and collect data from OBD-II. After ELM327 gets the data, ELM327 will send the data back to ESP32, and ESP32 will upload the data to the IoT Platform in form of ThingSpeak using MQTT. After designing the Device flow on general, the authors designed an wiring scheme and schematic diagram for the IoT system to be more detail. The wiring system is designed with the aim that the IoT system can switch on and off automatically when already installed to the vehicle without having to use other tools such as electricity from other source or anything else. The wiring scheme can be seen in Fig. 6. Based on the wiring scheme, the following is a schematic diagram to make it easier in assembling IoT devices as follows in Fig. 7.  According to the design in Fig. 6 and Fig. 7, here are some hardware and software that needed in the proposed IoT System to develop a complete system as shown in Table I and  Table II.

C. Data Processing with Fuzzy Logic Tsukamoto
After the system successfully collects and uploads all the data to Thingspeak, the authors uses a Mini-PC (Raspberry Pi 3b) to run the AI program. The AI program will GET data from Thingspeak and store it temporarily for the next process. The next process is to run the Fuzzy Logic Tsukamoto program to find the results of a vehicle health diagnosis. The AI program will be running in Mini-PC as shown in the block diagram and flowchart abin Fig. 8, and Fig. 9. There are limitations in every data that the author wants to use. The first one is for the battery voltage for the engine off; the threshold can be seen in the Table III threshold that the author uses are based on [85], [86]. The second one is the threshold for battery voltage for the engine start, in the Table IV. The last one is the threshold for the engine coolant temperature. The threshold that the author uses is based on [81], the author from that research said that the danger limits from engine coolant are around 220 o F or 104 o C, and it's shown in the Table V. From the threshold that already assign, the authors can finally design the Fuzzy Logic with Tsukamoto Algorithms. According to the previous section on Fuzzy Logic Theory, there are four main steps that must be design, which are:

• Fuzzification
In this step, the authors use the threshold that already assign in Tables III, IV    This research uses three parameters where it is one of the most important aspects of the motorized vehicle, by the reason of that, wherever one of the parameters is on the "bad" condition, the system will automatically diagnose the vehicle as "bad". Therefore, in the Fuzzy rules, the authors agree to use the conjunction "AND" to find the minimum of alphapredicate in the inference step.
As for the total of the Fuzzy rules is 3 3 = 27, because the authors use three parameters and wants to include all the possibilities. The Fuzzy rules are: In the inference step, the main purpose is to find the alpha predicate and the inference value. To find the alpha-predicate, the system will using the Fuzzy rules to find the minimum value. After that, there are three conditions based on the minimum alphapredicate that have been found, there are good, warning, and bad. To find the inference, the formula is based on the "diagnosis" membership degree (on the formula 15, 16, and 17).

• Deffuzification
The last step is defuzzification, and this step will be using the formula from number 3.
After the system has finished diagnosing the health of the vehicle, the results and data will be posted by the Raspberry pi to the database.
There is some software and hardware that needed in the AI system as we already proposed before, it shown in Table VI  and Table VII.

D. Data Show
Data that has been previously processed using a Fuzzy algorithm is displayed on Firebase Storage (Firestore Database). In the Firestore storage, general vehicle information and diagnostic results are displayed.

IV. RESULT
In testing, the data that authors have collected is 50 data, and from 3 motorized vehicles. In this sections, we conclude in to 3

A. Collecting Data with IoT
In IoT system, the testing will take the data from ECU with help of OBD-II. Here are the results shown in Fig. 9, and the proof, that the IoT system that the authors already design is working as it proposed. By using the IoT system shown in Fig. 14, the system can retrieve data after we install the tool into the vehicle, shown in the Fig. 15. After the data has been retrieved, the IoT system will automatically send the data to the IoT platform in the form of ThinkSpeak. The following is an example of proof that data has been successfully sent by the IoT system and received by the IoT platform. After that, to convince that the proposed system is already accurate, the testing for IoT system will also use the MAPE methods for two parameters: the voltage of engine off, and the voltage of engine start or cranking. The authors agree to use the Avometer to get the current voltage, whether it in the off state or start/cranking state. The purpose from that is to get the predicted value for MAPE. Here are the results shown in Table VIII, IX.  The main reason that engine coolant temperature is not included is the lack of equipment and time to really research what is the best methods or sensors that can get the engine coolant temperature while the engine of motorized vehicle is on.

B. Testing Fuzzy Logic
Next, the data on ThingSpeak will be retrieved using the mini-PC in each registered vehicle. After the mini-PC has successfully retrieved the data, the AI system that is already running will process every data on each vehicle that has been registered. The following is an example of evidence when the AI system runs to retrieve data to carry out the diagnosis process for each vehicle and send it to the storage using Firestore. As in the IoT testing, the authors used the same data set that was already collected. In this case, the authors use Fuzzy Logic Toolbox using the Mamdani algorithm to find the expected results and calculate the MAPE value. Here are the tables that shows the Fuzzy value that the authors already design and the Fuzzy value from Fuzzy Logic Toolbox:

C. Discussion
The proposed IoT and AI system has already been tested in 3 motorized vehicles. The main purpose of this is to find the accuracy of the proposed system that has been designed. By using the MAPE methods, we can see the results of the proposed system, whether it is already accurate or not.
In this case, the results of IoT testing for 2 parameters namely Engine Off Battery Voltage and Engine Start Battery Voltage, are very good. By comparing the system with Avometer, the MAPE for Engine Off Battery Voltage is 0.9510789847% and Engine Start Battery Voltage is 3.136217503%, which is very low. That also means the validity percentage of the data that the author's system gets and the Avometer is quite high as shown in the Table IX. After the IoT system, according to Table XI, the MAPE for the Fuzzy Logic with Tsukamoto that the authors design is quite high, shown by 20.74364412%. This result indicates that the system with Fuzzy Logic Tsukamoto in this system is quite inaccurate compared to the Fuzzy Logic Toolbox using the Mamdani algorithm. Therefore, the validity of this system is 79.25635588%.
To end this discussion, the difference between our work and previous work is mainly in the "Approach used", as shown in Table XII. The main strength of this work that if we want to implement this sistem, the cost for the IoT system will decrease because we uses ESP32 to collect 3 data from vehicle. To complete the diagnosis, we also uses Fuzzy Logic Tsukamoto to make a diagnosis vehicle health by using the 3 collected data Making an user interface for OBD-II based on Arduino Uno.

IoT
Randis et al, 2018 [37] Making an IoT system to monitor engine temperature to prevent over heat at the mining district.

IoT
Our work Making an IoT system to collect data using ESP32, and AI system using Fuzzy Logic Tsukamoto algorithm in the mini-PC to diagnose the vehicle health.

V. CONCLUSION
This work has shown how to get the data with the proposed IoT device, from ECU's vehicles, using a device called OBD-II and with a help of AI in the form of Fuzzy Logic Tsukamoto to diagnose the vehicle's health. As shown in Table, the proposed IoT system is already working well and accurately with the low MAPE value 9. While the proposed AI system is working quite well. Compared with the Fuzzy Logic Toolbox using Mamdani, the proposed AI (Fuzzy Logic with Tsukamoto) get a quite big MAPE value as shown in Table XI. The system designed by the authors already works fine. Although the data reported here only used three data from vehicles, this works shows that it is possible to make a diagnosis for vehicles from the ECU in real-time situations. Future works can try to obtain more parameters or data from ECU to expand the scope. For example the resistance of the battery for more accurate battery State of Health (SoH), tyre pressure, etc. In the same way, AI decision-making for diagnosing the vehicle can also be tried by different methods, like Fuzzy Logic with Mamdani, Sugeno, or any kind of decision-making to gain more accurate results. There are some suggestions for software development to develop an application to facilitate the end user. This software can use the concept of the fleet management system to make a complete monitoring vehicle.