A Low-Cost Radar-Based IoT Sensor for Noncontact Measurements of Water Surface Velocity and Depth

We designed an out-of-water radar water velocity and depth sensor, which is unique due to its low cost and low power consumption. The sensor is a first at a cost of less than USD 50, which is well suited to previously cost-prohibited high-resolution monitoring schemes. This use case is further supported by its out-of-water operation, which provides low-effort installations and longer maintenance-free intervals when compared with in-water sensors. The inclusion of both velocity and depth measurement capabilities allows the sensor to also be used as an all-in-one solution for flowrate measurement. We discuss the design of the sensor, which has been made freely available under open-hardware and open-source licenses. The design uses commonly available electronic components, and a 3D-printed casing makes the design easy to replicate and modify. Not before seen on a hydrology sensor, we include a 3D-printed radar lens in the casing, which boosts radar sensitivity by 21 dB. The velocity and depth-sensing performance were characterised in laboratory and in-field tests. The depth is accurate to within ±6% and ±7 mm and the uncertainty in the velocity measurements ranges from less than 30% to 36% in both laboratory and field conditions. Our sensor is demonstrated to be a feasible low-cost design which nears the uncertainty of current, yet more expensive, velocity sensors, especially when field performance is considered.


Introduction
When monitoring, modelling, and engineering urban water systems, one critical hydrological variable is the volumetric flowrate or discharge. Knowledge of discharge is important in optimising future urban water systems and minimising their environmental impact [1,2], detecting and locating leaks and burst pipes [3], and estimating pollutants from combined sewer overflow events [4,5]. Flow can be measured in a number of ways, ranging from manual dilution methods (i.e., adding salt tracers and EC sensors [6]), using stage discharge relationships that may or may not include the use of hydraulic control structures (i.e., weirs [7][8][9]), to the velocity-area method. Due to its accuracy and relative ease of installation, the velocity-area method is by far the most common method for small streams and stormwater drains. The cross-sectional area can be estimated from a water depth measurement using known bathymetry [10]. The mean flow velocity can either be obtained from in-water sensors or estimated via the surface velocity from an out-of-water sensor [9,11,12].
To facilitate a deeper understanding and to obtain a more accurate understanding of waterways, higher resolution monitoring has been desired so that real-time monitoring and control of our urban waterways can be achieved [3,[13][14][15]. For flowrate monitoring found when using existing sensors. By being both low-power and out-of-water, the sensor is low-maintenance as its batteries need to be changed very infrequently, and being out of the water, it is less likely to be blocked by debris. Furthermore, being out-of-water also simplifies the installation of the sensor, as mounting the sensor above the waterway can often be accomplished without entering the waterway or requiring confined-space entry.
While previous works have explored the potential of low-cost radar measurement, they left significant work in terms of bringing this technology into a state ready for use is large-scale environmental monitoring schemes. In contrast, the sensor developed in this study is ready for field operation in such monitoring schemes. Our sensor advances the out-of-water noncontact sensing space by integrating depth and velocity sensing into a single package, utilises 3D printing for cost reduction and reproduction ease, and includes a 3D-printed radar lens to vastly increase the sensitivity of the device.
In this paper, (1) the design and operating principle of the sensor are discussed, (2) the sensor is validated and characterised in laboratory and in-field tests, and (3) the results of the laboratory and in-field tests are used to characterise the sensor and analyse its performance.

Sensor Design
The sensor uses radar to measure both the water velocity and the water depth. A commercial off-the-shelf radar chip, the Acconeer XM132 [38], handles the generation and detection of the radar signals. The XM132 uses a pulsed coherent 60 GHz radar. In general, radar operates by emitting a radio wave which then reflects off an object and is detected by the radar antenna. Pulsed coherent radar sends out short pulses of radar, the time of flight of which can be used to determine the distance to the object. As the pulses are coherent, their phase is well known. This can be used to determine the phase upon reflection, which can encode velocity information via the Doppler effect. For the context of water velocity measurement, the radar is typically reflected back to the sensor due to the effect of Bragg scattering. This occurs off short surface waves with wavelength on the order of the radar wavelength, which may be caused by wind, rain, turbulence, and longer surface waves [39,40]. These surface waves travel at a speed of a few tens of centimetres per second along the water surface, hence in general the reflected signal contains multiple frequency components from the advancing and receding surface waves. Due to current variations, these two frequency components may have differing amplitudes and may not be distinguishable. Ideally, the midpoint of the two frequency components should be measured to obtain the surface velocity [39,40]. The Doppler effect then defines the relationship between the frequency shift of the radar upon reflection and the water velocity via v = c∆ f 2 f cosθ (1) where c is the speed of light in air, ∆f is the frequency shift between incoming and outgoing radar signals, f is the radar frequency (fixed for the used radar module), and θ is the angle between the radar and object motion. The line-of-sight distance to the water surface can be determined by considering the time taken for the radar signal to return to the sensor. Therefore, the distance d to the water surface can be determined using the following: where t is the time of flight of the pulse. For a reflection off a water surface, a radar measurement can determine both the Doppler shift and the time of flight. Here, as also seen in [35], it is approximated that the water surface is perpendicular to gravity, hence an accelerometer mounted to the radar sensor can be used to determine θ. Once this is known, Equations (1) and (2) can now be applied to determine the water surface velocity and line-of-sight distance to the water surface. The line-of-sight distance to the water surface can be converted to a water depth measurement, D, via D = H − d sinθ (3) where H is the perpendicular distance from the radar sensor to the channel bed, which should be measured manually during the installation of the sensor.

Electrical and Physical Overview
A schematic of the sensor is provided in Figure 1. It is separated into functional components. The MCU, an ATmega328PB, controls the other components of the printed circuit board (PCB) and handles the interface with the output. The ATmega328PB was chosen due to its ease of use and familiarity within sensing and datalogging applications [41]. A KXTJ3-1057 accelerometer measures the local acceleration of gravity to determine the orientation of the sensor. A power switch was incorporated in order to minimise the idle current draw of the sensor by turning components on and off as needed. In addition to handling the generation and detection of the radar signal, the radar module also has a custom developed processing algorithm to extract the depth and velocity. For a reflection off a water surface, a radar measurement can determine both the Doppler shift and the time of flight. Here, as also seen in [35], it is approximated that the water surface is perpendicular to gravity, hence an accelerometer mounted to the radar sensor can be used to determine θ. Once this is known, Equations (1) and (2) can now be applied to determine the water surface velocity and line-of-sight distance to the water surface. The line-of-sight distance to the water surface can be converted to a water depth measurement, where H is the perpendicular distance from the radar sensor to the channel bed, which should be measured manually during the installation of the sensor.

Electrical and Physical Overview
A schematic of the sensor is provided in Figure 1. It is separated into functional components. The MCU, an ATmega328PB, controls the other components of the printed circuit board (PCB) and handles the interface with the output. The ATmega328PB was chosen due to its ease of use and familiarity within sensing and datalogging applications [41]. A KXTJ3-1057 accelerometer measures the local acceleration of gravity to determine the orientation of the sensor. A power switch was incorporated in order to minimise the idle current draw of the sensor by turning components on and off as needed. In addition to handling the generation and detection of the radar signal, the radar module also has a custom developed processing algorithm to extract the depth and velocity. The sensor operates off a 3.3 V supply and communicates via a universal asynchronous receiver-transmitter (UART). A CAT5 cable carries this power and connectivity from a datalogger. The sensor body measures 60 mm in diameter and 60 mm in height and is entirely 3D-printed from polylactic acid (PLA) plastic. A picture of the sensor is provided in Figure 2. On the back of the sensor, there is a 15 mm radius ball mount which can be used to quickly attach the sensor during installations while still allowing for easy rotation of the sensor to the correct orientation. The front of the sensor houses a 3D-printed radar The sensor operates off a 3.3 V supply and communicates via a universal asynchronous receiver-transmitter (UART). A CAT5 cable carries this power and connectivity from a datalogger. The sensor body measures 60 mm in diameter and 60 mm in height and is entirely 3D-printed from polylactic acid (PLA) plastic. A picture of the sensor is provided in Figure 2. On the back of the sensor, there is a 15 mm radius ball mount which can be used to quickly attach the sensor during installations while still allowing for easy rotation of the sensor to the correct orientation. The front of the sensor houses a 3D-printed radar lens, which significantly boots the radar sensitivity. The back of the sensor is filled with a potting compound for waterproofing; however, there is an air cavity between the radar module and the lens required for radar operation. This cavity is waterproofed such that no water can enter it. The total cost of the sensor was less than USD 50 for the small production run of sensors for this study. A larger production run of a few hundred sensors would likely result in a lower per-unit cost. lens, which significantly boots the radar sensitivity. The back of the sensor is filled with a potting compound for waterproofing; however, there is an air cavity between the radar module and the lens required for radar operation. This cavity is waterproofed such that no water can enter it. The total cost of the sensor was less than USD 50 for the small production run of sensors for this study. A larger production run of a few hundred sensors would likely result in a lower per-unit cost.

Figure 2.
Picture of radar sensor labelling key features. Left: front view. Right: back view. The waterproofing back cover and cable are not shown in the back view so that the internal part of the sensor can be seen.

Radar Lens
Natively, the beam angle from the radar module is quite large, at a beam width of between 40° and 80° [42]. This is unideal for water measurement for several reasons: (a) a large beam width means that the radar power is dispersed over a wide area, hence only a small fraction is reflected back to the sensor; (b) narrow and distant water flows may only occupy a small fraction of the beam width, and hence not utilise the full output of the radar sensor; and (c) if the spot size of the radar beam on the water surface is too large, other objects present, such as pit walls or vegetation, may enter the radar beam and affect the measurement. For these reasons, it would be ideal to focus the beam width to a smaller angle. Recently, much work has been performed on developing radar quasioptics using low-cost additive manufacturing techniques such as fused deposition modeling (FDM) 3D printing [43][44][45][46][47]. Here we apply the advances of these previous works and incorporate such a 3D-printed radar lens to focus the radar beam. Many of these works have experimented with gradient refractive index to achieve a variable index of refraction. This work did not pursue this technology due to possibility of water ingress into metamaterials.
As the radar lens is 3D-printed with the case out of common PLA plastic, it is very inexpensive to produce and easily adjustable to the optimal lens shape. At the same time, the addition of the radar lens brings a 21 dB gain to the collected radar power when compared with the absence of any radar lens. A diagram of how the radar lens works is shown in Figure 3. The radar lens is positioned in the case such that it focuses parallel incoming radar rays to the radar module located at the focal point of the lens.

Radar Lens
Natively, the beam angle from the radar module is quite large, at a beam width of between 40 • and 80 • [42]. This is unideal for water measurement for several reasons: (a) a large beam width means that the radar power is dispersed over a wide area, hence only a small fraction is reflected back to the sensor; (b) narrow and distant water flows may only occupy a small fraction of the beam width, and hence not utilise the full output of the radar sensor; and (c) if the spot size of the radar beam on the water surface is too large, other objects present, such as pit walls or vegetation, may enter the radar beam and affect the measurement. For these reasons, it would be ideal to focus the beam width to a smaller angle. Recently, much work has been performed on developing radar quasioptics using low-cost additive manufacturing techniques such as fused deposition modeling (FDM) 3D printing [43][44][45][46][47]. Here we apply the advances of these previous works and incorporate such a 3D-printed radar lens to focus the radar beam. Many of these works have experimented with gradient refractive index to achieve a variable index of refraction. This work did not pursue this technology due to possibility of water ingress into metamaterials.
As the radar lens is 3D-printed with the case out of common PLA plastic, it is very inexpensive to produce and easily adjustable to the optimal lens shape. At the same time, the addition of the radar lens brings a 21 dB gain to the collected radar power when compared with the absence of any radar lens. A diagram of how the radar lens works is shown in Figure 3. The radar lens is positioned in the case such that it focuses parallel incoming radar rays to the radar module located at the focal point of the lens.  Several lens designs and parameters were tested for optimal gain before the final design was settled on. The PLA plastic used for the manufacturing was measured to have a refractive index at 60 GHz of 1.8 ± 0.2. For the spherical planoconvex lens used here, the following is a result of geometric optics: where f is the focal length of the lens, nlens is the refractive index of the lens material, n0 is the refractive index of the surrounding medium, and R is the radius of curvature of the lens. As long as the dimensions of the lens remain much larger than the wavelength, geometric optics can be used for analysis [48]. For a given plastic refractive index, this formula can be used to determine the radius of curvature to give optimal gain to the radar system. A further constraint of the focal length is that it should be a multiple of λ/2 to minimise the destructive interference of the radar signal reflecting between the radar module and the lens surface. Here, a focal length of f = 38 mm was chosen with an R = 30 mm radius of curvature. The diameter of the radar lens was made as large as is practical at b = 49 mm. This decreases diffractive effects and increases the proportion of the incoming radar signal collected, hence further increasing the receiver gain.

Data Processing
Data processing algorithms are needed to both determine the orientation of the sensor from the accelerometer readings and process the raw radar data collected to a final depth and velocity measurement. For determination of the orientation, the onboard accelerometer measures the acceleration of gravity in the local coordinates of the accelerometer. The accelerometer is mounted on the PCB such that the z-coordinate is parallel to the radar beam. Therefore, the angle between the radar beam and the horizontal is given by the following: where gx, gy, gz are, respectively, the x, y, z components of the acceleration as reported by the accelerometer, and atan2 is the two-argument arctangent function. The determination of the water velocity and depth from the raw radar data is more involved. The radar module measures the signal strength reflected from the environment. These data are binned by the distance of the reflection from the sensor. These bins are 60 . An optical diagram displaying the function of the radar lens. The falloff of radar intensity is illustrated in the orange background. Particular radar rays are displayed as dashed lines. Note how the radar lens focuses the rays from the radar module into a parallel beam reducing the intensity falloff with distance. b is the diameter of the lens, R the radius of curvature, and f the focal length. m is an arbitrary integer. β is the beam width angle of the radar emission. Paths of the rays through the lens are reversed for incoming radar signals.
Several lens designs and parameters were tested for optimal gain before the final design was settled on. The PLA plastic used for the manufacturing was measured to have a refractive index at 60 GHz of 1.8 ± 0.2. For the spherical planoconvex lens used here, the following is a result of geometric optics: where f is the focal length of the lens, n lens is the refractive index of the lens material, n 0 is the refractive index of the surrounding medium, and R is the radius of curvature of the lens. As long as the dimensions of the lens remain much larger than the wavelength, geometric optics can be used for analysis [48]. For a given plastic refractive index, this formula can be used to determine the radius of curvature to give optimal gain to the radar system. A further constraint of the focal length is that it should be a multiple of λ/2 to minimise the destructive interference of the radar signal reflecting between the radar module and the lens surface. Here, a focal length of f = 38 mm was chosen with an R = 30 mm radius of curvature. The diameter of the radar lens was made as large as is practical at b = 49 mm. This decreases diffractive effects and increases the proportion of the incoming radar signal collected, hence further increasing the receiver gain.

Data Processing
Data processing algorithms are needed to both determine the orientation of the sensor from the accelerometer readings and process the raw radar data collected to a final depth and velocity measurement. For determination of the orientation, the onboard accelerometer measures the acceleration of gravity in the local coordinates of the accelerometer. The accelerometer is mounted on the PCB such that the z-coordinate is parallel to the radar beam. Therefore, the angle between the radar beam and the horizontal is given by the following: where g x , g y , g z are, respectively, the x, y, z components of the acceleration as reported by the accelerometer, and atan2 is the two-argument arctangent function. The determination of the water velocity and depth from the raw radar data is more involved. The radar module measures the signal strength reflected from the environment. These data are binned by the distance of the reflection from the sensor. These bins are 60 mm in length. The reflection data are measured 64 times at rate on the order of 1 kHz. For data processing, the reflection data are organized into a 2D array as shown in Figure 4 (top). In this array, the time of the measurement is given by the column and the distance bin by the rows. The start and end distances for the measurement of the reflected signal strength can be configured to suit the sensor's installation. In this study, values of 240 mm and 2280 mm were used. To determine the water velocity, the Doppler velocity needs to be determined from the change in reflected signal strength over time. To accomplish this, a fast Fourier transform(FFT) is applied to each row of the array. This transforms the time axis into a frequency axis where the large values indicate the frequency has a large amplitude in the reflected signal (see bottom of Figure 4). Before the FFT is applied, the mean component of the signal is removed to detrend the data. This eliminates the contribution from stationary objects' reflections which would otherwise obscure the dynamic signal from the water surface.
Sensors 2023, 23, x FOR PEER REVIEW 7 of 19 mm in length. The reflection data are measured 64 times at rate on the order of 1 kHz. For data processing, the reflection data are organized into a 2D array as shown in Figure 4 (top). In this array, the time of the measurement is given by the column and the distance bin by the rows. The start and end distances for the measurement of the reflected signal strength can be configured to suit the sensor's installation. In this study, values of 240 mm and 2280 mm were used. To determine the water velocity, the Doppler velocity needs to be determined from the change in reflected signal strength over time. To accomplish this, a fast Fourier transform(FFT) is applied to each row of the array. This transforms the time axis into a frequency axis where the large values indicate the frequency has a large amplitude in the reflected signal (see bottom of Figure 4). Before the FFT is applied, the mean component of the signal is removed to detrend the data. This eliminates the contribution from stationary objects' reflections which would otherwise obscure the dynamic signal from the water surface. A single scan from the radar sensor completes all time samples within tens of microseconds. This is a very short time period compared with the random fluctuations of the water surface, so a single scan would be affected by this random fluctuation. Furthermore, the radar scan itself also has some uncertainty. To sample the water over a longer period of time and reduce uncertainty, the energy-preserving root mean square (RMS) average of six FFT processed scans, taken about one second apart, is calculated.
As per the theory behind radar velocity measurement [39], the signal does not have a single frequency peak, but rather a frequency spectrum. Therefore, to determine the Doppler frequency, an intelligent peak-finding algorithm is run on the RMS averaged array. The array is first preprocessed by applying a Gaussian blur with a kernel size of 1.5 bins. From here, the bin with the greatest amplitude is found; as this should occur in the bin corresponding to water surface -sensor distance, the analysis is then restricted to this row of the array. At this point, the value in the peak bin is taken as the 'signal strength' of the measurement. As the contrast between the peak and the background signal can be small, all bins with an amplitude less than one third of the maximum amplitude are set to zero. This eliminates most of the background signal, which can otherwise bias the readings to towards the centre of the measurement range. Finally, the amplitude-weighted A single scan from the radar sensor completes all time samples within tens of microseconds. This is a very short time period compared with the random fluctuations of the water surface, so a single scan would be affected by this random fluctuation. Furthermore, the radar scan itself also has some uncertainty. To sample the water over a longer period of time and reduce uncertainty, the energy-preserving root mean square (RMS) average of six FFT processed scans, taken about one second apart, is calculated.
As per the theory behind radar velocity measurement [39], the signal does not have a single frequency peak, but rather a frequency spectrum. Therefore, to determine the Doppler frequency, an intelligent peak-finding algorithm is run on the RMS averaged array. The array is first preprocessed by applying a Gaussian blur with a kernel size of 1.5 bins. From here, the bin with the greatest amplitude is found; as this should occur in the bin corresponding to water surface -sensor distance, the analysis is then restricted to this row of the array. At this point, the value in the peak bin is taken as the 'signal strength' of the measurement. As the contrast between the peak and the background signal can be small, all bins with an amplitude less than one third of the maximum amplitude are set to zero. This eliminates most of the background signal, which can otherwise bias the readings to towards the centre of the measurement range. Finally, the amplitude-weighted average of the frequency bins is taken, which equates to a frequency that we consider to estimate the Doppler frequency ∆f. When combined with the angle measurement from the accelerometer θ, Equation (1) can be used to calculate the surface velocity.
To determine the distance to the water surface, a higher resolution mode on the radar module was used which provided the reflection amplitude in 2 mm increments but provided no time domain data. The bin with the greatest reflection amplitude was taken as the distance to the water surface.

Power Usage
To test the power usage of the sensor, a Multicomp Pro MP730026 ammeter was placed in series with the ground connection. The ammeter was then used to measure the sleep current of the sensor, which is the current while the sensor is not performing any measurements. This was found to be 100 nA. To measure the duration and charge needed for a single velocity and depth measurement, a Rigol DS1054Z oscilloscope was connected across the ammeter. As the shunt resistance of the ammeter was 4 Ω, this allowed for high time-resolution measurement of current consumption. A single measurement (which, as described above, is the average of 6 individual scans) was found to take 7.02 s and require 0.0742 mAh of charge. This results in an average current of 38.1 mA for a single measurement. The peak current could also be measured to be 64 mA. For a typical logging rate of 10 measurements per hour, the average current draw of the sensor is 740 µA. This provides 196 days of operation on a typical 3500 mAh single 18,650 Li-ion cell. For a logging rate of 1 measurement per hour, over 5 years of operation could be optimally achieved. This low power consumption supports the use case of the sensor in battery-operated installations with infrequent maintenance.

Lab Characterisation
To gain an understanding of the performance of the sensor and its response to velocity and depth, a laboratory characterisation experiment was conducted. A flume was used to create conditions of varying depth and velocity ( Figure 5, top). The water velocity and depth were adjusted by adjusting the flowrate and height of weirs in the flume. Due to the hydraulics of the flume, the data above a velocity of 0.5 m/s and below 25 mm of depth displayed supercritical flow as opposed to the subcritical flow when these conditions were not met. The 'true' depth was measured by using two sets of level indicators on either side of the section of water measured by the radar sensor. The average of these two measurements was taken to be 'true' water depth. The disagreement between the two level indicators never exceeded 2 mm, so the flow in the region measured by the radar sensor was relatively level. The flow was also observed to be in steady state. The 'true' velocity of the water in the flow was measured using a pair of venturi meters positioned in line with the two level indicators. Again, the average of the two venturi meters was taken to be the true velocity. As the velocity of the water is not uniform across the cross section of the flow, the venturi meters were positioned close to the surface to obtain a best estimate for the water surface velocity. This was performed because the Doppler radar measurement technique used by the sensor measures the velocity of the water surface.
Three radar sensors (A, B, and C) were mounted a distance of H = 740 mm above the channel bed and pointing at an angle of 74 • from the horizontal. Sensor B was placed along the thalweg of the flow with sensors A and C offset by 60 mm to the left and right sides, respectively ( Figure 5 bottom). Multiple sensors were used to triplicate the data and gain an understanding of the variance in performance between the sensors. The radar data were recorded from each of the three sensors onto a computer via UART. Each datapoint is the average of 12 consecutive measurements. The results presented in this work were analysed using the processing algorithm explained above. Three radar sensors (A, B, and C) were mounted a distance of H = 740 mm above th channel bed and pointing at an angle of 74° from the horizontal. Sensor B was placed alon the thalweg of the flow with sensors A and C offset by 60 mm to the left and right side respectively ( Figure 5 bottom). Multiple sensors were used to triplicate the data and gai an understanding of the variance in performance between the sensors. The radar dat were recorded from each of the three sensors onto a computer via UART. Each datapoin is the average of 12 consecutive measurements. The results presented in this work wer analysed using the processing algorithm explained above.

Field Trial
For the field trial, the sensor was deployed for 5 weeks at the inlet of Troup's Cree Wetland in Melbourne, Australia. Over this period, the channel was mostly dry; howeve two large flow events were captured. The radar sensor was connected to a datalogge which uploaded a measurement from the sensor every 10 min to a cloud server. The rada sensor was compared against a commercial HACH AV9000 Submerged Area Velocity Sen sor [17], an in-water acoustic Doppler velocity and level sensor. The HACH probe wa installed at the bed of the channel and was set to log locally at intervals of 1 min. A pho tograph of this setup is provided in Figure 6. For the field trial, it was initially assume that the HACH sensor recorded the true velocity and depth of the channel. The validit of this assumption is questionable, as is discussed in the results. At certain times durin the trial, the HACH sensor reported failed velocity and depth measurements, usually du to an obstruction in front of the sensor. These periods of time are identified by a hig density of identical velocity readings from the HACH sensor and have been removed. Th data were also filtered so that all of the following were true: (a) the radar sensor was in

Field Trial
For the field trial, the sensor was deployed for 5 weeks at the inlet of Troup's Creek Wetland in Melbourne, Australia. Over this period, the channel was mostly dry; however, two large flow events were captured. The radar sensor was connected to a datalogger which uploaded a measurement from the sensor every 10 min to a cloud server. The radar sensor was compared against a commercial HACH AV9000 Submerged Area Velocity Sensor [17], an in-water acoustic Doppler velocity and level sensor. The HACH probe was installed at the bed of the channel and was set to log locally at intervals of 1 min. A photograph of this setup is provided in Figure 6. For the field trial, it was initially assumed that the HACH sensor recorded the true velocity and depth of the channel. The validity of this assumption is questionable, as is discussed in the results. At certain times during the trial, the HACH sensor reported failed velocity and depth measurements, usually due to an obstruction in front of the sensor. These periods of time are identified by a high density of identical velocity readings from the HACH sensor and have been removed. The data were also filtered so that all of the following were true: (a) the radar sensor was installed within the recommended operating angle of between 70 • and 87 • (on some occasions, birds or humans would move the sensor, which would cause the sensor to be pointing at objects other than the water flow), (b) the radar depth was non-negative and the water surface was further than 350 mm from the sensor, and (c) the HACH depth was above 100 mm. This last condition was necessary as the cable shroud ( Figure 6) around the HACH sensor cable was observed to create a small hydraulic jump at low depths, invalidating velocity readings. The installation height of the radar sensor was measured manually during installation and used to determine the water depth from the distance data. A HACH datapoint was associated with each radar sensor measurement by finding the temporally nearest HACH datapoint. Therefore, the maximum time difference between the HACH sensor measurement and the radar sensor measurement was ±1 min.
pointing at objects other than the water flow), (b) the radar depth was non-negative and the water surface was further than 350 mm from the sensor, and (c) the HACH depth wa above 100 mm. This last condition was necessary as the cable shroud ( Figure 6) around the HACH sensor cable was observed to create a small hydraulic jump at low depths invalidating velocity readings. The installation height of the radar sensor was measured manually during installation and used to determine the water depth from the distance data. A HACH datapoint was associated with each radar sensor measurement by finding the temporally nearest HACH datapoint. Therefore, the maximum time difference be tween the HACH sensor measurement and the radar sensor measurement was ±1 min.

Lab Characterisation
The performance of the sensor's depth measurement is shown in Figure 7. A strong linear trend is present in the data, with R 2 coefficients greater than 0.86, and the probability of the null hypothesis that the gradient is zero is p < 0.0001. For sensors A and B, the depth response differs from unity by less than 2% while the depth offset is less than 6 mm. Senso C does not have as ideal a response, however, with a gradient error of 12% and a 9 mm offset. It is possible that some of this uncertainty in the depth measurement is due to the placement of sensors A and C off the centreline of the flume, as the offset slightly affect the equations needed to recover the depth and velocity, and this offset may also affect the sensor's line of sight to the water. The root mean square (RMS) errors of each measure ment from their linear fit are 17%, 16%, and 24% for sensors A, B, and C, respectively. Due to constraints in the laboratory flume, only a small depth range of 15 mm to 125 mm could be tested; however, on this range it is seen that the sensor produces an accurate response to changes in the water depth.

Lab Characterisation
The performance of the sensor's depth measurement is shown in Figure 7. A strong linear trend is present in the data, with R 2 coefficients greater than 0.86, and the probability of the null hypothesis that the gradient is zero is p < 0.0001. For sensors A and B, the depth response differs from unity by less than 2% while the depth offset is less than 6 mm. Sensor C does not have as ideal a response, however, with a gradient error of 12% and a 9 mm offset. It is possible that some of this uncertainty in the depth measurement is due to the placement of sensors A and C off the centreline of the flume, as the offset slightly affects the equations needed to recover the depth and velocity, and this offset may also affect the sensor's line of sight to the water. The root mean square (RMS) errors of each measurement from their linear fit are 17%, 16%, and 24% for sensors A, B, and C, respectively. Due to constraints in the laboratory flume, only a small depth range of 15 mm to 125 mm could be tested; however, on this range it is seen that the sensor produces an accurate response to changes in the water depth. The performance of the sensor's velocity measurements is shown in Figure 8. Again, a strong linear trend is present in the data. All of the linear trendlines had a probability of the null hypothesis for a gradient of zero of p < 0.0001. The velocity data also show that sensor C does not perform as strongly as sensors A or B; this could be due to either unideal positioning of sensor C or a defect in sensor C's assembly. Considering only sensors A and B, the linear correlation coefficient is greater than 0.89 and the gradient is within 6% of unity. The offset is less than 0.14 m/s. It is seen, however, that below 0.3 m/s, the response of the radar velocity to changes in measured velocity is limited. This represents that the sensor has difficulty in resolving low velocities; however, this is somewhat unsurprising as it is a common issue faced by radar-based velocity sensing [19]. Due to this differing behaviour past 0.3 m/s, considering only the data above 0.3 m/s, sensors A, B, and C have RMS errors from their linear fit of 20%, 28%, and 30%, respectively. This figure gives an indication of the point-to-point error expected for a velocity measurement and is due to both a systematic and random error component. In field applications, where the measurement interval is much shorter than the characteristic timescale of velocity changes, averaging neighbouring measurements helps reduce the random component of this error; however, this is not able to address the systematic component. These data demonstrate the capability of the sensor to effectively measure the surface water velocity up to at least the 1.2 m/s tested in this experiment. While the sensor was installed quite close to the water surface (740 mm from the flume bed), the radar signal was also attenuated by the 10 mm acrylic top of the flume, which the radar signal had to pass through. The performance of the sensor's velocity measurements is shown in Figure 8. Again, a strong linear trend is present in the data. All of the linear trendlines had a probability of the null hypothesis for a gradient of zero of p < 0.0001. The velocity data also show that sensor C does not perform as strongly as sensors A or B; this could be due to either unideal positioning of sensor C or a defect in sensor C's assembly. Considering only sensors A and B, the linear correlation coefficient is greater than 0.89 and the gradient is within 6% of unity. The offset is less than 0.14 m/s. It is seen, however, that below 0.3 m/s, the response of the radar velocity to changes in measured velocity is limited. This represents that the sensor has difficulty in resolving low velocities; however, this is somewhat unsurprising as it is a common issue faced by radar-based velocity sensing [19]. Due to this differing behaviour past 0.3 m/s, considering only the data above 0.3 m/s, sensors A, B, and C have RMS errors from their linear fit of 20%, 28%, and 30%, respectively. This figure gives an indication of the point-to-point error expected for a velocity measurement and is due to both a systematic and random error component. In field applications, where the measurement interval is much shorter than the characteristic timescale of velocity changes, averaging neighbouring measurements helps reduce the random component of this error; however, this is not able to address the systematic component. These data demonstrate the capability of the sensor to effectively measure the surface water velocity up to at least the 1.2 m/s tested in this experiment. While the sensor was installed quite close to the water surface (740 mm from the flume bed), the radar signal was also attenuated by the 10 mm acrylic top of the flume, which the radar signal had to pass through. These data demonstrate some capacity for the radar sensor to measure through certain small obstructions to a direct line of sight to the water surface. This suggests another application for the sensor, that of external and unintrusive measurement of open channel flow in small pipes. Together, these lab characterisation tests provide evidence for the sensor's ability to measure both depth and velocity. These data demonstrate some capacity for the radar sensor to measure through certain small obstructions to a direct line of sight to the water surface. This suggests another application for the sensor, that of external and unintrusive measurement of open channel flow in small pipes. Together, these lab characterisation tests provide evidence for the sensor's ability to measure both depth and velocity.

Field Trial
The timeseries data recorded over the duration of the field trial are displayed in Figure 9. The depth data (Figure 9, top) show that the new radar sensor's depth measurements agree with the HACH measurements, with most data mostly superimposed on each other. It is seen, however, that there are a few sporadic depth measurements where isolated depth measurements from the radar sensor are lower than neighbouring measurements; again, this is most prevalent at low depths. While it is not certain what causes these sporadic points, they may be due to the effect of background clutter (ground, plants, etc.) [23]. Given their sparsity and distinctness from the rest of the depth data series, it is believed that a simple filtering algorithm could be applied to these data to reduce any significant jumps in the dataset. Furthermore, we believe the sensor data could be more thoroughly explored to provide uncertainty estimates of each measurement, either by a) using the variability in the six individual scans or b) using the strength information as a quality scoring system.

Field Trial
The timeseries data recorded over the duration of the field trial are displayed in Figure 9. The depth data (Figure 9, top) show that the new radar sensor's depth measurements agree with the HACH measurements, with most data mostly superimposed on each other. It is seen, however, that there are a few sporadic depth measurements where isolated depth measurements from the radar sensor are lower than neighbouring measurements; again, this is most prevalent at low depths. While it is not certain what causes these sporadic points, they may be due to the effect of background clutter (ground, plants, etc.) [23]. Given their sparsity and distinctness from the rest of the depth data series, it is believed that a simple filtering algorithm could be applied to these data to reduce any significant jumps in the dataset. Furthermore, we believe the sensor data could be more thoroughly explored to provide uncertainty estimates of each measurement, either by a) using the variability in the six individual scans or b) using the strength information as a quality scoring system.

3, 23, x FOR PEER REVIEW
13 of 19 Figure 9. Plot of timeseries data from field trial. Top: depth measurement. Bottom: velocity measurements. Note that many of the depth data are overlapping in the HACH and radar data series. Figure 10 shows a strong linear correlation between the depth values from the radar and HACH sensors, with a line of best fit having an R 2 of 0.88, a gradient of 0.93, and an intercept of 7 mm. The probability of the null hypothesis that the gradient is zero for the regression is p < 0.0001, reconfirming that precise absolute depth measurements are possible from this radar sensor, even with only a single measurement of the installation height of the sensor. The mean absolute error of the sensor is estimated to be 15%, and this is greater than what most existing commercial sensors promise [15,27,49] (which are often accurate to a few percent or mm). However, these are often provided for ideal laboratory conditions and others do report extremely high uncertainties (e.g., >30%) when these commercial sensors are used in field conditions, especially during times of low water depths [50]. These quoted uncertainties serve as a lower bound for the performance, as (a) the sporadically low points have not been filtered in this analysis; (b) the analysis assumes that the HACH sensor provides the true water depth when in reality it has an uncertainty of at least 2%, located upstream of the radar sensor, and its datasets were only synchronized up to a ±1 min error; and (c) the radar sensor can be more susceptible to passing debris and variance in water level due to turbulence and surface waves, whereas these changes would not be picked up by the in-water HACH sensor. Figure 9. Plot of timeseries data from field trial. Top: depth measurement. Bottom: velocity measurements. Note that many of the depth data are overlapping in the HACH and radar data series. Figure 10 shows a strong linear correlation between the depth values from the radar and HACH sensors, with a line of best fit having an R 2 of 0.88, a gradient of 0.93, and an intercept of 7 mm. The probability of the null hypothesis that the gradient is zero for the regression is p < 0.0001, reconfirming that precise absolute depth measurements are possible from this radar sensor, even with only a single measurement of the installation height of the sensor. The mean absolute error of the sensor is estimated to be 15%, and this is greater than what most existing commercial sensors promise [15,27,49] (which are often accurate to a few percent or mm). However, these are often provided for ideal laboratory conditions and others do report extremely high uncertainties (e.g., >30%) when these commercial sensors are used in field conditions, especially during times of low water depths [50]. These quoted uncertainties serve as a lower bound for the performance, as (a) the sporadically low points have not been filtered in this analysis; (b) the analysis assumes that the HACH sensor provides the true water depth when in reality it has an uncertainty of at least 2%, located upstream of the radar sensor, and its datasets were only synchronized up to a ±1 min error; and (c) the radar sensor can be more susceptible to passing debris and variance in water level due to turbulence and surface waves, whereas these changes would not be picked up by the in-water HACH sensor. For the velocity data, there are again similar trends between the two sensors, demonstrating the potential of the radar sensor to estimate water velocities (Figure 9, bottom). A linear trend is also seen between the HACH and the low-cost radar sensor (Figure 10, right), with an R 2 of 0.48, a gradient of 0.54, and an intercept of 66 mm/s. The radar velocity data have a mean absolute error (MAE) from their trendline of 36%. The probability of the null hypothesis that the gradient is zero is p < 0.0001, implying the fit is significant. This general agreement is an important finding, demonstrating the ability of the low-cost, lowpower, noncontact sensor to detect water velocities and providing an opportunity for collecting highly spatially distributed datasets of water movements throughout complex catchments.
The deviations observed between the radar and the HACH sensors were, however, greater for the velocity measurements than for the depth measurements. This was expected, as velocity measurements are far more complex and always have higher uncertainties than depth measurements [50]. The fact that open water flows have varying velocities throughout their cross section makes comparing one sensor with another even more challenging as deviations between sensors deployed in the field are further exacerbated due to the following: (a) the technique used for estimating velocity (e.g., water column velocity measurements vs. surface water velocities) and (b) the installation characteristics of the sensor (e.g., wall effects causing the sensor's measurements to be less representative of the actual water's velocity).
We believe that these factors resulted in the deviations we observe in Figure 9 (bottom) and Figure 10 (right). First, while both the HACH sensor and the radar sensor rely on the same fundamental physics (Doppler shift), they are measuring different parts of the water velocity profile, with one being out of the water column and the other being inside the water. Indeed, prior research demonstrates that the velocity can significantly change within a cross section of the water flow [51], and that this profile changes depending on the flow conditions. Under many conditions, the surface velocity can be 20% lower than the average cross-sectional velocity [51], especially if the flow is now measured along the thalweg. This likely contributes to the 0.54 gradient of the line when comparing the HACH with the radar sensor. Importantly, the differences between surface water velocities and average in-water velocities are often the greatest at low flow velocities and low depths, which are where the radar sensor and the HACH sensors deviate the most. For the velocity data, there are again similar trends between the two sensors, demonstrating the potential of the radar sensor to estimate water velocities (Figure 9, bottom). A linear trend is also seen between the HACH and the low-cost radar sensor ( Figure 10, right), with an R 2 of 0.48, a gradient of 0.54, and an intercept of 66 mm/s. The radar velocity data have a mean absolute error (MAE) from their trendline of 36%. The probability of the null hypothesis that the gradient is zero is p < 0.0001, implying the fit is significant. This general agreement is an important finding, demonstrating the ability of the low-cost, low-power, noncontact sensor to detect water velocities and providing an opportunity for collecting highly spatially distributed datasets of water movements throughout complex catchments.
The deviations observed between the radar and the HACH sensors were, however, greater for the velocity measurements than for the depth measurements. This was expected, as velocity measurements are far more complex and always have higher uncertainties than depth measurements [50]. The fact that open water flows have varying velocities throughout their cross section makes comparing one sensor with another even more challenging as deviations between sensors deployed in the field are further exacerbated due to the following: (a) the technique used for estimating velocity (e.g., water column velocity measurements vs. surface water velocities) and (b) the installation characteristics of the sensor (e.g., wall effects causing the sensor's measurements to be less representative of the actual water's velocity).
We believe that these factors resulted in the deviations we observe in Figure 9 (bottom) and Figure 10 (right). First, while both the HACH sensor and the radar sensor rely on the same fundamental physics (Doppler shift), they are measuring different parts of the water velocity profile, with one being out of the water column and the other being inside the water. Indeed, prior research demonstrates that the velocity can significantly change within a cross section of the water flow [51], and that this profile changes depending on the flow conditions. Under many conditions, the surface velocity can be 20% lower than the average cross-sectional velocity [51], especially if the flow is now measured along the thalweg. This likely contributes to the 0.54 gradient of the line when comparing the HACH with the radar sensor. Importantly, the differences between surface water velocities and average in-water velocities are often the greatest at low flow velocities and low depths, which are where the radar sensor and the HACH sensors deviate the most. Furthermore, the sensitivity of the in-water sensor is likely to be higher than that of the radar sensor, which relies on remote sensing style measurements, likely contributing to the plateau observed in the correlation plot (i.e., no variation in radar sensor response up to 300 mm/s) and the intercept of 66 mm/s. The installation characteristics of the two sensors also need to be considered when interpreting Figures 9 and 10. Indeed, due to vandalism, the HACH sensor was installed with a metal shroud to protect its cabling, as is visible in Figure 6. This was observed to act as a small hydraulic structure, particularly impacting low flow depths and hence low water velocities, and was assumed to increase in-water velocities by impacting acoustic signals that travel through the flow over the structure. This would have contributed to the large deviations observed in the velocities from the two sensors, especially during times of low water depths. In fact, the largest deviations observed in Figure 9 (bottom) occurred during the times of the lowest water depths (3 and 4 February), suggesting that this structure could also have contributed to these results.
To explore the inherent difficulties in comparing two sensors and to begin to understand the performance of the radar sensor in more detail, we compared two identical HACH AV sensors installed in the same cross section. The second in-water HACH sensor was installed 1 m to the right of the original HACH sensor, as seen in Figure 6. The R 2 between the two identical HACH sensors was 0.56 and the right HACH sensor measured 62% higher on average. These values are not dissimilar to the values we reported above for the comparison between the original HACH sensor and the radar sensor. The disagreement between these two sensors installed in similar conditions is indicative of the challenge of in-field velocity measurement and the typical degradation of performance in field vs. lab tests. This difference occurs despite the HACH sensors being state-of-the-art commercial sensors.
In summary, we provide the evidence above to demonstrate that the radar sensor is capable of estimating water velocities (i.e., R 2 = 0.48 when compared with a commercial sensor). However, it is noted that this sensor is measuring surface water velocities, which are related, but not equivalent, to the cross-sectional average velocity (hence resulting in a slope of the line of best fit of 0.54 when compared with the instream sensor). We further note that although installation characteristics limit our comparison between the HACH and the radar sensor, this field dataset, along with the extensive laboratory datasets, implies that the uncertainties in the sensor for velocities less than 300 mm/s are significant. While the poor performance of the radar sensor below 300 mm/s precludes the application of this radar sensor in measuring velocity in slow water bodies, it is less of a limitation for stormwater, wastewater, and rivers, in which the events of interest tend to have velocities well in excess of 300 mm/s. Future research could explore how radar lenses with greater gain or narrower cone angles could help to reduce these uncertainties.

Comparison with the Literature
While a strict comparison of the performance of this sensor with others available on the market is difficult due to the limited information provided in these publications, we attempt to perform a qualitative comparison with the literature, as summarised below and in Table 1. An implementation of Doppler radar using a custom-designed integrated circuit obtained an uncertainty of 8% in ideal conditions at the single velocity it was tested at of 1.2 m/s [35]. The 8% figure is likely an underestimate of the sensor's mean absolute error. For our sensor, while our error was 36% in field conditions and between 20% and 30% for the lab tests, this was over the entire range of the sensor. The low-cost, low-power in-water sensor proposed in [22] has RMS errors ranging from 17% to 43% between 200 mm/s and 1200 mm/s in long-term field testing. This performance is comparable with that of the radar sensor here. Image velocimetry from unmanned aerial drones (UAV) was attempted in [31]; in flow velocities of up to 200 mm/s, the average difference from a reference ADCP sensor was 50 mm/s. This equates to a minimum average error of 25%. A second image velocimetry from the UAV study found mean absolute errors of between 60 mm/s and 140 mm/s in flows of up to 1100 mm/s [28]. These values are 5% and 13% of the peak flowrate, respectively. A low-cost, low-power radar Doppler sensor utilising a custom radar board achieved mean errors of −3% and −11% at the two flow velocities tested in a field-day test [34]. Furthermore, [29] studied the accuracy of the commercial Decatur Surface Velocity Radar [52] at a range of sites and found that its surface velocity error ranged from 7% to 25%. From this comparison with the current literature (Table 1), our proposed sensor, while having a slightly higher average uncertainty, is near the range of the uncertainties of other sensors. The radar sensor also has the advantages of being out-of-water, low-cost, low-power, and capable of simultaneous depth measurement. Table 1. Comparison of our work with existing velocity sensors. While a cost estimate is not available for all works, as low cost was not a target for these works, their costs are likely to be significantly higher than USD 50. * Hypothesised cost if mass-produced in silicon system-on-chip.

Conclusions
The radar velocity and depth sensor designed and verified here was tested and found to successfully measure depth and velocity in both laboratory and field trials. The depth response was found to be highly linear, with the linear regression having a gradient differing only by at most 6% from unity and offsets of less than 7 mm in both lab and field tests. The average error in the surface velocity measurement was found to be less than 30% in lab conditions and 36% in real-world conditions from the mean velocity. The velocity uncertainty is greatest in slow-moving water of velocities of less than 300 mm/s. However, this limitation does not significantly inhibit stormwater, wastewater, and river monitoring applications as velocities of interest tend to be well above 300 mm/s. While the velocity error is larger than those of the best available sensors, the sensor proposed here has the advantage of being the first to compete with such sensors at a low cost (USD <50). Its low power consumption and out-of-water installation reduce maintenance frequency and cost. This supports low-cost long-term deployment, enabling wide arrays of these sensors to be installed to collect data over a large area with high spatial resolution. These deployment schemes have been previously prohibited by cost. The design of the sensor is made freely available and utilises off-the-shelf components. The use of 3D printing technology for the casing allowed a novel sensitivity-enhancing radar lens to be included at minimal cost. The sensor is also interfaceable with a wide array of dataloggers, and has an onboard accelerometer for automatic inclination detection.
Supplementary Materials: The following supporting information can be downloaded at: https://www. mdpi.com/article/10.3390/s23146314/s1. Please find the complete design files necessary to modify and build the sensors, along with the data used in the analysis of this study, in the supplementary materials.