# Internet of Things (IoT)-Based Solutions for Uneven Roads and Balanced Vehicle Systems Using YOLOv8
## 3 Methodology
### Stabilization Method
#### 3.3.1 Stabilization Strategies for Vehicle Body  
**(1) Hill Method:** When a car's wheel falls off a hill, only that wheel becomes unbalanced. To restore balance, the servo motor at the top of the wheel must be adjusted to stabilize the car's upper portion. When two wheels fall off the hill, both must be balanced. Similarly, when three wheels fall off the mountain, all three must be balanced. Balancing a car's body with a rotated servo motor and hole depth. Our demo project operates effectively up to a maximum hole depth of 2 cm. Max Hill = 2.0 cm  
Min Hill = 0.0 cm  
The GY-521 sensor provides x-axis values: 135 for a 2.0 cm hill and 120 for a 0 cm hill. Our model stabilizes when the hill height is 0 cm, with the servo motor standing at \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**Feature** & **YOLOv3** & **YOLOv4** & **YOLOv5** & **YOLOv7** & **YOLOv8** \\ \hline Detection head & Anchor-based & Anchor-based & Anchor-based & Anchor-free & Anchor-free \\ Post-processing & NMS & NMS & NMS & Extended NMS & Task-specific \\ Segmentation support & No & No & No & Yes & Yes \\ Object tracking & No & No & No & Yes & Yes \\ Export formats & Darknet & Darknet & ONNX, TensorRT & ONNX, TensorRT & ONNX, VINO, CoreML \\ Accuracy (COCO dataset) & 55\% & 65\% & 68\% & 71\% & 99\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: _Cont._a 90-degree angle relative to the surface. When the hill height is 2.0 cm, the servo motor stands at a 10-degree angle in Table 4.  
We also observe that if the hill height is \(0<\) height \(<2\), it follows a linear equation to stabilize the car body:  
\[A=mH+nX+C \tag{5}\]  
**where:**  
* \(H\) is the height of the hill;
* \(X\) is the GY-521 x-axis value;
* \(C\) is the y-intercept;
* \(A\) is the angle of the servo motor. We solve for \(m\) and \(n\) using the following equations:  
\[m(0)+n(135)+C = 90 \tag{6}\] \[m(2)+n(120)+C = 10 \tag{7}\]  
Since the servo angle follows a linear pattern mainly influenced by \(X\), we simplify the relationship to:  
\[A=pX+q \tag{8}\]  
Using the data points \((X=135,A=90)\) and \((X=120,A=10)\):  
\[90 = p(135)+q \tag{9}\] \[10 = p(120)+q \tag{10}\]  
Solving for \(p\) and \(q\):  
\[p = \frac{10-90}{120-135}=\frac{-80}{-15}=5.33 \tag{11}\] \[q = 90-(5.33\times 135)=90-719.55=-629.55 \tag{12}\]  
Thus, the final equation becomes:  
Table 4.0  
For an integer angle value rounded down to the nearest multiple of 10:  
Table 4.1  
Figure 2 represents the bump-angle ratio for heterogeneous scenarios. \begin{table}
\begin{tabular}{l c c} \hline
**Height of Hill (cm)** & **Axis X** & **Angle of Servo Motor** \\ \hline
0.0 & 135 & 90 \\
2.0 & 120 & 10 \\ \hline \end{tabular}
\end{table} 
Table 4: Servo Motor Angle Adjustment Based on Detected Hill Height and GY-521 X-Axis Values. **(2) Hole Method:** The same equation determines how much to rotate the servo motor to stabilize the car when a wheel hits a pothole. If a car wheel strikes a pothole, all the servo motors connected to the car's wheels must rotate accordingly. To assess the effectiveness of the detection and stabilization system, it will be tested on various types of roads, including urban roads, rural dirt tracks, mountainous areas, and coastal regions. We undertook a real-life simulation utilizing a prototype vehicle to illustrate the practical viability of our proposed servo-based stabilization approach. The system was implemented on a sloped surface, wherein elevation changes necessitated real-time angle adjustments facilitated by the GY-521 sensor and servo motors, as presented in Table 5. This scenario validates the control logic's accuracy under physical conditions. The hardware supporting our proposed approach has been physically constructed, as depicted in Figure 3, alongside examples of real-life vehicles navigating diverse terrains shown in Figure 4. This implementation establishes a fundamental basis for subsequent experiments and evaluations, which will be elaborated in the following sections.