# Periodical Vehicle Inspections with Smart Technology
## 2 Materials and Methods
### App Design
#### 2.1.3 Drive Brake Testing  
Brake failure-related crashes were discussed in [47], presenting an increasing rate of brake failure-related crashes with the age of the vehicle, which corresponds to conclusions in [41] presented in Table 1. Since the average age of a vehicle registered in Slovakia is still over 14 years, the drive brake testing feature has become a crucial aspect of this application. While roller bench devices are commonly used to test vehicle brakes, not all roller benches are suitable for certain vehicles or situations. For instance, roller benches may not be suitable for 4-wheel drive or agricultural vehicles. According to a survey in [48], dangerous defects related to brakes account for 2-3% of dangerous defects found in the agricultural vehicles category. In Slovakia, agricultural vehicle inspections can be performed on-site to avoid transporting the vehicles to PTI service stations. In such cases, the drive brake test serves as an alternative to the roller brake test, as stipulated by Slovak Republic legislation based on the United Nations Economic Commission for Europe Agreement [49]. Prior to 2021, decelerometers, such as the MAHA VZM300 [50], were used in these tests, which left ample room for fraudulent behavior since there was no way to verify the test results and there was no guarantee that the test had been conducted at all. According to the regulations, the function of brakes must be determined by either measuring the stopping distance relative to the initial vehicle speed and/or by measuring the mean fully developed deceleration during the test; for further information on the calculation and test procedure one can refer to an ISO standard [51]. There are multiple methods to measure the stopping distance using a mobile phone. One approach involves using GNSS sensors; however, these sensors have a limited update rate of no more than 1 Hz, as demonstrated in [52]. A more preferable alternative is to utilize the phone's inertial measurement unit (IMU), which typically generates data every 4-20 milliseconds, depending on the device's manufacturer and operating system version. To obtain the braking distance, the acceleration sensor data must be double-integrated, which can result in accumulating measurement errors. This positioning approach, referred to as dead reckoning, is unsuitable to be the sole method for localizing a vehicle. The capabilities of IMU positioning are summarized in [53], emphasizing its applicability for indoor use as well, while the effects of the cumulative error are discussed more closely in [54]. Nevertheless, in this scenario, the driving brake test, the measurement takes only a few seconds, which limits the impact of the cumulative error on the results. Therefore, in this mobile application, the measurement is based on IMU data through dead reckoning. The results provided by the phone measurements are consistent and offer a level of precision that is almost identical to that of the formerly used devices. Calibrating and testing each device before using it to measure the brakes is necessary for ensuring the accuracy and reliability of the safety system. Without such measures, it would not be feasible to use any device for this critical task. It is necessary to test the accelerometers at steady states every two years to ensure accuracy. Fortunately, the cost and frequency of calibration are comparable to those of previously used devices, so there is no significant increase in cost associated with this process. The process of performing a driving brake test is described in the sequence diagram shown in Figure 10. After selecting the vehicle designated for inspection, the inspector can press the \"driving brake test\" button. At this moment, the mobile phone should be securely mounted in a stand. Subsequently, the inspector can initiate the test during which they follow the instructions displayed on the mobile device. After completing the drive, the measured data are evaluated directly on the mobile device and the results are displayed on the device's screen.