# Periodical Vehicle Inspections with Smart Technology
## 2 Materials and Methods
### App Design
#### 2.1.2 OBD  
Although it is possible to gather more data from a vehicle using proprietary hardware and software, the solution being presented aims to be independent of vehicle make or manufacturer by utilizing the OBD II standards outlined in [44]. Special OBD readers, similar to the one described in [45], can be designed and developed as well, but it would result in additional expenses not only for the development and design stages but also for the maintenance of the devices in future. Our solution does not require any additional expenses on equipment or software licenses for PTI service stations since it employs a low-cost and widely available wireless OBD interface, the ELM327 (refer to [26]). The dongles utilized in the study were sourced from the lower end of the price range, approximately EUR 10 per unit. This device can also be used efficiently for research purposes, as demonstrated in [46]. The primary objective was to retrieve diagnostic trouble codes (DTCs) available via the open OBD service. Numerous smartphone applications are available that can read Diagnostic Trouble Codes (DTCs) using an ELM327 On-Board Diagnostic (OBD) reader. However, this particular application incorporates further PTI responsibilities and procedures, with an emphasis on preventing fraud by obtaining the following data:  
* ELM327 voltage: This is not the voltage requested from vehicles ECUs using OBD requests, but it is the voltage measured by the ELM 327 reader on the OBD port pins;
* VIN: The vehicle identification number is obtained by the OBD request. After successful parsing, it is compared with the VIN in the information system;
* DTCs: A request is also made for the list of permanent diagnostic trouble codes. There are additional communication features between the phone and ELM327, such as resetting to defaults, detecting the vehicle OBD protocol, and providing a list of supported services. However, these features are not extensively discussed in this paper. The sequence diagram shown in Figure 8 illustrates the process of gathering OBD data sending it to the national PTI server. After selecting the vehicle designated for inspection, the inspector can press the \"read OBD\" button. Communication is activated after selecting the correct ELM 327 module among Bluetooth devices. During OBD communication, requests are sent to the vehicle sequentially through the Bluetooth module, and incoming responses are processed accordingly. Every response from the vehicle is logged and transmitted to a central server for additional scrutiny in situations where the inspection has failed, the responses are incorrect, or there are any indications of possible fraudulent activity. Since 2020, these data have also been utilized in debugging and research endeavors, as it marks the initial year that such devices were integrated on a broad scale. Figure 9 illustrates the OBD reading screen screenshot. The results from parsed OBD responses are displayed in the upper section, starting with the VIN if the car does provide it via standardized OBD request according to [44]. Below the VIN number, one can see the status of self tests also referred to as readiness and the status of a malfunction indicator lamp also known as MIL. Then, the permanent DTCs are displayed below. The DTCs are displayed as hexadecimal figures and are subsequently parsed on the server. Figure 7: Photograph of gauges with malfunction indicator lamp on. The remaining portion of the screen displays the overall progress percentage, accompanied by check marks that indicated accomplished tasks, providing the inspector with more comprehensive feedback on the ongoing inspection. In case certain readings fail and must be repeated, delays may occur. Occasionally, some vehicles may not be compatible with the other vehicles. Figure 8: Sequence diagram for gathering and sending OBD data. Figure 9: OBD reading activity. with the ELM327 reader, in which case the inspector must at least attempt to connect via Bluetooth, record the voltage, and submit requests to the vehicle multiple times.