Aguilar, Ross; Graves, Spencer; Corcovilos, Theodore A.Department of Physics, Duquesne University; Pittsburgh Quantum Institute (pqi.org)
INTRODUCTION
We thank Duquesne University for financial and material support, particularlythe Bayer School of Natural and Environmental Science, the Office of the Provost, andthe Undergraduate Research Program. We also thank Dr. David Kahler for being apartner in the research conducted. Ross Aguilar was funded by the DuquesneDepartment of Physics.
ACKNOWLEDGEMENTS
CONTACT INFORMATION
Ted Corcovilos, Department of Physics, Duquesne University, 600 Forbes Ave. 317 Fisher Hall,Pittsburgh, PA 15282. Email: [email protected] Ph: (412) 396-5973
RESULTS
CONCLUSION
Our work sought to determine a method via software development to compute the
concentration of a given contaminant in water based on the optical intensity of the color
of a sample of water. This methodology can be applied to the Chemistry and
Environmental Science fields to simplify their work to analyze water in macro and
microecosystems. Red food dye was used to mimic a color-change test on
contaminated water and varying concentrations of dye were analyzed. The samples
were photographed with a mobile device through a RAW photo application to preserve
all color data. Software was developed in Python to determine the color of the water
based on an RGB scale and the data was fit along a variation of Beer’s Law. Blind tests
of unknown samples were then used to verify our method and the model we used. This
method will allow for the future development of a mobile application to simplify this
testing procedure and make it accessible to the general public.
BACKGROUND
Water is one of the most invaluable resources on the planet. Many of us in
developed countries take clean water for granted while many people and communities
around the world struggle with the purity of their water. Water contaminants and
impurities are commonplace but detection methods often are not. One goal that we
have in this work is to be able to provide a simple, inexpensive, and accessible way for
people and communities to conduct their own water testing. The most common use for
water testing is for the determination of the safety of drinking water. Clean drinking
water is pivotal to the sustainability of a community. However, the price point for a
thorough drinking water test kit renders this utility unattainable. (Fig 1a.) Our method
allows water to be tested for many different contaminants because it utilizes the
chromatic properties of a color-change water test. This project was conducted as one
part of a twofold project that searched for the best method of determining concentration
from a color-change test. The other project, conducted by Spencer Graves, is using a
homemade Arduino device that measures six color values.
Methods
For the red trials (Figure 2(a)) the cuvette was placed 10 cm away from the
camera and 10 cm away from the screen, and the green trials (Figure 2(b)), the cuvette
was placed 19 cm away from the camera and 15 cm away from the screen. As shown in
the Figures below, the background was a computer monitor displaying a plain white
screen and set to maximum brightness. The monitor served as the white background as
well as the light source for the test, as ambient light from the lab would add noise. The
green cuvettes were placed farther from the screen to eliminate any visible pixels that
would add noise to the data. As seen in Figures 2 and 3, each cuvette was placed on a
platform 2 cm tall (e.g. A lens case or petri dish) in order for the bottom of the cuvette to
be in alignment with the camera lens.
FUTURE WORK
REFERENCES
This research has the potential to be incredibly far reaching and beneficial to
numerous other fields and studies. Further development of this work would include the
development of a mobile app that would allow photos of water samples to be taken on
site and analyzed in real time. The application would be set up as a simple, easy to
use interface that would request the water test that is being analyzed, a photo of
untested water, and a photo of the water with the color-change test completed. The
software would then analyze the photos and return not only the concentration of the
contaminant with uncertainty but also with a recommendation as to how to remedy the
contamination. This would allow water testing to be done on-site with no special
equipment and make it accessible to the general public. This would also help to
educate the user about the importance of water purity and how to keep themselves
and their loved ones safe from contaminated water.
1. http://www.lamotte.com/en/drinking-water/combo-outfits/4783-03.html2. http://www.lamotte.com/en/pool-spa/kits-reagents/fas-dpd/7022-01.html3. http://life.nthu.edu.tw/~labcjw/BioPhyChem/Spectroscopy/beerslaw.htm
Photo Testing
Figure 2: (a) A cuvette of concentration 0.5 drop. Red dye was used for its opacity. (b) A cuvette of concentration 0.5 drop. Green was also used for its opacity.
Calibration
Motivation
Objectives
The main objective of our work was to simplify the water testing process and
make it more affordable, more versatile, and more accessible to those who would need
to use it. Specifically, investigating the utility of a smartphone camera is one way that
this methodology could become more accessible. Many people in the world own a
smartphone and the development of an easy to use mobile application would put water
testing into the hands of each of those smartphone users. This project was inspired, in
part, by previous work done that used a similar device to measure the lead
concentration in water via a similar method. The key variation is that we wanted this
methodology to be applicable to a wider variety of color-change water tests besides
lead. Certain contaminants that can be found in naturally occurring swimming waters
are not present in drinking water. As seen in Figure 1(b), a swimming water testing kit
can be just as inaccessible and expensive as a drinking water testing kit.
The end goal of this Smartphone camera approach is to be able to use the
hardware of a common Smartphone and its processing capabilities to determine the
concentration of certain chemical or contaminant in a sample of water. To do this, we
must do a controlled study, testing multiple known concentrations of the contaminant. It
is critical that we use a RAW image format for the photos, as regular image formats (eg
JPEG, PNG) will compress images and, in doing so, omit valuable color data. From this
known data, an equation can be generated from written code that will model the
relationship between the color intensity and the concentration. Once this equation is
determined, we will be able to verify its legitimacy by conducting “Blind Tests” using
“unknown” concentrations and verifying that the fit holds true. If so, the fit will be able to
determine the concentration of any colored sample given only its color. Finally, the
Smartphone camera method will be compared to the Arduino device method to
determine which methodology is more accurate.
Figure 1: (a) An example of a drinking water test kit. (Ref. 1) (b) An example of a pool water test kit.
Both kits’ retail prices are greater than $100 USD. For each trial, a photo of the cuvette was taken through a RAW photo application
then was diluted by 50%. To do so, 2cc of the dyed water was removed and discarded
and 2cc of clear water was added. This was repeated until no visible color remained in
the sample—approximately 12 trials. Data was taken as RGB values through the use of
Python code that would take the RAW image and then extract the RGB values. This was
done by selecting a grid of pixels within the cuvette, as seen in Figure 4(a), and a grid of
pixels in the background screen, as seen in Figure 4(b). The program then averaged the
RGB values from the cuvette and the background and calculated the transmittance
values and an estimated error value, denoted as sigma (𝜎). The data that was collected
was fitted to a variation of the Beer-Lambert law in order to establish parameters of the
fit. The Beer-Lambert law illustrates that there exists a linear relationship between the
absorbance and concentration of a species (Ref. 3). These parameters would
standardize the function and allow us to compute a concentration from the RGB values in
any image.
Figure 3: (a) A side view of the cuvette photo setup. (b) An above view of the cuvette photo set up
Screen
Cuvette
Platform
Figure 4: An example of the grid of pixels inside the sample and on the background. These grids were used to determine the
Calibration (continued)
The fitting parameters for the equation were established. While the Beer-Lambert
Law of optics was the basis of our experiment, it was not general enough to
accommodate the flexibility we wished to incorporate into our methodology. As illustrated
in Figure 5(b), the data was fit to an exponential function: T = ⅇ𝑘0+𝑘1𝐶+𝑘2𝐶2. Using this
equation, along with the fitting parameters ko, k1, and k2, we can determine an unknown
concentration when the program computes transmission (T) values. In order to test the
validity of the equation, a series of “Blind Tests” were conducted in which five different
samples were made with varying concentrations of green dye. These samples were
photographed and analyzed using the Python program and transmission values were
given for red, green, and blue. The concentration of each trial was then calculated using
a minimized Chi-Square calculation based on the fit equation and the parameters
determined previously. The values calculated were then tested and compared to
measurements taken by the method developed by Spencer Graves. Figure 5 shows the
comparison between the actual concentration values and the values calculated by the
two methods.
Figure 5: (a) The comparison between the true concentrations and the two calculated
concentrations. (b) A plot of the calibration fit curves produced by the Python code.
The results of the experiments were as expected. The intensity of a color and the
concentration of a substance in a sample of water are inversely proportional on a
decaying model. Despite its technological simplicity compared to the Arduino photo
sensor, the Smartphone camera was able to collect the data required to support the
hypothesis. Improvements must be made insofar as to account for instances where a
dark room and a screen would not be used in the photo process. This is the limiting
factor that will need to be removed for the overall success of a future mobile device
application that is practical and accurate. As of now, the comparison graph shows that
both methods are effective and accurate in measuring the color of a sample of water.