1. Introduction
Streamflow datasets underpin nearly every water-related decision, from understanding the frequency and magnitude of floods to establishing environmental flows, managing reservoirs and evaluating drought impacts [
1]. Despite their importance, continuous discharge measurements are still largely restricted to locations with substantial infrastructure and long-term institutional support. The high capital and operational costs associated with traditional gauging stations limit the number of sites that can be monitored, resulting in spatial gaps in hydrological data from rural areas even within relatively well-studied regions. In small headwater streams the challenges become even more pronounced. Installation can be logistically difficult, access may be limited to certain seasons while narrow, shallow channels often require tailored equipment. Manual discharge measurements, although widely used, cannot offer the temporal resolution required for many modern applications, especially where rapid hydrological responses occur [
2,
3]. For these reasons, there is growing interest in low-cost, rapidly deployable, and autonomous monitoring solutions that prioritize flexibility and temporal resolution, and can complement existing hydrometric networks in settings where conventional gauging is impractical.
The rise of embedded systems and low-power microcontrollers, together with the ubiquity of wireless communication protocols, has created an opportunity to rethink traditional hydrological instrumentation. Simultaneously, the widespread availability of inexpensive components allows researchers to construct monitoring platforms at a fraction of the cost of commercial stations while maintaining acceptable levels of accuracy for many practical applications [
4]. The system presented in this study aims to demonstrate that a small set of widely available components (Commercial Off-The-Shelf, COTS) when combined with careful calibration and energy-efficient firmware can form a viable solution for continuous streamflow observation. This work describes the architecture, experimental calibration and preliminary performance evaluation of this prototype. Research on IoT applications in hydrology has expanded substantially in recent years. Much of this work builds on earlier efforts to develop low-cost weather and environmental monitoring tools using COTS electronics, such as the modular platform introduced by Ioannou [
4], which demonstrated that relatively simple hardware can support large-scale deployments. Similar ideas have been extended to water level monitoring. Other researchers designed a solar-powered ultrasonic water level system for the Sakarya River illustrating that inexpensive microcontroller-based solutions can perform reliably under real-world conditions [
5]. Long-range wireless technologies such as LoRa have also been adopted in river monitoring systems, with studies showing that even sparse networks can cover large catchments when communication range is optimized [
6,
7].
Parallel work has focused on water quality. Ref. [
8] developed a solar-powered IoT device capable of monitoring several water quality parameters in lakes, demonstrating how multi-sensor configurations can be deployed at low cost. Ref. [
9] used LoRaWAN and a cloud-based dashboard to create a distributed water quality system suitable for rivers, highlighting the importance of lightweight data protocols. Another key issue in low-cost sensing—long-term stability—has been examined by [
10] who assessed the endurance of IoT systems under varying environmental conditions.
In relation to flow measurement, several studies have explored the suitability of the YF-S201 Hall-effect sensor. Although the device was originally designed for domestic water metering, it has been evaluated for scientific and industrial applications. Ref. [
11] reported that with proper calibration the YF-S201 produced linear and repeatable results across a moderate range of flow rates. Ref. [
12] conducted similar characterization experiments and confirmed that the sensor performs reliably when flow remains within its nominal operating range. Additional studies have emphasized both the strengths and the limitations of rotor-based sensors, noting increased uncertainty at very low flows and potential vulnerability to sediment and debris.
Other IoT-related research also confirms the present work. Ref. [
13] proposed AI-assisted IoT systems for water quality, illustrating the potential for combining low-cost sensors with onboard intelligence. Deep-learning approaches for interpreting water gauge imagery, such as the method developed by [
14], suggest opportunities for hybrid sensing architectures. Meanwhile, the study of [
15] on autonomous irrigation systems demonstrates how LoRa, solar energy and microcontrollers can offer long-term autonomy in remote agricultural areas.
Finally, while most of these studies demonstrate IoT architectures for hydrological and environmental monitoring, most of the approaches followed rely on relatively specialized sensing equipment (e.g., ultrasonic or pressure-based systems) or focus primarily on communication and data management aspects rather than on the sensing hardware itself. It is therefore evident that a gap remains in evaluating whether widely available commercial off-the-shelf (COTS) components—particularly very low-cost flow sensors originally designed for closed-conduit applications—can be effectively adapted for hydrological monitoring purposes.
The present study contributes to this growing field by focusing on a simple but effective combination of an inline flow sensor, an ESP32 microcontroller and a solar energy system, aimed specifically at measuring discharge in small channels. The objective is not to develop a fully validated hydrometric instrument, but to investigate the capability and limitations of COTS hardware for low-cost streamflow measurement. Under this scope, the system is presented as a proof-of-concept approach intended to support dense and scalable monitoring networks, where reduced cost and ease of deployment may be prioritized over high absolute accuracy. Unlike previous studies that evaluate the YF-S201 sensor primarily in closed-pipe configurations, this work investigates its integration within a complete IoT system and its adaptation to open-channel monitoring through a diverted flow approach.
2. Materials and Methods
The monitoring node consists of four main elements: the hydraulic section containing the YF-S201 sensor (Shenzhen TCT Electronics Co., Ltd., Shenzhen, China), the ESP32 microcontroller (Espressif Systems, Shanghai, China) that handles pulse acquisition and communication, the solar energy subsystem that powers the device and the server infrastructure where data are stored and visualized. Water passes through the sensor body, where a small rotor spins in proportion to the flow velocity. The Hall-effect element embedded in the rotor assembly generates a series of pulses, which the ESP32 counts during a fixed measurement interval. After basic filtering and averaging, the converted flow value is sent wirelessly to a cloud server. A PostgreSQL database stores the incoming records, and a lightweight dashboard provides real-time visualization (
Figure 1).
2.1. Flow Sensor and Experimental Setup
The YF-S201 flow sensor was tested in a controlled indoor environment using a closed-loop water channel. The flow experiments were conducted under controlled conditions over a representative range of flow values within the operational limits of the sensor (
Figure 2). Flow was adjusted manually using a valve, and discharge was estimated using a volumetric method, where water was collected over a fixed time interval and the accumulated volume was recorded. Multiple measurements were performed across different flow conditions to verify the consistency of the sensor response. The measurements should be interpreted primarily as indicative of relative flow variations rather than absolute discharge values.
Given the proof-of-concept nature of this study, the calibration procedure focused on establishing the functional relationship between pulse frequency and discharge, rather than on a full metrological characterization. As a result, detailed uncertainty quantification, systematic repetition counts, and standardized error metrics were not formally derived and are considered part of future work.
2.2. Microcontroller Firmware and Edge Processing
The ESP32 was programmed to remain in deep sleep for most of its duty cycle, waking only long enough to record pulses, convert them into flow estimates and transmit the results. During each active period, the microcontroller activated an interrupt service routine to count individual pulses. After a brief measurement window, typically lasting a few seconds, the raw pulse count was converted to flow using the calibration factor derived from the experiments. A simple moving average was applied to reduce short-term fluctuations. Once transmission was complete, the device returned to deep sleep to conserve energy.
2.3. Power System
A compact 6 V, 1 W photovoltaic panel was used to charge a single 18650 Li-ion cell through a TP4056 charge controller (Shenzhen TCT Electronics Co., Ltd., Shenzhen, China). The rest of the circuit was powered by a small voltage regulator that provided stable output to the ESP32 and the flow sensor. To understand energy consumption, current draw was measured in both active and sleep modes. These measurements were extrapolated over a normal operating schedule to evaluate daily power demand and to assess whether the solar panel could replenish the consumed energy.
2.4. Communication Protocols and Data Storage
The prototype communicated over Wi-Fi using a simple HTTP-based interface. Each message contained a timestamp, flow value and device identifier and was formatted as a compact JSON object. At the server side, a REST endpoint inserted these records into a PostgreSQL table designed for time-series storage. A browser-based dashboard then retrieved the data and displayed it as a continuously updating graph. This setup enabled monitoring with only a few seconds of delay between measurement and visualization.
2.5. Cost Summary
A full node can be assembled using inexpensive, readily available components. The approximate cost of the ESP32, YF-S201 sensor, photovoltaic panel, battery and enclosure is around 24 €, which highlights the potential for deploying multiple nodes in parallel without significant financial burden.
3. Results
The prototype was evaluated in terms of sensor response, real-time operation and energy performance. The focus was on assessing whether the low-cost components could provide sufficiently accurate and stable measurements for practical streamflow monitoring.
3.1. Sensor Calibration
The calibration experiments confirmed that the YF-S201 sensor exhibits a strong linear relationship between pulse frequency and actual discharge in the tested range. Fitting a simple regression model produced a conversion factor close to 0.24 mL per pulse and an R2 value near 0.99, corresponding to a linear discharge–frequency relationship within the tested range. While this indicates strong linear behavior within the tested range, it should be noted that additional quantitative performance metrics (e.g., RMSE, MAPE) and a formal uncertainty analysis were not included in this initial evaluation and will be addressed in future studies. The linearity remained stable over repeated runs, and no marked delays were detected when transitioning from higher to lower flows. Sensitivity declined at the lower limit of the sensor’s operating range, a well-known characteristic of rotor-based meters, yet even in these low-flow conditions the sensor provided consistent readings when averaged over longer intervals.
3.2. Real-Time Operation
During extended tests in the simulated channel the device successfully transmitted data at five-minute intervals. The dashboard refreshed shortly after each transmission, resulting in a near real-time view of flow variations. Communication remained stable even when Wi-Fi connectivity fluctuated; the device was able to resume operation without losing data. The edge filtering successfully removed occasional extreme pulse measurements.
3.3. Energy Efficiency
With the selected duty cycle the overall daily energy demand of the node remained low, roughly between 25 and 30 mAh. Under moderate sunlight the solar panel supplied around 100 mAh per day, providing a comfortable surplus. The battery alone kept the system operational for several days without solar charging, suggesting that the configuration is suitable for short periods of cloud cover or shading.
4. Discussion
The results demonstrate that low-cost IoT components can be assembled into a capable streamflow monitoring platform. The calibration confirmed that, despite its inexpensive design, the YF-S201 sensor offers predictable and stable performance within its specified range when carefully calibrated. Combined with the ESP32’s low-power features and built-in communication capabilities, the sensor forms the core of a compact and autonomous node suitable for small streams and channels.
In this study, discharge is measured within a diverted pipe section rather than directly in the open channel. To interpret these measurements as total streamflow, a hydraulic relationship between the diverted flow and the full channel discharge must be established. This can be achieved by installing a simple and stable intake structure (e.g., side diversion, partial weir, or calibrated inlet) that consistently captures a known fraction of the flow. Under such conditions, the total discharge Qstream can be related to the measured pipe discharge Qpipe through a site-specific calibration function, either in the form of a proportionality coefficient or a rating curve derived from simultaneous field measurements using conventional methods. The stability of this relationship depends on maintaining consistent hydraulic conditions at the intake and avoiding blockage or sediment accumulation.
However, the diverted flow may not always represent a constant fraction of the total discharge under varying hydraulic conditions, which can introduce bias in the estimation of streamflow. Changes in flow distribution, intake geometry, or upstream disturbances may affect this relationship.
Therefore, while the present work validates the sensing and measurement subsystem under controlled conditions, the extension to full streamflow estimation requires an additional calibration step during field deployment. For these reasons, the proposed system is currently best suited for controlled conditions, engineered channels, or carefully selected field sites where hydraulic conditions remain stable. These limitations are consistent with the proof-of-concept nature of the present study and will be addressed in future work through field validation and system refinement.
The cost advantage of this architecture is substantial. Traditional hydrometric installations often exceed several thousand euros, making widespread deployment impractical. In contrast, the system described here can be assembled for a tiny fraction of that cost. This opens possibilities for installing dense networks of flow sensors in catchments where funding or logistics previously limited the number of monitoring sites. Although absolute accuracy may not match that of advanced instrumentation, consistent relative measurements can still yield valuable hydrological insights, particularly when coupled with calibration, modeling or data assimilation techniques.
Some limitations must be acknowledged. The use of an inline rotor-based sensor restricts deployment to locations where a stable hydraulic section can be created. Natural streams with high sediment load or floating debris may compromise the sensor’s operation or increase maintenance requirements. While R2 indicates strong linearity, it does not fully describe measurement accuracy, and additional performance metrics will be considered in future studies. Additionally, in the present study the calibration was conducted as a proof-of-concept demonstration and does not yet include a full uncertainty analysis or standardized error metrics. Future work will focus on a more rigorous experimental protocol, including controlled repetition of calibration points, precise estimation of volumetric measurement uncertainty, and evaluation using established performance indicators such as RMSE and MAPE. Such an analysis will be essential for validating the system under field conditions and for comparison with established hydrometric instruments. Future work will include pilot field deployments over extended periods (e.g., several months) to evaluate system reliability, maintenance requirements, and calibration stability under real stream conditions. Finally, although Wi-Fi simplifies early development, it is not available in remote field sites. Future deployments will likely require LoRaWAN, NB-IoT or GSM modules. Even so, the modularity of the ESP32 ecosystem makes such upgrades straightforward.
The prototype also opens opportunities for future development. Integrating additional sensors such as turbidity, temperature or conductivity would broaden the system’s utility. Machine learning algorithms running either locally or on the server side could identify anomalies that might indicate clogging, sudden inflow changes or sensor drift. Such enhancements would gradually move the system from a simple data logger to a more intelligent monitoring station capable of supporting decision-making processes. Overall, the main advantage of the proposed approach lies in its ability to support the development of dense, distributed monitoring networks at a fraction of the cost of conventional systems. Such networks have the potential to significantly improve the spatial resolution of hydrological observations in ungauged or under-instrumented regions. However, this benefit comes with trade-offs in terms of measurement accuracy, long-term robustness, and the need for site-specific calibration, which should be carefully considered in future applications. Additionally, environmental factors such as sediment abrasion, biofouling, and extreme temperature variations (including freezing conditions) may further affect long-term performance and require additional investigation.
5. Conclusions
This study presented the design and evaluation of a low-cost IoT sensor node for real-time monitoring of streamflow in small channels. By combining a YF-S201 Hall-effect flow sensor, an ESP32 microcontroller and a compact solar energy system, the proposed architecture achieved reliable pulse detection, accurate flow estimation after calibration and autonomous operation over extended periods. Calibration results showed a strong linear relationship between pulse frequency and discharge, while power measurements confirmed that the device can sustain itself energetically under typical outdoor conditions.
What makes this system particularly promising is not only its low cost but also its adaptability. It fills a niche between manual flow measurements, which cannot capture rapid hydrological changes, and conventional gauging stations, which are too expensive to install in large numbers. Although additional work is needed to validate the system in more complex natural environments, the results already suggest that such low-cost monitoring nodes could substantially improve hydrological data availability, especially in ungauged or under gauged catchments. As environmental monitoring continues to move toward distributed, high-frequency observations, designs like the one presented here can provide the foundation for future networks that are both scalable and sustainable.