You are on page 1of 100

Colorimetric Water Quality Sensing

with Mobile Smart Phones


by

Samuel Schaefer

B.A.Sc., The University of British Columbia, 2012

A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF


THE REQUIREMENTS FOR THE DEGREE OF

MASTER OF APPLIED SCIENCE

in

THE COLLEGE OF GRADUATE STUDIES

(Electrical Engineering)

THE UNIVERSITY OF BRITISH COLUMBIA


(Okanagan)
April 2014

c Samuel Schaefer, 2014
Abstract
The goal of this thesis is to develop water quality sensors that are
portable, low cost, easy to use, and accurate. Such technology may poten-
tially be beneficial for a significant portion of the world’s population who
use ground water that is neither tested nor treated. We have developed two
versions of a colorimetric water quality sensor using an approach based on
integration with mobile smart phones. Mobile smart phones are advanced
communication devices with features including a touch-based interface, in-
ternet connectivity, and operating systems capable of running application
software (apps). Integration of these features with sensor hardware can yield
a new class of sensors with augmented usability, data mobility, and general
appeal. The first sensor prototype created in this work is based on a sensor
attachment that physically connects to an iPhone smart phone, utilizing the
flash and camera onboard the iPhone to perform colorimetric measurement
of water samples. The second sensor prototype created is based on a col-
orimetric sensor node that wirelessly communicates with an Android smart
phone through Bluetooth connection. Both sensors are capable of measur-
ing pH and the concentrations of chlorine and alkalinity, with accuracy and
precision comparable to industry-standard colorimeters. The distinguishing
features of our prototypes include high portability, operation without in-
struction manuals by interaction with a user through a graphical interface,
high data mobility by exploiting the internet connectivity of smart phones,
and rapid water quality measurements.

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 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

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

1.5.3 Wireless Smart Phone Sensors . . . . . . . . . . . . . 23


1.6 Sensor Prototyping Platforms . . . . . . . . . . . . . . . . . . 24
1.6.1 Microcontroller Architecture . . . . . . . . . . . . . . 24
1.6.2 System-On-Chip Computer Systems . . . . . . . . . . 25
1.7 Wireless Device Communication . . . . . . . . . . . . . . . . 25
1.7.1 Wireless Networking (WiFi) . . . . . . . . . . . . . . . 27
1.7.2 Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.7.3 Additional Communication Standards . . . . . . . . . 28
1.8 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Chapter 2: Smart-Phone-Attached Water Quality Sensor . . 30


2.1 Sensor Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.1 Light Source . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.2 Color Sensor . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.3 Sample Mount . . . . . . . . . . . . . . . . . . . . . . 31
2.2 Reagents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.1 pH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.2 Chlorine . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2.3 Alkalinity . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2.4 Indicator-Bearing Cuvettes . . . . . . . . . . . . . . . 37
2.3 Phone Application Software . . . . . . . . . . . . . . . . . . . 37
2.4 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.4.1 pH Calibration . . . . . . . . . . . . . . . . . . . . . . 41
2.4.2 Chlorine Calibration . . . . . . . . . . . . . . . . . . . 43
2.4.3 Alkalinity Calibration . . . . . . . . . . . . . . . . . . 46
2.5 Measurement Procedure . . . . . . . . . . . . . . . . . . . . . 48
2.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Chapter 3: Wireless Smart Phone Water Quality Sensor . . . 53


3.1 Sensor Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.1.1 Light Source . . . . . . . . . . . . . . . . . . . . . . . 54
3.1.2 Color Sensor . . . . . . . . . . . . . . . . . . . . . . . 54
3.1.3 Microcontroller . . . . . . . . . . . . . . . . . . . . . . 59
3.1.4 Wireless Communication . . . . . . . . . . . . . . . . 59
3.1.5 Power Supply . . . . . . . . . . . . . . . . . . . . . . . 59
3.2 Reagents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.3 Phone Application Software . . . . . . . . . . . . . . . . . . . 61
3.4 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.4.1 pH Calibration . . . . . . . . . . . . . . . . . . . . . . 63
3.4.2 Chlorine Calibration . . . . . . . . . . . . . . . . . . . 66

v
TABLE OF CONTENTS

3.4.3 Alkalinity Calibration . . . . . . . . . . . . . . . . . . 68


3.5 Measurement Procedure . . . . . . . . . . . . . . . . . . . . . 70
3.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

Chapter 4: Conclusion . . . . . . . . . . . . . . . . . . . . . . . . 74

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

vi
List of Tables

Table 1.1 Comparison between Arduino and BeagleBone Proto-


typing Platforms . . . . . . . . . . . . . . . . . . . . . 26

Table 2.1 iPhone 4S Camera Specifications . . . . . . . . . . . . 32


Table 2.2 Best-Fit pH Calibration Functions and Corresponding
R2 Values . . . . . . . . . . . . . . . . . . . . . . . . . 43
Table 2.3 Analytical Functions used to Determine pH . . . . . . 43
Table 2.4 Best-Fit Free Chlorine Calibration Functions and Cor-
responding R2 Values . . . . . . . . . . . . . . . . . . . 45
Table 2.5 Analytical Functions used to Determine Free Chlorine
Concentration . . . . . . . . . . . . . . . . . . . . . . . 45
Table 2.6 Best-Fit Total Chlorine Calibration Functions and Cor-
responding R2 Values . . . . . . . . . . . . . . . . . . . 47
Table 2.7 Analytical Functions used to Determine Total Chlo-
rine Concentration . . . . . . . . . . . . . . . . . . . . 47
Table 2.8 Best-Fit Alkalinity Calibration Functions and Corre-
sponding R2 Values . . . . . . . . . . . . . . . . . . . . 48
Table 2.9 Analytical Functions used to Determine Alkalinity Con-
centration . . . . . . . . . . . . . . . . . . . . . . . . . 50

Table 3.1 Best-Fit pH Calibration Functions and Corresponding


R2 Values . . . . . . . . . . . . . . . . . . . . . . . . . 63
Table 3.2 Analytical Functions used to Determine pH . . . . . . 66
Table 3.3 Analytical Functions used to Determine Free Chlorine
Concentration . . . . . . . . . . . . . . . . . . . . . . . 68
Table 3.4 Analytical Functions used to Determine Total Chlo-
rine Concentration . . . . . . . . . . . . . . . . . . . . 68
Table 3.5 Best-Fit Alkalinity Calibration Functions and Corre-
sponding R2 Values . . . . . . . . . . . . . . . . . . . . 71
Table 3.6 Analytical Functions used to Determine Alkalinity Con-
centration . . . . . . . . . . . . . . . . . . . . . . . . . 71

vii
LIST OF TABLES

Table 4.1 Specifications of Test Strips, the Attached Sensor, the


Wireless Sensor, and the Hach Colorimeter . . . . . . 76
Table 4.2 Performance Comparison between Test Strips, the At-
tached Sensor, the Wireless Sensor, and the Hach Col-
orimeter . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Table 4.3 Analysis of Measurement Error for the Attached and
Wireless Sensors . . . . . . . . . . . . . . . . . . . . . 79

viii
List of Figures

Figure 1.1 The Electromagnetic Radiation Spectrum . . . . . . . 6


Figure 1.2 Spectral Sensitivity of Retinal Cone Cells . . . . . . . 7
Figure 1.3 Wright-Guild Color Matching Experiments and Cor-
responding Color Matching Functions . . . . . . . . . 9
Figure 1.4 CIE XY Z Color Matching Functions . . . . . . . . . 10
Figure 1.5 CIE XY Z Chromaticity Diagram . . . . . . . . . . . 11
Figure 1.6 RGB Color Cube . . . . . . . . . . . . . . . . . . . . 13
Figure 1.7 Color Metamers due to Trichromatic Vision . . . . . 14
Figure 1.8 Opponent Process and the Creation of After-Images . 15
Figure 1.9 Optical Illusion due to Color Constancy . . . . . . . . 16
Figure 1.10 Operation Principle of a Spectrophometer . . . . . . . 17
Figure 1.11 Operation Principle of a Spectrometer and RGB Color
Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 1.12 Bayer Color Filter Arrangement . . . . . . . . . . . . 19
Figure 1.13 Hach DR/890 Colorimeter . . . . . . . . . . . . . . . 21

Figure 2.1Smart-Phone-Attached Sensor Design Overview . . . 30


Figure 2.2Spectrum of the Sensor Light Source . . . . . . . . . 32
Figure 2.3Internal Geometry of the Sensor Attachment . . . . . 34
Figure 2.4Isometric Views of the Smart Phone Sensor Attachment 34
Figure 2.5Smart-Phone-Attached Sensor . . . . . . . . . . . . . 35
Figure 2.6Software Application Design . . . . . . . . . . . . . . 38
Figure 2.7Software Application Measurement Display . . . . . . 40
Figure 2.8Color Gradient Decomposition into RGB Channels . 41
Figure 2.9pH Calibration Data and Best Fit Approximations . . 42
Figure 2.10
Free Chlorine Calibration Data and Best Fit Approx-
imations . . . . . . . . . . . . . . . . . . . . . . . . . 44
Figure 2.11 Total Chlorine Calibration Data and Best Fit Ap-
proximations . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 2.12 Total Alkalinity Calibration Data and Best Fit Ap-
proximations . . . . . . . . . . . . . . . . . . . . . . . 49

ix
LIST OF FIGURES

Figure 2.13 Measurement Steps for the Smart-Phone-Attached Sen-


sor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Figure 3.1 Wireless Smart Phone Sensor Design Overview . . . . 54


Figure 3.2 Sensor Enclosure Design . . . . . . . . . . . . . . . . 55
Figure 3.3 Wireless Sensor Circuit Diagram . . . . . . . . . . . . 56
Figure 3.4 Wireless Sensor Circuit Components and Schematic . 57
Figure 3.5 RGB Color Sensor Spectral Response . . . . . . . . . 58
Figure 3.6 Complete Circuit Mounted into the Enclosure . . . . 60
Figure 3.7 Software Application Title Screens . . . . . . . . . . . 62
Figure 3.8 Software Application Measurement Display . . . . . . 64
Figure 3.9 pH Calibration Data and Best Fit Approximations . . 65
Figure 3.10 Free Chlorine Calibration Data and Best Fit Approx-
imations . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 3.11 Total Chlorine Calibration Data and Best Fit Ap-
proximations . . . . . . . . . . . . . . . . . . . . . . . 69
Figure 3.12 Alkalinity Calibration Data and Best Fit Approxima-
tions . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Figure 3.13 Measurement Steps for the Wireless Smart Phone
Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Figure 3.14 Image of Wireless Smart Phone Water Quality Sensor 73

Figure 4.1 Four Colorimetric Water Quality Sensors . . . . . . . 75

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

Then we who are alive, who are left,


will be caught up together with them in the clouds to meet the Lord in the air,
and so we will always be with the Lord.
1. Thessalonians 4, 17

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

surement and are capable of quantifying commonly-used water quality pa-


rameters including pH, chlorine concentration, and alkalinity. The first-
generation prototype is based on a physical attachment to a smart phone
and the second-generation prototype is based on a sensor node that can
wirelessly interface to any smart phone. The distinguishing features of our
prototypes include high portability (both fit into the palm of a hand), op-
eration without instruction manuals by interaction with a user through a
graphical interface, high data mobility by exploiting the internet connectiv-
ity of smart phones, and rapid colorimetric water quality measurements with
sensitivity and accuracy comparable to that of commercially-available col-
orimeters. The prototypes can potentially be used to monitor water quality
parameters relevant for water consumption or recreational use.

1.1 Water Quality Measurement


Generally, water quality is determined by the presence of entities in
water that are harmful to human health. In this section, we will discuss
water quality in terms of contaminants that are either biological or chemical
in nature, and introduce standard methods to quantify the presence of these
contaminants.

1.1.1 Biological Contaminants


Biological contaminants include pathogenic micro-organisms such as
bacteria, protozoa, viruses, and algae that can cause illness and death in
humans [1]. Biological contamination is often caused by industrial, agricul-
tural, and domestic run-off entering the water supply. This form of con-
tamination is measured based on selected indicator micro-organisms, whose
presence is quantified through a multi-stage process that involves water sam-
ple collection, incubation, and enumeration. A water sample is incubated in
a medium that is selectively nutritious to a particular indicator organism.
Over the course of days, single cells multiply into entire colonies, which can
then be counted by visual inspection. Based on the number of colonies, it
is possible to indirectly determine the concentration of the indicator micro-
organism in the original water sample. While this method is relatively simple
and cost-effective, the incubation period required to grow the sample is on
the order of several days. There are currently no viable technologies that
can enable rapid, on-site measurement of biological contaminants, although
some recent research progress suggests the possibility of direct visualization

2
1.1. Water Quality Measurement

of individual micro-organisms using automated high-power microscopes and


computer algorithms [4–8].

1.1.2 Chemical Contaminants


Chemical (or inorganic) contaminants can have negative long-term
human health effects in addition to adverse effects in industrial and house-
hold settings through equipment damage. Chemical contaminants include
carcinogens, metals (such as copper, iron, arsenic, and manganese), nitrates
(fertilizer by-products), and treatment by-products (such as chloramines)
[1]. Some chemical indicators, such as pH, hardness, and turbidity, can also
be used as indirect indicators of biological contamination. In contrast to
indirect methods for measuring biological contaminants, chemical contami-
nants can be measured directly due to their homogenous distribution, dis-
tinguishable chemical attributes, and well-established measurement physics.
Chemical contaminants can be measured using a variety of instruments,
which we have categorized into those based on chromatography, electrode
measurement, or radiation measurement. Instruments that measure chemi-
cal contamination in water vary dramatically in terms of cost, accuracy, and
portability.

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

concentrator, and analysis algorithms, can be highly automated and perform


rapid measurements. However, due to the complex nature of the system, it
is very expensive and requires careful sample preparation and highly trained
personnel. The system is also very bulky due to a large array of complimen-
tary components.

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

photo-sensitive measurement of a water sample. To overcome this limita-


tion, indicator solutions can be added to a water sample to produce a char-
acteristic color change due to the presence of a particular chemical species.
The concentration of the targeted species can then be quantified based on
the magnitude of color change. Due to the availability of color indicators
for a wide range of water quality parameters, light-based measurement is a
very powerful and versatile tool for water quality determination and will be
used here to realize an inexpensive, portable, and easy-to-use water quality
sensor.

1.2 Color Theory


1.2.1 What is Color?
Although the concept of color is intuitive to nearly all humans, it
can be difficult to answer seemingly simple questions about color (“what is
color?”, “how is color generated?”, “how is color measured?”) without an
appreciation of color theory. Color describes an aspect of visual perception
related to the sensitivity of the eye to different spectral components (wave-
lengths) of light. Figure 1.1 shows the electromagnetic spectrum, of which
light visible to the human eye occupies a very small range. The visible light
spectrum spans a range of colors including indigo (≈390 nm), blue (≈410
nm), green (≈520 nm), yellow (≈580 nm), and red (≈680 nm). A particular
color can be a single spectral component or a combination of components
with different intensities (a spectrum).

1.2.2 Color Vision


The most ubiquitous type of color detector is the human eye. Vi-
sion relies on two types of light-sensitive cells located on the retina. Rods,
which are very sensitive in low-light environments but cannot detect col-
ors, and cones, which are responsible for color perception. Different colors
are distinguished based on the response of three types of cones, giving rise
to tristimulus vision. The three types of cones are distinguished by their
pigments which predominantly absorb one of three colors: reds (long wave-
lengths), greens (medium wavelengths), and blues (short wavelengths). The
illumination response of the cone cells is shown in Fig. 1.2. Nerve impulses
from the cones are sent to the brain, which can then distinguish roughly 10
million colors [11].

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Å

λ 700 nm 600 nm 500 nm 400 nm

Figure 1.1: The electromagnetic spectrum spans frequencies from low-


frequency radio waves to high-frequency gamma radiation. Only a small
fraction of this spectrum from 4.0 × 1014 Hz to 7.9 × 1014 Hz is visible to
the human eye.

1.2.3 Color Models


Between 1928 and 1932, the first experiments were conducted by
Wright and Guild in an attempt to quantify every perceptible color in terms
of three primary colors [13–15]. In these experiments, shown in Fig. 1.3(a),
a light spot was created from the combination of three primary monochro-
matic lights - a red light centered at a wavelength of 700.0 nm, a green light
centered at 546.1 nm, and a blue light centered at 435.8 nm - and presented
to an observer. The intensities of the primary lights were adjusted until the
observer determined that the combined light spot had a color exactly match-
ing the color of a light spot from a monochromatic test lamp. The resulting
color matching functions (CMF) obtained from these first experiments are
shown in Fig. 1.3(b). Interestingly, these results revealed that a negative
intensity value of the red primary was required to match certain colors (neg-
ative intensity values for the red primary were obtained by adding red to the
monochromatic test lamp in order to desaturate it and make a color match
possible [16]). This implied that not all visible colors could be created by
the addition of three primary monochromatic lights. Nevertheless, these ex-
periments lead to the first color model, assigning to each perceptible color
three values defining the relative intensities of the primaries (where one of
the values could be negative).
In 1931, the International Commission on Illumination (CIE) released

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]).

a curved line describing pure monochromatic wavelengths of light and a


straight line, known as the line of purples, describing colors that can be
created as a combination of other colors, but do not have a wavelength
associated with them. All colors within the gamut can be created as a
combination of colors. A color outside the gamut cannot be perceived by
the human eye. The XY Z color model was the first of many color models.
Other color models have been developed to better represent human vision.
For example, the L* a* b* color model consists of two chromaticity values
(a and b) and a lightness value (L).

1.2.4 Color Spaces


While an absolute color model maps out all colors in terms of a set
of primaries (such as the CIE XY Z colour model presented in the previous
section), it is possible to delineate a subset of colors, known as a color space,
within a color gamut by selecting a set of primary colors. Color spaces are
useful because in any practical application it is necessary to use real physical
primary colors, as opposed to the artificial colors that define the entire the
color gamut. A well-known color space is the RGB color space, based on the

9
1.2. Color Theory

1.5
tristimulus values

0.5

0
400 500 600 700
wavelength (nm)

Figure 1.4: The XY Z tristimulus color matching functions describe the


hypothetical tristimulus response of an observer to three primary artificial
light sources X, Y , and Z. These primaries are not physically realizable,
but are rather mathematical constructs designed to produce only-positive
color matching functions.

10
1.2. Color Theory

Figure 1.5: When the XY Z color model is normalized according to Eqns.


1.5 and 1.6, a two-dimensional chromaticity diagram is formed. The locus
of the diagram is the limit of the human color gamut. All of values within
the locus include colors that can be synthesized by addition of the three
primaries X, Y , and Z. The numbers along the curved edge correspond to
single units of wavelengths in nm.

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.

1.3 Color Measurement


Although human vision is color sensitive, factors such as color met-
amers, opponent process, color constancy, and color blindness make color
measurement by human vision subjective and error-prone. Objective color
quantification can be achieved using devices based on photo-sensitive elec-
tronic components (including photodiodes, photoresistors, and photomulti-
pliers), which produce electrical signals proportional to incident light inten-
sity. These devices can be broadly classified into those based on spectroscopy
and colorimetry. The former describes absolute color quantification based
on intensity measurement as a function of wavelength. The latter describes
relative color quantification in terms of the relative intensity of color sub-
components, often with connection to the tristimulus response of the human
eye.

1.3.1 Limitations of Human Color Perception


Color Metamers
Color perception in the human eye is based on the integrated spectral
response of three cone types, which leads to a loss of spectral information.
As a result, two distinct spectra can be perceived as identical colors. This is

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.

shown in Fig.1.7, where the yellow produced by a pure monochromatic light


source appears identical to the yellow produced from a computer monitor,
which is actually a combination of red, green, and blue primary colors.

Opponent Process Theory


Most humans perceive four colors to be naturally pure: red, yellow,
green, and blue. If these four colors are arranged in a conventional color
wheel, all the colors in between these four are a result of mixing either red
with yellow, yellow with green, green with blue, or blue with red. Inter-
estingly, it is impossible for the human mind to visualize a red-green or a

14
1.3. Color Measurement

Figure 1.8: The opponent process in human vision can be demonstrated


by looking at the black spot on the left for 30 seconds and then focussing
on the black spot on the right. A number of colors will appear adjacent
to the black spot on the right for a short time. This illusion is a result of
the response of the eye, which subtracts the colors seen previously from the
white background, giving the appearance of the opponent colors.

blue-yellow color mixture. This led to the development of Hering’s opponent


process theory [18]. According to this theory, nerve impulses from the cones
are pre-processed before being sent to the brain. This encoding process (1)
combines all of the cone responses as brightness values, (2) subtracts the long
cone response from the sum of the short and medium cone responses (red-
green opponent signal) and (3) subtracts the short cone response from the
sum of the long and medium cone responses (blue-yellow opponent signal)
[16]. Figure 1.8 demonstrates how the opponent process in human vision
can create after-images of different colors. Another result of this process is
that opponent colors used together will appear brighter than when they are
used individually. A red color on top of a green color will appear to be a
stronger red than a red color on top of a white color. This process can lead
to incorrect color perception by the human eye.

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

Figure 1.9: The effect of color constancy is demonstrated by comparing


squares A and B. Square A appears to be a much darker gray than square
B. In reality, the color of both squares is identical. The human brain adjusts
to the shade in the scene and assumes square B to be a white square due to
the surrounding scene.

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

Figure 1.10: The spectrophotometer relies on a monochromator (such as


prism or grating) to selecting a single color. Part of the single-color light in-
teracts with a sample and the other part is used as a reference. The intensity
of both components is measured using a photo-sensitive detector and used
to quantify the absorbance of the sample. By repeating this measurement
over a wide range of colors, the complete absorption spectrum of the sample
is measured.

tral measurements can be performed using either a spectrophotometer or a


spectrometer. The former works by illuminating a sample with a variable
single-wavelength light source and measuring the reflected/transmitted light
intensity as a function of wavelength (as shown in Fig.1.10). The latter works
by illuminating a sample with a white light source, dispersing the spectral
components of the reflected/transmitted light using a prism or grating, and
measuring the intensity as a function of wavelength using a photodiode ar-
ray (as shown in Fig. 1.11). In both cases, the intensity of light that has
interacted with a sample is measured as a function of wavelength.

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

Figure 1.11: Operation principles of a spectrometer and RGB color sensor.


(a) A spectrometer spatially decomposes light into its spectral components
using a prism or grating), which are then directed onto a large photodiode
array that outputs the spectral intensity distribution of incident light. (b)
The RGB sensor measures the relative intensities of the red, green, and blue
components of incident light, using photodiode pixels covered with either
red, green, or blue color filters. The RGB sensor mimics the tristimulus
color response of the human eye.

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.

1.4 Colorimetric Water Quality Sensor


In this work, we have chosen colorimetric measurements as the basis
of a portable, cost-effective water quality sensor. Although spectral mea-
surement provides the most rigorous means to quantify color, devices such
as spectrophotometers and spectrometers are expensive, bulky, and gen-
erally confined to operation in laboratory settings. Colorimetric measure-
ments, on the other hand, can be implemented into highly portable devices
consisting of cost-effective optoelectronic components. Currently, there are
several commercially available colorimeters capable of water quality mea-
surements. The most popular version is the one manufactured by Hach,

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.

1.5 Smart Phone Sensors


Smart phones are advanced cellular phones that run operating sys-
tems capable of high-level computational tasks such as downloading and
running mobile application software (apps), internet browsing, and emailing.
In late 2012, the number of smart phones in operation worldwide surpassed
one billion, and last year alone, another one billion smart phones were sold.
Smart phones are broadly classified by their operating system, with the
vast majority of smart phones currently using Google’s Android operating
system (81%), followed by Apple’s iOS operating system (13%), and then
Microsoft’s Windows operating system (4%). Due to the rising popularity
of apps and the open accessibility of app development tools, there has been
a growing trend in industry and academia towards the development of sen-
sors integrated with smart phones to leverage their portability, connectivity,
ease-of-use, and ubiquity [22, 23]. In this section, we will survey several ap-
proaches for developing smart phone sensors, parsing past works into those
based on software implementation, physical sensor attachment, and wireless

20
1.5. Smart Phone Sensors

Figure 1.13: The Hach DR/890 is an industry-standard colorimeter used for


water quality measurements. The colorimeter can measure over 60 water
quality parameters using standard methods described in the accompanying
handbook.

21
1.5. Smart Phone Sensors

sensor nodes.

1.5.1 Software-Based Smart Phone Sensors


One approach to realizing a sensor based on smart phones is to write
software applications (apps) that use sensors already integrated onto smart
phones to perform measurements. There are a large number of commercially
available applications that can be downloaded (through online vendors such
as Google Play for Android devices or the App Store for Apple devices) to
transform smart phones into portable sensors. Pelegris et al. created an
application that monitors the heart rate of a user by analyzing the color
change of a finger placed on the camera [24, 25]. Delaney et al. developed a
microfluidic sensor to measure chemiluminescence by using the camera of a
smart phone in conjunction with a paper-based chip [26]. For applications in
tele-medicine, Martinez et al. built an application to capture an image of an
assay and to tag it with relevant information. The image can subsequently
be sent electronically to health-care professionals for analysis [27]. Lopez-
Ruiz et al. designed a portable sensor to detect gaseous oxygen levels based
on an illuminated membrane placed over the smart phone camera [28]. A
variety of smart-phone-based colorimetric sensors have also been realized
for water quality measurement. For validating the effectiveness of water
disinfection, Copperwhite et al. developed a UV dosimeter that uses a
smart phone to take color images of a colorimetric sensing substrate [29].
Similarly, Shen et al. created a smart-phone-based pH meter by taking
color images of pH reagent test strips [30]. A commercially available app by
the company LaMotte also operates on the same principle [31]. Recently,
Sumriddetchkajorn et al. developed an app that enables measurement of
chlorine concentration by imaging a water sample mixed with a colorimetric
reagent [32].
Generally, software-based smart phone sensors are easy to imple-
ment and have a low cost of distribution. However, they have a couple
significant disadvantages. First, the sensing hardware is located inside the
smart phone and cannot be accessed or modified. Available literature on the
performance specifications of sensors integrated into smart phones is sparse,
making it difficult to predict the accuracy and precision of the sensor mea-
surements. Second, this type of sensor suffers from limited environmental
control. Measurements are typically performed in open environments and
can be detrimentally affected by ambient light, heat, noise, or vibrations.

22
1.5. Smart Phone Sensors

1.5.2 Smart Phone Sensor Attachments


An alternative route to realizing smart phone sensors is based on cus-
tom hardware attachments physically interfaced to a phone. One common
approach is to construct the attachment with all the necessary hardware
to perform measurements and then wire the attachment to a smart phone
to enable control of the attachment. For example, the company Oscium
Analyzers has recently released an oscilloscope, a spectrum and logic ana-
lyzer, and a power meter that operate by connection to the serial port of
the iPhone or iPad [33]. Other examples of sensors interfaced with smart
phones through the serial port include blood glucose monitors developed by
Sanofi [34] and pH meters developed by Sensorex [35]. Moreover, a wide
range of smart phone sensor attachments have been designed for connection
through the 3.5 mm audio input/output port (which is universal to nearly
all mobile devices and has analog input capabilities). This includes credit
card readers [36] and oximeters [37, 38].
Smart phone sensor attachments have also been developed to aug-
ment the measurement capability of components already integrated onto
the smart phone. For example, the camera in most smart phones can be
vastly improved by using additional external optical components. Breslauer
et al. first demonstrated that a camera phone (a precursor to the smart
phone) can be used as a portable microscope by mounting a microscope
objective in front of the camera [39]. A research group from UCLA has
created a clip-on device containing a lens and illumination optics to real-
ize a high-magnification fluorescence microscope [40] and a flow cytometer
[41]. Recent work from this group has also demonstrated clip-on devices
to enable virus detection [42], blood analysis [43], allergen testing [44], and
urine analysis [45]. Lee et al. developed a phone-based DNA detector by
attaching a custom-built sample holder, including an excitation light source
and emission filter, to the back end of a mobile phone [46]. Sumriddetchka-
jorn et al. created a colorimetric water quality sensor to quantify chlorine
concentration based on holding a smart phone to an aperture in the sensor
and capturing images of a water sample mounted against a white back-
ground [47]. Several crowd-funding projects have been proposed based on
lens attachments to smart phones to enhance imaging capabilities [48–50].

1.5.3 Wireless Smart Phone Sensors


Smart phone sensors that require a physical attachment are specific
to the dimensions and specifications of current smart phone models. Due

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.

1.6 Sensor Prototyping Platforms


Smart phone sensors generally require on-board or embedded com-
putation to collect, store, analyze, or transmit sensor data. Depending on
the amount of processing required, several prototyping platforms with vary-
ing capabilities can be used. In this section, we will discuss prototyping
platforms based on simple microcontroller units (MCU) and more powerful
system-on-chip (SOC) computer systems.

1.6.1 Microcontroller Architecture


Microcontroller units (MCU) account for the majority of embedded
electronic systems and are ideal for applications that require low data rates
and simple calculations. They generally consist of a microprocessor capable
of simple computational tasks and a number of interfaces, input and output
(I/O) pins, displays, and sensors. While MCUs have been in use for several

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.

1.6.2 System-On-Chip Computer Systems


System-on-chip (SOC) systems are suited for applications that re-
quire on-board computation to perform more intensive tasks such as signal
processing at high data rates, video acquisition, image processing, high-
bandwidth communication, and user interaction. SOCs are basically entire
computer systems on a single chip capable of running an operating system.
Compared to the MCU development process, the SOC development process
is significantly longer due to increased hardware and software integration
and includes time-intensive tasks such as customization of the hardware
system components, boot optimization, kernel development, and applica-
tion development. Recent developments in open-source integrated hardware
and software systems have led to the proliferation of single-board computing
systems. One of the most popular low-cost SOC options is the BeagleBone
prototyping platform. The BeagleBone system includes a central processor
with on-board RAM and ethernet, USB, HDMI, and general purpose I/O
pins [66]. Add-on hardware allows for the integration of camera systems,
wireless connectivity, motor control, touch-screen technology, and external
storage. Software development resources are open-source and readily avail-
able. Table 1.1 outlines some of the specifications of a typical Beaglebone
platform.

1.7 Wireless Device Communication


Wireless connection protocols and standards have been developed
in the last few years for general use in electronic devices. In this section,

25
1.7. Wireless Device Communication

Table 1.1: Comparison of specifications for the Arduino microcontroller and


BeagleBone embedded computer system.

Arduino Beaglebone Black

Processor ATmega 328 ARM Cortex - A8


Clock Speed 16 MHz 1 GHz
RAM 2 Kbyte 512 Mbyte
Flash Storage 32 Kbyte 2 GByte
Input/Output 14 GPIO, 6 Analog 69 GPIO
Operating System -- Linux
USB -- 1
Ethernet -- 10/100
Video -- Mini-HDMI
Power Consumption 0.15 W 1.5 W
Cost $30 $45
Size 53 mm x 75 mm 55 mm x 90 mm

26
1.7. Wireless Device Communication

we will review the most widely used wireless standards applicable for device
communication.

1.7.1 Wireless Networking (WiFi)


Wireless LAN (WLAN) is the most widely used wireless connection
standard. The WLAN standard is based on the IEEE 802.11 standard,
which runs at frequencies of 2.4 GHz and 5 GHz. Hardware that quali-
fies for certification bears the trademark WiFi [67]. A WiFi connection
allows multiple devices to be connected to a wireless access point (hotspot
or router). WiFi is most commonly used to connect consumer electronic
devices to local networks, which can then access the internet. Due to price
reduction of wireless LAN chipsets over the last few years, wireless access
is now ubiquitous for a large number of devices. WiFi is very well suited
for high data rates and the latest official standard supports speed up to
600 MBits/second. The range of WiFi devices can be up to several hun-
dred meters, with this upper bound set by each country’s radiative power
restrictions. In order to guarantee secure transmission of data between de-
vices several encryption technologies are available, including the password
protected Wireless Equivalent Privacy (WEP) standard and, more recently,
the WiFi Protected Access II (WPA2) [67, 68]. Although powerful, the main
limitations of WiFi hardware include high power consumption and complex
infrastructure requirements.

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

power consumption [70], which is attractive for mobile devices running on


batteries.

1.7.3 Additional Communication Standards


Another wireless standard is the IEEE 802.15.4 wireless standard.
The aim of this standard is to facilitate simple, low power, and low data
rate communication between sensors and devices. Implementations include
ZigBee and WirelessHART. Devices operate at 2.4 GHz and are connected
in mesh networks, also known as Wireless Personal Area Networks (WPAN).
Although these systems can connect a vast array of devices (up to 65,000),
they are prone to interference and power consumption is higher than that
of Bluetooth Low Energy systems.
Radio broadcasting is one of the oldest forms of wireless communi-
cation. There are two bands: the AM band (500 kHZ to 1600 kHz in North
America) and the FM band (87.0 MHz to 108 MHz in North America).
The frequencies in these bands are licensed. The benefits of radio include
very long range (up to 100’s km) and simple receiver architecture, but the
large transmitter infrastructure, cost, low data rate makes it unattractive
for mobile device applications.
Mobile communication protocols have evolved as the use of mobile
phones has expanded. Global System for Mobile Communication (GSM) has
been a very common set of standards used for mobile phone communication.
To meet consumer demand of higher data rates and to enable data access
on phones, new standards have evolved to allow faster and more secure
communication. Examples include 3G, 4G, and the latest LTE networks.
The satellite communication system is another system that can be
used to transmit information. Two-way satellite communication allows de-
vices to send and receive data using satellite communication. For sensor
applications this is largely impractical due to high power consumption, high
cost of implementation, and maintenance. However, as a result of the in-
novations in chip design, many consumer devices now come with one way
satellite communication in the form of GPS. GPS is a very powerful tool
as it allows very precise location measurements. When implemented onto a
sensor, it allows for geo-tagging of measurements, a useful feature for many
sensing applications.

28
1.8. Thesis Outline

1.8 Thesis Outline


The goal of this thesis is to develop a portable, easy-to-use, low-cost
colorimetric water quality sensor that enables a user to make measurements
of multiple water quality parameters immediately at the point of sampling.
To achieve this goal, the water quality sensor will leverage the computation
power, connectivity, and intuitive display of mobile smart phones. In Chap-
ter 2, we describe our first-generation water quality sensor based on a hard-
ware attachment and a custom software application designed for the iPhone
4S. In Chapter 3, we describe our second-generation water quality sensor
based on a sensor node and a custom software application that can wire-
lessly interface through Bluetooth to any Android device. Both water quality
sensors are capable of measuring pH, chlorine concentration, and alkalinity
with accuracy and precision comparable to industry-standard colorimeters.
In the Conclusion, we compare the specifications and measurement capabil-
ities of our water quality sensor prototypes to two commercially available
colorimetric water quality sensors: a high-tech colorimeter and low-tech test
strips.

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

2.1 Sensor Hardware

The basic hardware components of the sensor include a light source, a


sample mount, and a color-sensitive camera. Because the sensor will be
used in conjunction with a smart phone, an elegant method to minimize the
sensor power consumption is to employ the flash light source and camera
already integrated onto the smart phone. Given this constraint, the critical
component of the sensor is the sample mount, which must be designed to
securely fasten to the smart phone in a way such that the flash and camera
can be used for controlled and repeatable colorimetric measurement of water
samples.

2.1.1 Light Source


The sensor uses the flash onboard an iPhone for the light source. The
operating system on the iPhone only allows the flash to be used at either low
or high brightness levels. The light source is a light emitting diode (LED)
producing white light. Although the color appears relatively white to the
human eye, the spectrum of the light is not uniformly distributed over the
visible spectrum, as shown in Fig. 2.2. The spectral distribution peaked in
the blue is common for white LEDs, which consist of a diode emitting blue
light and fluorescent phosphors emitting green and red light upon excitation
with blue light.

2.1.2 Color Sensor


The sensor uses the camera onboard an iPhone for color determination.
Use of the integrated camera eliminates the need for external electronic
hardware. The specifications of the camera are listed in Table 2.1. Note
that the camera has features such as exposure compensation, auto-focus, and
white balance compensation which mimic the human eye but are detrimental
for objective color quantification.

2.1.3 Sample Mount


Figures 2.3 and 2.4 show the top and isometric views, respectively,
of the designed sample mount. To provide a light-tight enclosure to per-
form light intensity measurements, the sample mount is constructed from
an opaque black plastic. The sample mount slides over the top of an iPhone
4 or 4S like a sleeve, with the bulk of the mount covering the top portion of

31
2.1. Sensor Hardware

Figure 2.2: Spectral measurement of the light emitted from the LED inte-
grated onto the iPhone 4S.

Table 2.1: Specifications of the camera integrated on the iPhone 4S.


Resolution 8 Megapixel
Pixel Size 1.4 µm
Image Size 3264 x 2448
Aperture Size f/2.4
Sensor Size 1/3.2 ”
Focal Length 35 mm
Autofocus Yes
Exposure Compensation Yes
White Balance Compensation Yes

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

mirror water sample


mirror inside cuvette

diffuser

iPhone flash iPhone camera


iPhone
(light source) (sensor)

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

pH indicator is phenol red, which ranges from yellow at a pH of 6.5 to pink


at a pH of 8.5.

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

2.2.4 Indicator-Bearing Cuvettes


In this work, we will we use commercially available powdered indi-
cators for pH, chlorine, and alkalinity which are pre-filled into disposable
plastic cuvettes (supplied from LaMotte Inc.). The amount of indicator in
each cuvette is designed to produce an observable color change when mixed
with a 3 mL water sample. The content of the vials are proprietary, but
are based on the chemical reactions described above. To correlate the color
response of the indicators to the species concentration, the sensor will be
calibrated with standard samples having known concentrations.

2.3 Phone Application Software


We next discuss the application software to enable operation of the
sensor. All software applications developed for the iPhone (and other mobile
Apple devices) are made for the iOS operating system. Apple has released
the Xcode software development kit to allow developers to create, test, and
distribute software through the Apple App Store. For our sensor, the soft-
ware provides a platform for user interaction, allowing the user to control
the sensor, obtain measurements, and view results. In the background, the
software analyzes and converts the data captured by the camera into a mea-
surement of species concentration.
The software app for the sensor has been designed to provide an in-
tuitive, easy-to-use interface on the iPhone’s touch-based screen. When the
app has been initiated, it will prompt the user with a list of water qual-
ity parameters which can be selected by touching its labeled button. After
selection of a particular parameter, the app then guides the user through
the measurement process in two user-initiated steps: a first step to ensure
that the sensor is attached to the phone and a second step in which the
sample is inserted into the mount and the measurement is performed. The
screenshots corresponding to these steps are shown in Fig. 2.6. An inter-
nal algorithm, which will be described below, computes a measurement of
the desired parameter and displays the result both numerically and on an
animated scale with an indicator arrow. Examples of measurement results
for the four different types of parameters are shown in Fig. 2.7. After the
measurement result has been displayed, the user can immediately initiate
another measurement using the button labeled “MEASURE” located above
the displayed result. The navigation bar at the top of the app also allows
the user to quickly navigate back to the title screen containing the list of
parameters to perform a measurement of another parameter. At any point

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

Figure 2.7: Upon successful completion of the measurement, the concen-


tration of the selected water quality parameter is displayed along with an
animated color bar that indicates the position of the measurement relative
to the overall range of the sensor. Example screenshots from the software
application are shown for all four parameters.

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.

quires a sufficient number of measurements to resolve sharp transitions. To


minimize errors due to the camera itself, the calibration is performed using
normalized values of the red (R), green (G), and blue (B) channels given by

R = Rmeas − Rref , (2.1)

G = Gmeas − Gref , (2.2)


and
B = Bmeas − Bref , (2.3)
where the subscript “ref” corresponds to channel measurements without
the water sample in the reference step of the algorithm and the subscript
“meas” corresponds to channel measurements with the water sample in the
measurement step of the algorithm.

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

Figure 2.9: Intensity variations of the R, G, and B channels as a function of


the pH of standard solutions, along with lines of best fit.

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

Table 2.2: Calibration of the smart-phone-attached 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 = −4.81 × [pH] + 65.17 0.371
Green Channel G = −109.81 × [pH] + 738.52 0.985
Blue Channel B = 44.57 × [pH] − 414.91 0.978

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.

Table 2.3: Analytical functions used by the software algorithm to calculate


pH based on the green and blue channels. The final pH measurement is
based on a weighted average of the pH measurements from the green and
blue channels.
Analytical Function
Green Channel pHgreen = −0.0091 × G + 6.73
Blue Channel pHblue = 0.022 × B + 9.31
pH = 0.7 × pHgreen + 0.3 × pHblue

2.4.2 Chlorine Calibration


For swimming pool water, the desired chlorine concentration range is
1-4 mg/L. To distinguish free and total chlorine, therefore, the sensor should
be capable of detecting chlorine concentrations over the range 1-7 mg/L.
We thus prepare 9 standard solutions having chlorine concentrations varying
from 1 to 9 mg/L. The solutions are created by diluting sodium hypochlorite
(NaClO) in Type 1 ultra-pure filtered water. The chlorine concentration
in the standard solutions are verified using an iodometric titration. The
standard solutions can be used to calibrate the sensor for both free and

43
2.4. Calibration

Figure 2.10: Intensity variations of the R, G, and B channels as a function


of the free chlorine concentration of standard solutions, along with lines of
best fit.

total chlorine concentrations.

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

Table 2.4: Calibration of the smart-phone-attached sensor for measurement


of free chlorine concentration, [Clf ree ]. Best fit functions and corresponding
R2 for the R, B, and G channels as a function of [Clf ree ].
Model R2
Red Channel R = 0.12 × [Clf ree ] + 0.41 0.011
Green Channel G = −24.05 × [Clf ree ] − 4.59 0.974
Blue Channel B = −9.582 × [Clf ree ] + 14.58 0.972

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.

Table 2.5: Analytical functions used by the software algorithm to calculate


free chlorine concentration based on the green and blue channels. The final
free chlorine concentration is based on a weighted average of the chlorine
concentrations from the green and blue channels.
Analytical Function
Green Channel F Cgreen = −0.0416 × G − 0.191
Blue Channel F Cblue = −0.104 × B + 1.52
F C = 0.5 × F Cgreen + 0.5 × F Cblue

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

Figure 2.11: Intensity variations of the R, G, and B channels as a function


of the total chlorine concentration of standard solutions, along with lines of
best fit.

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.

2.4.3 Alkalinity Calibration

Alkalinity is generally defined as the equivalent concentration of calcium


carbonate (CaCO3 ). However, calcium carbonate is not soluble in water and
precipitates at room temperature when the concentration exceeds 15 mg/L.
As a work around, we use sodium carbonate (Na2 CO3 ), which has better
water solubility, to create standard solutions with known alkalinity. To de-
termine the alkalinity of the standard solutions in terms of the concentration

46
2.4. Calibration

Table 2.6: Calibration of the smart-phone-attached sensor for measurement


of total chlorine concentration, [Cltotal ]. Best fit functions and corresponding
R2 for the R, B, and G channels as a function of [Cltotal ].
Model R2
Red Channel R = −0.047 × [Cltotal ] + 33.94 0.003
Green Channel G = −19.20 × [Cltotal ] − 16.93 0.9647
Blue Channel B = −9.62 × [Cltotal ] + 13.89 0.981

Table 2.7: Analytical functions used by the software algorithm to calculate


total chlorine concentration based on the green and blue channels. The final
total chlorine concentration is based on a weighted average of the chlorine
concentrations from the green and blue channels.
Analytical Function
Green Channel T Cgreen = −0.052 × G − 0.882
Blue Channel T Cblue = −0.104 × B + 1.44
T C = 0.5 × T Cgreen + 0.5 × T Cblue

47
2.5. Measurement Procedure

Table 2.8: Calibration of the smart-phone-attached sensor for measurement


of alkalinity concentration, [Alk]. Best fit functions and corresponding R2
for the R, B, and G channels as a function of [Alk].
Model R2
Red Channel R = −1.046 × [Alk] + 16.75 0.988
Green Channel G = −0.404 × [Alk] + 12.52 0.992
Blue Channel B = 0.458 × [Alk] − 91.42 0.970

of calcium carbonate, we use the relation

[CaCO3 ] [Na2 CO3 ]


= (2.4)
MCaCO3 MNa2 CO3

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.

2.5 Measurement Procedure


We will now discuss the entire measurement procedure (outlined in
Fig. 2.13) using the water quality sensor developed in this Chapter. The
measurement procedure consists of 12 steps: (1) the attachment is pushed
onto the iPhone and the app is initiated; (2) a parameter is selected for
measurement from the app title screen; (3) after ensuring that the mount

48
2.5. Measurement Procedure

Figure 2.12: Intensity variations of the R, G, and B channels as a function


of the alkalinity of standard solutions, along with lines of best fit.

49
2.6. Conclusion

Table 2.9: Analytical functions used by the software algorithm to calculate


alkalinity concentration based on the red, green, and blue channels. The
final alkalinity concentration is based on a weighted average of the alkalinity
concentrations from the red, green, and blue channels.
Analytical Function
Red Channel Alkred = −0.956 × R + 16.02
Green Channel Alkgreen = −2.474 × G + 30.97
Blue Channel Alkblue = 2.183 × B + 199.6
Alk = 0.35 × Alkred + 0.5 × Alkgreen + 0.15 × Alkblue

is closed, START is selected to capture a reference measurement; (4) the


cuvette lid is removed from the attachment; (5) the cuvette lid is inserted
onto a cuvette, which breaks the seal on the cuvette; (6) the cuvette is
filled with water using a dropper inserted into the lid opening; (7) filling the
cuvette up to the rim of the lid yields exactly 3 mL; (8) the cuvette is inverted
to mix the sample; (9) the cuvette is inserted back into the attachment;
(10) the cuvette lid clicks into position to indicate good alignment; (11)
MEASURE is selected to perform the measurement; and (12) the color of
the water sample is measured and correlated through calibration functions
to the concentration of the selected parameter, which is displayed on screen.

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

Wireless Smart Phone 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 wireless connection and custom-written applica-
tion software. The key difference between the prototype described in the
previous Chapter and the one described here is that water quality measure-
ments are made by a stand-alone sensor node that can wirelessly connect
to any device (phone, tablet, or computer) through a Bluetooth connection.
The sensor node will contain all necessary hardware to perform colorimetric
measurement and wireless communication. The sensor node will be fully
automated and controlled by the user on a mobile device through a soft-
ware application. In this Chapter we have chosen to interface the sensor
with an Android smart phone. We have chosen to use an Android smart
phone, as opposed to an iPhone which was used in the previous Chapter,
due to the overwhelming popularity of Android devices. The key conceptual
components of the sensor are shown in Fig. 3.1.

3.1 Sensor Hardware


The critical component of the sensor is the wireless sensor node. As
shown in Fig. 3.2, the sensor case is constructed from a black opaque plas-
tic to provide a light-tight enclosure to perform colorimetric measurement.
The case is light weight and has dimensions of 50 mm × 70 mm × 110 mm.
The sensor contains a square slot that accommodates the same colorimetric
reagent cuvettes used in the previous Chapter. On one side of the slot is
a light source that illuminates the water sample. On the other side of the
slot is a color sensor to detect the color of the light transmitted through
the water sample. In addition to basic components to perform colorimet-
ric measurement, the sensor node contains a suite of off-the-shelf electronic
components that enable data processing, data transmission, and commu-

53
3.1. Sensor Hardware

light source water sample color sensor microcontroller wireless interface

wireless interface data analysis result display

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.

nication with a mobile smart phone. Details of the electronic components


are shown in Figs. 3.3 and 3.4. The system can be broadly classified ac-
cording to four components: a microcontroller that controls all components,
optical components to perform colorimetric measurement, a communication
component to wirelessly interface with a smart phone, and a power system
to enable battery operation and battery charging. In this section, we will
describe the details of each of these components.

3.1.1 Light Source


The light source is a diffused white light-emitting diode (LED). As
mentioned in the previous Chapter, white LEDs do not provide a broad
visible spectrum (like that of sunlight). However, LEDs are extremely energy
efficient and available at low cost. A diffused LED is used, as opposed to
a directional LED, to broaden the illumination angle and provide greater
illumination uniformity. The alignment of the LED is critical due to the
compact size of the colorimetric setup and the narrow acceptance angle of
the color sensor. Once the LED has been mounted, it is affixed with optical
glue to prevent further movement.

3.1.2 Color Sensor


Color measurement is performed using a RGB color sensor (Avago
Technologies, model: HDJD-S822-QR999). There are several advantages
to using a color sensor for colorimetric measurement as opposed to a color
camera, which was used in the previous Chapter. First, color sensors require

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

Figure 3.4: Diagram of the circuit with component names.

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

Figure 3.5: Response of the three color channels of the HDJD-S822-QR999


sensor.

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.

3.1.4 Wireless Communication


Communication between the sensor node and smart phone is per-
formed through a wireless connection. A Bluetooth connection is suitable
for this application due to the low data rates needed for this application.
Moreover, a Bluetooth connection has the advantages of low power con-
sumption, compatibility with a wide range of mobile devices, and a simple
setup (no routing hardware is required and communication is direct). The
Bluetooth chipset used in our system is the JY-MCU module. The module is
designed to operate as a class 2 device (≈ 10 m range) under the Bluetooth
V2.0 standard. Because the Bluetooth module operates at a logic level of
3.3 V, while the MCU operates at a logic level of 5 V, a logic level converter
(which up-converts signals from the Bluetooth module from 3.3 V to 5 V
and down-converts signals from the MCU from 5 V to 3.3 V) is used to
interface the two systems.

3.1.5 Power Supply


The sensor node requires additional electronics to provide portable
power to the device for extended periods of time. We have incorporated a
rechargeable lithium polymer 1000 mAh battery (model: PRT-00339) into
the electronics of the sensor. When the battery is fully charged, a boost
converter (model: PRT-10255) allows the circuit to fully run from battery
power. The boost converter ensures a consistent supply voltage and turns
off when the battery is empty. We have also included a micro USB charging
circuit (model: PRT-10217) that allows the user to charge the battery when

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

3.3 Phone Application Software


The phone application software performs two main functions: 1) it
analyzes raw data from the sensor and 2) it provides a touch-based interface
for the user. Because the colorimetric measurements do not depend on
the hardware of the smart phone, the sensor node can operate with any
smart phone model running the phone application software. For our initial
prototype, we have chosen an Android-based Samsung Galaxy S2 smart
phone.
When the phone application is launched on the phone, it first checks
to ensure that the phone is a Bluetooth-enabled device. The application im-
mediately ceases if the phone does not have Bluetooth connectivity. Once
the software has confirmed Bluetooth connectivity, a title screen is displayed
consisting of a list of measurable parameters and a button labeled “Con-
nect”, which initiates an attempt by the phone to establish a connection
with the sensor node. Prior to establishing the Bluetooth connection, all
buttons on the title screen are inactive except for the “Connect” button.
Once the user initiates a connection, the application enables the Bluetooth
radio on the phone and searches for the device. The application assumes
that the sensor has previously been paired with the phone and the Bluetooth
device name and PIN are hard-coded into the application. A connection re-
quest is sent from the phone to the sensor. When the phone and sensor
have been successfully connected, the phone sends out a request to the sen-
sor node to perform a reference measurement. This reference measurement
is made with no sample in place and relayed back to the phone. The connec-
tion sequence and reference measurement are performed in the background
without any input from the user and usually take 1-2 seconds. Figure 3.7
shows screenshots of the title screen before and after connection with the
sensor node. Once the sensor has been connected, the “Connect” button
changes to a “Connected” button and the buttons for the water quality
parameters are activated.
After connection with the sensor node, the user can perform water
quality measurements by selecting a desired parameter from the title screen.
One the parameter is selected, the app sends a measurement request to the
sensor node. The sensor, upon receiving the request, turns on the LED light,
waits 200 ms and then performs 10 sensor readings over a 1 second period.
The average voltage signals from the red, green, and blue channels are calcu-
lated and sent to the phone. The phone application receives the three values,
calculates the corresponding parameter value based pre-determined calibra-
tion curves, and then displays the resulting concentration numerically and

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

graphically. Some example screenshots of measurement results displayed by


the app are shown in Fig. 3.8.

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

Figure 3.8: Upon successful completion of the measurement, the concen-


tration of the selected water quality parameter is displayed along with an
animated color bar that indicates the position of the measurement relative
to the overall range of the sensor. Example screenshots from the software
application are shown for all four parameters.

64
3.4. Calibration

Figure 3.9: Intensity variations of the R, G, and B channels as a function of


the pH of standard solutions, along with lines of best fit.

65
3.4. Calibration

Table 3.2: Analytical functions used by the software algorithm to calculate


pH based on the red and green channels. The final pH measurement is
based on a weighted average of the pH measurements from the red and
green channels.
Analytical Function
Red Channel pHred = 0.044 × R + 8.08
Green Channel pHgreen = 0.0096 × G + 6.18
pH = 0.55 × pHred + 0.45 × pHgreen

3.4.2 Chlorine Calibration


To calibrate the wireless sensor for chlorine, 11 standard solutions
having chlorine concentrations varying from 0 to 10 mg/L are prepared.
When the standard solutions are mixed with the reagent-bearing cuvettes,
the observed color of the water sample ranges from clear for lower chlorine
concentrations to a strong pink for higher chlorine concentrations.

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

Figure 3.10: Intensity variations of the R, G, and B channels as a function


of the free chlorine concentration of standard solutions.

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

Table 3.3: Analytical functions used by the software algorithm to calculate


free chlorine concentration based on the red, green, and blue channels. The
final free chlorine concentration is based on a weighted average of the free
chlorine concentrations from the red, green, and blue channels.
Analytical Function R2
R+37.51
Red Channel F Cred = −0.34 + 1.75 × e 29.13 0.954
G−25.74
Green Channel F Cgreen = 0.33 + 0.68 × e 73.99 0.990
B−109.47
Blue Channel F Cblue = −0.29 + 5.04 × e 84.66 0.995
F C = 0.2 × F Cred + 0.4 × F Cgreen + 0.4 × F Cblue

Table 3.4: Analytical functions used by the software algorithm to calculate


total chlorine concentration based on the red, green, and blue channels. The
final total chlorine concentration is based on a weighted average of the total
chlorine concentrations from the red, green, and blue channels.
Analytical Function R2
R+2.93
Red Channel T Cred = −0.28 + 6.96 × e 27.51 0.996
G−63.66
Green Channel T Cgreen = 0.41 + 0.95 × e 62.30 0.987
B−14.60
Blue Channel T Cblue = −0.073 + 1.27 × e 68.73 0.992
T C = 0.3 × T Cred + 0.3 × T Cgreen + 0.4 × T Cblue

the phone-attached sensor.

3.4.3 Alkalinity Calibration


To calibrate the wireless sensor for alkalinity, 11 standard solutions
with alkalinity ranging from 0-200 mg/L CaCO3 are prepared. Figure 3.9
displays the normalized red, green, and blue channels measured by the wire-
less sensor as a function of alkalinity. We fit the data from the blue channel
with a single linear function and the data from the red and green channels
with piecewise linear functions that have been broken into two segments.
The linear fit functions are shown in Table 3.5, and the corresponding ana-
lytical functions used by the software to determine alkalinity are shown in

68
3.4. Calibration

Figure 3.11: Intensity variations of the R, G, and B channels as a function


of the total chlorine concentration of standard solutions.

69
3.5. Measurement Procedure

Figure 3.12: Intensity variations of the R, G, and B channels as a function


of the alkalinity concentration of standard solutions, along with lines of best
fit.

Table 3.6.

3.5 Measurement Procedure


We will now discuss the entire measurement procedure (outlined in
Fig. 3.13) using the wireless water quality sensor developed in this Chapter.
Operation of the sensor consists of 10 steps. (1) First, the app on the smart
phone is initiated and the smart phone connects to the sensor after the
user touches the “Connect” button on the title screen. The wireless sensor
node must be turned on and the smart phone Bluetooth adapter enabled
to establish a connection. (2) After establishing a connection, the user
removes the cuvette lid from the sensor. (3) The cuvette lid is inserted over
the cuvette, piercing the seal on the reagent-bearing cuvette. (4) A sample
of water is added to the cuvette through the opening in the lid. (5) The
cuvette is filled with water until the meniscus level reaches the bottom of
the lid, indicating 3 mL. (7) The cuvette is inverted to mix the water sample

70
3.6. Conclusion

Table 3.5: Calibration of the wireless sensor for measurement of alkalinity,


[Alk]. Best fit functions and corresponding R2 for the R, B, and G channels
as a function of [Alk].
Model R2
Red Channel (0-80 mg/L) R1 = 1.34 × [Alk] − 10.10 0.983
Red Channel (80-200 mg/L) R2 = 0.31 × [Alk] + 73.99 0.937
Green Channel (0-80 mg/L) G1 = 1.18 × [Alk] + 14.84 0.956
Green Channel (80-200 mg/L) G2 = 0.32 × [Alk] + 84.41 0.954
Blue Channel (0-200 mg/L) B = −0.43 × [Alk] + 123.76 0.934

Table 3.6: Analytical functions used by the software algorithm to calculate


alkalinity concentration based on the red, green, and blue channels. The
final alkalinity concentration is based on a weighted average of the alkalinity
concentrations from the red, green, and blue channels.
Analytical Function
Red Channel (0-80 mg/L) AlkRed1 = 0.74 × R + 7.51
Red Channel (80-200 mg/L) AlkRed2 = 3.20 × R − 237.03
Green Channel (0-80 mg/L) Alkgreen1 = 0.85 × G − 12.58
Green Channel (80-200 mg/L) Alkgreen2 = 3.09 × G − 260.57
Blue Channel Alkblue = −2.33 × B + 288.51
Alk = Wred × Alkred + Wgreen × Alkgreen + Wblue × Alkblue

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

Battery Life - - 2 months 6 months


Meas. Duration (sec)b 30 45 35 120
a
Number of parameters can be extended.
b
Measurement time includes reagent mixing and corresponds to the measurement of one parameter.

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

Table 4.2: Estimated accuracy and precision of pH measurements made


using test strips, the phone-attached water quality sensor, the wireless water
quality sensor, and a Hach DR/890 colorimeter.
Average Error Precision of
of pH Measurements pH Measurements
Test Strips 0.56 0.4
Attached Sensor 0.09 0.15
Wireless Sensor 0.13 0.15
Colorimeter 0.23 0.1

provide pH measurements with accuracy and precision comparable to that


of the pH measurements made with the colorimeter. Based on the limited
data of this test, the phone-attached sensor provides the most accurate pH
measurements, followed by the wireless sensor, and the colorimeter.
We next examine the source of measurement errors for the phone-
attached and wireless sensors. Based on the tests described above with the
three test solutions with varying pH, we analyze the behavior of two types of
data from the sensors: 1) raw R, G, and B values obtained under reference
measurement conditions when no sample cuvette is in place and 2) normal-
ized R, G, and B values obtained under measurement conditions when the
filled sample cuvette is in place. As shown in Table 4.3, under reference
measurement conditions the raw color data from the phone-attached sensor
shown much larger variations than the raw color data from the wireless sen-
sor. This is due to white-balancing, exposure compensation, and automatic
focussing inherent to the camera onboard the iPhone, which re-adjusts the
camera settings for each reference measurement. Normalizing the R, G, and
B values largely eliminates this source of error for the phone-attached sen-
sor, which explains the dramatic reduction in the variation of the color data
under measurement conditions. Color data from the wireless sensor, on the
other hand, exhibit low variation under reference measurement conditions
and relatively high variation under measurement conditions. The low vari-
ation under reference measurement conditions is due to the stability of the
color sensor chip. The high variation under measurement conditions is due
to the sensitivity of colorimetric setup. The active area of the color sen-
sor is approximately 1 mm2 , which measures color corresponding to a very

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 (%)

Avg. Std. Dev.


1.21 0.40
with 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

improved by incorporating diffusing elements or lenses into the path between


the light source and the color sensor, which would reduce the sensitivity of
the measurement. The power consumption of the wireless sensor can also be
improved by using a more energy efficient Bluetooth implementation (such
as the new Bluetooth Low Energy Standard) and by optimizing the circuit
with custom-built electronics. Future work should also extend the number
of measurable parameters and include those parameters that are relevant
for water contamination by industrial and agricultural processes such as
turbidity, nitrates, and metals.

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

[3] Environment Canada, “2011 Municipal water use report:


Municipal water use 2009 statistics.” http://ec.gc.ca/
Publications/B77CE4D0-80D4-4FEB-AFFA-0201BE6FB37B%
5C2011-Municipal-Water-Use-Report-2009-Stats_Eng.pdf, 2011.
[Online; accessed 16-December-2013]. → pages 1

[4] S. Schaefer, S. A. Boehm, and K. J. Chau, “Automated, portable, low-


cost bright-field and fluorescence microscope with autofocus and au-
toscanning capabilities,” Applied Optics, vol. 51, pp. 2581–2588, May
2012. → pages 3

[5] J. Selinummi, J. Seppala, O. Yli-Harja, and J. Puhakka, “Software


for quantification of labeled bacteria from digital microscope images
by automated image analysis,” Biotechniques, vol. 39, pp. 859–863,
December 2005. → pages

[6] M. R. Lamprecht, D. M. Sabatini, and A. E. Carpenter,


“CellProfilerTM : Free, versatile software for automated biological image
analysis,” Biotechniques, vol. 42, pp. 71–75, January 2007. → pages

[7] L. Shamir, J. D. Delaney, N. Orlov, D. M. Eckley, and I. G. Goldberg,


“Pattern recognition software and techniques for biological image anal-
ysis,” PLOS Computational Biology, vol. 6, November 2010. → pages

81
Bibliography

[8] L. L. Drey, M. C. Graber, and J. Bieschke, “Counting unstained, conflu-


ent cells by modified bright-field microscopy,” Biotechniques. → pages
3

[9] D. A. Skoog, D. M. West, and J. F. Holler, Analytical Chemistry - An


Introduction. Philadelphia: Sauders College Publishing, 5 ed., 1990. →
pages 3

[10] D. C. Harris, Exploring Chemical Analysis. New York: W.H. Freeman


and Company, 4 ed., 2009. → pages 4

[11] R. W. G. Hunt, Reproduction of Colour. The Atrium, Southern Gate,


Chichester, West Sussex PO19 8SQ, England: John Wiley & Sons Ltd,
6 ed., 2004. → pages 5

[12] A. Stockman, D. I. A. MacLeod, and N. E. Johnson, “Spectral sensitiv-


ities of the human cones,” J. Opt. Soc. Am. A, vol. 10, pp. 2491–2521,
Dec 1993. → pages 7

[13] W. D. Wright, “A trichromatic colorimeter with spectral primaries,”


Transactions of the Optical Society, vol. 29, no. 5, p. 225, 1928. →
pages 6

[14] W. D. Wright, “A re-determination of the trichromatic coefficients of


the spectral colours,” Transactions of the Optical Society, vol. 30, no. 4,
p. 141, 1929. → pages 9

[15] J. Guild, “The colorimetric properties of the spectrum,” Philosophical


Transactions of the Royal Society of London. Series A, Containing Pa-
pers of a Mathematical or Physical Character, vol. 230, pp. pp. 149–187,
1932. → pages 6, 9

[16] M. D. Fairchild, Color Appearance Models. New York: Wiley, 3 ed.,


2013. → pages 6, 9, 15

[17] CIE - The International Commission on Illumination, “Selected


colorimetric tables.” http://www.cie.co.at/index.php/LEFTMENUE/
index.php?i_ca_id=298, 2014. [Online; accessed 07-January-2014]. →
pages 9

[18] E. Hering, Outlines of a Theory of the Light Sense. Cambridge: Harvard


University Press, 1 ed., 1964. → pages 15

82
Bibliography

[19] B. Wong, “Points of view: Colour blindness,” Nature Methods, vol. 8,


no. 6, p. 441, 2011. → pages 16

[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

[21] S. S. Deeb, “The molecular basis of variation in human color vision,”


Clinical Genetics, vol. 67, no. 5, pp. 369–377, 2005. → pages 16

[22] P. Daponte, L. De Vito, F. Picariello, and M. Riccio, “State of the art


and future developments of measurement applications on smartphones,”
Measurement, vol. 46, pp. 3291–3307, November 2013. → pages 20

[23] A. Ozcan, “Mobile phones democratize and cultivate next-generation


imaging, diagnostics and measurement tools,” Lab Chip, pp. –, 2014.
→ pages 20

[24] P. Pelegris, K. Banitsas, T. Orbach, and K. Marias, “A novel method


to detect heart beat rate using a mobile phone,” in Engineering in
Medicine and Biology Society (EMBC), 2010 Annual International
Conference of the IEEE, pp. 5488–5491, August 2010. → pages 22

[25] Azumio Inc., “Instant heart rate.” https://play.google.com/store/


apps/details?id=si.modula.android.instantheartrate&hl=en,
March 2012. [Online; accessed 31-January-2014]. → pages 22

[26] J. L. Delaney, C. F. Hogan, J. Tian, and W. Shen, “Electrogenerated


chemiluminescence detection in paper-based microfluidic sensors,” An-
alytical Chemistry, vol. 83, no. 4, pp. 1300–1306, 2011. → pages 22

[27] A. W. Martinez, S. T. Phillips, E. Carrilho, S. W. Thomas, III, H. Sindi,


and G. M. Whitesides, “Simple telemedicine for developing regions:
Camera phones and paper-based microfluidic devices for real-time, off-
site diagnosis,” Analytical Chemistry, vol. 80, pp. 3699–3707, May 2008.
→ pages 22

[28] N. López-Ruiz, A. Martı́nez-Olmos, I. P. de Vargas-Sansalvador,


M. Fernández-Ramos, M. Carvajal, L. Capitan-Vallvey, and A. Palma,
“Determination of O2 using colour sensing from image processing with
mobile devices ,” Sensors and Actuators B: Chemical, vol. 171172, no. 0,
pp. 938 – 945, 2012. → pages 22

83
Bibliography

[29] R. Copperwhite, C. McDonagh, and S. O’Driscoll, “A camera phone-


based UV-dosimeter for monitoring the solar disinfection (SODIS) of
water,” Sensors Journal, IEEE, vol. 12, pp. 1425–1426, May 2012. →
pages 22

[30] L. Shen, J. A. Hagen, and I. Papautsky, “Point-of-care colorimetric


detection with a smartphone,” Lab Chip, vol. 12, pp. 4240–4243, 2012.
→ pages 22

[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

[32] S. Sumriddetchkajorn, K. Chaitavon, and Y. Intaravanne, “Mobile


device-based self-referencing colorimeter for monitoring chlorine con-
centration in water,” Sensors And Actuators B-Chemical, vol. 182,
pp. 592–597, June 2013. → pages 22

[33] Dechnia LLC, “Portable test tools.” http://www.oscium.com/, 2013.


[Online; accessed 03-February-2014]. → pages 23

[34] Sanofi Group, “iBGStar


R
blood glucose meter.” http://www.bgstar.
com/web/products/ibgstar/ibgstar, 2014. [Online; accessed 05-
February-2014]. → pages 23

[35] Sensorex, “PH- 1 pH meter for iPhone R


, iPod R
, & iPad
R
.” http:
//www.sensorex.com/products/more/ph1_iphone_pH_meter, 2014.
[Online; accessed 05-February-2014]. → pages 23

[36] Paypal Inc., “PayPal Here: credit card reader.” https://www.paypal.


com/webapps/mpp/credit-card-reader?bn_r=m, 2014. [Online; ac-
cessed 03-February-2014]. → pages 23

[37] J. Hudson, S. M. Nguku, J. Sleiman, W. Karlen, G. A. Dumont, C. L.


Petersen, C. B. Warriner, and J. M. Ansermino, “Usability testing of a
prototype phone oximeter with healthcare providers in high- and low-
medical resource environments,” Anaesthesia, vol. 67, no. 9, pp. 957–
967, 2012. → pages 23

[38] Lionsgate Technologies Inc., “Mobile vital signs monitoring: Everyone,


everywhere,” tech. rep., Lionsgate Technologies Inc., March 2013. →
pages 23

84
Bibliography

[39] D. N. Breslauer, R. N. Maamari, N. A. Switz, W. A. Lam, and D. A.


Fletcher, “Mobile phone based clinical microscopy for global health
applications,” PLOS ONE, vol. 4, July 2009. → pages 23

[40] H. Zhu, O. Yaglidere, T.-W. Su, D. Tseng, and A. Ozcan, “Cost-


effective and compact wide-field fluorescent imaging on a cell-phone,”
Lab Chip, vol. 11, pp. 315–322, 2011. → pages 23

[41] H. Zhu, S. Mavandadi, A. F. Coskun, O. Yaglidere, and A. Ozcan,


“Optofluidic fluorescent imaging cytometry on a cell phone,” Analytical
Chemistry, vol. 83, no. 17, pp. 6641–6647, 2011. → pages 23

[42] Q. Wei, H. Qi, W. Luo, D. Tseng, S. J. Ki, Z. Wan, Z. Göröcs, L. A.


Bentolila, T.-T. Wu, R. Sun, and A. Ozcan, “Fluorescent imaging of
single nanoparticles and viruses on a smart phone,” ACS Nano, vol. 7,
no. 10, pp. 9147–9155, 2013. → pages 23

[43] H. Zhu, I. Sencan, J. Wong, S. Dimitrov, D. Tseng, K. Nagashima, and


A. Ozcan, “Cost-effective and rapid blood analysis on a cell-phone,”
Lab Chip, vol. 13, pp. 1282–1288, 2013. → pages 23

[44] A. F. Coskun, J. Wong, D. Khodadadi, R. Nagi, A. Tey, and A. Ozcan,


“A personalized food allergen testing platform on a cellphone,” Lab
Chip, vol. 13, pp. 636–640, 2013. → pages 23

[45] A. F. Coskun, R. Nagi, K. Sadeghi, S. Phillips, and A. Ozcan, “Albumin


testing in urine using a smart-phone,” Lab Chip, vol. 13, pp. 4231–4238,
2013. → pages 23

[46] D. Lee, W. P. Chou, S. H. Yeh, P. J. Chen, and P. H. Chen, “DNA de-


tection using commercial mobile phones,” Biosensors & Bioelectronics,
vol. 26, pp. 4349–4354, July 2011. → pages 23

[47] S. Sumriddetchkajorn, K. Chaitavon, and Y. Intaravanne, “Mobile-


platform based colorimeter for monitoring chlorine concentration in
water,” Sensors and Actuators B: Chemical, vol. 191, no. 0, pp. 561
– 566, 2014. → pages 23

[48] V. Chalenko, “Beastgrip. Universal lens adapter for most camera


phones.” https://www.kickstarter.com/projects/107650693/
beastgrip-universal-lens-adapter-for-most-camera-p?ref=
live, November 2013. [Online; accessed 05-February-2014]. → pages
23

85
Bibliography

[49] T. Larson, “Micro Phone Lens: cell phone based micro-


scope.” https://www.kickstarter.com/projects/968523355/
micro-phone-lens-cell-phone-based-microscope?ref=live,
September 2013. [Online; accessed 05-February-2014]. → pages

[50] S. Johnston, “TURN-I-KIT a Lens adapter for your iPhone 5


& 5S.” https://www.kickstarter.com/projects/864119060/
turn-i-kit-a-lens-adapter-for-your-iphone-5-and-5s?ref=
live, February 2014. [Online; accessed 05-February-2014]. → pages 23

[51] Woodman Labs Inc., “HERO3+ Black Edition — Wi-Fi enabled


— Most advanced HD GoPro ever.” http://gopro.com/cameras/
hd-hero3-black-edition, February 2014. [Online; accessed 05-
February-2014]. → pages 24

[52] Nikon Inc., “WU-1a wireless mobile adapter.” http://www.


nikonusa.com/en/Nikon-Products/Product/Wireless/27081/
WU-1a-Wireless-Mobile-Adapter.html?cid=prt-0512-wu1a, 2014.
[Online; accessed 05-February-2014]. → pages 24

[53] Apple Inc., “Run or workout with Nike + iPod.” http://www.apple.


com/ca/ipod/nike/, 2014. [Online; accessed 05-February-2014]. →
pages 24

[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

[56] P. S. Kumar, S. Oh, P. Rai, H. Kwon, N. Banerjee, and V. K. Varadan,


“Design and implementation of a Bluetooth-based band-aid pulse rate
sensor,” in Nanosensors, Biosensors, And Info-Tech Sensors And Sys-
tems 2011 (Varadan, VK, ed.), vol. 7980 of Proceedings of SPIE, 2011.
→ 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

[68] “IEEE Standard for Information technology–Telecommunications and


information exchange between systems Local and metropolitan area
networks–Specific requirements Part 11: Wireless LAN Medium Access
Control (MAC) and Physical Layer (PHY) Specifications,” IEEE Std
802.11-2012 (Revision of IEEE Std 802.11-2007), pp. 1–2793, March
2012. → pages 27

[69] Bluetooth Special Interest Group, “Specification of the Bluetooth sys-


tem,” Bluetooth Specification Version 3.0 + HS, pp. 1–1712, April 2009.
→ pages 27

[70] Bluetooth Special Interest Group, “Specification of the Bluetooth sys-


tem,” Bluetooth Specification Version 4.1, pp. 1–2684, December 2013.
→ pages 28

[71] D. L. Harp, “Current technology of chlorine analysis for wa-


ter and wastewater.” http://www.hach.com/cms-portals/hach_com/
cms/documents/pdf/LIT/L7019-ChlorineAnalysis.pdf, 2002. →
pages 36

88

You might also like