Professional Documents
Culture Documents
Samuel Schaefer
in
(Electrical Engineering)
ii
Preface
This work was done under the supervision of Dr. Kenneth Chau at
the School of Engineering in The University of British Columbia. This thesis
was co-written with Dr. Kenneth Chau.
The work presented in this thesis was done over the course of my Mas-
ter of Applied Science degree and was started as an undergraduate capstone
design project completed with Yannick Letailleur and Aurelien Schilles.
iii
Table of Contents
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Water Quality Measurement . . . . . . . . . . . . . . . . . . . 2
1.1.1 Biological Contaminants . . . . . . . . . . . . . . . . . 2
1.1.2 Chemical Contaminants . . . . . . . . . . . . . . . . . 3
1.2 Color Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 What is Color? . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Color Vision . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 Color Models . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.4 Color Spaces . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Color Measurement . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.1 Limitations of Human Color Perception . . . . . . . . 12
1.3.2 Spectrophotometry . . . . . . . . . . . . . . . . . . . . 16
1.3.3 Colorimetry . . . . . . . . . . . . . . . . . . . . . . . . 17
1.4 Colorimetric Water Quality Sensor . . . . . . . . . . . . . . . 19
1.5 Smart Phone Sensors . . . . . . . . . . . . . . . . . . . . . . . 20
1.5.1 Software-Based Smart Phone Sensors . . . . . . . . . . 22
1.5.2 Smart Phone Sensor Attachments . . . . . . . . . . . 23
iv
TABLE OF CONTENTS
v
TABLE OF CONTENTS
Chapter 4: Conclusion . . . . . . . . . . . . . . . . . . . . . . . . 74
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
vi
List of Tables
vii
LIST OF TABLES
viii
List of Figures
ix
LIST OF FIGURES
x
Acknowledgments
I would like to offer my sincere gratitude to everyone that has sup-
ported me over the course of my studies. First, I would like to thank my
supervisor Dr. Kenneth Chau for his guidance, motivation, and enthusiasm
during our work together over last five years. His attention to detail and
drive for perfection have helped me become a better engineer, succeed in
this work, and will have a lifelong positive impact. I would like to thank
my committee members Dr. Thomas Johnson and Dr. Jahangir Hossain
for their helpful comments throughout this work. I also want to thank Dr.
Kevin Smith for his valuable input and careful reading of the thesis.
A special thanks goes to Michelle Tofteland for her efforts in helping
me set up and complete the calibration of the sensors. I would also like
to thank my capstone project teammates Yannick Letailleur and Aurelien
Schilles who helped bring this project to life, and their enthusiasm which
has motivated me to further develop the idea of a mobile color-based water
quality sensor. I want to thank Dr. Peter Ott of Heilbronn University and
Claude Labine of Campbell Scientific Canada Corp. for their suggestions
and helpful discussions. I am also very thankful to Dr. Jonathan Holz-
man for his support in my NSERC-CGS scholarship application. I am very
grateful for the help I received from Dr. Deborah Roberts and Dr. Ray
Taheri.
I have truly enjoyed working with my fellow graduate students, Reyad
Mehfuz, Mohammed Al-Shakhs, Max Bethune-Wadell, Faqrul Chowdhury,
and Waqas Maqsood and would like to thank them all for their contributions.
I would also like to extend my gratitude to Timesys Corporation for offering
us a subscription to the LinuxLink Pro service which was a great help in the
development of the project.
Finally, I would like to thank my family and friends who have sup-
ported me not only throughout the course of this work but throughout my
entire life. Without the support from my mother and siblings, I would not
have been able to complete the work I have done. Their guidance, motiva-
tion, and love will continue to shape my life and career.
xi
Dedication
In loving memory of my dad
August Schaefer
xii
Chapter 1
Introduction
The goal of this thesis is to develop cost-effective sensor technologies
that will enable a user with minimal training to make rapid measurements
of multiple water quality parameters on-site immediately after water sam-
pling. Such technology would enable water quality measurements signifi-
cantly faster than traditional methods based on collection of water samples,
sample transportation to a laboratory, and subsequent measurement in a
controlled setting. In contrast to other stand-alone water quality sensors
that already enable immediate measurements on-site, our water quality sen-
sor leverages the abundant processing power, intuitive touch-based interface,
connectivity, and general ubiquity of smart phone systems, a novel approach
that places priority on cost-effectiveness, portability, and ease of use.
In this work, we define the quality of water as it relates to the con-
sumption and use of water by humans. Measurable parameters that form
an aggregate metric of overall water quality include the concentration of
organic and inorganic species, temperature, pH, conductivity, and turbid-
ity [1]. When any of these parameters exceed regulatory limits, the quality
of water is compromised and there are risks of short- and long-term ad-
verse effects to human health. Although most urbanized populations in
developed countries obtain their water from distribution systems that are
centrally regulated and monitored, the availability of affordable technologies
to allow individuals to make rapid water quality measurement at the point
of sampling would benefit the majority of the world’s population residing
in developing countries, who use and consume ground water that is neither
monitored nor treated. In addition, the rural population in developed coun-
tries (in Canada and US alone, this amounts to approximately 40 million
people [2, 3]) frequently obtain water from private wells and could poten-
tially benefit from timely access to drinking water quality data. Rapid and
on-site water quality measurements are also important for house-hold uses
such as pool, spa, and aquarium maintenance.
We have developed two iterations of a water quality sensor that have
achieved portability, cost-effectiveness, and ease of use by integration with
mobile smart phone systems. The sensors are based on colorimetric mea-
1
1.1. Water Quality Measurement
2
1.1. Water Quality Measurement
Chromatography
Chromatography instruments (chromatographs) provide the greatest
sensitivity and accuracy for quantifying chemical contamination. To mea-
sure a chemical species dissolved in water, chromatographs work by sepa-
ration of ions in a sample and subsequent detection. A separation vessel
consisting of a long column is filled with a material known as the station-
ary phase. The water sample is mixed with another fluid having known
concentration of ions and fed through the column. A third fluid known as
the eluent is added to the top of the column to wash the sample mixture
through the column. The stationary phase is selective and preferentially
binds to the ions in the sample solution, separating the ions as they travel
down the column at different rates. A detector placed at the bottom of the
column detects the arriving ions of the sample. Differences in the arrival
time (retention times) of the ions are used in conjunction with a calibration
standard to identify the ion concentrations and sample composition. The
detector can be a colorimetric sensor, a conductivity sensor, or a mass spec-
trometer [9]. The ion chromatograph is a very powerful tool and, combined
with an autosampler (a device that enters the sample into the column), a
3
1.1. Water Quality Measurement
Electrode Measurements
Ion-selective electrode measurement is another technique to quan-
tify chemical contamination in water. This technique works on the basis
of a redox reaction and uses two electrodes. One electrode is immersed in
a reference solution with known ion concentration and a second electrode
is encased in a selectively permeable housing and immersed in the sample
solution. Only the desired ions pass through the housing to the second
electrode. Knowing the concentration and standard potential of the refer-
ence solution and the measured potential between the two electrodes, one
can determine the concentration of the targeted ion species in the sample
solution. Depending on the construction of the selective membrane, vari-
ous ion concentrations can be measured. One variation of this technology
is the popular electrode-based pH meter [10]. Ion selective electrode mea-
surements are very accurate, but require frequent calibration, are limited to
measurement of a few ionic species, are notoriously fragile, and are costly.
Radiation Measurements
Perhaps the simplest and most widely-used method for measuring
chemical contamination is based on radiation or light-based measurement.
There are several forms of light-based water quality measurement. The most
universal is based on direct observation of a water sample either by eye or
by using a color-sensitive image sensor to arrive at a qualitative description
of water quality (for example, “the water is murky” or “the water is crystal
clear”). Quantitative descriptions of water quality can be obtained through
photo-sensitive measurements usually expressed in terms a parameter known
as absorbance given by
P0
A = log , (1.1)
P
where the P0 is the incident light power and P the transmitted light power.
It can be difficult to confidently determine the presence of a particular chem-
ical contaminant in a water sample based solely on direct observation or
4
1.2. Color Theory
5
1.2. Color Theory
f (Hz) 106 107 108 109 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019
AM radio waves microwaves infrared ultraviolet
FM radio waves radar X rays
terahertz waves visible gamma rays
λ 1km 100m 10m 1m 10cm 1cm 1mm 100μm 10μm 1μm 100nm 10nm 1nm 1Å 0.1Å
6
1.2. Color Theory
Figure 1.2: The retina located at the back of the human eye consists of 7
million cones. Cones are categorized by their sensitivity to long wavelengths
(L), medium wavelengths (M), and short wavelengths (S). The figure plots
the spectral sensitivity of the different cone types. Perceived color is deter-
mined by the relative response of the three cone types, giving rise to the
tristimulus response of the human eye. Data obtained from [12].
7
1.2. Color Theory
the first widely accepted color model. Rather than use the color match-
ing functions determined from the Wright-Guild experiments based on real,
monochromatic light sources, the commission allowed for the creation of ar-
tificial primaries X, Y , and Z which would have the following properties: 1)
the CMFs corresponding to the primaries (x̄(λ), ȳ(λ), and x̄(λ)) are always
positive, which implies that they encompass the entire color gamut of the
human eye and 2) the CMF corresponding to the Y color would match the
illumination response of the human eye. The XY Z primaries are not phys-
ical light sources but rather mathematical constructs, more saturated than
monochromatic light, that enable the definition of the entire color gamut of
human vision in terms of three positive values. For a given light spectrum,
Φ(λ), the relative intensities of the three primaries can be calculated by
convolving Φ(λ) with the color matching function over visible wavelength
ranges given by Z 760
X= Φ(λ)x̄(λ)dλ, (1.2)
360
Z 760
Y = Φ(λ)ȳ(λ)dλ, (1.3)
360
and Z 760
Z= Φ(λ)z̄(λ)dλ, (1.4)
360
where the limits of integration are expressed in units of nanometers.
If we examine the case of pure monochromatic light (a spectrum with a
single wavelength component), we can apply the Eqns. 1.2, 1.3, and 1.4 to
determine the outermost visible X, Y , and Z tristimulus values. The space
enclosed by this locus is a three dimensional representation of all colors
visible to the human eye. In order to visualize the range of colors in a two
dimensional plane, the color model can be normalized to yield x, y, and z
values given by
X
x= , (1.5)
X +Y +Z
Y
y= , (1.6)
X +Y +Z
and
z = 1 − x − y, (1.7)
respectively, and plotted as just a function of x and y. The result of this
normalization is the familiar horseshoe-shaped CIE color model shown in
Fig. 1.5. The two-dimensional plot includes all visible colors bordered by
8
1.2. Color Theory
a) b)
0.4
rgb tristimulus
0.3
lamps
relative intensity
0.2
0.1
monochromatic
observer
test lamp
−0.1
400 500 600 700
wavelength (nm)
Figure 1.3: Initial work by Wright [14] and Guild [15] led to the development
of the CIE RGB color observer functions. (a) Three monochromatic light
sources (red, green, and blue) with variable intensities are combined to a
spot, which is then color matched to a monochromatic test spot according
to the perception of an observer [16]. The resulting color matching functions
(CMF) are shown in (b) (data from [17]).
9
1.2. Color Theory
1.5
tristimulus values
0.5
0
400 500 600 700
wavelength (nm)
10
1.2. Color Theory
11
1.3. Color Measurement
selection of red, green, and blue as the primary colors. Placing the intensities
of the red, green, and blue primary colors on three orthogonal axes yields
a three-dimensional volume that includes all possible colors of that color
space. Figure 1.6 shows the RGB color cube and the different possible
color combinations. By normalizing the RGB cube in a manner similar to
the normalization applied to the XY Z model, the RGB color space can
be visualized by a triangular region inside the two-dimensional color gamut
with vertices defined by the three primary colors. Since the triangular region
lies within the boundaries of the color gamut, it is impossible to reproduce
all visible colors using only three primary colors. There are several RGB
color spaces whose color extent depends on the choice and saturation of the
primary color values. A very common RGB color space is the sRGB space,
which has relatively small coverage of the color gamut. Other spaces include
the Adobe RGB space and ProPhoto RGB space. It should be noted that
the RGB color space is additive, meaning that the primaries add together
to form white. Subtractive color spaces, such as the CMYK color space,
produce black when mixed together and are used for printing processes.
12
1.3. Color Measurement
(a) B
Blue Cyan
(0,0,1) (0,1,1)
White
Magenta (1,1,1)
(1,0,1)
Black
(0,0,0)
G
Green
(0,1,0)
Red Yellow
R (1,0,0) (1,1,0)
(b) B (c) B
G R
R G
Figure 1.6: The RGB color space can be visualized according to three or-
thogonal axes mapping the intensities of the primary colors. (a) shows the
color combinations of different primary intensities resulting in the main col-
ors of the conventional color wheel. The possible color combinations are
shown on the color cube when viewed from the (b) front and (c) back.
13
1.3. Color Measurement
Light
Source
x x
S M L S M L
Sensor
Response
= =
Perceived
Color
Figure 1.7: Two different spectra can be perceived as the same color by a
trichromatic observer. In the first column, a single wavelength light source
emits yellow light, which is perceived as yellow by the observer. In the
second column, a broadband light source emits light that is also perceived
as yellow by the observer.
14
1.3. Color Measurement
Color Constancy
Figure 1.9 demonstrates yet another artifact that makes it difficult
for the human eye to absolutely quantify color. For given light conditions,
the brain automatically adjusts perceived color according to the brightness
and chromaticity of the entire scene. A ripe tomato, for example, appears
15
1.3. Color Measurement
red under bright sunlight as well as under a yellow sodium vapour street
lamp. This effect is very important as it increases the dynamic range and
enables identification and recognition of objects even under different lighting
conditions. In terms of color sensing, color constancy means that perceived
colors are dependent on surrounding light conditions, which can lead to
incorrect observations.
Color Blindness
Approximately 8% of males and 1% of females have some degree of
color blindness [19]. Color blindness is a genetic condition that results in the
absence of certain proteins responsible for the development of the pigments
in the cone cells [20, 21]. Depending on the type of genetic defect, a color
blind individual may not be able to see certain colors, or may have no color
vision altogether.
1.3.2 Spectrophotometry
Spectrophotometry describes the absolute quantification of color in
terms of the intensity of light over the visible wavelength range. Spec-
16
1.3. Color Measurement
aperture
diffraction
beam splitter chopper
grating sample
detector
mirror mirror
reference
light source
1.3.3 Colorimetry
Colorimetry describes the relative quantification of color in terms
of the intensity of selective portions of the visible spectrum. One of the
most common colorimetric technologies is the RGB image sensor found in
most digital cameras. These image sensors consist of an array of photodi-
odes based on either complementary metal oxide semiconductor (CMOS) or
charged coupled device (CCD) technology. The individual photodiode sites
are covered by red, green, or blue color filters, which have filter functions
17
1.3. Color Measurement
(a) photodiode
array
grating
resulting
spectral data light source
(b) photodiode
array
light source
resulting
RGB values
red, green,
and blue filter
18
1.4. Colorimetric Water Quality Sensor
G B
R G
Figure 1.12: The Bayer filter arrangement uses two green filters, one red,
and one blue filter. The filter arrangement most closely matches the human
eye luminance response.
closely matching the illumination response of the three types of cones in the
human eye (Fig. 1.11). Light incident onto an RGB sensor is quantified in
terms of the relative intensities of green, red, and blue filtered light. The
most common method for spatially arranging the color filters over a photodi-
ode array is the Bayer arrangement, which consists of a 2 × 2 unit cell made
of two green filters, one red filter, and one blue filter arranged according
to Fig. 1.12. The three intensity values obtained from the unit cell corre-
sponding to the three colors are then used to describe the color of a single
effective pixel. It should be noted that many RGB sensors are designed to
include hardware and software to mimic subjective color perception of the
human eye. White balancing of raw image information, exposure control,
sensitivity manipulation (in the form of camera ISO) manipulate the color
measured by the sensor to more closely approximate human vision.
19
1.5. Smart Phone Sensors
shown in Fig. 1.13. The operation principle is based on relative color de-
termination (through a method similar to that used in RGB image sensors)
and comparison with pre-established calibration curves. A water sample is
mixed with a colorimetric indicator for a selective chemical species and illu-
minated in a light-tight enclosure using various light sources. The intensity
of light transmitted/scattered from a water sample is measured and com-
pared to calibration curves to estimate the concentration of the chemical
species.
Current portable colorimeters have several drawbacks. First, the
high cost is prohibitive to wide-spread use. Second, they are not intuitive to
use and thus lack mass appeal. Each device comes with a large instruction
manual and the user requires a fair amount of training before establishing
a comfort level with its operation. Third, they lack higher functionalities
common in most portable computer devices such as touch-based display,
internet connectivity, and GPS tagging. Finally, they are stand-alone in-
struments incapable of interfacing with other devices. To overcome some of
these limitations, we will develop a colorimetric water quality sensor that
operates in conjunction with a mobile smart phone, leveraging its compu-
tational power, connectivity, and intuitive touch-based display. In the next
section, we will review some of the latest developments in sensor technologies
based on mobile smart phones.
20
1.5. Smart Phone Sensors
21
1.5. Smart Phone Sensors
sensor nodes.
22
1.5. Smart Phone Sensors
23
1.6. Sensor Prototyping Platforms
to the rapid evolution of smart phones, these sensors can quickly become
obsolete and out-of-date. One way to overcome this limitation is to develop
sensor nodes that wirelessly interface with smart phones through standard
wireless protocols (such as WiFi or Bluetooth). There are many benefits
of this approach: the sensor is universally compatible with all smart phone
systems, sensor operation is more elegant due to the absence of physical
connection, and the smart phone can communicate with multiple sensors at
once.
There has been tremendous research and development in wireless sen-
sors spanning a wide range of applications. The GoPro series camera and
the Nikon DSLR cameras, for example, now have wireless interfaces to en-
able camera control and data transfer with mobile devices [51, 52]. Nike and
Apple have collaborated to create a wireless sensor integrated into Nike run-
ning shoes that can be used with Apple mobile devices to monitor exercise
[53]. The iGrill wireless thermometer provides meat temperatures readings
that are wirelessly sent to a smart phone [54]. A variety of biomedical de-
vices have been demonstrated based on wireless communication with smart
phones, including pulse rate monitors [55, 56], electrocardiograms [57–60],
stethoscopes [61], and health monitoring stations [62]. Due to the diversity
of applications for wireless sensors [63], some have endorsed the idea of cre-
ating an open wireless sensor platform to enable developers and designers
to rapidly create and prototype new concepts [64]. Indeed, the potential
impact of wireless sensors in a diverse range of applications is enormous.
24
1.7. Wireless Device Communication
decades, it has only been in the last few years that portable and low cost
prototyping platforms have become widely available. One of the most popu-
lar is the Arduino prototyping platform [65]. The Arduino hardware consists
of a microcontroller with general input and output pins and its software is
written in a C-based programming language. A large community of devel-
opers have been attracted to the Arduino platform because the hardware
and software are both open-source and the development interface is simple
and easy to use. The open-source hardware has spurred the development of
a number of add-on boards (shields) that connect to the Arduino and con-
trol peripherals such as motors, displays, wireless and wired communication
platforms, and input devices. Table 1.1 outlines some of the specification of
a typical Arduino micro-controller platform.
25
1.7. Wireless Device Communication
26
1.7. Wireless Device Communication
we will review the most widely used wireless standards applicable for device
communication.
1.7.2 Bluetooth
The Bluetooth wireless communication standard is a short range,
point-to-point communication system suited for low data rates that was
primarily designed to eliminate the need for short cables. Bluetooth specifi-
cations are maintained by the Bluetooth Special Interest Group (Bluetooth
SIG). The Bluetooth system transmits data on the unlicensed 2.4 GHz fre-
quency band using a frequency hopping spread spectrum (FHSS) to reduce
the effects of interference and fading. A Bluetooth device can be connected
to several other devices, but can only communicate with a single device
at a time. The range of a Bluetooth radio varies between 1 m to 100 m,
depending on the class of the device. The data rate for Bluetooth is lim-
ited to 24 Mbits/s [69], much lower than that of WiFi. In order to allow
secure communication of devices, two devices must be paired using a pass-
code before any information can be transmitted. In 2013, the Bluetooth
SIG released the Bluetooth Low Energy (BLE) standard to further reduce
27
1.7. Wireless Device Communication
28
1.8. Thesis Outline
29
Chapter 2
Smart-Phone-Attached
Water Quality Sensor
In this Chapter, we will present the design, fabrication, calibration,
and validation of a water quality sensor that operates in conjunction with
a smart phone through a physical attachment and custom-written applica-
tion software. The sensor has been designed to operate with the iPhone 4
or 4S. This choice was made due to the simple exterior form of the iPhone
and its high-quality optical components (flash and camera). The sensor
performs colorimetric measurements of water samples spiked with color in-
dicators sensitive to selective chemical species. Water quality parameters
that are measured include pH and the concentrations of chlorine and al-
kalinity. These parameters have been selected due to their widespread use
and availability of colorimetric indicators. The sensor attachment has three
purposes: to provide a stable mount for the water sample, to re-direct light
from the flash of the smart phone through the water sample and onto the
camera, and to provide a light-tight enclosure. Application software per-
forms the colorimetric measurement through control of the smart phone
flash and camera, data acquisition and interpretation, and graphical display
of the parameter measurement. The software has been designed to be easy
to use and visually pleasing. The key conceptual components of the sensor
are shown in Fig. 2.1.
hardware software
water sample color sensor raw image data
light source result output
& reagent (camera) data interpretation
Figure 2.1: Overview of the phone-attached water quality sensor. The hard-
ware includes a light source, a sample holder, and a color sensor. The
software performs data acquisition and analysis and displays measurement
results.
30
2.1. Sensor Hardware
31
2.1. Sensor Hardware
Figure 2.2: Spectral measurement of the light emitted from the LED inte-
grated onto the iPhone 4S.
32
2.2. Reagents
the back of the iPhone where the camera and flash are located. The sides of
the mount clamp onto the iPhone and provide a snug compression fit. The
side clamps have a low profile and do not obscure the front of the iPhone.
Because the mount is constructed from a soft plastic, it can be mounted and
dismounted from the iPhone without leaving scratches. Inside the mount,
there are three mirror surfaces which are aligned in a way so that the light
from the camera flash is directed through the sample and directly onto the
camera. The sample mount contains a square slot to accommodate a stan-
dard cuvette (with a square cross section having 10 mm sides) containing
the water sample. The cuvette slot is positioned close to the camera so that
the entire water sample fills the field of the view of the camera. Two diffus-
ing elements are placed before and after the water sample. These diffusing
elements blur the image of the sample taken by the camera, which reduces
the sensitivity of the camera measurement to inhomogeneities in the water
sample and imperfections such as scratches, defects, and dirt on the mirrors
and cuvette. Critical to the operation of the sensor is the opaque wall be-
tween the flash and the camera which ensures that the image captured by
the camera is representative of the transmissivity of the water sample. The
sample mount is sealed by an opaque lid to completely block out ambient
light during the measurement. The device has been designed with ease of
manufacturing in mind and can be readily manufactured through standard
polymer processes such as injection molding. Figure 2.5 shows an image of
the fabricated mount attached to an iPhone 4S.
2.2 Reagents
Colorimetric indicators enable quantitative color-based analysis of
water samples. Reagents react with a targeted species in the water sample
and produce a characteristic color change proportional to the concentration
of the species. A large number of colorimetric indicators have been developed
to determine concentrations of metals, oxidizers, and acidity. In this work,
we will use indicators for pH, chlorine, and alkalinity, widely used water
quality parameters for determining the suitability of water for recreational
use in swimming pools.
2.2.1 pH
pH quantifies the acidity of a water sample. The pH scales from 0
(very acidic) to 14 (very basic), with a pH of 7 defined as neutral. A common
33
2.2. Reagents
mirror
light enclosure
diffuser
diffuser
Figure 2.3: A top view of the sensor attachment highlights its internal ge-
ometry and the light path used for colorimetric measurement.
Figure 2.4: Front (left) and back (right) three-dimensional views of the
sensor attachment. The device prototype consists of ABS plastic, which is
opaque to visible light.
34
2.2. Reagents
Figure 2.5: Image of the actual sensor attached onto an iPhone 4S running
the custom application software.
35
2.2. Reagents
2.2.2 Chlorine
Chlorine is commonly used as a water disinfectant. Chlorine, in the
form of chlorine gas, or hypochlorous acid, oxidizes biological contamina-
tion, removes odors, and reduces turbidity. When free chlorine reacts with
ammonia (present in urine or perspiration), it forms chloramines, which are
also known as combined chlorine. Chloramines are odorous and harmful for
human health. In swimming pools, both the free chlorine and total chlorine
(free chlorine plus chloramines) concentrations are monitored. Chlorine con-
centration should be between 1-4 mg/L depending on the size of the pool.
If the total chlorine exceeds the free chlorine concentration, this indicates
the presence of combined chlorine must be oxidized using a shock treat-
ment. Chlorine concentrations can be colorimetrically determined using the
N,N-diethyl-p-phenylenediamine (DPD) method. When DPD reacts with
chlorine, a dye known as Würster is produced. The intensity of the dye
changes from clear when no chlorine is present to a strong pink when the
chlorine concentration is above 7 mg/L. The DPD method is sensitive to free
chlorine and can be directly used to measure the free chlorine concentration
in a water sample. The DPD method is insensitive to combined chlorine.
To measure the total chlorine concentration, iodide is added to the water
sample to react with the chloramines to produce triiodine ions (I3 − ) which
react with the DPD forming an observable color change [71].
2.2.3 Alkalinity
Alkalinity describes the buffering capability of water. Alkalinity is
caused by the presence of carbonates and bicarbonates and is generally mea-
sured as equivalents of mg/L of calcium carbonate (CaCO3 ). Low alkalinity
water is susceptible to large changes in the pH. High alkalinity water is
susceptible to precipitation. In swimming pools, a desirable range for alka-
linity is between 80-120 mg/L. Alkalinity can be measured colorimetrically
by titrating a water sample with a strong acid and determining the titration
endpoint using a pH indicator. Based on the amount of acid titrated, the
alkalinity concentration can be determined.
36
2.3. Phone Application Software
37
2.3. Phone Application Software
Figure 2.6: The software app guides the user through the measurement pro-
cess. The user selects a water quality parameter, initiates the measurement
by attaching the sensor, and then performs a measurement after inserting
the cuvette into the mount.
during the measurement procedure, the user can press the home button on
the iPhone to exit the app completely.
Unseen by the user, the app performs colorimetric measurement through
a two step process where it first obtains a reference image and then obtains
an image of the water sample. The reference image step is particularly im-
portant due to the limited software control over the camera. As mentioned
before, the camera onboard the iPhone has features such as automatic ex-
posure (the phone will detect the ambient brightness level and adjust the
exposure setting on the camera), auto-focus (the phone will adjust the optics
of the camera in an attempt to obtain a sharp image), and white balancing
(chromaticity adjustment to more closely match human vision), which are
all detrimental for quantitative color determination. While it is not possible
to set the exposure value, focus, white balance temperature value for the
camera directly through software, it is possible to lock these settings at any
time to their current values while the camera is in use by the phone (for
example, you can lock the focal position of the camera while attempting
to capture an image). However, every time the camera function is closed
and re-initiated, the camera settings are again unlocked and subject to au-
tomatic settings. To alleviate this problem, the app initiates the camera
function on the iPhone the moment the user presses the “START” button
and takes a reference image with the mount attached to the phone but no
38
2.4. Calibration
water sample in place. After the reference image is taken, the app locks all
camera settings (exposure, focus, and white balance) under the conditions
in which the reference image was taken. The reference image is cropped to
isolate a region of interest and the average red, green, and blue components
of the region of interest are calculated and stored.
In the next step, the water sample is inserted into the mount and the
user presses the “MEASURE” button. The app will then take an image of
the water sample using the locked camera settings. The image is cropped
over the same region of interest and the average red, green, and blue compo-
nents of the region of interest are calculated. The measured red, green, and
blue values are each subtracted from their reference values. The three differ-
ence values are then mapped onto three separate pre-determined calibration
curves to produce three measurements of the parameter concentration. A
good measurement is one in which the parameter estimated from the red,
green, and blue channels are similar within an acceptable amount of error.
If the measurements show significant variations, the app will alert the user
that an error has been detected (for example, the mount was not properly
attached, the reference measurement was made incorrectly, or the wrong
reagent was used) and prompt the user to repeat the measurement. Be-
cause the sensitivity of the red, green, and blue channels will be different
for different colorimetric indicators, weighting factors (determined from the
calibration process to be discussed next) are placed on the measurement
from each channel and the weighted average is displayed to the user.
2.4 Calibration
In this section, we will describe the calibration of our water quality
sensor by correlating the color of standard water samples with known con-
centrations. The quantification of color change in terms of red, green, and
blue intensity values can yield non-intuitive behavior. For example, the top
panel of Fig. 2.8 illustrates, from left to right, a gradual change in color
from red, to yellow, to pink, to white. Although the color transition from
red to white appears gradual, decomposition of this color change into three
primary red, green, and blue channels yields strikingly different behavior
across the channels. In particular, the red channel is at a constant high
value, the blue channel monotonically transitions from low to high values,
and the green channel varies in a non-linear manner from low values to high
values to low values and back to high values again. Due to the possibility
of non-linear variations in the red, green, or blue channels, calibration re-
39
2.4. Calibration
40
2.4. Calibration
color
change
red
channel
green
channel
blue
channel
Figure 2.8: The color gradient in the top panel is decomposed into red,
green, and blue channels below to highlight disparities in the channel be-
haviors.
2.4.1 pH Calibration
We calibrate our sensor to measure pH values ranging from 6.5 to
8.5. Standard samples within the desired pH range are created using varying
concentrations of two buffer solutions. The buffer solution 0.2 M monobasic
potassium phosphate (KH2 PO4 ) is used to controllably lower the pH, and
41
2.4. Calibration
the buffer solution 0.2M dibasic potassium phosphate (K2 HPO4 ) is used to
controllably raise the pH. The buffers are added to Type 1 ultra-pure filtered
water. An Oakton pH 500 meter (model WD-35617-00) is used to verify the
pH of the standard solutions. For a given measurement, a 3 mL sample of
the standard solution is mixed with the phenol red indicator in the Lamotte
reagent cuvette (model: 4310) and the R, G, and B values from the sensor
are recorded. 24 samples with different pH values are measured. Figure 2.9
shows the R, G, and B measurements over pH values ranging from 6.5 to
8.5. Although there are slight oscillations in the calibration curves for the
R, G, and B measurements, the overall trend for all three channels is fairly
linear. Thus, we employ linear functions to model the sensor response over
the pH range. The linear calibration functions for each channel and their
corresponding R2 are given in Table 2.2.
The calibration results show that the blue and green channels exhibit the
largest sensitivity to the color change of phenol red over the pH range. The
red channel, on the other hand, is relatively insensitive. As a result, only the
green and blue channels are used by the software algorithm to calculate the
42
2.4. Calibration
pH value. Based on the linear fits to the calibration data, analytical linear
expressions are developed for the pH concentration based on the green and
blue channel values, as shown in Table 2.3. The weighting factors for the
pH measured from the green and blue channels are 0.7 and 0.3, respectively,
reflecting the greater sensitivity of the green channel and the superior linear
fit to the calibration data for the green channel.
43
2.4. Calibration
Free Chlorine
For a given calibration measurement, a 3 mL sample of the standard
solution is mixed with a Lamotte free chlorine reagent cuvette (model: 4311)
and the R, G, and B values from the sensor are recorded. For low chlorine
concentrations, the water sample is clear, and for high chlorine concentra-
tions, the water sample is saturated pink. The calibration data is shown in
Fig. 2.10 along with linear fits to the data for the three channels. Although
the red and blue channels are well-modeled by linear functions over the en-
tire range of chlorine concentrations, the green channel is linear for only low
chlorine concentrations up to 6.5 mg/L. The linear calibration functions for
each channel and their corresponding R2 are given in Table 2.4.
Like the case for pH, the blue and green channels exhibit the greatest
sensitivity to chlorine concentrations. As a result, only the green and blue
channels are used by the software algorithm to determine the free chlorine
44
2.4. Calibration
concentration. The analytical linear expressions for the free chlorine con-
centration in terms of the green and blue channels are shown in Table 2.5.
These functions are valid for free chlorine concentrations over the range from
1 mg/L up to 7 mg/L. The free chlorine concentrations measured from the
green and blue channels are given equal weighting factors to determine the
weighted average free chlorine concentration.
Total Chlorine
The same standard solutions used to calibrate the sensor for free
chlorine are used to calibrate the sensor for total chlorine. For a given mea-
surement, a 3 mL sample of the standard solution is mixed with a Lamotte
total chlorine reagent cuvette (model: 4312) and the R, G, and B values
from the sensor are recorded. The calibration data is shown in Fig. 2.11.
Like the case for free chlorine calibration, total chlorine calibration is per-
formed over the range from 1 mg/L to 9 mg/L. Linear calibration functions
for each channel and their corresponding R2 are given in Table 2.6. The
45
2.4. Calibration
total chlorine concentration is determined from the green and blue chan-
nels using the analytical expressions shown in Table 2.7. The total chlorine
concentrations measured from both the green and blue channels are given
equal weighting factors to determine the weighted average total chlorine
concentration.
46
2.4. Calibration
47
2.5. Measurement Procedure
where MCaCO3 = 100.09 g/mol and MNa2 CO3 = 105.09 g/mol are the respec-
tive molar masses of calcium carbonate and sodium carbonate. 11 standard
solutions with alkalinity ranging from 0-200 mg/L CaCO3 are prepared. For
a given measurement, a 3 mL sample of the standard solution is mixed with
a Lamotte alkalinity reagent cuvette (model: 4318) and the R, G, and B val-
ues from the sensor are recorded. The water sample exhibits a color change
from yellow to deep blue with increasing alkalinity concentrations. The cal-
ibration data is shown in Fig. 2.12. The data from all three channels are
fitted with linear functions, which are plotted in Fig. 2.12 and provided ex-
plicitly in Table 2.8. Due to appreciable sensitivity of R, G, and B channels
to the alkalinity of the standard solutions, all three channels are used by the
software algorithm to determine alkalinity based on the analytical expres-
sions shown in Table 2.9. The weighting factors for the alkalinity measured
from the red, green, and blue channels are 0.35, 0.5, and 0.15, respectively.
These factors have been determined based on both the quality of fit of the
linear functions to the calibration data and the slope of the linear functions.
48
2.5. Measurement Procedure
49
2.6. Conclusion
2.6 Conclusion
We have designed, created, and validated a sensor prototype that op-
erates in conjunction with an iPhone to perform colorimetric water quality
measurements. Colorimetric measurements are performed by exploiting the
light source and camera integrated onto an iPhone. A physical attachment
has been designed to provide a light-tight enclosure to perform controlled
and repeatable measurements. The attachment has been designed to house
standard cuvettes containing colorimetric indicators that produce charac-
teristic color changes due to pH, chlorine, and alkalinity. The cuvettes are
available for bulk purchase and can be disposed upon completion of the
measurement. The developed sensor provides several benefits over other
colorimetric measurement tools. First, the measurement process is quick
and intuitive. The total measurement procedure for one parameter takes
less than thirty seconds and requires no precise measuring of chemicals.
50
2.6. Conclusion
Figure 2.13: The measurement process for a single water quality parameter
using the phone-attached water quality sensor. The average time for the
measurement of one parameter is under a minute.
51
2.6. Conclusion
The instructions are given to the user on-screen, which largely eliminates
the need for a physical user manual. The attachment is completely passive
(because it relies on the flash and camera already integrated on the iPhone),
light-weight, and portable. Because the attachment can be constructed from
plastic and contains no active electronic components, the manufacturing
costs are low and the performance of the device is robust. We anticipate
that this sensor could be used to determine water quality for recreational
uses such as swimming pools.
Our prototype sensor also has several limitations. The attachment
is designed for the iPhone 4/4S. To work with another smart phone model,
the attachment must be re-designed and tailored to the specific dimensions
of the phone and the locations of the camera and flash for the phone. Be-
cause the sensor relies on a physical connection to the iPhone, the user
must remove any cases and covers before using the sensor. Moreover, the
measurement requires the user to bring the iPhone near open water, which
increases the risk of water contact. Like other smart phone sensors that rely
upon hardware integrated onto the phone, our implementation suffers from
limited access to the hardware. As we have discussed, the camera settings
of the iPhone cannot be directly adjusted, which necessitated the reference
measurement step. Finally, the operation of the sensor relies upon commer-
cially available reagent-filled cuvettes. Reliance on third-party equipment
could potentially hinder wide-spread use of the sensor.
52
Chapter 3
53
3.1. Sensor Hardware
Figure 3.1: The wireless water quality sensor consists of a portable sensor
node containing the sensing hardware, a sample mount, and a wireless inter-
face. Application software on the smart phone wirelessly receives data from
the sensor node, analyzes the data, and displays the measurement result.
54
3.1. Sensor Hardware
Figure 3.2: The enclosure, constructed from black ABS plastic, houses the
light source, color sensor, microcontroller, wireless module, and battery cir-
cuit.
55
3.1. Sensor Hardware
Figure 3.3: A visual diagram of the circuitry of the wireless smart phone
sensor system. The circuit consists of a light source, color sensor, microcon-
troller, wireless communication system, and power supply. The circuit can
interface to a micro-USB charging circuit, has a power switch to turn on the
sensor, and a wireless Bluetooth interface to connect to a smart phone.
56
3.1. Sensor Hardware
less power, have a much simpler architecture, and are easier to control.
Second, we can obtain direct color data without having to work around built-
in camera functions such as auto-exposure, auto-focus, and white balancing.
The color sensor consists of a 12 × 12 array of photodiodes, where each
photodiode is covered by either a red, green, or blue filter. The photodiode
array outputs an amplified analog voltage signal in the red, green, and blue
channels proportional to the intensity of light in the red, green, and blue
spectral regions as defined by the response of the filters. An aggregate
measure of color is obtained based on the relative voltage values from the
red, blue, and green channels of the color sensor. The spectral response
of the red, green, and blue channels is shown in Fig. 3.5. Note that the
blue channel is the least sensitive followed by green and then red. This
is due to the inherent photo-electric response of the photodiode and the
transmissivity of the filters. Due to the small size of the active area of the
sensor (approximately 1 mm2 ), the sensor must be carefully aligned with
respect to the center of the light beam from the LED. Once the sensor has
been mounted, it is affixed with optical glue to prevent further movement.
57
3.1. Sensor Hardware
58
3.1. Sensor Hardware
3.1.3 Microcontroller
We use a simple MCU to control the light source and color sensor
and perform all communication tasks with the smart phone. The MCU used
in our system is the 16 MHz Arduino Pro Micro (model: DEV-12640), which
is based on the ATmega32U4 microcontroller chip. The board is equipped
with a JTAG debugging USB interface to allow rapid loading and prototyp-
ing of software programs. Three analog input pins and their corresponding
10 bit analog to digital converters are used to read the three voltage signals
from the RGB color sensor. The color sensor and light source are controlled
through digital input and output pins. The platform is also equipped with
serial communication pins to handle serial communication with the Blue-
tooth module to be described in the next section. The entire MCU has a
small foot print (approximately 2 × 3 cm) and fits inside the sensor case.
59
3.2. Reagents
Figure 3.6: An image of the complete circuit inside the sensor enclosure with
the lid removed. A switch on the outside of the sensor allows the user to
turn the device on and off. A micro-USB interface is available to charge the
battery when the sensor is not in use.
the sensor is not in use. A switch fastened to the outside of the enclosure
enables the user to toggle between charging mode (off) and running mode
(on).
The circuit components have been selected for their small footprint.
As shown in Fig. 3.6, the completed circuit compactly fits into the enclosure
of the sensor.
3.2 Reagents
The wireless sensor will perform measurements of pH, chlorine, and
alkalinity concentration using similar colorimetric reagent chemistries as dis-
cussed in the previous Chapter. We will use reagent cuvettes supplied from
LaMotte Inc.
60
3.3. Phone Application Software
61
3.3. Phone Application Software
Figure 3.7: Title screens of the software application (left) prior to and (right)
after establishing Bluetooth connection with the sensor node.
62
3.4. Calibration
3.4 Calibration
Calibration curves for pH, chlorine, and alkalinity concentrations are
established by measuring the sensor output using standard solutions with
known concentrations. The preparation methods for the standard solutions
are identical to those used in the previous Chapter. The sensor response is
quantified according to average voltage signals from the red, green, and blue
channels sent from the sensor to the phone, each normalized (by a simple
difference as shown in Eqns. 2.1-2.3) to reference values obtained when the
phone first connects to the sensor.
3.4.1 pH Calibration
To calibrate the wireless sensor for pH, 15 standard solutions with
pH varying from 6.5 to 8.5 are prepared. The pH values of the solutions are
verified using a pH meter (Oakton pH 500). The solutions are injected into
the reagent-bearing cuvette and the color of the water sample is quantified
using the wireless sensor. Figure 3.9 displays the normalized red, green, and
blue channels measured by the wireless sensor as a function of pH. From
these results, we derive the calibration curves shown in Table 3.1. Based on
slope and quality of fit of the calibration curves, only measurements from
the red and green channels are used by the application software to determine
pH. The analytical functions used by the application software to calculate
pH, along with the relative weights of the pH measurement from the red
and green channels, are shown in Table 3.2.
Table 3.1: Calibration of the wireless sensor for measurement of pH, [pH].
Best fit functions and corresponding R2 for the R, B, and G channels as a
function of [pH].
Model R2
Red Channel R = 22.81 × [pH] − 184.29 0.966
Green Channel G = 103.64 × [pH] − 640.60 0.951
Blue Channel B = −4.97 × [pH] + 168.41 0.129
63
3.4. Calibration
64
3.4. Calibration
65
3.4. Calibration
Free Chlorine
Figure 3.10 displays the normalized red, green, and blue channels
measured by the wireless sensor as a function of free chlorine concentration.
The evolution of color as a function of chlorine concentration is non-linear
in all three channels. To obtain analytical functions that can be used by
the software to determine chlorine concentration, the calibration data is
inverted (concentration on the vertical axis and normalized red, green, and
blue channels on the horizontal axis) and fit to an exponential function of
the form x−x0
y = y0 + Ae t , (3.1)
where x and y are the respective horizontal and vertical coordinates, x0
and y0 are the respective horizontal and vertical shifts, A is the amplitude
scaling factor, and t describes the rate of change of the exponential factor.
The values of x0 , y0 , t, and A are selected to provide an optimal match to
the calibration data. The resulting exponential functions and the quality
of fit of these functions to the calibration data are shown in Table 3.3. All
three channels provide good sensitivity to the chlorine concentration, with
the green and blue channels having higher sensitivity for higher chlorine
concentrations. Accordingly, the chlorine measurement from the green and
66
3.4. Calibration
blue channels are given greater weights than that from the red channel for
the computation of the nominal chlorine concentration.
Total Chlorine
Figure 3.11 displays the normalized red, green, and blue channels
measured by the wireless sensor as a function of total chlorine concentration.
Like the case for free chlorine, we fit the inverted total chlorine calibration
data with exponential functions having a general form given by Eqn. 3.1.
The exponential functions and the quality of fit of these functions to the
calibration data are shown in Table 3.4. Data from all channels is used
to determine the total chlorine concentration. The nominal total chlorine
concentration consists of a weighted sum of measurement from all chan-
nels, where approximately equal weights have been applied to each channel
measurement. It should be noted that the exponential fit functions for the
calibration data for chlorine concentration provide significantly better fits
than the linear functions used in the previous Chapter. As a result, the
wireless sensor can measure a larger range of chlorine concentrations than
67
3.4. Calibration
68
3.4. Calibration
69
3.5. Measurement Procedure
Table 3.6.
70
3.6. Conclusion
with the colorimetric reagent. (8) The mixed water sample is then inserted
back into the sensor. (8) A parameter is selected from the title screen of
the phone app. (9) The sensor performs the measurement and wirelessly
sends the raw data back to the phone. (10) The phone application analyzes
the raw data based on pre-programmed calibration curves and displays the
measurement result on screen.
3.6 Conclusion
The wireless water quality sensor has several advantages compared
with the phone-attached water quality sensor developed in the previous
71
3.6. Conclusion
Figure 3.13: The measurement process for a single parameter has been
streamlined to be completed in few steps in under one minute.
72
3.6. Conclusion
Figure 3.14: Image of the wireless water quality sensor and a Samsung
Galaxy S2 smart phone running the application software.
Chapter. First, the use of the Bluetooth wireless standard makes this de-
vice compatible with a wide range of mobile devices, including smart phones,
tablets, and laptops. Second, the wireless connection enables measurements
to be performed without a physical attachment to the smart phone, which
reduces risk of phone damage due to exposure to water. Like the phone-
attached prototype, the wireless sensor is light-weight and portable, fitting
into the palm of a hand. Although this prototype requires battery power,
the circuit has been designed to minimize power consumption and runs on
a rechargeable battery that can be charged using the common micro-USB
interface. An image of the final completed sensor is shown in Fig. 3.14.
73
Chapter 4
Conclusion
The goal of this thesis was to create water quality sensors that would
enable a user with minimal training to make immediate measurements of
water quality at the point of sampling. We have developed water quality
sensors based on the quantification of the color of water samples mixed with
indicator reagents, a standard procedure widely used to estimate the pres-
ence of chemical contaminants in water. Color has been quantified through
colorimetry, a technique based on measurement of the relative intensity of
light over selective portions of the visible spectrum. To achieve a colorimet-
ric water quality sensor that is highly portable, cost-effective, and easy to
use, we have explored a strategy in which the sensors leverage the compact-
ness, computing power, and intuitive touch-based displays of smart phones.
Two versions have been created: a first-generation prototype based on a
physical sensor attachment to a smart phone and a second-generation pro-
totype based on a wireless sensor node that communicates to any smart
phone through a Bluetooth interface.
74
Chapter 4. Conclusion
Figure 4.1: Image of four colorimetric water quality sensors (from left to
right): a Hach DR/890 colorimeter and accompanying user manual, the
wireless sensor presented in Chapter 3, the phone-attached sensor presented
in Chapter 2, and test strips.
75
Table 4.1: Specifications of four colorimetric water quality sensors: test strips, the attached sensor, the wireless
sensor, and the Hach colorimeter.
Test Strips Attached Sensor Wireless Sensor Colorimeter
Parameters 3 4a 4a 60
Price low - - high
Dimensions (mm) - 60 × 60 × 50 110 × 70 × 50 240 × 90 × 50
Weight (g) negligible 50 150 500
Power Source - - rechargeable battery 4 AA batteries
Chapter 4. Conclusion
76
Chapter 4. Conclusion
How do the sensors developed in this work compare to other water qual-
ity sensor technologies? Let’s take for comparison the industry-standard
Hach DR/890 colorimeter and conventional test strips commonly used to
assess pool water quality. Both the colorimeter and test strips determine
water quality through color measurement. Test strips are rectangular pieces
of paper that have been impregnated with a colorimetric reagent. Upon dip-
ping the strip into a water sample, the paper changes to a color which can
be visually inspected to estimate the concentration of the targeted chemi-
cal species. The inherent disadvantage of test strips is that they rely upon
human vision, which has been shown in Chapter 1 to be subjective and
error-prone due factors such as metamerism, opponent process, color con-
stancy, and color blindness. The colorimeter works in a similar manner to
our sensors - the user mixes the water sample with reagents in a clear vial,
inserts the vial into the colorimeter, and the colorimeter outputs a measure-
ment of the concentration of the targeted chemical species. In contrast to
our prototypes, however, the colorimeter is not intuitive to use as the user
must consult a large instruction manual to operate the device. Colorimeters
are also costly, which prohibits widespread adoption especially in developing
countries. Finally, the colorimeter lacks advanced features that are standard
in most smart phones such as touch-based displays, GPS-tagging, and data
sharing through email. Table 4.1 summarizes the key features of test strips,
the prototype sensors developed here, and the colorimeter. Figure 4.1 shows
an image of all four sensor types, highlighting their portability.
In addition to achieving portability, cost-effectiveness, and ease-of-
use, it is important that the sensor prototypes provide water quality mea-
surements that are both accurate and precise. To compare the measurement
quality of our sensors to that of the colorimeter and test strips, we set up a
comparative experiment using three test samples of varying pH. The nom-
inal pH values of the test samples have been determined using a calibrated
pH meter (Oakton pH 500). Using each of the four sensors, six independent
measurements of pH are made for each of the three test samples (yielding
a total of 18 measurements for each sensor). The precision of the measure-
ments made by the smart phone sensors are quantified by the average stan-
dard deviation of the three sets of six measurements. The precision of the
colorimeter and test strips are given by the resolution of the measurements.
The accuracy of the measurement made by each sensor is quantified by the
average discrepancy between the average pH values from the three sets of
six measurements and the nominal pH values. The results of the compara-
tive experiment are shown in Table 4.2. Not surprisingly, test strips provide
the least accurate and least precise pH measurements. Both prototypes
77
Chapter 4. Conclusion
78
Chapter 4. Conclusion
Table 4.3: Summary of the measurement variation for the attached and
wireless sensors under reference measurement conditions with no sample in
place and measurement conditions with a sample in place. Also shown is
the average measurement discrepancy between the various color channels.
Attached Sensor Wireless Sensor
Avg. Std. Dev.
2.94 0.06
with No Samplea (%)
Channel
6.5 7.5
Discrepancyb (%)
a
Standard deviation is calculated as a percentage of the sensor range.
b
Discrepancy is calculated as a percentage of the total range of the sensor.
small portion of the cuvette. As a result, the output from the color sensor
is highly sensitive to local variations in the reagent concentration, imperfec-
tions in the cuvettes, bubbles on the cuvette walls, and internal reflections.
As shown in Table 4.3, discrepancies in the concentrations measurements
obtained from the different color channels for both sensors are small and
comparable, which suggests that the calibration procedures and functions
used for both sensors are equally good.
In conclusion, we have realized two versions of a colorimetric water
quality sensor achieving portability, ease-of-use, and cost-effective imple-
mentation by operating in conjunction with smart phones. One sensor is
based on physical attachment to a smart phone and another sensor is based
on a wireless node that communicates to a smart phone through Bluetooth
connection. Water quality measurements made using both sensors are com-
parable to that of standard colorimeters in terms of accuracy and precision.
The results of this work provide the first steps towards creating accessible
and ubiquitous water quality monitoring technologies that could potentially
be used in rural settings or in developing countries.
Going forward, there are still several areas that require future inves-
tigation. As discussed, the performance of the wireless sensor can be easily
79
Chapter 4. Conclusion
80
Bibliography
[1] R. D. Letterman, Water Quality and Treatment: A Handbook of Com-
munity Water Supplies. New York: McGraw-Hill, 5 ed., 1999. → pages
1, 2, 3
[2] U.S. Census Bureau, “Current housing reports, series H150/07, Ameri-
can housing survey for the United States: 2007.” http://www.census.
gov/prod/2008pubs/h150-07.pdf, September 2008. [Online; accessed
16-December-2013]. → pages 1
81
Bibliography
82
Bibliography
[20] S. S. Deeb, “Genetics of variation in human color vision and the retinal
cone mosaic,” Current Opinion in Genetics & Development, vol. 16,
no. 3, pp. 301 – 307, 2006. → pages 16
83
Bibliography
[31] LaMotte Company, “Insta-LINK HOME pool and ppa water test-
ing.” http://www.insta-link.com/poolspa/learn_morehome.html?
tab=2#tabbedpanels1, May 2013. [Online; accessed 01-February-
2014]. → pages 22
84
Bibliography
85
Bibliography
[54] iDevices LLC, “The ultimate gadget for the BBQ lover.” http:
//idevicesinc.com/igrill/, 2014. [Online; accessed 05-February-
2014]. → pages 24
[55] U. Che, C. K. Lao, S.-H. Pun, P. U. Mak, F. Wan, and M.-I. Vai,
“Portable heart rate detector based on photoplethysmography with an-
droid programmable devices,” in Telecommunications and Signal Pro-
cessing (TSP), 2012 35th International Conference on, pp. 605–609,
2012. → pages 24
[57] J. Healey and B. Logan, “Wearable wellness monitoring using ECG and
accelerometer data,” in Wearable Computers, 2005. Proceedings. Ninth
IEEE International Symposium on, pp. 220–221, 2005. → pages 24
86
Bibliography
[58] C.-C. Chan, W.-C. Chou, C.-W. Chen, Y.-L. Ho, Y.-H. Lin, and H.-
P. Ma, “Energy efficient diagnostic grade mobile ECG monitoring,” in
New Circuits and Systems Conference (NEWCAS), 2012 IEEE 10th
International, pp. 153–156, 2012. → pages
[59] Y.-Y. ChenWu, H.-P. Ma, C. Biswas, and D. Markovic, “Universal ar-
chitecture prototype for patient-centric medical environment,” in VLSI
Design, Automation, and Test (VLSI-DAT), 2012 International Sym-
posium on, pp. 1–4, 2012. → pages
[60] B. Yu, L. Xu, and Y. Li, “Bluetooth Low Energy (BLE) based mobile
electrocardiogram monitoring system,” (Shenyang, China), pp. 763 –
767, 2012. → pages 24
[61] A. Sa-ngasoongsong, J. Kunthong, V. Sarangan, X. Cai, and S. T. S.
Bukkapatnam, “A low-cost, portable, high-throughput wireless sen-
sor system for phonocardiography applications,” Sensors, vol. 12,
pp. 10851–10870, August 2012. → pages 24
[62] M. Kozlovszky, L. Bartalis, B. Jokai, J. Ferenczi, P. Bogdanov,
Z. Meixner, L. Nemeth, and K. Karoczkai, “Personal health monitoring
with Android based mobile devices,” in Information Communication
Technology Electronics Microelectronics (MIPRO), 2013 36th Interna-
tional Convention on, pp. 326–330, 2013. → pages 24
[63] W. Z. Khan, Y. Xiang, M. Y. Aalsalem, and Q. Arshad, “Mobile phone
sensing systems: a survey,” IEEE Communications Surveys And Tuto-
rials, vol. 15, no. 1, pp. 402–427, 2013. → pages 24
[64] A. Munawar, A. Masood, and F. Bangash, “Open sensor platform:
Integration of sensors and mobile phones,” in Applied Sciences and
Technology (IBCAST), 2012 9th International Bhurban Conference on,
pp. 445–452, January 2012. → pages 24
[65] Arduino, “Arduino UNO.” http://arduino.cc/en/Main/
ArduinoBoardUno, January 2014. [Online; accessed 30-January-
2014]. → pages 25
[66] BeagleBoard.org, “BeagleBone Black.” http://beagleboard.org/
Products/BeagleBone%20Black, December 2013. [Online; accessed 30-
January-2014]. → pages 25
[67] Wi-Fi Alliance, “Certification — Wi-Fi Alliance,” January 2014. Ac-
cessed: 2014-01-30. → pages 27
87
Bibliography
88