Open-source, low-cost, in-situ turbidity sensor for river network monitoring

<jats:title>Abstract</jats:title><jats:p>Fine sediment transport in rivers is important for catchment nutrient fluxes, global biogeochemical cycles, water quality and pollution in riverine, coastal and marine ecosystems. Monitoring of suspended sediment in rivers with current sensors is challenging and expensive and most monitoring setups are restricted to few single site measurements. To better understand the spatial heterogeneity of fine sediment sources and transport in river networks there is a need for new smart water turbidity sensing that is multi-site, accurate and affordable. In this work, we have created such a sensor, which detects scattered light from an LED source using two detectors in a control volume, and can be placed in a river. We compare several replicates of our sensor to different commercial turbidity probes in a mixing tank experiment using two sediment types over a wide range of typical concentrations observed in rivers. Our results show that we can achieve precise and reproducible turbidity measurements in the 0–4000 NTU or 0–16g/L range. Our sensor can also be used directly as a suspended sediment sensor and bypass an unnecessary calibration to Formazin. The developed turbidity sensor is much cheaper than existing options of comparable quality and is especially intended for distributed sensing across river networks. </jats:p>

section_content: Fine sediment production and transport is an important process at the global scale, affecting riverine, coastal and marine ecosystems [1] [2] [3]. Present-day fine sediment export from the land surface to global oceans by large rivers is estimated at about 15. 5-18. 5 Gt per year 4, 5 and this is about half of the estimated global annual soil erosion from the land surface 6. However, it remains very difficult to estimate suspended sediment yields in rivers because of the high variability in along-stream suspended sediment concentrations (SSC) and inadequate monitoring thereof. 

The primary method to determine SSC is gravimetric analysis of bottle samples taken at river cross-sections in regular or irregular intervals. This method is reliable but has many disadvantages such as being discontinuous (poor temporal resolution), inefficient and costly (high effort for collection/transport/analysis of the samples, long processing times). Sediment budgets for river basins are usually derived from these direct measurements of SSC 7. Continuous SSC data at high temporal resolutions can be obtained by dedicated in-situ sensors which measure turbidity (T), and by calibrating a relation between SSC and T. In river cross-sections where measurements of water discharge (Q) are also made, sediment yield (QS) is then computed as QS=SSC*Q. High resolution estimates of SSC can be used to quantify human effects on sediment production, for example the effects of dam construction and erosion control 8, 9, the natural erosion gradients over entire mountain ranges 10, the role of sampling in global erosion rates 11, and many others. Measurements of SSC at a basin outlet can give us a basin-integrated picture of possible hydroclimatically-driven sources of sediment, like rainfall erosion, snowmelt hillslope erosion, glacier ice melt erosion, even hydropower storage in dams 12. These measurements of SSC are also important for understanding the impact of hydroclimatic forcing on activating sediment sources and transport dynamics, and physically-based modelling thereof [13] [14] [15] [16]. 

High temporal resolution monitoring using in-situ turbidity sensors at, for example, glacier streams is useful for identifying the time-dependent sediment export rates connected to the development and evolution of subglacial channels and the possible contributions of proglacial sediment sources 17, 18. Together with grain size measurements, highly resolved SSC data can be used for the detailed hydraulic modelling of glacially-derived sediment transport by meltwater drainage in subglacial streams 19. Hillslope source connectivity to the fluvial network in proglacial areas is also an important modulator of time-dependent sediment production 13, 20. Such process understanding requires a spatial perspective on sediment pathways of production and storage within the catchment which cannot be achieved by single-site measurements. Additionally, the main deficiency of point river measurements by devoted suspended sediment monitoring sensors is that they are expensive (e. g. state-of-the-art turbidity sensor by Campbell is about C6000, In-Situ is C7000), making widespread deployment at many sites along a river system to quantify spatial variability next to impossible. Nevertheless, this is currently the state-of-the-art measurement in both small and large river systems, providing the most accurate SSC data at a point. 

An alternative to ground point measurements is remote sensing. The spatial distribution of SSC can be obtained using satellite imagery which is based on the reflectance of water surface as it is affected by a range of parameters (chlorophyll, suspended sediment, dissolved organic matter, etc. ). Dissolved and suspended sediment concentrations together with gross biological activity affect the intrinsic colour of natural waters 21, 22, which makes optical satellite remote sensing of oceans, coastal areas, large lakes/rivers possible. When calibrated with ground measurements, such satellite data can be very useful for SSC estimates 23 and can give a range of additional water quality parameters 24 at large scales but not with high temporal resolutions (repeatability given by satellite overpasses) and with poor point accuracy. In rivers, satellite-based analyses are only possible if the spatial footprint is sufficiently large. For example, in the Amazon SSC variations with satellite imagery were shown to follow overbank flow, and could be explained by resuspension of sediments in depression lakes 25 only because the river is very wide. Optical sensing of river turbidity, and other water quality indicators, is also possible with terrestrial photography 26, 27. New developments include optical sensing from unmanned aerial vehicle (UAV) carriers [28] [29] [30] [31]. Optical sensing of turbidity by mobile phone cameras 32 is another application that has broad appeal for some ground applications. However, all ground-based and UAV optical sensing methods are limited by cost, poor temporal resolution, and are strongly affected by many environmental constraints (light, good optical transmission, visibility, etc. ), which make them currently not very suitable for regular long-term monitoring of SSC in rivers. 

We argue that a new type of sediment monitoring is necessary to demonstrate the many physical connections between hydrology, river processes, and sediment fluxes. The connections between sediment source activation and transport on hillslopes, cultivated fields, vegetated surfaces, subglacial channel networks, in streams, large rivers, and deltas, all require sediment monitoring at high spatial (from source to sink) and temporal (activation timescale) resolutions that are not fully guaranteed by any of the standard approaches in economically-effective ways. This new data is needed for developing an understanding of sediment storages and budgets in Alpine basins [33] [34] [35], revealing intricate details of sediment connectivity in such fluvial systems 13, 20, and for calibrating physically-based hydrological-sediment transport models 14, 16, 36, 37. For this reason, we propose here an affordable turbidity sensor that can be used to create a distributed suspended sediment monitoring network.
section_name: Introduction

section_content: Several novel turbidity sensors have been documented in peer-reviewed literature. Gillett 38 investigated the use of low-cost, commercially-available appliance turbidity sensors (such as those found in washing machines and dishwashers). These sensors work on the principle of light attenuation, where the light detector is placed 180 o from the incident light. Gillet 38 found that these analog attenuation sensors could not achieve a sufficiently high resolution to monitor small changes in turbidity. Trevathan 39 recalibrated an appliance sensor (DF Robot SEN0189 Gravity -also attenuation style) and built a waterproof housing for field deployments. However, they did not report on the accuracy of the sensor and were not able to calibrate below 100 Nephelometric Turbidity Units (NTU) (although their test measurements were between 0-20 NTU). Additionally, the data obtained by their sensor was influenced by ambient stray light and they were not able to overcome this problem. 

To improve the accuracy of an attenuation-style sensor in the 0-100 NTU range, Lambrou 40 and Wang 41 equipped these attenuation sensors with a detector at 90 o to the incident beam. This method provides good stability, linearity, sensitivity, low stray light, and increases the NTU measurement range (when incorporating the backscatter detector) 42. The use of several detectors at different angles allows the partial cancellation of errors due to wavelength absorption in samples 43. However, Lambrou's 40 sensor was only tested from 0-100 NTU and did not report on how the 0. 1 NTU resolution was obtained. Additionally, Wang 41 only tested their sensor within the 0-1000 NTU range. Kelley 44 created a low-cost, hand-held turbidity meter meant for investigating drinking water quality in low-income communities around the world. This sensor was calibrated with and tested against a commercial turbidity sensor but only in the 0-1000 NTU range. Additionally, using commercial turbidity sensors to calibrate is not advisable since their measurements have strong differences in reported values among the various sensors 45. Kitchener 46 conducted a sediment settling experiment by constructing a modular PVC ring that could hold light detectors at several angles (0 o, 10 o, 20 o, 90 o, 160 o ) to the illuminating LED. They reported their results in SI units of radiant intensity (mW/sr) instead of using formazin and obtaining units of NTU. Their device did however cost around 340GBP and cannot be deployed for environmental applications. 

In addition to testing the appliance sensors, Gillett 38 created a flow-through sensor meant to be attached to a PVC and continuously monitor turbidity for 64C. However, due to the nature of their design (large PVC diameter), they used a very powerful ambient LED and calibrated their sensor under dark-room conditions. This sensor can be used in a pump-test setup, as they've shown, but is unsuitable for environmental applications where ambient stray light will interfere with the measurement. Jiang 47 created a turbidity sensor for deep-sea applications, reaching depths of over 3400 meters. The sensor was based on a backscatter principle (the detector is positioned at < 45 o relative to the incident LED beam) but is only suitable in the 0-20 FNU range (FNU and NTU are interchangeable units of turbidity). Additionally, the sensor is claimed to cost under $40 however, the bill of materials does not include sensor housing costs and all of the components used.
section_name: State-of-the-art in low-cost turbidity sensing

section_content: In this paper, we propose an open-source and low-cost turbidity sensor that can be used for in-situ river network deployment. Based on the review above and on the work carried out in the Supplementary Methods -First prototype section, we have designed a sensor with the following features. ( 1 ) The sensor has one light source and two detectors at different angles to each other for partial cancellation of errors 43. (2) It takes the difference between two measurements (LED off and on) to reduce ambient light effects. (3) It covers a large suspended sediment range 0-4000 NTU or 0-16 g/L concentration. (4) The sensor is low-cost and open-source so it can be built by users. (5) The sensor can be installed in a river system for in-situ measurements. 

We built three different versions of our open-source sensor, which can be seen in Figure 1. The operating principle of all three versions are the same, the differences lie in the construction of the devices and in the detector angles within the control volume. S1.
section_name: New sensor design

section_name: Results and Discussion

section_content: We tested sensor versions A-B-C against three Endress+Hauser (E&H) sensors (two are model CUS51D and one is CUS52D) in a mixing tank setup with two different sediment types: Feldspar (d 50 = 90µm) and sediment collected from the Fieschertal channel (d 50 = 30µm) 45 ). 

Figure 2 shows the eight open-source sensor results overlayed with the three E&H results for Feldspar (Fig. 2 a-c ) and Fieschertal (Fig. 2 d-f ) sediment in three different ranges. All eight open-source sensors are plotted with version A in yellow gradient, version B in red gradient, and version C in purple gradient. Every point is a mean which was computed using all of the values, at every SSC level, recorded over the length of the experiment (30min per every SSC level in Feldspar and 15min per every SSC level in Fieschertal -see Methods for more details). 

Our open-source sensors provide very similar measurements between the replicates of individual sensor versions for the full 0-16 g/L range, even in the sub 2 g/L range down to 0. 25 g/L (Fig. 2 b-c and e-f ). For example, the three version B sensors (red gradient) show that all measurements are repeatable down to 0. 05 g/L (in Feldspar) and 0. 25 g/L (in Fieschertal). Our version C sensors (purple gradient) follow a similar trend down to 0. 1 g/L (in Feldspar) and 0. 25 g/L (in Fieschertal) but with an offset in the NTU values between the two version C sensors therefore, creating less "repeatable" results (NTU comparison between sensors is more difficult), probably due to the sensors' less precise 3D-printed construction. We consider version A and B sensors to be suitable for future testing and possibly for distributed applications. Alternatively, the version C sensors can be used for the monitoring of trends, but we have lower confidence in the absolute values. 

In contrast, the E&H sensors do not provide similar measurements for all three sensors or even when comparing two sensors of the same model (CUS51D) for the entire measurement range. Both CUS51D sensors do provide similar measurements in both Feldspar and Fieschertal but only above 2g/L (Fig. 2 a and d ), meaning that these two sensors give "repeatable" results (turbidities could be compared at two sites along a river network with these sensors). In general, the CUS51Ds' measurements cannot be compared to the CUS52D's measurements, since their readings differ highly at SSCs above 2 g/L (Fig. 2 a and d ) and the CUS52D inexplicably plateaus after 5g/L. No clear relationship between NTU and SSC can be observed below 2 g/L (Fig. 2 b-c and e-f ) for all three sensors, even if all sensors are from the same manufacturer and have been calibrated from 0-4000 NTU. This is important because many alpine river applications have such low SSCs. Finally, none of the E&H sensors are able to give sensible results for the entire 0-16 g/L range. Further details on the E&H performance are in Supplementary Figure S2.
section_name: Comparison NTU-SSC between open-source sensor and commercial sensors

section_content: An important characteristics of a sensor is its measurement error, i. e. fluctuations in measurements in time for a given sediment concentration. Figure 3 reports the sensor error for each SSC level in both Feldspar and Fieschertal sediments, where the relative measurement error is defined by:

where NTU i is a single NTU measurement and NTU is the mean of all NTU i measurements (at a specific SSC level). All of the values that were recorded over the length of the experiment were used to plot this figure. In practical applications we envision that the sensors will collect raw data at a chosen frequency, and this data will be internally processed by taking the mean over a sampling interval, to be stored in the logger (SD card). Figure 4 again shows the error from the raw data in the Fieschertal experiment (a) together with such processed data (b). The raw data falls within ±10% of the mean whereas the processed data falls within ±5% of the mean. The processed data in this case was obtained by taking the mean over bins of 20 measurements from the raw data, which would be a typical application in field settings with sampling interval 20s (measurement at 1Hz). This way, we can expect most of our data (IQR) to land between ±5% of the mean, showing the importance of averaging as opposed to trusting single measurements. 

Note in Figure 4 that the measurement error is very stable over a large range of SSCs. This consistency is a desired property of the sensors as we expect large fluctuations in SSCs in real river applications. For example, the mean SSC observed across 13 Swiss suspended sediment monitoring stations is 0. 11 g/L, but the maximum is 18 g/L and the minimum is close to zero. The measurement that is exceeded on average 5% of the time is about 0. 4 g/L (see Supplementary Fig. S3 ). This is well within our tested range and gives us confidence that we can capture well both low and high sediment transport conditions.
section_name: Sensor precision and error distribution

section_content: NTU as a unit of measure of turbidity is not intuitive for monitoring SSC, as this unit is not universally comparable between watersheds and sensors; you cannot assume that 1000 NTU in two different rivers (or in the same river but using two different sensors) means that there is the same SSC [g/L] present. This is because turbidity does not only depend on SSC, but also on the Particle Size Distribution (PSD), shape, and particle material properties such as colour (reflectivity), density, refractive index, and surface roughness [48] [49] [50]. This holds in general and also affects our sensors, however our version A and B sensors overcome this issue of repeatability at least within the same sediment type (Fig. 2 ). 

Observing our open-source sensor performance in Feldspar (Figure 2 a-c), we see that the relationship between NTU and SSC is linear in the sub 2 g/L range and becomes non-linear with increasing SSC. This is in line with what was observed by Holliday 51 and several others 52, 53. Kelley 44 tried to use a linear model to calibrate NTU and SSC but had to split their model into several ranges of NTU. Holliday 51 found through experiments that the relationship between turbidity and SSC follows:

where a and b are regression-estimated coefficients and b is approximately equal to one for all particles. But in general, for every watershed and sediment type, it is likely that both a and b will be different. For example, Costa 12 found a = 0. 56 and b = 1. 25 in their investigated alpine catchment whereas Felix 54 found a = 0. 59 and b = 1 in their HPP storage tunnel. In our case, at larger SSCs the relationship diverges from linearity (Fig. 2 ). Therefore, when working with these sensors, its important to realize that a doubling in SSC can mean a doubling in NTU at lower NTUs and a quadrupling at higher NTUs (for example, 1 to 2 g/L can give 100 to 200 NTU but 10 to 20 g/L can give 1000 to 4000 NTU). 

It is known that the NTU-SSC relationship will depend on sediment type. According to Sadar 42 and Tran 55, particles with sizes much smaller than the wavelength of the incident light will scatter light with roughly equal intensity in all directions. Particles larger than the wavelength of the incident light will create a spectral pattern that results in greater light scattering in the forward direction than in the other directions. Therefore, the reported differences in NTUs in Feldpar and Fieschertal sediment (Figure 2 ) are likely due to the shape and size of the two sediment types. This shows the importance of calibrating the sensors with sediment samples collected at the river where the sensors would be installed. 

Our eight open-source sensors were in a first step calibrated using several dilutions of 4000 NTU Formazin and deionized water: 0, 3, 6, 10, 40, 70, 100, 400, 700, 1000, 2000, and 4000 NTU, as is commonly done in turbidity sensors. However, the sensors calibrated in this way (see Supplementary Methods -First Prototype section), failed to produce data measured in Feldspar and Fieschertal sediment. This is because Formazin scatters light evenly in all directions, which is not true in natural sediment where the directionality of scattered light is highly sensitive to particle grain size. This is demonstrated in Fig. 5, where a peak in light detected by the 135 o detector in Feldspar powder (Fig. 5a ) can be observed, whereas in Fieschertal powder (Fig. 5b ) there is no peak and the amount of light detected plateaus around 5 g/L. The 45 o detector (Fig. 5c-d ) shows a linear increase in the amount of light received in both sediments but the quantity of light received by the detector in Feldspar (Fig. 5c ) is much higher than in Fieschertal sediment (Fig. 5d ). Similar results were found previously 53. For this reason, in a second step we developed the Formazin calibration model for the mixing tank experiments (for the results shown in Fig. 2 3 4 ) using only the 90 o (versions A and C) and 45 o detectors (version B) in four distinct NTU ranges (0-10, 10-100, 100-1000, 1000-4000 NTU). The model using only one detector in each sensor (used in Fig. 2 3 4 ) is of the form:

where α is the y-intercept, β is the first order coefficient associated with the measured light intensity d from the 45 o or 90 o detector (90 o in versions A and C, 45 o in version B) and γ is the second order coefficient from the same detector. The resulting models for Sensor 6 for the four different NTU ranges (0-10, 10-100, 100-1000, and 1000-4000 NTU) are shown in the Supplementary Fig. S4 and their coefficients are in Supplementary Table S5. Finally, we challenge the need to calibrate the sensors to NTU in order to predict SSC from a separate NTU-SSC relation, which compounds estimation errors. Our sensors are meant for use in a range of different rivers with various grain sizes and shapes (therefore, constantly changing the direction of scattered light). We envision that one can directly calibrate SSC observations to the reflected light intensity observed by the combined detectors. This can be done in laboratory calibration experiments or in on-site river applications by measuring suspended sediment concentration in a few samples that cover a range of SSCs. 

In this approach we calibrated the light intensity measured by the detectors for each open-source sensor directly to SSC, separately for the Feldspar (Figure 6 a-c ) and Fieschertal (Fig. 6 d-f ) sediment. The model used is of the form:

where α is the y-intercept, Figure 6 shows SSC mean predictions against observations for all versions of the sensor. The fit is excellent across the entire range of SSC with R 2 > 0. 98, with the main benefit due to the multiple linear regression using both detectors. Analysing the versions separately, all sensors are now able to predict well in the entire SSC range down to 0. 4 g/L in Feldspar (Fig. 6c, with version A performing well down to 0 g/L) and down to 0. 25 g/L in Fieschertal (Fig. 6e, with versions A and B performing well down 0. 12 g/L and 0. 17 g/L, respectively). Here the 3D printed sensors (version C) do not perform as well. An improvement in the 0-0. 5g/L range can probably be done by splitting the model and having two separate linear calibrations. It is important to note that avoiding the Formazin calibration step has additional benefits. By calibrating from the detector output directly to SSC, we are able to save up to a week's worth of lab work and we are able to avoid exposure to Formazin, a known carcinogen. Collecting gavimetric samples and calibrating directly to SSC might seem like a lot of work, but this needs to anyways be done when installing turbidity sensors in a river network to collect SSC data. Additional problems with Formazin calibration can be found in Supplementary Discussion -Problems with calibrating NTU with Formazin. A conceptual example of how direct calibration of the open-source sensor to SSC would work in a real case and how this calibration gives a more representative SSC reading is shown in Figure 7. From Monday to Saturday there are isolated rainfall events which occur only in certain subcatchments, as depicted in Fig. 7. Each subcatchment has a different grain size distribution and different grain properties, which in turn scatter light differently (creating different scatter spectra). A sensor is located near the outlet of a catchment. The sensor works by measuring the quantity of scattered light (at a specific angle) and it is consistently measuring this value only. A rainfall event on Monday in a subcatchment with very fine particles gives rise to an SSC of 10g/L at the sensor location (gravimetrically determined SSC from a bottle sample). However, these fine particles do not scatter light strongly in the direction of the sensor detector. This causes the calibration points to sit above our calibration curve (low light detected -similar to Feldpsar). Whereas, a rainfall event on Saturday in a subcatchment with very coarse particles, giving rise to an SSC of 15g/L, scatters light strongly in the direction of the sensor detector (even more than is expected at this SSC). This causes the calibration points to sit below our calibration curve (higher amount of light detectedsimilar to Fieschertal). 

The combination of response curves (Fig. 5 ) from multiple detectors can produce good reflectance curves for a range of sediment types (sources) and concentrations (Fig. 6 ). The mixing of these response curves over many events will not only lead to a robust calibration curve for the entire catchment, but also for individual subcatchments and reaches where distributed measurements can be made. In this way, sediment sources with possibly different sediment properties may be identified. In this example, every subcatchment experiences an isolated rainfall event on a different day. The sensor detectors at the downstream end of the river have a different light intensity response depending on the sediment type. After sampling many different events, a single calibration curve representative of the different subcatchment sediment sources and their activation frequencies can be obtained.
section_name: Calibration of new sensor to SSC

section_content: In the future, we would like to incorporate a temperature and pressure sensor into our sensors to also monitor the stage and temperature of the river. We are also considering incorporating a wiper to prevent fouling on the optical lenses. The Hz-SSC calibration curve, along with the number of sediment-water samples necessary to create this curve, should also be investigated further. It is clear that over a longer timescale that catchment properties will change, causing a change in the Hz-SSC calibration curve. Therefore, our sensors are not intended to replace long-term river monitoring, but rather provide short-term identification related to changes in water quality, and finding sediment sources and their activation. 

Our hope is that the affordable, open-source SSC sensor brings accessibility to global river research. With a fully transparent design, students, researchers, and organizations are able to build, install, use, and repair the instruments themselves, ultimately eliminating waste and making the data from our world's rivers, lakes, and oceans available to all.
section_name: Outlook

section_content: The basic design of our turbidity sensor was created with an infrared (IR) LED and two light detectors at different angles relative to the LED. The design principle can be seen in Figure 8. An LED at 850nm was selected (TSHG6200 by Vishay Semiconductor Opto Division) because water as a medium does not reflect this wavelength. The detectors chosen are the TSL237S-LF by AMS and they were chosen for two reasons: 1) they convert light to a digital output frequency and so variations in voltage or current driven by temperature fluctuations in the field environment, that affect an analog detector, are eliminated; 2) this sensor responds to light in the 320nm to 1050nm range and has a peak responsivity at 700nm. An ESP32 was chosen as the microcontroller for this sensor instead of an Arduino Uno (a common microcontroller chosen for hobbyists) because of its superior number of timers. Since the detectors output a digital pulse with varying frequency proportional to the light intensity, the chosen microcontroller should have at least two timers to compute frequency, one to count pulses and one to count the elapsed time, for each detector. Therefore, the Arduino can only be used to convert the digital output of one detector and the S7. The total cost of one sensor is 61. 37 CHF (Swiss Francs). It is worth noting that the cost of our sensor doesn't include calibration labor costs and we are not sure if the E&H sensors must undergo additional calibration and/or servicing prior to every use. Machined PVC is more expensive and harder to produce than simply 3D printing the sensing head. Therefore, before deciding to 3D print or purchase and machine PVC, the purpose of the sensor should be evaluated. If replicates of the sensor need to be made in order to create a distributed network of sensors within a watershed, then perhaps purchasing and machining PVC is worth the extra in order to have comparative results along the watershed. However, if only one sensor needs to be created and installed at the outlet of a water system in order to obtain a basin-integrated picture of the suspended sediments, then a 3D printed sensor is probably enough for this purpose and the extra time and cost would not contribute much to the final output. The 3D printed version can also be used to monitor trends in a distributed network instead of absolute values. Additionally, if the sensor is used for a school project then a 3D-printed sensor should suffice.
section_name: Methods

section_content: Figure 10a shows the mixing tank setup with a 200L cylindrical tank and a line marking 140L of water when the tank is full with all 11 tested sensors. In the background, the green pump used to empty the tanks can be seen. Figure 10b shows the placement of the sensors around the tank along with the water level. In the center of the tank is the mixer, which is a drill with a paint mixing attachment. The mixer was used to suspend the sediment in the tank.
section_name: Mixing tank setup

section_content: There were two different sediment types used in these experiments: Feldspar and sediment taken from the Fieschertal canal, both of which were used previously by Felix 45. 

Feldspar powder (Na-plagioclase) was chosen because of it's abundance in the earth's crust. It was purchased from a manufacturer that sells Feldspar milled for pottery (Feldspat NA LF 90). The Fieschertal sediments were collected from the deposits in the tailwater channels at the Fieschetal hydropower plant (HPP) in the Canton of Valais, Switzerland. This sediment was chosen because we are planning on using our open-source sensors to investigate sediment sources on the Rhone river such as the Fiescher glacier. The Fiescher HPP is located at the mouth of the Fiescher glacier, on the mountain stream Wysswasser which is a tributary of the upper Rhone. However, it should be noted that the finer sediments don't settle in the tailwater channel, therefore the Fiescher sediments are coarser than would be expected. 

The particle size distribution (PSD) and the solid densities, ρ s, of both powders were measured previously by Felix 45. The PSD was measured from suspended samples with adequate dilution using a stationary laser diffractometer (LA-950 manufactured by Horiba). It was found that the Fieschertal sediments contained almost 80% by mass of fine sand (d 50 = 90µm) whereas the Feldspar was mainly in the range of silt (d 50 = 30µm) 45. The solid densities were measured using a helium expansion pycnometer and are 2. 65g/cm 3 and 2. 70 g/cm 3 for the Feldspar and Fieschertal sediment, respectively 45.
section_name: Sediment type

section_content: The experimental procedure was as follows. First, all of the sensors would be turned on and the clean tank would be filled with tap water. The E&H sensors take a measurement every second for the duration of the experiments. For the first experiment with the Feldspar, the open-source sensors were taking 3 measurements for 3 seconds every minute and sleeping between readings. For the next experiment with the Fieschertal sediment, the open-source sensors were taking a measurement every second (as the E&H sensors) without sleeping between readings. 

With clear water in the tank, the mixing drill and measurements were started. Every 30 min afterwards, the water temperature of the tank was taken along with a water sample of around 300mL. Afterwards, a pre-defined amount of Feldspar sediment mixed with 300mL of tap water was added to the tank in order to increase its SSC in a step-wise manner. This experiment was repeated again for the Fieschertal sediment except since the open-sourced sensors were continuously measuring like the E&H devices, we were able to increase the SSC of the tank every 15 min instead of every 30 min. Every time we increased the SSC of the tank, we also wiped all of the bubbles off of the 11 sensors. 

Afterwards, the water-sediment samples were taken to the lab and evaporated in a ventilated oven and the SSC was computed by weighing the dry sediment. Some tap water samples without sediment were also evaporated so we could determine the dissolved mineral concentration and subtract this from our calculated SSC. Error is defined by (NTU i -NTU)/NTU and both plots represent the error at each SSC level for all eight sensors. The raw sensor data (a) falls within ±10% (grey box) of the mean. The processed data (b) falls within ±5% of the mean. To obtain the processed data, the mean was taken over bins of 20 measurements (of the raw data). The boxes represent the interquartile range (IQR), the black line within the boxplot is the median, the bars extend to ±1. 5*IQR, and the grey points are outliers. In this example, every subcatchment experiences an isolated rainfall event on a different day. The sensor detectors at the downstream end of the river have a different light intensity response depending on the sediment type. After sampling many different events, a single calibration curve representative of the different subcatchment sediment sources and their activation frequencies can be obtained.
section_name: Experimental procedure

section_name: Acknowledgements

section_content: We thank the Laboratory of Hydraulics, Hydrology and Glaciology (VAW, Prof. Dr. R. Boes ) for providing laboratory facilities, the commercially available turbidimeters and the sediment particles for the tests. We thank Ruben Stadler, Michael Arnold, and Dr. David Felix ( VAW ) for providing guidance and assistance. This research was funded by the ETH Research Grant ETH-13 19-1.
section_name: Acknowledgements

section_name: Data Availability

section_content: The datasets generated during and/or analysed during the current study are available in the Zenodo repository, https: //doi. org/10. 5281/zenodo. 5789513.
section_name: Data Availability

section_name: Second prototype construction

section_content: ESP32 is needed because it has the required four timers to resolve the digital signal of two detectors. With the above design in mind, we built several versions of our first turbidity sensor prototype and tested it with Formazin, a popular turbidity sensor calibration liquid. Details about focusing lenses, ambient stray light elimination, detector placement, and calibration model can be found in the Supplementary Methods -First prototype section. 

In order to test the turbidity sensors in a real-world setting, we designed a mixing tank experiment where our sensors can be compared to commercially-available sensors. In order to submerge our sensors into a mixing tank and take many measurements over several hours, a second prototype of the turbidity sensor was created.

section_content: From the Supplementary Methods -First Prototype, it was found that focusing lenses were necessary for the design of the sensor, whereas long-pass filters (eliminating stray ambient light) were unnecessary since the same effect is achieved using the off-on differencing measurement method 56. Additionally, for our chosen LED and detector parts, it is important to avoid the 180 o detector placement since the detector becomes saturated by the incoming light (see Supplementary Methods -First Prototype for more details). 

With this in mind, the second prototype was based off of Sensors 3 and 4 found in Supplementary Methods -First Prototype section because we wanted to test the detector orientations further. It has three different versions (A, B, and C) and 2-3 replicates of each version (to see the variation from construction) and all of the sensors and replicates are summarized in Supplementary Table S1. Version A has detectors at 90 o and 135 o relative to the LED and version B has detectors at 45 o and 135 o. Unlike the first prototypes created in the Supplementary Methods -First Prototype section that had a 3D-printed sensing head, these first six sensors have sensor heads that were made by machining a solid piece of black PVC. However, with the hope to keep this project accessible to everyone, we also created two additional replicates (version C) but with a 3D-printed sensing head from PLA. All eight sensors details are listed in Supplementary Table S1. 

All eight sensors were housed in a simple waterproof housing made of standard PVC from the hardware store. The waterproof housing can be seen in Fig. 9a. Figure 9b shows the internal sensing head (black PVC) and the electronics of the sensor. We also see two O-rings on the left-hand side of both images. These, along with some vacuum grease, were used to keep the sensor waterproof. All of the electronics of the sensor were housed on a prototyping soldering board. The electronic schematic is found in Supplementary Fig. S6 and the CAD for the PVC sensing head is available on this project's repository 57.
section_name: Second prototype construction

section_content: We tested three commercial turbidity sensors against our open-source sensors. These sensors were two CUS51Ds and one CUS52D, all from Endress+Hauser (E&H). The CUS51Ds are rated for a measurement range of 0 to 4000 FNU and are used for turbidity and suspended solids measurement at all stages of the wastewater treatment process and at primary water treatment applications with medium to high turbidity 58. The CUS52D is also rated for a measurement range of 0 to 4000 FNU, but unlike the CUS51D, the CUS52D can be used at every stage of the water treatment process, even at the lowest turbidity 59. The E&H sensors additionally needed to be hooked up to a data acquisition system (Liquiline CM442), which enabled the sensors to continuously measure while connected to a power source.
section_name: Commercial sensors

section_content: J. D designed and built the sensors, conceived and conducted the experiments. P. M provided guidance and supervision of the project. All authors contributed to the discussion of the results and review of the manuscript.
section_name: Author contributions statement

section_content: Competing interests: The author(s) declare no competing interests.
section_name: Additional information

section_content: This is a list of supplementary les associated with this preprint. Click to download.
section_name: Supplementary Files

section_name: Scienti cReportsSupplementarymaterials.pdf