Enhancing the Accuracy of Low-Cost Inclinometers with Artificial Intelligence

: The development of low-cost structural and environmental sensors has sparked a transformation across numerous fields, offering cost-effective solutions for monitoring infrastructures and buildings. However, the affordability of these solutions often comes at the expense of accuracy. To enhance precision, the LARA (Low-cost Adaptable Reliable Anglemeter) system averaged the measurements of a set of five different accelerometers working as inclinometers. However, it is worth noting that LARA’s sensitivity still falls considerably short of that achieved by other high-accuracy commercial solutions. There are no works presented in the literature to enhance the accuracy, precision, and resolution of low-cost inclinometers using artificial intelligence (AI) tools for measuring structural deformation. To fill these gaps, artificial intelligence (AI) techniques are used to elevate the precision of the LARA system working as an inclinometer. The proposed AI-driven tool uses Multilayer Perceptron (MLP) to glean insight from high-accuracy devices’ responses. The efficacy and practicality of the proposed tools are substantiated through the structural and environmental monitoring of a real steel frame located


Introduction
Civil engineering and architecture are undergoing a significant transformation in the era of the fourth industrial revolution, also known as Industry 4.0 [1].This digital revolution is fundamentally changing how professionals in these fields approach the planning, design, construction, and maintenance of both infrastructures and buildings.Cuttingedge methodologies and technologies, such as Building Information Modeling (BIM) [2], which allows for the digital and interdisciplinary representation of physical assets, and artificial intelligence (AI) tools capable of performing tasks traditionally requiring human intelligence, are at the forefront of this transformation [3].
AI tools encompass a wide range of applications and capabilities, including, but not limited to, machine learning [4,5], optimization algorithms [6], computer vision [7], and deep learning [8,9].Thanks to their ability to improve decision-making processes offering innovative solutions even to complex problems, AI tools are reshaping both civil engineering and architecture [10].In fact, the growing interest in the utilization of AI tools within these fields is well documented in the existing literature.For example, Huang et al. [11], Lagaros and Plevris [12], Manzoor et al. [13], Dede et al. [14], Pan and Zhang [15], and Lu et al. [16] reviewed the application of AI tools in civil engineering, while Momade et al. [17] and Bölek et al. [18] documented the recent applications of these tools in architecture.
One of the most promising research areas in the fields of civil engineering and architecture is structural health monitoring (SHM), as this technology aims to ensure both the safety and reliability of structures [19].Historically, SHM relied on conventional sensors and manual inspection methods to assess the condition of infrastructure, such as bridges, buildings, and pipelines.However, with the integration of AI technologies, SHM is evolving into a highly efficient and proactive discipline.In fact, AI-based solutions are able to process vast amounts of sensor data in real-time, enabling the early detection of structural anomalies, defects, and potential failures.The applications of AI tools in structural and health monitoring were reviewed by Sun et al. [20] and Salehi and Burgueño [21].These works also analyze the challenges and future trends associated with the application of AI tools in these fields.
Sensors play a key role in SHM applications by enabling the collection of real-time data on-site.Among the most common sensor types employed in SHM are structural sensors like accelerometers and inclinometers, as well as environmental sensors for measuring ambient temperature.A critical consideration when selecting a monitoring system is its costs.Historically, cutting-edge sensors often came with substantial price tags, limiting their deployment to well-funded research projects or industrial applications.However, over the past decade, there has been a remarkable surge of interest within the academic and research community in the adoption of low-cost sensors.The cost-effectiveness of these devices allows for the deployment of larger monitoring solutions, facilitating comprehensive monitoring across multiple locations within a reduced budget.This scalability proves especially advantageous in scenarios requiring dense sensor networks.Additionally, the versatility and adaptability of low-cost solutions make them suitable for customization and integration with existing systems.This fosters innovation and opens up endless possibilities for customized monitoring strategies.Some of the fields benefiting from the application of low-cost sensors include environmental monitoring (for assessing air [22], water quality [23], and measuring noise levels [24]), healthcare (for monitoring vital signs [25]), agriculture (for soil monitoring [26]), building management (for monitoring indoor air quality [27], occupancy [28], and energy usage [29]), building monitoring (for ambient temperature and transmittance monitoring [30]), and structural monitoring (for measuring distances [31] and accelerations [32]).Comprehensive reviews of the application of low-cost solutions for building, mining, and corrosion monitoring are presented in [33,34], respectively.Among the wide array of monitoring devices, inclinometers, commonly referred to as tilt sensors, deserve special attention for their widespread application across SHM [35].For instance, in the context of bridge health assessment, researchers such as Huseynov et al. [36] employed rotation measurements from inclinometers to detect structural damage, while in building structural analysis, Jun et al. [37] demonstrated the efficiency of inclinometer-derived rotation data to efficiently identify damage in building beams.

Low-Cost Inclinometers
When considering cost-effective approaches to measure inclinations, one efficient strategy in the literature involves the application of Micro-Electro-Mechanical System (MEMS) accelerometers [38,39].Noteworthy examples of the successful development of this technology are found in the work of Hoang et al. [40], who designed an orientation system for industrial applications, Woong Ha et al. [41], who engineered an economical inclinometer for ground movement estimation, Ruzza et al. [42], who investigated the measurement of landslide inclinations, and Yu et al. [43], who monitored structural oscillations.It is important to clarify that, similar to any commercial solution, the instrumentation of a structure with sensors involves additional costs, such as labor, cabling, boxing, and so forth.LARA, like other solutions, requires these tools.Notably, a significant distinction between LARA and most commercial inclinometers lies in the fact that LARA does not need a separate data acquisition system.Therefore, from a logical standpoint, it is anticipated that the instrumentation of a structure using LARA would be faster and more cost-effective and efficient than other commercial alternatives.
Despite the advantages of low-cost MEMS accelerometers working as inclinometers, this monitoring solution also comes with certain inherent challenges.Firstly, these devices may require frequent calibration to maintain accuracy and can experience drift over time, making their readings less reliable if not regularly recalibrated.Secondly, these sensors can be sensitive to environmental conditions such as temperature and humidity, further impacting their accuracy.Lastly, low-cost sensors often have a shorter lifespan compared to higher-quality sensors, resulting in increased maintenance and replacement costs over time.In the current literature, there is a growing trend of employing various research approaches to enhance tilt measurement resolution using MEMS sensors [39].Among these methods, two commonly utilized techniques include the complementary filter and the Kalman filter [44].The complementary filter functions by averaging the computed angles from both the accelerometer and gyroscope, assigning distinct weights to each sensor.It should be noted that scholars frequently note that the Kalman filter requires substantial computational resources [45,46].As a result, inclinometers implementing the Kalman filter typically exhibit a lower sampling frequency compared to those utilizing the complementary filter [47].To further enhance measurement resolution, there are also AI applications discussed in the literature.For instance, Podder [48] provides a literature review of AI applications for MEMS accelerometers, primarily focusing on fault detection and sensor diagnosis.Other works, such as Gou et al. [49], Qi [50], Pan [51], and Wang [52], employed AI to mitigate temperature-related issues in low-cost MEMS accelerometers.
Another major concern of low-cost sensors is their potentially lower accuracy compared to more expensive commercial alternatives.This limitation may restrict their utility in those applications demanding high precision.For example, in the MEMS accelerometers, factors such as noise, non-linearity, and cross-axis sensitivity can introduce inaccuracies in the measured acceleration data.To address the accuracy issues associated with MEMS accelerometers working as inclinometers, Komarizadehasl et al. [44] developed the monitoring system LARA (Low-cost Adaptable Reliable Anglemeter).This device is capable of measuring either accelerations or inclinations, in addition to monitoring temperature and humidity.In contrast to other low-cost solutions in the literature, LARA employs a strategy to enhance its performance by averaging measurements from five distinct low-cost MEMS accelerometers, all operating together with a multiplexer.This approach effectively reduces the sensitivity of the reference low-cost sensor MPU9250 from 0.055° to 0.002°.However, it is worth noting that the advantages derived from averaging data from different accelerometers have certain limitations, and LARA's sensitivity still falls considerably short of that achieved by other high-accuracy commercial solutions, such as EL Tiltmeter SC [53] or ACA 2200 [54], which reach resolutions of 30 × 10 −5 ° and 10 × 10 −5 °, respectively.In the literature, AI tools have been used to increase the precision of low-cost sensors.This is exemplified by the work of Hoang et al. [55], who highlighted the advantages of these techniques in enhancing accuracy orientation tracking using MEMS inclinometers.No prior studies have explored the benefits of employing low-cost MEMS inclinometers with an AI tool in the literature for estimating structural deformations.

Low-Cost Inclinometers in Smart Homes
Smart homes refer to residences equipped with a range of connected devices and systems that leverage automation, communication, and intelligent control to enhance the overall living experience [56].These structures are based on advanced technologies to manage and optimize various aspects of daily life, including security, energy efficiency, entertainment, and convenience.Sensors play a crucial role in the functionality of smart homes by providing the necessary input for intelligent decision-making and automation.In particular, inclinometers contribute significantly by identifying changes in the orientation or inclination and finding integration into various smart home devices, offering unique features and automation possibilities.Examples of the application of inclinometers in smart homes encompass smart window coverings capable of dynamic adjustments based on the sun's position, door and window sensors monitoring opening inclinations, pet care devices facilitating the monitoring of food or water levels, and smart appliances ensuring optimal inclination levels.
Unlike more expensive alternatives, low-cost inclinometers offer a cost-effective solution for expanding the array of monitoring elements, thereby supplying valuable data for home automation [57].Examples of low-cost inclinometers for smart homes include the work of Wang et al. [58], who developed a screen-printed flexible radio frequency identification (RFID) sensor for measuring inclinations in smart home objects.
The workflow for developing an inclinometer-based system for smart home applications comprises the following steps: (1) data collection: inclinometers measure tilt angles and microcontrollers process the data; (2) communication: microcontrollers transmit inclinometer data to the central processing unit through wireless communication; (3) data processing: central processing unit interprets inclinometer data, and algorithms are used to determine if any actions need to be taken based on the tilt information; (4) automation: automation scripts execute actions such as adjusting devices or triggering alerts; and (5) user interaction: users can monitor inclinometer data and configure automation settings through a user interface.A summary of the key hardware and software components for the design of a smart house system using low-cost inclinometers is presented in Table 1.

Aim of the Paper and Structure
This paper introduces the development of a novel AI tool to improve the accuracy of low-cost monitoring MEMS accelerometers when employed as inclinometers.The proposed methodology leverages an AI-driven tool equipped with artificial neural networks to derive incline estimations from the input data collected by LARA, including rotations, temperature, and humidity readings.To do so, this AI tool undergoes supervised training using data from a high-precision inclinometer as a reference.The effectiveness and practicality of the developed methodology is demonstrated through an analysis of a real-world case study involving a steel frame located in Cuenca, Spain.
The remainder of this paper is structured as follows: Section 2 presents the research methodology followed in this work.Section 3 presents a detailed analysis of the main characteristics of the low-cost monitoring system LARA, including both its software and hardware.In Section 4, the AI tool developed to enhance the accuracy of the rotations acquired by LARA is detailed.In Section 5, the practical application of these tools to the case study is summarized.Finally, the main conclusions are drawn in Section 6.

Research Methodology
The primary objective of this study is to develop an AI-based tool designed to enhance the precision of inclination measurements taken using low-cost sensors.The system developed is tailored to integrate with the LARA low-cost monitoring system and complementary low-cost environmental sensors.To achieve this main goal, the research also defines the secondary objective of conducting an experimental investigation into the impact of environmental variables, particularly temperature and humidity, on the rotational behavior of a steel frame.To accomplish these objectives, the Design Science Research Method (DSRM) proposed by March and Smith [59] was employed.
This methodology was structured on the stages, activities, and deliverables presented in Figure 1, and it is summarized as follows: 1. Stage (i)-State-of-the-art review: This stage aims to identify gaps in the existing literature.Initially, this involves a systematic literature review of low-cost MEMS inclinometers.This is followed by an examination of how artificial intelligence tools can address the technical limitations of these devices.The literature reviews for this stage were conducted on Scopus and Web of Science, following the systematic approach proposed by Navarro et al. [60] and followed by Komary et al. [34].Finally, the research methodology to be employed is defined.The outcomes of this stage encompass a summary of findings, the research objectives, and the customization of the research methodology.The results derived from this stage are included in both the Introduction and Section 2: "Research Methodology".2. Stage (ii)-Solution design: After defining the hardware and software components of LARA, this phase articulates the characteristics and design of the AI tools that will be employed to improve LARA's measurement precision.The deliverables of this phase comprise the principal functionalities of LARA and the AI tool.This information is incorporated into Section 3: "Low-cost Adaptable Reliable Anglemeter (LARA)", and 4: "Artificial Intelligence Tool".3. Stage (iii)-Case study: This phase involves developing an AI tool to improve LARA's measurement accuracy within a case study.Initially, a case study is selected for analysis.Long-term monitoring of the structure is then conducted using both commercial inclinometers and LARA.Following this, the AI tool, designated as Intelligent (I)-LARA, is tailored to the specific dataset of the case study.The deliverables of this stage include the AI tool to enhance the accuracy of the monitoring information.These results are summarized in Section 5: "Case Study".4. Stage (iv)-Evaluation: This stage is designed to evaluate the enhancement of the accuracy obtained by the AI tool in the case study.To achieve this, the outputs of LARA and I-LARA are statistically analyzed and compared with the readings from the commercial accelerometer.These results are incorporated into Section 5: "Case Study" and Section 6: "Conclusions".

Low-Cost Adaptable Reliable Anglemeter (LARA)
LARA, the acronym for Low-cost Adaptable Reliable Anglemeter, refers to a monitoring device designed to measure structural parameters (accelerations or inclinations).Unlike most low-cost accelerometers in the literature, LARA possesses a distinctive feature: it can be remotely configured to operate as either a triaxial accelerometer or inclinometer [44].When functioning as an inclinometer, LARA utilizes the accelerometers along the X, Y, and Z axes to determine the orientation with respect to the gravitational force.It is important to mention that LARA is a calibrated low-cost inclinometer equipped with a complementary filter integrated into its Arduino code.The decision to employ a complementary filter was driven by the limitations of the Arduino platform, which lacks the capacity to incorporate a Kalman filter while maintaining an adequate data read frequency.This choice eliminates the need for a high-powered computational system typically required for Kalman filter calculations.As a result, LARA achieves a higher sampling frequency compared to when a Kalman filter is utilized [44].The technical specifications of LARA working as an inclinometer are detailed in Table 2.The analysis of this table shows that as an inclinometer, LARA can reach a precision of up to 0.002° working in the static mode for a measurement range between 0 and 4°.The application of LARA has been validated for the dynamic monitoring of bridges [61].Subsequent sections offer detailed descriptions of LARA's hardware and software.It should be noted that, even though LARA exhibits comparable accuracy to certain widely used commercial inclinometers in infrastructure monitoring, such as the HI-INC sensor [61], it falls short in terms of accuracy when compared to some highly precise commercial inclinometers like EL Tiltmeter SC [53], which comes with a high price of EUR 15,000 and a resolution approximately seven times better than that of LARA.To enhance the resolution of LARA beyond the already implemented signal processing tools and filters, such as the low-pass filter, this paper explores the local calibration of a low-cost inclinometer with a high-resolution one.The primary objective is to locally calibrate a few instrumented lowcost sensors rather than solely relying on high-resolution expensive sensors.This approach aims to reduce monitoring budgets, unlock the potential for long-term monitoring applications using affordable systems, and efficiently utilize the available economic resources.

LARA Hardware
This subsection provides a comprehensive overview of LARA's key hardware features.LARA is presented in Figure 2a, and it consists of five precisely aligned and synchronized MPU9250 chipsets, complemented by a multiplexer (TCA9548A).Each MPU9250 chipset is equipped with an accelerometer, gyroscope, and magnetometer, enabling comprehensive data collection and analysis.LARA relies on a well-established methodology in which the signal outputs from multiple aligned and synchronized sensors are utilized to enhance the system's precision and resolution [61].This approach is rooted in the Signal-to-Noise Ratio (SNR) principle.By adopting this strategy, the primary signal of interest remains unaffected by the process of averaging the outputs from various dynamic sensors.In contrast, the intrinsic dynamic noises, sometimes referred to as intrinsic noise [62], of the sensors are mitigated as they are averaged across the combined sensors.As a result, smaller dynamic fluctuations, such as changes in acceleration or angular speed, become more discernible as the magnitude of these dynamic disturbances diminishes.To facilitate the programming and control of LARA, a cost-effective data conditioner, Arduino Due (Figure 2b), is employed.This device establishes a connection with LARA through the Inter-Integrated Circuit (I2C) communication port, ensuring a consistent sampling frequency and functioning as a vital data conditioner.In the data acquisition process, a Raspberry Pi is utilized as an additional data conditioner.Its primary role is to capture the streamed data from both LARA and the Arduino Due, effectively storing this valuable data for further analysis and processing.Also, it adds the capability of the remote programming, control, and monitoring of the system (Figure 2c).It is important to emphasize that, despite the presence of an (I2C) communication port on the Raspberry Pi, removing the Arduino Due from this system is not feasible.This necessity arises from the fact that, during the system's development, the Raspberry Pi was found to be incapable of maintaining a consistent sampling frequency.In contrast, the Arduino Due consistently exhibits excellent long-term performance by ensuring a steady sampling frequency without any fluctuations.

LARA Software
This subsection outlines the automated software procedures of LARA.This monitoring solution is designed as a user-friendly IoT-based sensor, simplifying the setup process.Once the sensor is installed on a structure, it only requires connection to a 5 V, 2.5 A battery or a power source through the Raspberry Pi adapter.Upon powering up, LARA commences data acquisition and transmits the collected data to a designated Google Drive account.
The automatic steps that LARA performs immediately upon boot-up are presented in Figure 3 and summarized as follows: 1. Startup: Upon power-up, LARA is preconfigured to establish an internet connection via Wi-Fi, LAN, or SIM Card, provided that the Wi-Fi credentials align with LARA's preprogrammed settings.2. Google Drive access: Once internet connectivity is established, LARA gains access to a predefined Google Drive repository.

Instructions: To initiate data acquisition, LARA downloads an open-source Python
code from the designated Google Drive.This code is adaptable, allowing users to specify settings such as scheduled vibration acquisition and data acquisition duration without the need for reprogramming the Raspberry Pi directly.4. Data acquisition: Upon completion of data acquisition, the acquired files are transferred to a dedicated folder on the connected Google Drive.This design ensures that LARA's hard drive remains unburdened as long as an internet connection, via Wi-Fi or LAN, is maintained.Notably, if there is a loss of internet connectivity, the collected data will be retained on LARA's local hard drive until the connection is restored.Additionally, the option to utilize external hard drives for expanded storage capacity is available.5. Data postprocessing: At this stage, the acquired data from LARA undergo postprocessing, primarily aimed at estimating inclination based on the collected data.Additionally, this phase allows for the implementation of other programs or processes to enhance estimation resolution or perform specific calculations.This segment is adaptable and can be customized to meet the specific requirements of the monitoring application.6. Internet of Things, IoT, update: Following the postprocessing stage, Python code is employed to transmit the estimated inclination and other computed parameters to an online IoT platform hosted on the Thingspeak website.It is worth mentioning that the Thingspeak platform is affiliated with MathWorks, the creators of MATLAB.Consequently, users can employ this platform to write custom code for further online processing and analysis of the monitored data of the channel.Notably, the channel on this platform can be either private or public.A public channel offers access to anyone with its web address, enabling them to monitor the ongoing monitoring process.It is important to remain vigilant regarding potential issues or malfunctions related to the Raspberry Pi and its programmed functions.In such cases, rebooting LARA can often resolve unforeseen software glitches, including accelerometer unresponsiveness, Arduino connectivity issues, or restricted access to Google Drive.While LARA is designed for autonomous operation, manual rebooting or reprogramming can be executed remotely in emergency situations using the Visual Network Computing, VNC, viewer program.
It is crucial to emphasize that the utilization of AI tools for locally calibrating LARA is not intended to replace traditional signal processing tools and filters; rather, it serves as an additional layer complementing them.LARA has already benefitted from the ongoing research in novel signal processing tools and filters [32].Laboratory experiments have demonstrated that these methods significantly enhance the accuracy and resolution of LARA [44], surpassing many commercial alternatives.However, recognizing the constant potential for improvement, this study concentrates on integrating an AI tool as an extra layer of signal processing, aiming to further unlock the potential and capabilities of LARA.
It should be noted that LARA itself incorporates two different techniques of signal filtering to enhance its estimation.The first is a low-pass filter [63], which maintains the inclination estimation from steady acceleration measurements while filtering out noise.Additionally, LARA benefits from a novel idea, in line with the Signal-to-Noise Ratio (SNR) law [62], as demonstrated through laboratory experiments by Komarizadeshasl et al. [61].According to this law, the noise density of the averaged value of aligned and synchronized sensors is reduced by the square root of the number of synchronized sensors.In the case of LARA, it utilizes five aligned and synchronized sensors, leveraging this principle to reduce noise.This paper focuses on further improving the noise density, reducing the standard deviation of LARA, and enhancing its accuracy by incorporating artificial intelligence on top of its existing features.

Artificial Intelligence Tool
In this section, an artificial intelligence (AI) tool is developed to enhance the accuracy of LARA working as an inclinometer.Initially, the foundational principles of the Multilayer Perceptron (MLP) neural network employed are described.Subsequently, the architecture of the proposed MLP is detailed.

Multilayer Perceptron
Multilayer Perceptron (MLP) is a type of artificial neural network characterized by multiple neuron layers arranged in a sequential manner.This tool is characterized by its robustness and adaptability to learn complex patterns from a supervised learning process.Recent implementations of the MLP are exemplified by the work of Wang et al. [64], who employed this tool to predict the compressive strength of geopolymer concrete.Similarly, Nejati et al. [65] utilized an MLP to predict building thermal loads, while Martinez-Comesaña et al. [66] applied it to estimate the indoor environmental conditions of existing buildings.
The scikit-learn package, a versatile and user-friendly Python library, was used to develop the MLP.This package offers several significant advantages [67].Firstly, it provides a consistent interface for machine learning models, making it easy to switch between algorithms and processes.Secondly, its comprehensive documentation and abundant examples foster a smooth learning curve for beginners and a quick reference for advanced users.Thirdly, scikit-learn is highly efficient, as it is based on optimized libraries for numerical computations.Additionally, it supports a wide range of supervised and unsupervised learning algorithms.Lastly, it has a thriving community and commercial support, ensuring continual improvements and updates to the library.These benefits have motivated the application of the scikit-learn library in a number of building applications.For example, Yan et al. [68] used this library to improve the energy consumption prediction models on buildings, and Buddhahai et al. [69] applied scikit-learn to analyze home energy disaggregation.Similarly, Chen et al. [70] utilized it for forecasting building thermal loads, while Hareuhansapong et al. [71] employed it for fault detection and diagnosis heating, ventilation, and air conditioning (HVAC) systems.

AI Architecture
The MLP model is designed to derive accuracy-enhanced values for the X-axis rotations of LARA.The main features of the input layer, hidden layers, activation functions, output layer, and the solver employed in the proposed MLP model are summarized as follows:

•
Input layer: The input layer comprises four neurons that represent the normalized data from low-cost on-site sensors.Specifically, it processes X-axis and Y-axis rotations measured by LARA, as well as temperature and relative humidity data obtained from the DHT22 sensor.This latter sensor has been extensively used in the literature for ambient monitoring, see, e.g., [30].

•
Activation functions: The Rectified Linear Activation Function (ReLU), sourced from the scikit-learn library, was selected for the activation function due to its simplicity and proven empirical efficacy.Recent examples of the application of this activation function in the literature include Gong et al. [72].

•
Output layer: The output layer comprises a single neuron that yields accuracy-enhanced measurements of LARA's inclinations along the X-axis, named Intelligent (I)-LARA.This neuron undergoes supervised training using data from precise commercial sensors.• Solver: The "adam" solver from the scikit-learn library was selected for its demonstrated efficiency in managing datasets of substantial sizes.
A typical architecture of the proposed MLP is summarized in Figure 4.This architecture includes three hidden layers, denoted as i, j, and k, with m, n, and l hidden neurons, respectively.

Case Study: Steel Gable Frame
In this section, the geometry and key features of the case study are first described.Then, the monitoring program of the structure, encompassing the utilization of both commercial inclinometers and LARA, is detailed.Next, the application of the proposed AI tool is presented together with its enhanced monitored results, referred to as I-LARA.In addition, the enhanced results are compared with those of the commercial inclinometer.Finally, the application of the proposed IoT methodology to introduce the monitoring results of LARA and I-LARA into the BIM model of the structure is detailed.

Description of the Structure
The monitored case study corresponds with a steel gable frame.This structural element is located at the building of the Institute of Technology of the University of Castilla-La Mancha (UCLM) in the city of Cuenca, Spain.It consists of HEB 300 for the columns (6 m high) and IPE 400 for the beams (11.5 m long).The cloud points of this structure are presented in Figure 5a.This dataset served as the basis for creating the Building Information Model (BIM) of the steel gable frame depicted in Figure 5b.The creation of this model was carried out within Revit, aided by Autodesk ReCap software (Autodesk ReCap Pro 2024), achieving a Level of Development (LOD) of 300.The roof's live loads are limited to sporadic maintenance tasks.It is crucial to emphasize that no maintenance activities were undertaken during the monitoring period, and the structural response of this structure was primarily driven by environmental parameters, such as temperature and humidity changes.

Monitoring Program
In this section, the main details and results of the monitoring program are summarized.Since its construction in 2008, the structure has been under continuous surveillance, aimed at examining the influence of environmental factors and foundation settlements.This extensive, ongoing monitoring initiative encompasses a network of 27 measurement points dedicated to monitoring soil water content, along with 4 inclinometers, 4 thermometers, a weather station, and 22 topographical leveling points.For a comprehensive overview of the sensor specifications, please consult the work by González-Arteaga et al. [73].
Among the installed monitoring solutions in this structure, special attention is given to those incorporated into the gable frame under study.These monitoring solutions are based on the uniaxial electrolytic sensor EL Tiltmeter SC [53], which also includes temperature measurement capabilities.Table 3 presents a summary of the key technical specifications for this device.The resolution of this device (0.00027°) is 7.4 times better than that reported by LARA (0.002°).Nevertheless, it is important to emphasize that achieving this level of accuracy in the commercial inclinometer comes at a considerably higher cost, EUR 15,000, which is 37.5 times higher than the price of LARA, at EUR 400 [49].The commercial inclinometer was located at the connection between the beam and the column on the East façade, and it has captured data since October 2016 with a 15 min interval.It is worth emphasizing that the readings of this sensor cannot be accessed wirelessly; instead, they require manual extraction through a USB connection.Additionally, it should be noted that the sensor was directly powered by the building's electrical supply.
The alternative monitoring implemented within this structure included the following two low-cost sensors: (1) LARA, employed to measure rotations across three axes (X, Y, and Z), and (2) DHT22, used to record environmental temperature and humidity data.These sensors were positioned at the same location as the commercial inclinometer.Figure 6 provides a visual representation of the low-cost sensors' installation on-site, highlighting LARA's rotational axes.It is important to highlight that the LARA's X-axis rotations corresponded with those measured by the commercial inclinometer.The monitoring system included one Arduino Uno Board and one 4GB Raspberry Pi.This device might be used to control up to four LARAs.The low-cost monitoring system collected data with the same measuring interval as the commercial inclinometer, starting from its installation on 10 January to 17 May 2023, with an interval of 15 min.Over this period, a total of 5790 datasets, including temperature, humidity, and rotations in the X and Y axes, were recorded and analyzed.The resulting measurements are visually represented in Figure 7, where Figure 7a denotes temperature, Figure 7b shows humidity, Figure 7c    The standard deviation (SD) and the Mean Square Error (MSE) resulting from the comparative analysis between LARA's readings and those of the commercial sensor were 0.023495 and 0.000556, respectively.

Intelligent LARA (I-LARA)
The monitoring data were randomly divided into three distinct sets: the training set, comprising 60% of the data; the holdout cross-validation data set, which included 20% of the data; and the test set, representing the remaining 20% of the data.The I-LARA algorithm was implemented on LARA's Raspberry Pi to enable the automated computation of the values from the data monitored by low-cost sensors.The hyperparameters were determined through an experimental analysis of the model performance using cross-validation datasets.
The selected architecture for the MLP model included four input neurons, which encompassed X-axis and Y-axis rotation, humidity, and temperature, three hidden layers, each containing five neurons, and one output neuron, representing the enhanced X-axis rotation measurements, referred to as "I-LARA".The network underwent supervised training using the rotations obtained from the commercial inclinometer.The initial learning rate and the epoch during the training process were fixed to 0.00001 and 100, respectively.The model variables for the considered MLP are listed in Table 4.The network performance for various architectures is presented in Figure 9, which includes the Mean Squared Error (MSE) values obtained from the cross-validation dataset for different numbers of hidden layers (ranging from 1 to 10) and neurons (ranging from 1 to 6).

Conclusions
While Micro Electro-Mechanical System (MEMS) accelerometer-based inclinometers offer cost-effective solutions for civil engineering and architectural applications, their precision might not reach that of high-cost commercial alternatives, potentially restringing their scope of use.To address this limitation, this work proposes the use of an artificial intelligence (AI) tool for calibrating the low-cost inclinometer LARA (Low-cost Adaptable Reliable Anglemeter).In this approach, a Multilayer Perceptron was trained with longterm monitoring data to improve the precision of LARA, enabling it to function as a highaccuracy inclinometer.The calibrated device delivers precise inclinations based solely on the structural and environmental data, particularly humidity and temperature, acquired from low-cost sensors.
The application of the proposed AI tool was exemplified through a real case study involving the long-term monitoring of a steel gable frame.The results of the analysis of this structure highlighted the effectiveness of the proposed tool, demonstrating its capacity to improve the accuracy of the rotations estimated by LARA under real environmental conditions, matching the precision of the commercial inclinometer used during the training.To enhance its applicability in the digital maintenance and operation of buildings, the proposed methodology will be further developed in future works, with the objective of establishing a seamless connection with smart homes and digital twins.

Figure 1 .
Figure 1.Research methodology based on the DSRM.

Figure 3 .
Figure 3. Flow of information in LARA software.

Figure 4 .
Figure 4. Typical architecture of the proposed MLP.

Figure 6 .
Figure 6.Location of LARA in the case study, including the direction of the rotational axes X, Y, and Z.

Figure 8 Figure 8 .
Figure 8 presents a comparison of the inclinations obtained by LARA and the commercial accelerometer from 12 to 22 February 2023.This figure also includes the temperatures measured by the DHT22 sensor.The analysis of Figure 8 illustrates the considerable impact of temperature fluctuations on the monitored rotations.For instance, the rotations of the EL-Tiltmeter SC on 22 February shifted from 0.019° to −0.002° as the ambient temperature decreased from 21.1 °C to 12.2 °C.Although both sensors demonstrate similar trends in capturing the influence of temperature over time, LARA's results present higher variations.

Figure 9 .
Figure 9. Analysis of the optimal number of hidden layers and neurons (nodes) in the MLP.

Figure 10 Figure 10 .
Figure10depicts a comparison of the X-axis rotations measured by LARA, I-LARA, and the commercial inclinometer across a set of 700 records randomly selected from the monitoring period for the test set.This figure is segmented into three parts: Figure10aillustrates the comparison between LARA and the commercial inclinometer; Figure10bpresents the comparison between I-LARA and the commercial inclinometer; and Figure10cshows the comparison among LARA, I-LARA, and the commercial inclinometer.For ease of visualization, the latter figure is arranged in ascending order of the values recorded by the commercial inclinometer.The analysis of these figures indicates that the implementation of the AI tool significantly reduces the Mean Squared Error (MSE) for I-LARA when compared to the commercial inclinometer, with the MSE reducing from 0.000556 to 2.10812 × 10 −5 .This reduction represents a reduction of 96.21% in the MSE between LARA and the commercial inclinometer.Furthermore, the comparison between I-LARA and the commercial inclinometer yielded a Root Mean Squared Error (RMSE) of 0.00459 and a Pearson's correlation coefficient of 0.89.

FigureFigure 11 .
Figure11aillustrates the probability density function of the errors between LARA and the commercial inclinometer, superimposed with a corresponding normal distribution curve.Conversely, Figure11bexhibits analogous results derived from the comparison between I-LARA and the commercial inclinometer.A comparison of these figures underscores the advantageous effects of employing the AI tool, as evidenced by the reduction in the standard deviation from 0.023495 to 0.004258.These results represent a reduction of 81.88% with respect to the original standard deviation measured between LARA and the commercial inclinometer.The standard deviation is especially interesting for this study as it provides a summary statistic that describes the amount of variation or dispersion within a dataset, and it provides a comparison of the spread of data between different datasets.It helps in determining which dataset has more variability or dispersion.It shows how tightly or loosely the data points are clustered around the mean, and I-LARA shows exceptional performance in terms of standard deviation.

Table 1 .
Hardware and software components for the application of low-cost inclinometers into smart homes.

Table 2 .
Technical specifications of LARA working as an inclinometer.

Table 3 .
Technical features of the commercial inclinometer.