Acessibilidade / Reportar erro

Low-cost ultrasonic sensors for in-field experimentation data collection

Sensores ultrassônicos de baixo custo para coleta de dados em experimentação a campo

ABSTRACT

Surface runoff monitoring is important for the sustainable management of global water resources. Obtaining a practical and inexpensive method for collecting data in the field can help to better understand surface runoff and its effects, necessary for the management of watersheds. This study sought to elaborate the calibration curves of the ultrasonic sensor due to temperature variability, verifying the inaccuracy of the distance between objects and the sensor, and determining the feasibility of using low-cost sensors in an in-loco experiment installed on Parshall flumes. The experiment was conducted on the Experimental Farm of the Federal University of Grande Dourados, Dourados, MS, Brazil. The data were collected by twelve HC-SR04 ultrasonic distance sensors , which were coupled to a data acquisition system composed of an expansion board connected to a Raspberry minicomputer. Sensor calibration using temperature data resulted in the error correction of ± 8.0 mm of distance reading. On the other hand, the R2 of the comparison curves between sensor and control system (laser distance meter and ruler in the flume) resulted in high values (above 0.95), showing the feasibility of its use and meeting the specifications for use in the field subject to weather conditions. This study demonstrates the performance of ultrasonic sensors as a potential for new application to evaluate surface runoff aiming to propose new runoff coefficients.

Index terms:
Calibration; HC-SR04; parshall flume; flow rate; surface runoff.

RESUMO

O monitoramento do escoamento superficial é crucial na gestão sustentável dos recursos hídricos globais. Obter um método prático e econômico para coletar dados de campo pode ajudar a entender melhor o escoamento superficial e seus efeitos, necessários para a gestão das bacias hidrográficas. Este trabalho buscou elaborar calibração de um sensor ultrassônico devido à variabilidade da temperatura, verificando a imprecisão da distância dos objetos com o sensor, determinando a viabilidade do uso dos sensores de baixo custo em experimento “in loco”, instalados em calhas Parshall. O experimento foi realizado em área da Fazenda Experimental da Universidade Federal da Grande Dourados, Dourados/MS. Os dados foram coletados por doze sensores de distância ultrassônicos HC-SR04, que foram acoplados a um sistema de aquisição de dados composto por uma placa de expansão conectada a um minicomputador Raspberry. A calibração pela temperatura resultou na correção do erro de ± 8,0 mm da leitura de distância. Já, o R2 das curvas de comparação entre sensor e sistema de controle (trena laser e régua instalada nas calhas) resultaram em altos valores de coeficientes de determinação, acima de 0,95, mostrando a viabilidade do seu uso e atendendo as especificações para uso em condições de campo sujeito as intempéries climáticas. Este estudo demonstra o desempenho dos sensores ultrassônicos como possível potencial de nova tecnologia para avaliar escoamento superficial no intuito de propor novos coeficientes de escoamento.

Termos para indexação:
Calibração; HC-SR04; calha Parshall; vazão; escoamento superficial.

INTRODUCTION

The need to control the effects of surface runoff has driven the development of more efficient and cheaper methods for monitoring agricultural production (Meyer et al., 2019MEYER, A. M. et al. Real-time monitoring of water quality to identify pollution pathways in small and middle scale rivers. Science of The Total Environment, 651:2323-2333, 2019. ; Rodríguez-Robles et al., 2020RODRÍGUEZ-ROBLES, J. et al. Autonomous sensor network for rural agriculture environments, low cost, and energy self-charge. Sustainability , 12(15):5913, 2020. ). The sustainable management of water resources requires the estimation of the rainfall surplus and its actions on the Earth’s surface, especially the negative consequences of water erosion (Mohammadifar et al., 2021MOHAMMADIFAR, A. et al. Assessment of the interpretability of data mining for the spatial modelling of water erosion using game theory. Catena , 200:105178, 2021. ), which has caused the transport of nutrients from the soils, resulting in changes in production capacity, in addition to river pollution (Martínez-Mena et al., 2020MARTÍNEZ-MENA, M. et al. Long-term effectiveness of sustainable land management practices to control runoff, soil erosion, and nutrient loss and the role of rainfall intensity in Mediterranean rainfed agroecosystems. Catena, 187:104352, 2020. ; Wang et al., 2021WANG, L. et al. Deposition- and transport-dominated erosion regime effects on the loss of dissolved and sediment-bound organic carbon: Evaluation in a cultivated soil with laboratory rainfall simulations. Science of The Total Environment , 750:141717, 2021. ).

Although most works estimate surface runoff by models (Al-Juboori, 2022AL-JUBOORI, A. M. Solving complex rainfall-runoff processes in semi-arid regions using hybrid heuristic model. Water Resources Management, 36:717-728, 2022. ), some projects have been designed to determine surface runoff using empirical methods, whose accuracy will depend on the designer’s experience. It is due to the need of using reference tables when choosing parameters related to surface characteristics (Erena; Worku, 2019ERENA, S. H.; WORKU, H. Urban flood vulnerability assessments: The case of dire dawa city, Ethiopia. Natural Hazards, 97:495-516, 2019. ). Nevertheless, the tables present the specificity of the drainage basins for which they were developed. Therefore, reference tables are generalist and may not cover specific cases, requiring further studies and updating of technical references (Lapides; Sytsma; Thompson, 2021LAPIDES, D. A.; SYTSMA, A.; THOMPSON, S. Imprications of distinct methodological interpretations and runoff coefficient usage for rational method predictions. Journal of the American Water Resources Association, 57(6):859-874, 2021. ; Young; Mcenroe; Rome, 2009YOUNG, C. B.; MCENROE, B. M.; ROME, A. C. Empirical determination of rational method runoff coefficients. Journal of Hydrologic Engineering, 14(12):1283-1289, 2009. ).

Collection containers are one of the methods to carry out measurements in in-loco studies, being an expensive work because the precipitation is variable, implying the need for dynamic monitoring to obtain accumulated volumes for each event (Portocarrero; Andrade; Campos, 2017PORTOCARRERO, H.; ANDRADE, A. G.; CAMPOS, T. M. P. Monitoramento automatizado do escoamento superficial em parcela experimental instalada em talude de corte. Geo UERJ, 4(30):277-304, 2017. ). Still, methods that involve real-time data collection can be advantageous in immediate and accurate decision-making (Sanches et al., 2022aSANCHES, A. C. et al. Low-cost and high-efficiency automated tensiometer for real-time monitoring. Revista Brasileira de Engenharia Agrícola, 26(5):390-395, 2022a. ).

The use of flumes, such as the Parshall flume, is also common in the measurement of surface runoff (Tiwari; Sihag, 2020TIWARI, N. K.; SIHAG, P. Prediction of oxygen transfer at modified parshall flumes using regression models. ISH Journal of Hydraulic Engineering, 26(2):209-220, 2020. ), mainly coupled to level sensors. However, they need equipment for data collection and an energy source for more remote areas. For example, Abualfaraj et al. (2018ABUALFARAJ, N. et al. Monitoring and modeling the long-term rainfall-runoff response of the Jacob K. Javits center green roof. Water, 10(11):1494-1517, 2018. ) used Parshall flumes equipped with pressure transducers to measure the flow rate on green roofs and observed good results.

The emergence of affordable minicomputers and accessories for teaching programming and robotics has allowed carrying out experiments previously limited to a few institutions. Studies with low-cost sensors have already been applied in loco in automatic monitoring of phosphate and nitrite in agricultural aquatic environments (Lin et al., 2018LIN, B. et al. A low-cost automatic sensor for in-situ colorimetric detection of phosphate and nitrite in agricultural water. ACS Sensors, 3(12):2541-2549, 2018. ), such as an intelligent soil moisture sensor (González-Teruel et al., 2019GONZÁLEZ-TERUEL, J. D. et al. Design and calibration of a low-cost SDI-12 soil moisture sensor. Sensors, 19(3):491, 2019. ). Low-cost sonars have been used in experiments applied to plant growth monitoring (Trevisan et al., 2018TREVISAN, R. G. et al. Management of plant growth regulators in cotton using active crop canopy sensors. Agriculture, 8(7):101, 2018. ) and automated irrigation systems (Rodríguez-Robles et al., 2020RODRÍGUEZ-ROBLES, J. et al. Autonomous sensor network for rural agriculture environments, low cost, and energy self-charge. Sustainability , 12(15):5913, 2020. ) with satisfactory results.

However, tests need to be carried out to determine the limitations of their use or interference caused by bad weather given the fragility of components (Kruger et al., 2016KRUGER, A. et al. Bridge-mounted river stage sensors (BMRSS). IEEE Access, 4: 8948-8966, 2016. ; Papa; Ponte, 2018PAPA, U.; PONTE, S. Preliminary design of an unmanned aircraft system for aircraft general visual inspection. Electronics , 7(12):435, 2018. ). In the case of sensors, we can consider that every measurement 𝑀 is actually a measurement of 𝑀 = 𝑀𝑟𝑒𝑎𝑙 + 𝜖, in which 𝜖 indicates measurement error (Barcelo-Ordinas et al., 2019BARCELO-ORDINAS, J. M. et al. Self-calibration methods for uncontrolled environments in sensor networks: A reference survey. Ad Hoc Networks, 88:142-159, 2019. ). However, understanding how sensor error influences performance and its accuracy is essential (Placidi et al., 2020PLACIDI, P. et al. Characterization of low-cost capacitive soil moisture sensors for IoT networks. Sensors, 20(12):3585, 2020. ).

Many studies have already been using sonars to measure height directly in water bodies to monitor extreme high runoff events (Meyer et al., 2019MEYER, A. M. et al. Real-time monitoring of water quality to identify pollution pathways in small and middle scale rivers. Science of The Total Environment, 651:2323-2333, 2019. ; Panagopoulos et al., 2021PANAGOPOULOS, Y. et al. Assessment of an ultrasonic water stage monitoring sensor operating in an urban stream. Sensors , 21(14):4689, 2021. ) but they may present late warning as runoff may have already occurred on the surface. Knowing the runoff before reaching the rivers is essential to predict the results of major rainfall events in advance.

Payero et al. (2021PAYERO, J. O. et al. Development of an internet of things (IoT) system for measuring agricultural runoff quantity and quality. Agricultural Sciences, 12(5):584-601, 2021. ) used the Internet of Things (IoT) to develop a surface runoff measurement system utilizing H flumes and eTape liquid level sensor, including a water collection system for analyzing the impacts of runoff in soybean and cotton fields with and without coverages and obtained an R2 = 0.99 with the calibration. Schallner et al. (2021SCHALLNER, J. W. et al. Evaluation of a runoff monitoring methodology for rangelands: UBeTubes. Rangeland Ecology & Management, 78:46-50, 2021. ) monitored runoff using low-cost UBeTube technology and concluded that the methodology, with proper calibration, could be used in pastures.

Therefore, the purpose of this study was to elaborate the calibration curves of the HC-SR04 ultrasonic sensor due to temperature variability, to confirm the inaccuracy of the distance between objects and the sensor, and to determine the feasibility of using low-cost sensors in an in-loco experiment installed on Parshall flumes.

MATERIAL AND METHODS

Experimental site

The experiment was carried out in the unit located in the experimental area of FAECA (Experimental Farm) on the campus of the Federal University of Grande Dourados (UFGD), in Dourados, Mato Grosso do Sul, Brazil (22°24′18″ S, 54°99′47″ W, 437 m altitude). The materials were prepared in the Laboratory of Hydraulics, in the building of the School of Agricultural Sciences, Unit 2 of UFGD, also in Dourados, MS, Brazil.

According to the Köppen climate classification, the climate of the study area is Am, that is, a tropical monsoon climate (Alvares et al., 2013ALVARES, C. A. et al. Köppen’s climate classifi cation map for Brazil. Meteorologische Zeitschrift, 22(6):711-728, 2013. ), with a dry winter, a mean annual temperature of 22.8 °C, and a mean annual precipitation of 1389 mm for the last 30 years (1991-2021), as shown in Figure 1, according to (Empresa Brasileira de Pesquisa Agropecuária -2022EMPRESA BRASILEIRA DE PESQUISA AGROPECUÁRIA - EMBRAPA. Estação - Embrapa - Dourados/MS. 2022. Available in: <Available in: https://mob.cpao.embrapa.br >. Access in: May 17, 2023.
https://mob.cpao.embrapa.br...
).

Figure 1:
Annual values of temperature and precipitation in the experimental area. Source: (Embrapa, 2022).

The experimental area consisted of twelve experimental plots of 4 m × 10 m, with a 4-m² downstream triangle, totaling 44 m². Six hillslopes have a gradient of 8.2%, whereas the remaining six have a gradient of 18.6%. The plots of the higher slope were used from the natural land profile. The soil was cut to obtain the lowest slope aiming at minimal changes in the natural soil conditions. The plots were divided using guides made with the soil and the Parshall flumes with sensors were placed at the plot outlet (Figure 2 and 3).

Figure 2:
Sketch of the experiment.

Figure 3:
Picture of the implanted system.

Electronic system

The system used in the experiment was designed for using HC-SR04 ultrasonic sensor manufactured by OSEPP Electronics, installed in each Parshall flume, and an HC-SR04 ultrasonic sensor installed at 40 cm from a concrete slab that did not undergo reading variation due to rain, identified as a standard sensor for comparison purposes. A Texas Electronics Inc. TR-525M tipping bucket rain gauge was also installed. In addition, a HiLetgo HTU21D air temperature and humidity sensor was used. The data were stored on an SD card attached to a Raspberry Pi 3 minicomputer. The language used was Python, which is open-source and easy to program.

An expansion board for up to 20 devices was required to connect all the sensors to the Raspberry. The entire system was connected to a 12V battery powered by a photovoltaic board, as there is no power supply at the experimental site. A charge controller was installed not to damage the battery, limiting the voltage to 13.5V (Figure 4).

Figure 4:
Scheme of experiment connections.

According to the manufacturers, the HC-SR04 sensors have a working range between 2.0 and 400.0 cm, with an accuracy of 0.3 cm and a field of vision of 15°. The HTU21D sensor has an operating range for temperature and humidity from −40 to 125 °C, with an accuracy of ±0.2 °C, being factory calibrated. The rain gauge has a resolution of 0.2 mm, an accuracy of 1.0% up to 50 mm per hour, a range of 700 mm per hour, and operating temperature limits from 0 to 70 °C.

Parshall flumes (Figure 5) have a rectangular cross section and feature a converging inlet section, a throat and a diverging outlet section, following the current NBR/ISO 9826:2008 standard. They were duly calibrated through the correlation of the water depth and their output flow rate, with a calibration curve according to Equation 1 from (Sanches et al., 2022bSANCHES, A. C. et al. Development and application of WSC and parshall flumes for data collection of surface runoff. Irriga, 27(2):256-267, 2022b. ):

Q = 0.2924 H 1.4638 , w i t h R 2 = 0.99 (1)

where Q is the flow rate in m3 h−1 and H is the water depth in cm.

Figure 5:
Sketch of the design of the Parshall flume. Measurements in cm.

The costs for implementing the experiment are detailed in Table 1, with a value of US$ 98.02 per monitored plot.

Table 1:
Implementation costs.

Data collection

The data were collected during an approximate 1-year experimental cycle (April 17, 2020, to June 23, 2021), used in the system adjustments and calibration. The area maintenance was carried out weekly to verify the functioning and cleaning of the flumes when required.

The installation height of each sensor was established by the mean of five readings using a Bosch GLM40 laser distance meter, with a 1.5-mm precision, according to the manufacturer. Forty readings were performed for eight well-defined distance variations between sensors and Parshall flume in four randomly chosen sensors (two from each slope group) to verify the sensor reading precision compared to height.

The distances were defined by obstacles with height variations of sensors relative to the flumes (Figure 6) to save water, as it depended on the supply of a water truck on site to carry out the verification readings during the minimum 80 minutes of collection. Overlapping 3-mm glass slides, with thickness calculated by the mean thickness at 3 points of the slide using a Mitutoyo® 530-104b-10 8-inch universal Analog Caliper, were used.

Figure 6:
Methods used for data acquisition to compare with the values obtained by the sensors.

The HC-SR04 sensor sends an ultrasonic wave when triggered, being able to signal when the sent pulse is received. The Raspberry records the time between sending and receiving and the system calculates how far the sensor is from the object. The distance can be determined by Equation 2 and time by Equation 3, as the speed of sound propagating through the air is known (343.40 m s−1 at 20 °C), and the sound traveled twice the distance between the sensor and the object.

d = Δ t c 2 (2)

Δ t = 2 d c (3)

where d is the distance traveled by sound in m, Δt is the pulse travel time in s, and c is the speed of sound in m s−1, primarily adopted as 343.40 m s−1.

The system was programmed to measure five pulses per reading, recording their simple mean. The system performs a test limited to 40 µs of the response time before performing the reading, thus verifying the functioning between the transmitter and the transducer, as 50 µs is the limit of repetition of sensor readings, according to Zhmud et al. (2018ZHMUD, V. A. et al. Aplication of ultrasonic sensor for measuring distances in robotics. Journal of Physics: Conference Series, 1015(3):032189, 2018.). Faulty is logged after 1 second if this condition is not met, warning of sensor problems. The sensors were installed in two groups (according to slopes) on the expansion board to save system energy. Therefore, whenever one sensor presents faulty, there is an indication of instability in the group to which the respective sensor belongs.

The experiment was programmed to take one reading per hour. However, the readings would be taken every 15 seconds if there was a record on the rain gauge. The date, time, and temperature and relative humidity sensor readings were recorded along with the sensor readings. Readings ceased 10 minutes after the last rain record, totaling at least 40 readings per event and collections are returned every hour.

Calibration

Initially, the sound travel time (∆t) is calculated using Equation 3. Subsequently, Equation 4, used to correct the speed of sound relative to air temperature, was applied (Bartoszek et al., 2022BARTOSZEK, S. et al. Impact of the selected disturbing factors on accuracy of the distance measurement with the use of ultrasonic transducers in a hard coal mine. Energies, 15(1):133, 2022. ). Then, Equation 5 was applied, thus obtaining the distance corrected by temperature.

c = 331.85 1 + 0.00183 T (4)

where c is the speed of sound in m s−1 and T is the temperature in °C.

d s o u n d = Δ t c 100 (5)

in which dsound is the distance traveled by sound corrected in cm, Δt is the pulse travel time in s, and c is the corrected speed of sound in m s−1.

Subsequently, the correlation of the corrected values between dsound and temperature was calculated, obtaining how much the temperature impacts the other system components. Thus, the following correction is applied to obtain the calibrated distance (Equation 6):

d T = d s o u n d c o r r e l a t i o n T (6)

where dT is the calibrated height of the sensor relative to the temperature in cm, dsound is the corrected height relative to the air temperature in cm, correlation is the correlation between dsound and T, and T is the temperature in °C.

Data analysis

The data were separated by sensors to analyze the collected heights relative to the temperature. The distances read in Parshall flumes can vary on rainy days and, for this reason, only dry days were analyzed, not considering rainy days. The values were subjected to the distribution test, after which the correlation was calculated, and a linear regression curve was modeled for distance x temperature.

After calibration, the dT points were obtained (measured after all calibrations), the correlation was calculated, and a new linear regression curve was modeled for dT x temperature. Subsequently, distance (d) and calibrated distance (dT) values underwent descriptive analysis (mean, quartiles, standard deviation, and coefficient of variation), comparing them and verifying a decrease in error 𝜖 by comparing the mean errors Equation 7, absolute mean errors Equation 8, and root mean square error Equation 9, as proposed by Legates and Mccabe (1999LEGATES, D. R.; MCCABE, G. J. Evaluating the use of “goodness-of-fit” measures in hydrologic and hydroclimatic model validation. WaterResources Research, 35(1):233-241, 1999. ):

M E = H c o n t r o l H s e n s o r n (7)

M A E = H c o n t r o l H s e n s o r n (8)

R S M E = H c o n t r o l H s e n s o r 2 n (9)

in which Hcontrol is the height obtained by the control system (ruler in the flume or laser distance) in cm, Hsensor is the distance read by the sensor in cm, and n is the amount of data.

Finally, the height values obtained in the laboratory test and the field with the glass slides of the four flumes were analyzed to verify the reliability of the elaborated curves, according to the variation of the distance from obstacles, modeling a linear regression curve, calculating correlation, and obtaining R2, ME, MAE, and RSME.

RESULTS AND DISCUSSION

Temperature

Figure 7 shows the air temperature variation collected by the HTU21D sensor after 1 year of the experiment, demonstrating a large temperature variation even in predominantly hot regions. Several temperature values close to 0 and 45 °C were observed in August, which has the lowest temperatures. The mean temperature obtained in the experimental period was 23.75 °C, very close to that observed by Embrapa (2022)EMPRESA BRASILEIRA DE PESQUISA AGROPECUÁRIA - EMBRAPA. Estação - Embrapa - Dourados/MS. 2022. Available in: <Available in: https://mob.cpao.embrapa.br >. Access in: May 17, 2023.
https://mob.cpao.embrapa.br...
in 2020 and 2021 for Dourados (23.61 and 23.40 °C, respectively), as shown in Figure 1.

Figure 7:
Temperature variation during 12 months of data collection.

Reference sensor (Sensor 13) x temperature

First, the IQR (interquartile range) statistical method is used to analyze outliers, so that outliers = value < (Q1−1.5IQR) or value > (Q3+1.5IQR), as well as Li et al. (2023LI, W. et al. Fabric defect detection algorithm based on image saliency region and similarity location. Electronics, 12(6):1392, 2023. ). Of the 13232 readings, 287 data points were removed (2.16% outliers) and the remaining data are presented in Figure 8. The sensor was positioned to avoid abrupt changes in the distances read and failures may have been caused by interference from some animal, vegetation (Figure 9), or even read failure due to power supply below 3.6V, as observed by Komarizadehasl et al. (2022KOMARIZADEHASL, S. et al. Low-cost sensors accuracy study and enhancement strategy. Applied Sciences, 12(16):3186, 2022. ) that showed high sensibility this type sensors.

Figure 8:
Readings performed by Sensor 13.

Figure 9:
Examples of vegetation interference in data collection.

In a solar panel and battery system, voltage supply below 3.6V may occur when the battery is discharged or when there is an issue in the electrical system that hinders proper battery recharging (Chen et al., 2020CHEN, H. et al. Optimization of sizing and frequency control in battery/supercapacitor hybrid energy storage system for fuel cell ship. Energy, 197:117285, 2020. ). Furthermore, battery quality and age can also affect the system’s ability to supply power. It is important to ensure that the electrical system is functioning correctly and that the battery is charged enough to supply the necessary energy to the system. Regularly monitoring the battery charge level and the efficiency of the electrical system can help prevent power supply below 3.6V and keep the system operating properly (Liu; Gao; Liu, 2022LIU, Z.; GAO, Y.; LIU, B. Na artificial intelligence-based electric multiple units using a smart power grid system. Energy Reports, 8:13376-13388, 2022.).

The values of uncorrected distances did not show a normal distribution but the Spearman correlation coefficient between distance and temperature resulted in r = −0.933 (significant at α=0.05), demonstrating a high-temperature interference. After calibration, the values were compared with the known references values (installed heights) and no statistically significant differences were found (r=0.004 at α=0.05) (Figure 10).

Figure 10:
Relationship between distances obtained directly by the sensor (d), distances calibrated using the relationship between sound speed and air temperature (dT) and temperature of the ultrasonic sensor 13 (reference).

The correlation coefficient −0.067 demonstrates that the calculated distances without the proper use of the speed of sound will be smaller as the temperature increases, as the sound moves faster (Kumar et al., 2020KUMAR, R. et al. Development of remote wireless environmental conditions measurement, monitoring and recording device for metrological and other scientific applications. MAPAN, 35:193-199, 2020. ), that is, at 0.622 m s−1 at every 1 °C (Bartoszek et al., 2022BARTOSZEK, S. et al. Impact of the selected disturbing factors on accuracy of the distance measurement with the use of ultrasonic transducers in a hard coal mine. Energies, 15(1):133, 2022. ), thus reducing the response time of the distance sensor.

The dT points were obtained after correcting the distance relative to the temperature, showing that the sensor-maintained precision despite the low cost, reducing the minimum and maximum values. The new equation (dT = 0.0001T+41.479) demonstrates that the new slope of the trend line is very close to zero with little temperature interference, resulting in values close to that of the installed height of 41.45 cm.

A descriptive statistical analysis was applied using electronic spreadsheets, with the data shown in Table 2.

Table 2:
Descriptive statistics calculated for distance measurement and temperature-corrected distance (cm) for the reference sensor (S13).

Table 2 shows the fundamental importance of considering the variation of the speed of sound relative to the air temperature, which reached minimum and maximum values of 0 and 44.60 °C, respectively. Correction led to a reduction of up to 229.90% in the range of the obtained values, which represents 0.33 m3 h−1 for every 1 cm in the Parshall flume flow, according to Equation 1. Sensor 13 showed constant values after correcting the total errors, keeping the values between 41.01 and 41.98 cm, with a mean of 41.48 cm. It represented a maximum error of ±5 mm, equal to those found by Kumar et al. (2020KUMAR, R. et al. Development of remote wireless environmental conditions measurement, monitoring and recording device for metrological and other scientific applications. MAPAN, 35:193-199, 2020. ) with laboratory measurements.

Sensors in Parshall flumes (Sensors 1 to 12) x temperature

The same procedure was applied to the other 12 sensors and the obtained values demonstrated similar behavior to the reference sensor (S13) (Table 3). However, Sensors 03 and 06 presented a maximum error of 8 mm, Sensors 02, 08, 10, and 11 showed a maximum error of 7 mm, and Sensors 01, 04, 05, 07, 09, and 12 presented a maximum error of 6 mm when comparing minimum and maximum values with the mean, as observed by Pereira et al. (2022PEREIRA, T. S. R. et al. Evaluation of water level in flowing channels using ultrasonic sensors. Sustainability, 14(9):5512, 2022. ) in an experiment carried out to analyze the water level in flow channels in the laboratory.

Table 3:
Descriptive statistics calculated for distance measurement and temperature-corrected distance (cm) for 12 sensors in Parshall flumes.

The experiment was carried out without any weather control, with the sensor installed only avoiding direct contact with rain, aiming to undergo other interferences present in agricultural activities, resulting in higher imprecision compared to laboratory experiments (Al-Agele; Jashami; Higgins, 2022AL-AGELE, H. A.; JASHAMI, H.; HIGGINS, C. W. Evaluation of novel ultrasonic sensor actuated nozzle in center pivot irrigation systems. Agricultural Water Management, 262:107436, 2022. ). Table 4 shows the sensor installation height, means, and standard deviations of the distances obtained after calibration compared to that expected, as well as ME, MAE, and RMSE, for each data set.

Table 4:
Height values of installed sensors, means of calibrated distances, and errors of 13 sensors (cm).

RMSE values are close to that found by Kholopov (2015KHOLOPOV, I. S. Development of strapdown inertial navigation system with MEMS sensors, barometric altimeter and ultrasonic range meter. IOP Conference Series: Materials Science and Engineering, 93:012060, 2015. ), with 3.2 mm for an inertial navigation system using HC-SR04 sensor, very close to the value established by the manufacturer (3 mm).

Sensors in Parshall flumes x height variation

The reliability of the heights read after the calibrations related to the ambient temperature were verified by laboratory and field tests carried out using the HC-SR04 sensor compared to readings performed by the ruler installed in the Parshall flume, with the linear regression shown in Figure 11.

Figure 11:
Distance sensor x ruler in the flume.

The results of calibration presented high correlations, the R² = 0.99 showed good precision the values, corresponding already observed to Abreu et al. (2021ABREU, D. et al. Low-cost ultrasonic range improvements for an assistive device. Sensors, 21(12):4250, 2021. ), Therefore, the results calibrations showed values R² near the one with anothers sensors, whose calibrations were greater than 0.9 of the coefficients of determination (Sanches et al., 2020SANCHES, A. C. et al. Capacitive probe calibration in eutroferric latosolred nitosol cultivated with irrigated forages. Irriga , 25(1):38-45, 2020. ; 2022bSANCHES, A. C. et al. Development and application of WSC and parshall flumes for data collection of surface runoff. Irriga, 27(2):256-267, 2022b. ).

Subsequently, a statistical analysis was performed using the obtained results, as shown in Table 5.

Table 5:
Statistical values for measurements obtained with a laser distance meter and sensor in the laboratory.

Figure 12 shows the relationship between calibrated distances and distances with laser tape. Can be observed that the HC-SR04 sensor has good precision with compared laser tape, as it presented a linear fit with a high coefficient of determination. It should be noted that laser measuring tapes have an accuracy of +/- 1.5 mm.

Figure 12:
Relationship of the distances sensor x laser distance meter for Sensors 5 (a), 6 (b), 7 (c), and 9 (d).

Comparative sensors calibration is very common, in work conducted by Sanches et al. (2022aSANCHES, A. C. et al. Low-cost and high-efficiency automated tensiometer for real-time monitoring. Revista Brasileira de Engenharia Agrícola, 26(5):390-395, 2022a. ) a mechanical vacuum sensor was compared with an automated pressure transducer, showing that both showed good correlation as with the present work, in which the results were for r² = 0.99 (Figure 12).

Table 6 shows the values of mean error (ME), mean absolute error (MAE), root mean square error (RSME), Spearman’s correlation coefficient (r), and coefficient of determination (R2) for the tests performed in the laboratory and field.

Table 6:
Values obtained in the laboratory test with HC-SR04 compared to the ruler and in the field compared to the laser distance meter (cm).

The results were satisfactory, with the lowest r of 0.97 and R2=0.99. Similarly, MAE and RMSE values remained within the 3-mm range of factory error. The entire experiment was carried out in loco, and the deviations in the distances of Sensor 05 may be the result of interference of some insect or grass.

Amorim et al. (2021AMORIM, A. E. A. et al. Análise experimental do desempenho dos sonares LV-EZ, us100 e HC-SR04. Revista Fatecnológica da Fatec-Jahu, 15(1):8-20, 2021. ) conducted a calibration test using the same sensor and observed good accuracy and low data dispersion, suggesting that the sensor may have high applicability in automation and robotics projects. Likewise, Pereira et al. (2022PEREIRA, T. S. R. et al. Evaluation of water level in flowing channels using ultrasonic sensors. Sustainability, 14(9):5512, 2022. ) had excellent results using the sensors in level flumes, with high accuracy up to readings of 20 cm. However, the present study showed good results when using distances up to 30 cm, as observed by Dusarlapudi et al. (2020DUSARLAPUDI, K et al. Accuracy analysis of an ultrasonic sensor over an open channel rectangular notch for rainwater harvesting. International Journal of Scientific & Technology Research, 9(1):2813-2816, 2020.).

Al-Agele, Jashami and Higgins (2022)AL-AGELE, H. A.; JASHAMI, H.; HIGGINS, C. W. Evaluation of novel ultrasonic sensor actuated nozzle in center pivot irrigation systems. Agricultural Water Management, 262:107436, 2022. used the same sensor model with fixed measurements of 0.5 m in the laboratory and found a maximum error of 3.2% in the mean, with a standard deviation of 3.3 cm, well above that found in the study. On the other hand, the HRXL-MaxSonar-WR ultrasonic sensor used in a river level measurement experiment showed a standard deviation of 0.13 cm (Panagopoulos et al., 2021PANAGOPOULOS, Y. et al. Assessment of an ultrasonic water stage monitoring sensor operating in an urban stream. Sensors , 21(14):4689, 2021. ), very close to that of 0.14 cm of Sensor 09, but at acquisition cost 10 times higher.

The error should be considered relative to time, as fatigue can be representative in long-term experiments (Gandha; Santoso, 2020GANDHA G.; SANTOSO, D. A. The Newton’s polynomial based: Automatic model generation (AMG) for sensor calibration to improve the performance of the low-cost ultrasonic range finder (HC-SR04). Journal INFOTEL, 12(3):115-122, 2020. ). Implementing a correction during data collection, such as the Kalman filter and linear prediction, may further reduce total errors (Liu, Kouguchi; Li, 2021LIU, P.; KOUGUCHI, N.; LI, Y. Velocity measurement of coherent doppler sonar assisted by frequency shift, kalman filter and linear prediction. Journal of Marine Science and Engineering, 9(2):109, 2021. ). Similarly, Abreu et al. (2021ABREU, D. et al. Low-cost ultrasonic range improvements for an assistive device. Sensors, 21(12):4250, 2021. ) proposed changes in software and hardware, which produced an error reduction from 7% to 1% without affecting the low cost of the sensor.

Figure 13 shows the behavior of the S05 sensor with the variation of the water flow for 30 minutes, a field test carried out on 04/14/2021. 2000 liters were released in plot T5, increasing and decreasing the flow, and the data collected showed a drained volume of 437.8 liters, resulting in a surface runoff coefficient of 0.219. With the end of the flow, from reading 127, it was found a 1.2 cm layer of eroded soil present in the Parshall flume. Of the 120 readings collected during the 30 minutes of testing, 4 showed negative values and were discarded, resulting in 3.33% of outliers.

Figure 13:
Data read by sensor S05, simulating water flow.

CONCLUSIONS

The studied low-cost sensors presented good calibration adjustments with excellent results in the measured heights, in addition to low absolute mean errors and root mean square errors, especially considering the excellent cost benefit. The values calibrated and verified in water flow were close to those obtained in the field, showing the great potential of using HC-SR04 sensors to measure the water level in Parshall flumes in the field, as long as the ambient temperature is monitored.

ACKNOWLEDGMENTS

To the Programa de Pós-Graduação em Engenharia Agrícola of the Universidade Federal da Grande Dourados (PPGEA/UFGD), the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES - Finance Code: PDPG Ordinance 155/2022), and the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) for the financial support granted through the research project process No. 428043/2018-6.

REFERENCES

  • ABREU, D. et al. Low-cost ultrasonic range improvements for an assistive device. Sensors, 21(12):4250, 2021.
  • ABUALFARAJ, N. et al. Monitoring and modeling the long-term rainfall-runoff response of the Jacob K. Javits center green roof. Water, 10(11):1494-1517, 2018.
  • ALVARES, C. A. et al. Köppen’s climate classifi cation map for Brazil. Meteorologische Zeitschrift, 22(6):711-728, 2013.
  • AL-AGELE, H. A.; JASHAMI, H.; HIGGINS, C. W. Evaluation of novel ultrasonic sensor actuated nozzle in center pivot irrigation systems. Agricultural Water Management, 262:107436, 2022.
  • AL-JUBOORI, A. M. Solving complex rainfall-runoff processes in semi-arid regions using hybrid heuristic model. Water Resources Management, 36:717-728, 2022.
  • AMORIM, A. E. A. et al. Análise experimental do desempenho dos sonares LV-EZ, us100 e HC-SR04. Revista Fatecnológica da Fatec-Jahu, 15(1):8-20, 2021.
  • BARCELO-ORDINAS, J. M. et al. Self-calibration methods for uncontrolled environments in sensor networks: A reference survey. Ad Hoc Networks, 88:142-159, 2019.
  • BARTOSZEK, S. et al. Impact of the selected disturbing factors on accuracy of the distance measurement with the use of ultrasonic transducers in a hard coal mine. Energies, 15(1):133, 2022.
  • CHEN, H. et al. Optimization of sizing and frequency control in battery/supercapacitor hybrid energy storage system for fuel cell ship. Energy, 197:117285, 2020.
  • DUSARLAPUDI, K et al. Accuracy analysis of an ultrasonic sensor over an open channel rectangular notch for rainwater harvesting. International Journal of Scientific & Technology Research, 9(1):2813-2816, 2020.
  • EMPRESA BRASILEIRA DE PESQUISA AGROPECUÁRIA - EMBRAPA. Estação - Embrapa - Dourados/MS. 2022. Available in: <Available in: https://mob.cpao.embrapa.br >. Access in: May 17, 2023.
    » https://mob.cpao.embrapa.br
  • ERENA, S. H.; WORKU, H. Urban flood vulnerability assessments: The case of dire dawa city, Ethiopia. Natural Hazards, 97:495-516, 2019.
  • GANDHA G.; SANTOSO, D. A. The Newton’s polynomial based: Automatic model generation (AMG) for sensor calibration to improve the performance of the low-cost ultrasonic range finder (HC-SR04). Journal INFOTEL, 12(3):115-122, 2020.
  • GONZÁLEZ-TERUEL, J. D. et al. Design and calibration of a low-cost SDI-12 soil moisture sensor. Sensors, 19(3):491, 2019.
  • KHOLOPOV, I. S. Development of strapdown inertial navigation system with MEMS sensors, barometric altimeter and ultrasonic range meter. IOP Conference Series: Materials Science and Engineering, 93:012060, 2015.
  • KOMARIZADEHASL, S. et al. Low-cost sensors accuracy study and enhancement strategy. Applied Sciences, 12(16):3186, 2022.
  • KRUGER, A. et al. Bridge-mounted river stage sensors (BMRSS). IEEE Access, 4: 8948-8966, 2016.
  • KUMAR, R. et al. Development of remote wireless environmental conditions measurement, monitoring and recording device for metrological and other scientific applications. MAPAN, 35:193-199, 2020.
  • LAPIDES, D. A.; SYTSMA, A.; THOMPSON, S. Imprications of distinct methodological interpretations and runoff coefficient usage for rational method predictions. Journal of the American Water Resources Association, 57(6):859-874, 2021.
  • LEGATES, D. R.; MCCABE, G. J. Evaluating the use of “goodness-of-fit” measures in hydrologic and hydroclimatic model validation. WaterResources Research, 35(1):233-241, 1999.
  • LI, W. et al. Fabric defect detection algorithm based on image saliency region and similarity location. Electronics, 12(6):1392, 2023.
  • LIN, B. et al. A low-cost automatic sensor for in-situ colorimetric detection of phosphate and nitrite in agricultural water. ACS Sensors, 3(12):2541-2549, 2018.
  • LIU, Z.; GAO, Y.; LIU, B. Na artificial intelligence-based electric multiple units using a smart power grid system. Energy Reports, 8:13376-13388, 2022.
  • LIU, P.; KOUGUCHI, N.; LI, Y. Velocity measurement of coherent doppler sonar assisted by frequency shift, kalman filter and linear prediction. Journal of Marine Science and Engineering, 9(2):109, 2021.
  • MARTÍNEZ-MENA, M. et al. Long-term effectiveness of sustainable land management practices to control runoff, soil erosion, and nutrient loss and the role of rainfall intensity in Mediterranean rainfed agroecosystems. Catena, 187:104352, 2020.
  • MEYER, A. M. et al. Real-time monitoring of water quality to identify pollution pathways in small and middle scale rivers. Science of The Total Environment, 651:2323-2333, 2019.
  • MOHAMMADIFAR, A. et al. Assessment of the interpretability of data mining for the spatial modelling of water erosion using game theory. Catena , 200:105178, 2021.
  • PAYERO, J. O. et al. Development of an internet of things (IoT) system for measuring agricultural runoff quantity and quality. Agricultural Sciences, 12(5):584-601, 2021.
  • SANCHES, A. C. et al. Low-cost and high-efficiency automated tensiometer for real-time monitoring. Revista Brasileira de Engenharia Agrícola, 26(5):390-395, 2022a.
  • SANCHES, A. C. et al. Development and application of WSC and parshall flumes for data collection of surface runoff. Irriga, 27(2):256-267, 2022b.
  • SANCHES, A. C. et al. Capacitive probe calibration in eutroferric latosolred nitosol cultivated with irrigated forages. Irriga , 25(1):38-45, 2020.
  • SCHALLNER, J. W. et al. Evaluation of a runoff monitoring methodology for rangelands: UBeTubes. Rangeland Ecology & Management, 78:46-50, 2021.
  • PANAGOPOULOS, Y. et al. Assessment of an ultrasonic water stage monitoring sensor operating in an urban stream. Sensors , 21(14):4689, 2021.
  • PAPA, U.; PONTE, S. Preliminary design of an unmanned aircraft system for aircraft general visual inspection. Electronics , 7(12):435, 2018.
  • PEREIRA, T. S. R. et al. Evaluation of water level in flowing channels using ultrasonic sensors. Sustainability, 14(9):5512, 2022.
  • PLACIDI, P. et al. Characterization of low-cost capacitive soil moisture sensors for IoT networks. Sensors, 20(12):3585, 2020.
  • PORTOCARRERO, H.; ANDRADE, A. G.; CAMPOS, T. M. P. Monitoramento automatizado do escoamento superficial em parcela experimental instalada em talude de corte. Geo UERJ, 4(30):277-304, 2017.
  • RODRÍGUEZ-ROBLES, J. et al. Autonomous sensor network for rural agriculture environments, low cost, and energy self-charge. Sustainability , 12(15):5913, 2020.
  • TIWARI, N. K.; SIHAG, P. Prediction of oxygen transfer at modified parshall flumes using regression models. ISH Journal of Hydraulic Engineering, 26(2):209-220, 2020.
  • TREVISAN, R. G. et al. Management of plant growth regulators in cotton using active crop canopy sensors. Agriculture, 8(7):101, 2018.
  • WANG, L. et al. Deposition- and transport-dominated erosion regime effects on the loss of dissolved and sediment-bound organic carbon: Evaluation in a cultivated soil with laboratory rainfall simulations. Science of The Total Environment , 750:141717, 2021.
  • YOUNG, C. B.; MCENROE, B. M.; ROME, A. C. Empirical determination of rational method runoff coefficients. Journal of Hydrologic Engineering, 14(12):1283-1289, 2009.
  • ZHMUD, V. A. et al. Aplication of ultrasonic sensor for measuring distances in robotics. Journal of Physics: Conference Series, 1015(3):032189, 2018.

Publication Dates

  • Publication in this collection
    10 July 2023
  • Date of issue
    2023

History

  • Received
    27 Sept 2022
  • Accepted
    27 Apr 2023
Editora da Universidade Federal de Lavras Editora da UFLA, Caixa Postal 3037 - 37200-900 - Lavras - MG - Brasil, Telefone: 35 3829-1115 - Lavras - MG - Brazil
E-mail: revista.ca.editora@ufla.br