Abstract
Nature-based Solutions (NbS) Regulatory Ecosystem Services are less tangible and more complex to quantify. Among these, research to quantify water regulation services provided by Blue-Green Infrastructure is especially relevant for a range of different applications. However, to reach this quantification, experimentalists usually need to measure the flow rate, which can be costly if using high-end industry standard sensors. The present article brings, thus, a low-cost experimental setup for real-time data capture and logging using the US-025 ultrasonic sensor. The proposed setup measures a weir tanks’ water level in order to indirectly estimate the flow rate. A successful pilot experiment is described, estimating the water quantity performance of a vegetated roof in comparison to a ceramic tiled roof. For a same event, flow rate measures taken by the proposed setup are compared to readings from a rain gauge and results show a close trend. The performance of the vegetated roof has shown substantial rainfall retention and detention when compared to the ceramic roof. It is concluded that the setup is a cost-effective tool that can be attached to inlets and outlets of different NbS for characterising a range of water flow rates capable of supporting laboratory and field data capture.
HIGHLIGHTS
A low-cost flow meter was developed to combine an ultrasonic sensor and a weir.
The setup was successfully used for runoff monitoring on a pilot experiment.
Adherence was shown between the proposed setup results and a rain gauge.
The setup can measure flow rates on inlets and outlets of Nature-based Solutions.
The ultrasonic sensor speed of sound fluctuations was irrelevant within a rainfall event.
Graphical Abstract
INTRODUCTION
Nature-based Solutions (NbS), as defined by the International Union for Conservation of Nature (IUCN), are ‘actions to protect, sustainably use, manage and restore natural or modified ecosystems, which address societal challenges, effectively and adaptively, providing human well-being and biodiversity benefits’ (Cohen-Shacham et al. 2016). Among the range of NbS, some of the most widely known are wetlands, bioretentions, stormwater planters, swales, vegetated roofs and vegetated walls (Eggermont et al. 2015).
A way to express and quantify the trade-offs between humans and its environment is via the Ecosystem Services (ES) provided by these NbS, which are defined as ‘the benefits people obtain from ecosystems' (MA 2005). But as Mengist et al. (2020) indicate, the necessary attention is not given to Regulatory Ecosystem Services (RES) as its benefits may not be as tangible. Methods for quantifying regulatory benefits are needed, thus, to generate scientific data in order to support decision-makers towards the large implementation of NbS.
Among the main regulatory services provided by NbS are its potential for regulating water dynamics in cities and its capacity for managing flood risk (Sahani et al. 2019). In order for experiments to quantify water-regulating services in NbS, measuring the water flow is eventually necessary. For that, real-time sensing and a low-cost experimental setup are a relevant toolbox to support researchers on quantifying the hydrological performance of these systems. Naveen et al. (2020) propose measuring the flow rate through the displacement of a cantilever LED strip in the investigated pipeline; Loizou & Koutroulis (2016) bring a state-of-the art review on water-level sensors and propose a novel capacitive water-level measurement system, which can be used for measuring water flow if associated with a tank. Dijkstra & Uittenbogaard (2010) correlate that the flow rate with flexible plastic strip positions subjects to water currents; Dinardo et al. (2013) investigate the vibrations in pipelines using accelerometers to improve flow rate measurements; Hill et al. (2015) and Stovin et al. (2012) use rain gauges and measure runoff from vegetated roofs via tipping buckets, meaning that for each bucket that tips after filled, it counts each tip, having the precision of about the bucket's volume.
On the other hand, previous works such as from El Hattab et al. (2019) and Piro et al. (2019) demonstrate the use of weirs for assessing water quantity in Green Infrastructure. El Hattab et al. (2019) show that most of previous studies used pressure transducers to find the water level, a variable to be further converted into the upstream head and then to the flow rate. These works have not used ultrasonic sensors to measure the water level. Other researchers, on the other hand, such as Carson et al. (2013) and Bliss et al. (2009), used ultrasonic sensors combined with a weir: the former using a Senix TSPC-30S1 and the latter a Greyline LIT25. Both are high-end industrial sensors, which can cost from 500 USD to 1,000 USD. Finding cost-effective ultrasonic sensors that can provide a similar accuracy with a lower price is a gap identified, and the present work hypothesises that open-sourced hardware and software platforms such as Arduino can provide interesting alternatives.
Real-time sensing can support the collection of a substantial amount of data. This becomes useful for urban planning applications as increasing the resolution of NbS performance in a city and retrieving data from real structures can be used for the application on not only public policies but also for validating and modelling BGS. Quantifying the water dynamics can also be relevant for understanding other regulatory services such as heat-related, as evapotranspiration removes heat from surface (Broadbent et al. 2019). Water quantity flow meters can be relevant for irrigation control, for the correct selection of plant species in landscaping (Farrell et al. 2013), among other applications in Blue-Green Infrastructure.
Measuring the flow rate can be expensive, and inaccurate and equipment may demand close supervision and regular maintenance. As indicated by Naveen et al. (2020), affordable sensors must be developed, aiming specially for inexpensive, reliable and easy to implement solutions. Pereira (2009) brings a comprehensive review on flow meter types and characteristics, recalling that now in the era of digital flow meters, a variety of methods are available. Baker (2005) also reviews available flow meters and categorises them into different methods of measurement, involving, for example, orifice plate flow meters, nozzles, momentum-sensing meters, turbine flow meters, etc.
As noticeable in the aforementioned flow rate-measuring methods, it is possible to transform the physical variable being measured: the flow rate can be measured directly or indirectly in a variety of different ways. Evapotranspiration in vegetated roofs, for example, can also be estimated indirectly by measuring the weight loss of a physical model through time (Walter et al. 2004), as a lysimeter does, or can be estimated using thermography (Krasowski et al. 2021). For the flow rate, a range of different experimental setups can be used to attain measurements as close as possible to the phenomenon behaviour.
In this sense, the present work brings an indirect method for measuring the flow rate using an ultrasonic sensor and a weir tank, converting a flow rate measurement into a water-level measurement. Previous works that attempted characterising the runoff from vegetated roofs can be divided into classes. Some managed to only read the final runoff volume after a rainfall event (Loiola et al. 2019; Liberalesso et al. 2021): these were able to only present results about retention, or the water stored in the roof. Others could read the flow rate, but only manually (Silva et al. 2019): these were able to characterise also detention, or peak runoff attenuation and delay, but only for simulated rainfall events. This happens because an experimentalist cannot be all the time available during every unexpected rainfall event. The present sensor setup can support a third class of experiments: those that use real-time sensing and can leave the sensors collecting flow rate data at all times, being a setup capable of measuring retention and detention in simulated and natural events. Though the combination of a weir tank and an ultrasonic sensor is a technique already known, the present work brings a specially designed version of this setup that can be applied to NbS. The method can be implemented not only in laboratory experiments, but also in real structures built in public places, being useful for both inlet and outlet flow depending on the structure analysed.
The scope of the present work involves evaluating the method in a vegetated roof prototype experiment built at the University of São Paulo, Brazil. Section 2 brings the working principles of the sensor, the experimental setup, its uncertainties involved, the setup costs, along with describing step by step the data collection and processing from this above-mentioned pilot experiment. Section 3 presents and discusses the pilot experiment results for not only the hydrological performance of the vegetated roof, but also for the outcomes found in the quality of the proposed sensor readings, bringing challenges that were successfully addressed and difficulties found. A demonstration of the method's feasibility for application in a bioretention experiment is also shown in this session. The paper presents conclusions, limitations and further work in section 4.
METHODS
Low-cost sensors can be a good alternative for high-end industry standard sensors but demand special attention to detail. As indicated by Naveen et al. (2020), a flow meter ideally should have an adaptable design and avoid fatigue characteristics. Though the ultrasonic sensor selected is not waterproof, meaning that it can rust when operating under humid conditions, the module exposed to weathering can be replaced easily and inexpensively.
As a low-cost method for measuring the flow rate, an Arduino-based hardware was built and evolved from many years of testing and prototyping (Pereira et al. 2021). The ultrasonic sensor used here is the US-025 ultrasonic sensor operated by the ESP12e8266 control module for data logging and communication, with a user software interface that enables wireless data collection.
Sensor working principle
The US-025 ultrasonic sensor is a recently developed module, and there is still scarce information available regarding its working details. But its principles are the same as the HC-SR04 ultrasonic sensor, which is a widely used instrument for a variety of applications. Thus, the working principle of the US-025 is described based on the HC-SR04.
Working principle of the US-025 sensor. Source: the authors, based on Panda et al. (2016).
Working principle of the US-025 sensor. Source: the authors, based on Panda et al. (2016).

3D rendering of the ultrasonic sensor housing and triangular-notch thin-plate weir tank. Source: illustrated by Henrique Capanema, adapted by the authors.
3D rendering of the ultrasonic sensor housing and triangular-notch thin-plate weir tank. Source: illustrated by Henrique Capanema, adapted by the authors.
Microcontroller-based data logging
The proposed setup
The sensor hardware is housed within a protective plastic box, which is attached to the weir tank by self-locking nylon zip ties for easy removal. Ideally the plastic box should be hermetic to prevent water from getting in. The sensor should be facing the water and oriented parallel to the liquid surface. The sensor housing and the weir tank assembled can be seen in Figure 4. The figure also shows the position of both the triangular weir and a stone barrier which should separate the inflow and the outflow. The contribution of this barrier is to attenuate surface waves if water inflow generates turbulence as the sensor precision is high and small surface disturbances will be captured by the setup. The stone barrier height (H) should be higher than the maximum water level (L(h)) height, that is , where P is the height of the notch vertex (dashed arrow in Figure 4) with respect to the tank's floor and
is the maximum height of water the weir is designed to accommodate.

Triangular-notch thin-plate weir flow rate and section detail. Source: adapted by the authors from Shen (1981) and El Hattab et al. (2019).
Triangular-notch thin-plate weir flow rate and section detail. Source: adapted by the authors from Shen (1981) and El Hattab et al. (2019).







Vegetated roof building prototype and CT roof building prototype, highlighting the triangular-notch weir tank with the ultrasonic sensor and the Vantage Vue weather station. Source: the authors.
Vegetated roof building prototype and CT roof building prototype, highlighting the triangular-notch weir tank with the ultrasonic sensor and the Vantage Vue weather station. Source: the authors.
The constants A, B, P, H, and θ, illustrated in Figure 4, should be designed according to the maximum flow rate capacity of the setup, which should be estimated beforehand by the experimentalist. The notch angle θ can be found by forcing a maximum estimated design flow rate
and a maximum chosen design weir height
in Equation (5).



Measurement uncertainty

Equation (9) demonstrates that the proportion between the flow rate error and the flow rate measurement will be always 2.5 times the proportion between the water-level error and the water-level measurement, for the zone in which water is running off the v-notch. For the lower zone (), uncertainty can be found by simple error propagation of sums and multiplications. For other uncertainties such as from the weir tank construction, it is indicated the use of a calibration constant, which can be found by inputting a series of known flow rates in the tank and measuring
. The constant will be an integer which better approximates the measured flow rate to the known flow rate. Fluctuations in the flow rate can be caused by the accumulation of debris in the tank, which can partially block the v-notch. For higher flow rates, a slight volumetric expansion of the tank can be observed, and thus, a solid material is advised.
Regarding the environmental conditions, fluctuations in water-level measurements can happen due to rainfall falling directly into the tank due to changes in the temperature and changes in the atmospheric pressure. With respect to uncertainties associated with the experimentalist, errors can happen due to mispositioning the sensor in relation to the water level and an initial miscalibration of the sensor. Regarding the method as a whole, errors can also happen by chance. Besides environmental variable effects, there are also random interferences on the ultrasound signal that need to be treated during data acquisition. Considering that each sample is taken along 10 or 20 μs, the sampling process can be repeated a certain number of times until the result reaches a desired stability, for example, limited by a threshold of the standard deviation (SD). The reading routine can be adapted to perform the Welford algorithm for the running SD (Knuth 1998).
Sensor costs
The triangular-notch weir tank setup can vary a lot in terms of dimensioning, given the range of flow rates it is designed to measure. The proposed module was built using aluminium sheets, costing a total of USD 20.00. Regarding the sensor, it can remain the same for any given weir tank setup, even if using other geometries of weirs such as rectangular ones. The components currently cost roughly as follows: ultrasonic sensor US-025 costs about USD 0.93; the module ESP12e8266 costs about USD 1.10; the module USB/SERIAL converter FTDI FT232RL costs about USD 1.14; the 3.7 V 18650 battery costs about USD 5.00 and other general electronic components top up about USD 5.00 more. Therefore, the total sensor cost is about USD 13.17, not taking into account the sensor housing.
A high-end industry standard sensor can be much more expensive. Flow meters available in the market can offer the same precision cost from USD 190.00. Arduino-based flow meters such as the YF-S201 can also be cheap but will not give the same precision. The proposed setup is versatile and adaptable to different flow types and scales. The US-025 can perform well under the described experiment conditions and operates successfully for at least 6 months without replacement.
Pilot experiment
To assess the practicality of the proposed ultrasonic flow rate sensor setup, a pilot experiment was conducted. As seen in Figure 6, two masonry prototypes were built at the Civil Construction Engineering Department of the Polytechnic School of the University of São Paulo – Brazil. One is a ceramic tiled (CT) roofing system and the other is an extensive vegetated roof (VR). Along with the ultrasonic sensors and weir tanks, a weather station was installed on top of the CT roof in order to capture rainfall depth and duration. The setup collected data from natural rainfall events and four representative events of the summer season in Brazil were analysed, developed from December/2021 to February/2022. Two weather stations were used, both with a tipping bucket rain gauge: a Vantage Vue made by Davis Instruments and a locally produced rain gauge from the Hydraulic Engineering laboratory. The stations precision rate is 0.1mm, and their resolutions are 0.1 and 0.5mm, respectively. The Vantage Vue was positioned right on top of the CT prototype and the other rain gauge was 30m away from the experiment.
For a given characteristic natural rainfall event, the experiment used the triangular-notch weir tank to measure both prototypes’ runoff. It is an experiment that can characterise the performance of roofs towards rainwater management, which is associated with its retention and detention capacities. Retention stands for how much a vegetated roof can store from the input rainfall by saturating its substrate pores; detention illustrates how much it can delay and attenuate the peak runoff (Berndtsson 2010). These indicators can demonstrate the ability of NbS to work as Sustainable Drainage Systems.
To evaluate if the combined water-level ultrasonic sensor and weir tank can generate robust results, the CT roof results were used. As the CT roof will not retain almost any rainwater, the runoff from the CT prototype measured by the proposed setup should be similar to the rainfall intensity measured by the weather station.
RESULTS AND DISCUSSION
Results of the comparison between the CT roof runoff and the weather station rain gauge readings are presented, as well as results regarding the hydrological performance of the vegetated roof. A discussion regarding the sensor reliability and its relevant limitations and the applications in other NbS for water quantity investigation is also brought in this session.
Vegetated roof hydrological performance
A rainfall-runoff series was captured during four short summer natural rainfall events. Table 1 brings a summary of the events analysed, which are organised in higher peak rainfalls (top) to lower peak rainfalls (bottom). Table 2 brings a summary of the retention and detention results found in the experiments.
Summary of the events analysed
. | Rain gauge . | Sample size . | Peak rainfall . | Rainfall duration . | Total rainfall . | Rainfall intensity . |
---|---|---|---|---|---|---|
(mm/min) . | (min) . | (mm) . | (mm/min) . | |||
Event 1 | A | 298 | 0.8 ± 0.1 | 90.5 ± 0.5 | 37.60 ± 0.84 | 0.418 ± 0.010 |
Event 2 | A | 321 | 0.8 ± 0.1 | 120.0 ± 0.5 | 17.40 ± 0.71 | 0.145 ± 0.006 |
Event 3 | B | 300 | 0.3 ± 0.1 | 80.5 ± 0.5 | 21.40 ± 0.39 | 0.268 ± 0.005 |
Event 4 | B | 431 | 0.2 ± 0.1 | 200.5 ± 0.5 | 20.80 ± 0.55 | 0.104 ± 0.003 |
. | Rain gauge . | Sample size . | Peak rainfall . | Rainfall duration . | Total rainfall . | Rainfall intensity . |
---|---|---|---|---|---|---|
(mm/min) . | (min) . | (mm) . | (mm/min) . | |||
Event 1 | A | 298 | 0.8 ± 0.1 | 90.5 ± 0.5 | 37.60 ± 0.84 | 0.418 ± 0.010 |
Event 2 | A | 321 | 0.8 ± 0.1 | 120.0 ± 0.5 | 17.40 ± 0.71 | 0.145 ± 0.006 |
Event 3 | B | 300 | 0.3 ± 0.1 | 80.5 ± 0.5 | 21.40 ± 0.39 | 0.268 ± 0.005 |
Event 4 | B | 431 | 0.2 ± 0.1 | 200.5 ± 0.5 | 20.80 ± 0.55 | 0.104 ± 0.003 |
Rain gauge A is the Vantage Vue weather station (0m away) and rain gauge B the locally produced rain gauge (30 m away).
Results found for retention and detention of the VR prototype in comparison to the CT roof prototype
. | Rainfall volume . | Runoff volume . | Retention . | Peak attenuation . | Peak delay . | ||
---|---|---|---|---|---|---|---|
(L) . | (L) . | (L) . | (%) . | (L/s) . | (%) . | (min) . | |
Event 1 | 440.01 ± 8.06 | 289.5352 ± 0.0060 | 150.47 ± 8.06 | 34.2 ± 1.9 | 0.0705 ± 0.0405 | 43.5 ± 0.3 | 30.5 ± 0.5 |
Event 2 | 196.60 ± 6.60 | 147.6277 ± 0.0030 | 48.97 ± 6.60 | 24.9 ± 3.5 | 0.1554 ± 0.0531 | 66.6 ± 0.3 | 14.0 ± 0.5 |
Event 3 | 130.22 ± 8.33 | 66.3227 ± 0.0015 | 63.90 ± 8.33 | 49.1 ± 7.1 | 0.0996 ± 0.0311 | 42.7 ± 0.2 | 15.0 ± 0.5 |
Event 4 | 148.48 ± 11.78 | 91.6693 ± 0.0015 | 56.81 ± 11.78 | 38.3 ± 8.5 | 0.0460 ± 0.0177 | 57.0 ± 0.2 | 37.0 ± 0.5 |
. | Rainfall volume . | Runoff volume . | Retention . | Peak attenuation . | Peak delay . | ||
---|---|---|---|---|---|---|---|
(L) . | (L) . | (L) . | (%) . | (L/s) . | (%) . | (min) . | |
Event 1 | 440.01 ± 8.06 | 289.5352 ± 0.0060 | 150.47 ± 8.06 | 34.2 ± 1.9 | 0.0705 ± 0.0405 | 43.5 ± 0.3 | 30.5 ± 0.5 |
Event 2 | 196.60 ± 6.60 | 147.6277 ± 0.0030 | 48.97 ± 6.60 | 24.9 ± 3.5 | 0.1554 ± 0.0531 | 66.6 ± 0.3 | 14.0 ± 0.5 |
Event 3 | 130.22 ± 8.33 | 66.3227 ± 0.0015 | 63.90 ± 8.33 | 49.1 ± 7.1 | 0.0996 ± 0.0311 | 42.7 ± 0.2 | 15.0 ± 0.5 |
Event 4 | 148.48 ± 11.78 | 91.6693 ± 0.0015 | 56.81 ± 11.78 | 38.3 ± 8.5 | 0.0460 ± 0.0177 | 57.0 ± 0.2 | 37.0 ± 0.5 |
Rainfall-runoff for the VR and CT roof during Event 1. Source: the authors.
Retention rates of the VR were always higher than 20% in all events and peak runoff was substantially attenuated (by at least 40%) and delayed (by at least 14 min). These results represent an encouraging possibility for vegetated roofs to manage small return period events within the megalopolis of São Paulo, Brazil, which stills lack data regarding the hydrological performance of vegetated roofs.
Proposed setup performance
Central tendency of the flow rate for each of the four events measured with the proposed setup compared with the same flow rate measured with a rain gauge under the pilot experiment conditions. The shaded area represents a 95% confidence interval. Source: the authors.
Central tendency of the flow rate for each of the four events measured with the proposed setup compared with the same flow rate measured with a rain gauge under the pilot experiment conditions. The shaded area represents a 95% confidence interval. Source: the authors.
By comparing Table 1 and Figure 8, it is interesting to highlight that the events with a smaller peak rainfall had the worse trend when comparing both measurement systems and events with a higher peak rainfall had the best adherences. Events 3 and 4 were measured using a rain gauge with a lower resolution, which may affect the R2 values, but should not affect the regression line equation. This indicates that for lower runoff rates, the sensor may generate higher uncertainties, and for higher runoff rates, it should operate with an accuracy close to a rain gauge. This can be solved by reducing the angle of the v-notch and also changing the geometry of the tank. Reducing the angle θ will increase the tank precision for lower flow rates and reducing its B dimension will increase the resultant water level for an equal flow rate, making it easier to measure. Rapid changes in water level have not been observed as a problem, given that the sensor can read every 60ms.
Sound speed correction



The relevance of this investigation is exemplified by summer rainfall events. In the subtropical climate of Brazil, they are normally associated with frontal rainfall when temperature increases minutes before the beginning of the rainfall event and so does relative humidity. The authors compared both results of flow rate: with the speed of sound corrections and without. The differences between both were irrelevant. This happened mainly because the flow rate was measured in roughly uniform temperature and relative humidity in all four events. Whereas for experiments where temperature and relative humidity are not uniform, the correction for sound speed should be taken into account. In this sense, it is possible to conclude that temperature and humidity may not explain the fluctuations found in the sensor readings, which may be thus more closely related to instrument errors and chance.
Use for other NbS
Bioretention using the same method for water quantity characterisation: the inlet with a rectangular-notch acrylic thin-plate weir surrounded by a concrete framing and the outlet with a triangular-notch steel thin-plate weir in a concrete tank. Source: the authors.
Bioretention using the same method for water quantity characterisation: the inlet with a rectangular-notch acrylic thin-plate weir surrounded by a concrete framing and the outlet with a triangular-notch steel thin-plate weir in a concrete tank. Source: the authors.
CONCLUSIONS
In this work, a setup for measuring the water flow rate in NbS was presented along with the mathematical characterisation and the demonstration of software and hardware design. The results show the system as a cost-effective, reproducible and adaptable alternative to high-end industry standard flow meters. It is capable of measuring a range of flow rates and useful for both laboratory and field applications, for example, quantifying the water performance of public structures in situ. Statistical analysis demonstrated that it has a good precision when compared to a rain gauge and its operation can be supported by the IoT for remote data logging.
The setup using ultrasonic sensors can support practitioners and researchers for quantifying the real benefits of NbS in terms of not only water quantity, but also many related RES. In this sense, the present work describes a tool that can help better understand the effectiveness and benefits of Blue-Green Systems, helping its mainstreaming as public policies based on robust scientific research.
As further work, long-term performance analysis should be undertaken for the sensors and sensor housing, especially for operation under hostile weather conditions. To properly verify the sensor fluctuations and accuracy, a side-by-side test with a high-end pressure sensor or other flow rate sensor is mandatory, which will be the author's next steps. Furthermore, working towards a smaller hardware for the sensor and its housing can also bring benefits for making its installation easier and less evident, especially for use in public places.
ACKNOWLEDGEMENTS
The authors acknowledge the support provided by the Coordination of Superior Level Staff Improvement (CAPES) for the financial support of M. Pereira; the Foundation Hydraulics Technological Centre (FCTH) for the material support; the University of São Paulo and the Santander Bank via USP Municipalities Notice 01/2021 ‘Desafio USP: cidades sustentáveis’ for the financial support of the project and of L. Gobatti; and São Paulo State Research Support Foundation (FAPESP) for previous material support still used during this project. The authors thank the illustrator Henrique Capanema for rendering the images.
DATA AVAILABILITY STATEMENT
All relevant data are available from an online repository or repositories (https://data.mendeley.com/datasets/kdvw2vhxbf/3).
CONFLICT OF INTEREST
The authors declare there is no conflict.