Water quality assessment using a portable UV optical absorbance nitrate sensor with a scintillator and smartphone camera

Nitrate contamination of water sources is a global environmental concern. A major source of pollution is agricultural runoff, which can contain decomposed organic matter, fertilizer, and animal or human waste. Nitrate adversely affects the stability of water systems such as dams and rivers and thus also public health. Regulation is essential but difficult to implement, given that measuring nitrates is laborious, and normally done using chemical assays in laboratories. We present a novel portable nitrate sensor that uses a smartphone camera fitted with low-cost optics. The sensor uses ultraviolet absorbance analysis to detect nitrates in water samples and quantify the concentration. The sensor’s absorptivity when a bandpass filter was used was 0.0681 L∙mg−1∙cm−1 compared to 0.0934 L∙mg−1∙cm−1 measured with a spectrophotometer in a laboratory. Measurements by the sensor of the concentration of nitrates in two environmental samples differed from those taken by the spectrophotometer by 19% and 7%. The sensor achieved a nitrate concentration measurement resolution of 0.2 mg∙L−1, and a detection range of 0–5 mg∙L−1, with higher concentrations requiring dilution to quantify. Our tests showed that the smartphone-based nitrate sensor is sufficiently accurate to be used as an inexpensive instrument for nitrate analysis in the field.


INTRODUCTION
Human activity can pollute water sources (Peavy et al., 1985). One of the worst pollutants is nitrogen, particularly nitrates. Nitrates can damage water systems and the health of those who use the water. Some sources of nitrogen are decomposed plants and animals, human and animal waste, wastewater and chemical fertilizers. These contaminate water systems through groundwater discharge, surface runoff or direct discharge into streams. As the contaminants come into contact with the water, the nitrogen is oxidized to form nitrates and released into the water.
Although the numbers reported are unreliable and definitions vary, many people living in Africa do not have access to safe water and sanitation and their survival is often dependent on agriculture, which has a sensitive relationship with water (WHO, 2018;Easterly, 2009). According to the WHO (2018), the practice of extensive agriculture can increase the levels of nitrates in nearby water sources to more than 200 mg•L −1 . Most health organizations recommend a level of no more than 25 mg•L −1 -at higher levels complications can occur. People who are obliged to use such water are at risk from the dangers of nitrate pollution.
High concentrations of nitrates cause eutrophication, which can eventually lead to anoxia, threatening higher aquatic lifeforms and creating a favourable environment for disease-causing bacteria. Consumption of water with a high concentration of nitrates may lead to methemoglobinemia (a condition where the blood cannot carry enough oxygen), mucous membrane irritation and even gastric cancer (Peavy et al., 1985;Sohail and Adeloju, 2016;Temkin et al., 2019).
Chromatography, electrochemistry and spectroscopy are the most commonly used methods to detect nitrates (Sohail and Adeloju, 2016;Wang et al., 2017). Chromatography is extremely sensitive, with a low susceptibility to interference from non-analyte ions (i.e., those not of interest in the analysis) or organic materials in samples, but it requires several steps and specialized components, making it more complicated and more expensive than the other two methods. Electrochemistry has great potential, but its sensitivity and accuracy can be influenced by interfering ions and organics, which probably makes it the least suitable for assessing nitrates in most water sources, given their complex composition. Spectroscopy can also suffer from interference, but it is less complicated to use than the other two methods, and has the added advantage of obtaining fast results (Sohail and Adeloju, 2016;Wang et al., 2017).
The convenience and portability of smartphones has led to a surge in smartphone-based devices for analysing various substances (Vashist et al., 2014;Cloete et al., 2016;Srivastava et al., 2018). Levin et al. (2016) developed a smartphone-based fluoride sensor for colourimetric water analysis that compares favourably with established methods. The device uses a smartphone camera to capture colour in the visible spectrum and an algorithm to record and analyse the colour of the sample solutions. The authors reported that the device was compact, low-cost, field-portable, and had a detection range of 0-2 mg•L −1 . Hussain et al. (2017) developed a similar inexpensive and portable smartphone-based fluoride sensor, also using colourimetry for testing drinking water. However, instead of using the smartphone camera as the sensor, they used the smartphone's ambient light sensor as a light detector and created a smartphone application that can determine the concentration of the fluoride samples and send the collected data to a central water quality monitoring establishment, from any remote area. The device's performance was adequate and similar to that of commercial counterparts, having a resolution of 1.23 × 10 −4 mg•L −1 . Colourimetric methods for nitrate analysis are, however, hampered by the need for reagents to produce the chemical reaction that will result in a visible colour.
For mobile health applications, Ding et al. (2018) developed a highly accurate smartphone spectrophotometer that analysed absorption of light in the visible part of the electromagnetic spectrum for the detection of creatinine, an excess of which can indicate kidney problems. They improved the accuracy of the smartphone camera's CMOS sensor (the semiconductor that converts light to electronic signals, similar to the human retina) for spectroscopy by creating a spectral intensity correction algorithm. They found that without the intensity correction the device's performance was inferior to that of a commercial spectrophotometer, but with the intensity correction its performance was similar. Their device was able to measure sulphur dioxide at concentration levels similar to those detected by costly counterparts, and they reported that the spectral detection resolution was 1nm.
Most relevant to the topic of this paper, Wang et al. (2015) developed a low-cost portable smartphone electrochemical nitrate sensor using cyclic voltammetry. They created an application for reporting the geospatial locations of the collected samples. Their device performed well using standard samples, but in certain environmental samples reported much lower concentrations than established methods.
The studies cited above demonstrate the effective use of smartphone-based technologies for measurements in the field in a variety of applications. However, the use of smartphones to perform spectroscopy in the wavelength range lower than 300 nm has to our knowledge not been reported. The device we describe in this paper can be used for UV analysis at wavelengths as low as 205 nm, without the need for an additional and/or modified external camera.
Our contribution to the growing list is a portable device that measures nitrate concentrations in water. The design of our smartphone-based nitrate sensor is based on a standard laboratory spectrophotometer, but with fewer components, and the advantage of being portable and less expensive. Since nitrates absorb light at 205 nm; we used UV absorbance analysis. We explored the use of a smartphone camera as the detecting mechanism for the analysis of nitrate in water samples. However, since smartphone cameras are unable to detect UV light at this wavelength, we used a scintillator to convert UV light into visible green light. In tests our smartphonebased nitrate sensor worked with an accuracy fairly similar to that of a typical spectrophotometer.

METHOD
The inspiration for our design was the common spectrophotometer whose design we adapted to be simpler and more compact than the typical laboratory spectrophotometer, and less expensive. The components are shown in Figure 1, which illustrates both the physical prototype, the functional diagram, and an example of the resulting captured image. Our design uses a smartphone camera to detect the amount of UV light transmitted through the water samples. We used an iPhone Xs Max (Apple Inc) with a 12 MP camera, with the aperture sized fixed at f/1.8.
Nitrates absorb light mostly in a subsection of the UV-C range, between 195 and 210 nm, and has a peak absorbance at wavelength λ max = 205 nm (Drolc and Vrtovosek, 2010;Karlsson et al., , 1995). The absorbance of light passing through a sample is defined by: where I 0 is the intensity of the light transmitted through a reference sample, and I is the intensity of the light transmitted through an analyte sample (i.e. a sample containing the substance to be measured) (Higson, 2004;Skoog et al., 2018). The Beer-Lambert Law states that the amount of light a sample absorbs is proportional to the concentration of the analyte sample (Higson, 2004;Skoog et al., 2018). The relationship between the absorbance and the concentration in a sample is given by: where ε is the molar absorptivity, C is the concentration of the analyte, and l is the path length.
Spectrophotometers are generally designed to analyse a wide range of chemicals, which means they must be able to measure the absorbance of light across a broad spectrum. However, a fitfor-purpose spectrophotometer can be designed for a specific wavelength.
For nitrates, the wavelength of interest is 205 nm. A basic spectrophotometer requires at least a light source, sample holder, and detector. Deuterium lamps are almost exclusively used to provide light in the UV spectrum (approximately 195 to 400 nm) (Skoog et al., 2018). Additional optics, such as a monochromator (an optical device that transmits a mechanically selectable narrow band of wavelengths of light), may be necessary if the desired accuracy is not achieved. Adjustable monochromators are used to ensure that light passing through the analyte sample radiates at a narrow band of wavelengths. Alternatively, a narrowband bandpass filter with a centre wavelength at λ max of the analyte may be used (Skoog et al., 2018). The main shortcoming of such a filter is that it can test only for a fixed wavelength, whereas the monochromator can be adjusted to test in a narrow band for a range of wavelengths.
A cuvette is used as a sample holder in spectroscopy, made of either quartz, plastic or glass, depending on which part of the spectrum is being tested for. For our device the most suitable was quartz, since it is the only material with negligible absorbance at 205 nm (Skoog et al., 2018). We used a cuvette with an optical pathlength of 1 cm.
The sensitivity and accuracy of spectroscopic measurements are influenced by the analyte concentration and the presence of interfering ions or organic matter in the sample. The Beer-Lambert Law is limited to low concentrations; in highly concentrated samples, the absorbance properties of the molecules and the ability of light to travel through the sample are altered, thereby affecting the linear relationship described in Eq. 2 (Skoog et al., 2018; Simulab). Interfering ions or organic matter may lead to light dispersion or absorption at the wavelength of interest, thereby decreasing measurement accuracy (Skoog et al., 2018;Wenzel and Dana, 2020).
Since smartphone cameras do not detect UV light at wavelengths as low as 205 nm, we used a scintillator to convert the light transmitted through the analyte into the visible spectrum. We used a Lumilass-G9 (green fluorescent glass) (Sumita Optical Glass Inc, Japan), a scintillator that fluoresces a green light with an intensity proportional to that of UV light at 200 to 400 nm.
We evaluated a number of light sources and found that the only commercially available compact source that emits light at the relevant wavelength was the Compact FiberLight D 2 (Heraeus, Germany), weighing 104 g, with a maximum power consumption of 7 W from a 12 V supply, and comprising two independently switchable deuterium and tungsten lamps (Heraeus Holding). The deuterium lamp is suited to UV analysis between 185 and 400 nm, thus including the band of interest. It would have been preferable to use an LED source, for size, power and cost considerations. However, we were unable to find any commercially available ones that worked at the required wavelengths.
Since optical components added to the size, complexity and cost of our device, we evaluated the effect of replacing or omitting them. Since the object was to detect only nitrates, we considered the monochromator unnecessary and replaced it with a narrow-band bandpass filter, which is more compact, easier to use, and cheaper. The narrow-band bandpass filter (Edmund Optics) was placed in between the sample holder and the light source, as shown in Figure 1. With a centre wavelength of 200 nm and a bandwidth of 10 nm, it was well suited for the peak wavelength of nitrates, 205 nm. We assessed the performance of our device with and without the bandpass filter, and compared the results with those from an AE-S60 laboratory spectrophotometer (A & E Lab Instruments).
The optically transparent sides of the cuvettes and the scintillator were placed in line with the light beam, as shown in Figure 1. The smartphone camera was positioned at a 90° angle to the scintillator, to minimize the unintended detection of scattered leaking light from the deuterium lamp. This is a configuration commonly used in fluorescence spectroscopy to eliminate interference from the light source (Yu et al., 2014;Zhao and Sakurai, 2017).
An image of the green light fluoresced by the scintillator was captured by the smartphone for each reference sample and nitrate sample. We quantified the intensity of the transmitted light by determining the aggregated intensity of the pixels of each green image. We could then calculate the absorbance by using Eq. 1. To measure and compare the UV light absorbances of the spectrophotometer and our smartphone-based nitrate sensor, we prepared triplicate nitrate samples by dissolving sodium nitrate in distilled water, with concentrations ranging from 1-10 mg•L −1 . The measured absorbances were used to generate a nitrate concentration calibration curve, as described by Eq. 2. Using this equation, the sensor could determine the concentration of unspecified nitrate samples.
We evaluated the two versions of the smartphone-based nitrate sensor (with and without the bandpass filter) individually, against each other and against the AE-S60 spectrophotometer. The individual evaluations consisted of measuring the absorbance of three sets of known samples. The means of these three sets and standard errors are reported in the results. We determined and assessed the relationship between the absorbance and the concentration using the Beer-Lambert Law. We then compared the relationship found by both versions of our sensor with each other and with that found by the spectrophotometer. Finally, we compared the result from the version of our sensor that gave the better performance with the result from the spectrophotometer, using samples from a wastewater treatment plant. Figure 2 shows the absorbance levels measured with the AE-S60 spectrophotometer and with the smartphone-based sensor using concentrations of 1-10 mg•L −1 . As mentioned, we evaluated our smartphone-based sensor with and without the bandpass filter. Each concentration level was tested in triplicate with different samples, with the cuvette removed and replaced between tests to evaluate repeatability. The absorbance increased linearly with concentrations up to 5 mg•L −1 . Above this point, the increase was non-linear, indicating that the Beer-Lambert Law fails above 5 mg•L −1 . We therefore used only the results from the first five concentrations in a linear regression. The spectrophotometer achieved a molar absorptivity (a measure of how strongly the nitrate attenuates light at a particular wavelength) of 0.0934 L•mg −1 •cm −1 . The smartphone-based sensor achieved a molar absorptivity of 0.0136 L•mg −1 •cm −1 without the bandpass filter, and 0.0681 L•mg −1 •cm −1 with the bandpass filter. Although both versions measured absorbances proportional to the actual concentrations, the sensitivity was greater with the bandpass filter than without.

RESULTS
The results with the bandpass filter were also better aligned with the results obtained from the spectrophotometer. The molar absorptivity determined with the filter differed from that of the spectrophotometer by only 27%, compared to 85% without the filter. Without the filter, the light passing through the sample had a wide bandwidth of 185-400 nm; with the filter it was only 195-205 nm. As noted earlier, nitrates absorb light mostly between approximately 195 nm and 210 nm, with peak absorption at 205 nm. Outside of this band little to no light is absorbed. If a wide interval of wavelengths between 185 and 400 nm passes through a sample containing nitrates, the fraction of light that is absorbed will be small. The transmitted light (primarily consisting of light with wavelengths longer than 210 nm) would still cause excitation and fluorescence in the scintillator, effectively decreasing the sensitivity of the instrument. The bandpass filter blocks approximately 95% of the light from the source, resulting in a larger fraction of the light being absorbed by a nitrate analyte. The inclusion of the bandpass filter thus decreases the noise induced by the use of a polychromatic light source, which leads to improved measurement sensitivity.
Our results demonstrated, firstly, that that the use of a scintillator enables the detection of UV range absorption using a smartphone and, secondly, that a narrow-band bandpass filter increases the sensitivity and performance of our smartphone-based nitrate sensor. Our final design therefore included the bandpass filter.
To demonstrate that our smartphone-based nitrate sensor also works with a real-world sample, we benchmarked it against the spectrophotometer using treated effluent from a wastewater treatment plant, which has stringent regulations for nitrate levels.
The concentration of nitrates in effluent water depends on many factors, including season, region, and plant operations, so the concentration can vary from less than 1 mg•L −1 to over 30 mg•L −1 (Agoro et al., 2018). This gave us an environmental sample of which we did not know the concentration. Two separate samples were taken and each diluted to provide multiple sampling points, at ratios of 1:5 and 1:10. We analysed the four diluted samples and then calculated the original concentration in the two undiluted samples. We measured the concentration of each diluted sample using the spectrophotometer and the smartphone-based nitrate sensor and then calculated the average concentration of the original two samples. The results are shown in Figure 3.
The difference between the concentration of the effluent samples measured with the spectrophotometer and the smartphone-based nitrate sensor was 19% for the first and 7% for the second. At the wastewater treatment plant where the effluent water was collected, samples are taken weekly as part of operational reporting. Figure 3 also shows the concentrations reported by the wastewater treatment plant 2 days before and 5 days after our sample was taken.
Overall, the nitrate concentrations reported by the smartphonebased nitrate sensor were lower than those reported by the spectrophotometer, but within the values reported by the wastewater treatment plant. It is interesting to note that the smartphone-based sensor's readings were closer than the AE-S60 spectrophotometer's to the readings from the treatment plant.

CONCLUSION
The overall performance of our smartphone-based nitrate sensor suggested that it could be used to measure the concentration of nitrates in water. It was designed to be usable and portable beyond the confines of a laboratory. Although colourimetry can be used inexpensively for nitrate analysis, spectroscopy is more convenient as it does not require prerequisite steps to be performed on the sample. This was therefore the method we chose for our device.
In contrast to existing methods described in the literature for analysing visible or UV light at 310 nm, our smartphone-based nitrate sensor can perform UV analysis at 205 nm.
Our experiment confirmed that UV spectrum absorbance analysis can be performed through the combined use of a smartphone and a scintillator and, further, that a bandpass filter can be used to replace a monochromator for applications focusing on a specific wavelength, thereby greatly simplifying the optical requirements.
Finally, when we compared the results obtained using a standard laboratory spectrophotometer with those obtained using the smartphone-based sensor for laboratory-prepared nitrate samples with known concentrations, we found that our device's performance was very similar to that of the laboratory instrument. Tests using samples from a wastewater treatment plant produced similar performances. Further research must be carried out to validate the system for in-the-field nitrate concentration measurement on water samples, to investigate the effects of interfering compounds in real water samples. Such a study would require investigating a large number of samples of different origins.
We focused on the detection of nitrates, but our results show that a low-cost fit-for-purpose smartphone-based device can achieve measurement accuracy and sensitivity similar to that of an established laboratory instrument, which comes with greater flexibility, but at much greater cost and the disadvantage of not being portable.