# A Low-Cost IoT-Based Bidirectional Torque Measurement System with Strain Gauge Technology
## 4 Results  
The IoT-based torque measurement system was calibrated and validated using both clockwise and counterclockwise torque applications. This comprehensive approach ensures the sensor's response is well-characterized for bidirectional torque, which is essential for many practical applications such as drivetrain analysis and reversible mechanical systems [3, 21, 34]. Calibration was performed by applying known torque values to the instrumented shaft in both directions using a certified dynamometric wrench [5, 43]. For each torque increment, the sensor's raw digital outputs were recorded. The raw digital output of the sensor was used directly for calibration and measurement calculations. This approach is more suitable for continuous torque monitoring, where it is not practical to return to zero after every measurement. It is recommended to periodically perform a zeroing procedure, either after a certain number of measurements or after a set number of operating hours, to compensate for potential drift and offset that may accumulate over time. Table 1 presents the averaged digital measured sensor values corresponding to each applied torque level, for both clockwise and counterclockwise directions. A nonlinear relationship was observed between the applied torque and the net sensor value in both directions. This bidirectional calibration enables the device to accurately measure both positive (clockwise) and negative (counterclockwise) torques using a fifth-order polynomial regression model. All calibration and regression formulas used in this work are based on the procedures described in ISO 376:2011 [44], adapted for nonlinear calibration. The relationship between the applied torque (\(T\)) and the digital sensor value (\(DV\)) was established using fifth-order polynomial regression, as shown in Equation (1) [5]:  
\[T_{i}=a_{0}+a_{1}DV_{i}+a_{2}DV_{i}^{2}+a_{3}DV_{i}^{3}+a_{4}DV_{i}^{4}+a_{5} DV_{i}^{5}+\varepsilon_{i} \tag{1}\]  
where \(T_{i}\) is the applied torque, \(DV_{i}\) is the averaged digital value, \(a_{0}\) to \(a_{5}\) are the polynomial coefficients, and \(\varepsilon_{i}\) is the residual error. The coefficients \(a_{0}\) to \(a_{5}\) were determined using the ordinary least squares (OLS) method in matrix form, as presented in Equation (2) [45]:  
\[\hat{a}\ =\ \left(X^{\mathrm{t}}\cdot X\right)^{-1}\cdot X^{\mathrm{t}}\cdot T \tag{2}\]  
where \(X\) is the Vandermonde matrix is constructed from the digital values (\(DV\)), and \(T\) is the vector of measured torque values. This approach minimizes the sum of squared differences between the measured and indicated torque values, providing the best-fit polynomial coefficients for the calibration curve. The goodness of fit was quantified using the coefficient of determination (\(R^{2}\)) as defined in Equation (3) [46]. This is the classic definition of the coefficient of determination, which quantifies the proportion of variance in the dependent variable (torque) that is predictable from the independent variable (sensor output). This is a standard statistical metric. \[R^{2}=1-\frac{\sum_{i=1}^{n}\left(T_{i}-\hat{T}_{i}\right)^{2}}{\sum_{i=1}^{n} \left(T_{i}-\overline{T}\right)^{2}} \tag{3}\]  
where \(T_{i}\) is the measured torque for the \(i\)-th data point, \(\hat{T}_{i}\) is the indicated torque from the regression model, \(\overline{T}\) is the mean of measured torque values, and \(n\) is the number of data points. The \(R^{2}\) value indicates how well the regression model fits the observed data. An \(R^{2}\) value close to 1 signifies that the model accounts for nearly all the variability in the measured torque, confirming the appropriateness of the polynomial model for this calibration. For the obtained values, \(R^{2}\) = 0.99916, confirming excellent agreement between the polynomial fit and the experimental data, thus validating the model's reliability. The calibration curve was constructed by plotting the mean digital sensor values against the applied torque for each calibration point.