UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Colorimetric water quality sensing with mobile smart phones Schaefer, Samuel 2014

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata


24-ubc_2014_spring_schaefer_samuel.pdf [ 11.79MB ]
JSON: 24-1.0074338.json
JSON-LD: 24-1.0074338-ld.json
RDF/XML (Pretty): 24-1.0074338-rdf.xml
RDF/JSON: 24-1.0074338-rdf.json
Turtle: 24-1.0074338-turtle.txt
N-Triples: 24-1.0074338-rdf-ntriples.txt
Original Record: 24-1.0074338-source.json
Full Text

Full Text

Colorimetric Water Quality Sensingwith Mobile Smart PhonesbySamuel SchaeferB.A.Sc., The University of British Columbia, 2012A THESIS SUBMITTED IN PARTIAL FULFILLMENT OFTHE REQUIREMENTS FOR THE DEGREE OFMASTER OF APPLIED SCIENCEinTHE COLLEGE OF GRADUATE STUDIES(Electrical Engineering)THE UNIVERSITY OF BRITISH COLUMBIA(Okanagan)April 2014c© Samuel Schaefer, 2014AbstractThe goal of this thesis is to develop water quality sensors that areportable, low cost, easy to use, and accurate. Such technology may poten-tially be beneficial for a significant portion of the world’s population whouse ground water that is neither tested nor treated. We have developed twoversions of a colorimetric water quality sensor using an approach based onintegration with mobile smart phones. Mobile smart phones are advancedcommunication devices with features including a touch-based interface, in-ternet connectivity, and operating systems capable of running applicationsoftware (apps). Integration of these features with sensor hardware can yielda new class of sensors with augmented usability, data mobility, and generalappeal. The first sensor prototype created in this work is based on a sensorattachment that physically connects to an iPhone smart phone, utilizing theflash and camera onboard the iPhone to perform colorimetric measurementof water samples. The second sensor prototype created is based on a col-orimetric sensor node that wirelessly communicates with an Android smartphone through Bluetooth connection. Both sensors are capable of measur-ing pH and the concentrations of chlorine and alkalinity, with accuracy andprecision comparable to industry-standard colorimeters. The distinguishingfeatures 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.iiPrefaceThis work was done under the supervision of Dr. Kenneth Chau atthe School of Engineering in The University of British Columbia. This thesiswas 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 capstonedesign project completed with Yannick Letailleur and Aurelien Schilles.iiiTable of ContentsAbstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iiPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iiiTable of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . ivList of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viiList of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ixAcknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . xiDedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiChapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . 11.1 Water Quality Measurement . . . . . . . . . . . . . . . . . . . 21.1.1 Biological Contaminants . . . . . . . . . . . . . . . . . 21.1.2 Chemical Contaminants . . . . . . . . . . . . . . . . . 31.2 Color Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2.1 What is Color? . . . . . . . . . . . . . . . . . . . . . . 51.2.2 Color Vision . . . . . . . . . . . . . . . . . . . . . . . 51.2.3 Color Models . . . . . . . . . . . . . . . . . . . . . . . 61.2.4 Color Spaces . . . . . . . . . . . . . . . . . . . . . . . 91.3 Color Measurement . . . . . . . . . . . . . . . . . . . . . . . . 121.3.1 Limitations of Human Color Perception . . . . . . . . 121.3.2 Spectrophotometry . . . . . . . . . . . . . . . . . . . . 161.3.3 Colorimetry . . . . . . . . . . . . . . . . . . . . . . . . 171.4 Colorimetric Water Quality Sensor . . . . . . . . . . . . . . . 191.5 Smart Phone Sensors . . . . . . . . . . . . . . . . . . . . . . . 201.5.1 Software-Based Smart Phone Sensors . . . . . . . . . . 221.5.2 Smart Phone Sensor Attachments . . . . . . . . . . . 23ivTABLE OF CONTENTS1.5.3 Wireless Smart Phone Sensors . . . . . . . . . . . . . 231.6 Sensor Prototyping Platforms . . . . . . . . . . . . . . . . . . 241.6.1 Microcontroller Architecture . . . . . . . . . . . . . . 241.6.2 System-On-Chip Computer Systems . . . . . . . . . . 251.7 Wireless Device Communication . . . . . . . . . . . . . . . . 251.7.1 Wireless Networking (WiFi) . . . . . . . . . . . . . . . 271.7.2 Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . 271.7.3 Additional Communication Standards . . . . . . . . . 281.8 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . 29Chapter 2: Smart-Phone-Attached Water Quality Sensor . . 302.1 Sensor Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 312.1.1 Light Source . . . . . . . . . . . . . . . . . . . . . . . 312.1.2 Color Sensor . . . . . . . . . . . . . . . . . . . . . . . 312.1.3 Sample Mount . . . . . . . . . . . . . . . . . . . . . . 312.2 Reagents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.2.1 pH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.2.2 Chlorine . . . . . . . . . . . . . . . . . . . . . . . . . . 362.2.3 Alkalinity . . . . . . . . . . . . . . . . . . . . . . . . . 362.2.4 Indicator-Bearing Cuvettes . . . . . . . . . . . . . . . 372.3 Phone Application Software . . . . . . . . . . . . . . . . . . . 372.4 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392.4.1 pH Calibration . . . . . . . . . . . . . . . . . . . . . . 412.4.2 Chlorine Calibration . . . . . . . . . . . . . . . . . . . 432.4.3 Alkalinity Calibration . . . . . . . . . . . . . . . . . . 462.5 Measurement Procedure . . . . . . . . . . . . . . . . . . . . . 482.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Chapter 3: Wireless Smart Phone Water Quality Sensor . . . 533.1 Sensor Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 533.1.1 Light Source . . . . . . . . . . . . . . . . . . . . . . . 543.1.2 Color Sensor . . . . . . . . . . . . . . . . . . . . . . . 543.1.3 Microcontroller . . . . . . . . . . . . . . . . . . . . . . 593.1.4 Wireless Communication . . . . . . . . . . . . . . . . 593.1.5 Power Supply . . . . . . . . . . . . . . . . . . . . . . . 593.2 Reagents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603.3 Phone Application Software . . . . . . . . . . . . . . . . . . . 613.4 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633.4.1 pH Calibration . . . . . . . . . . . . . . . . . . . . . . 633.4.2 Chlorine Calibration . . . . . . . . . . . . . . . . . . . 66vTABLE OF CONTENTS3.4.3 Alkalinity Calibration . . . . . . . . . . . . . . . . . . 683.5 Measurement Procedure . . . . . . . . . . . . . . . . . . . . . 703.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Chapter 4: Conclusion . . . . . . . . . . . . . . . . . . . . . . . . 74Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81viList of TablesTable 1.1 Comparison between Arduino and BeagleBone Proto-typing Platforms . . . . . . . . . . . . . . . . . . . . . 26Table 2.1 iPhone 4S Camera Specifications . . . . . . . . . . . . 32Table 2.2 Best-Fit pH Calibration Functions and CorrespondingR2 Values . . . . . . . . . . . . . . . . . . . . . . . . . 43Table 2.3 Analytical Functions used to Determine pH . . . . . . 43Table 2.4 Best-Fit Free Chlorine Calibration Functions and Cor-responding R2 Values . . . . . . . . . . . . . . . . . . . 45Table 2.5 Analytical Functions used to Determine Free ChlorineConcentration . . . . . . . . . . . . . . . . . . . . . . . 45Table 2.6 Best-Fit Total Chlorine Calibration Functions and Cor-responding R2 Values . . . . . . . . . . . . . . . . . . . 47Table 2.7 Analytical Functions used to Determine Total Chlo-rine Concentration . . . . . . . . . . . . . . . . . . . . 47Table 2.8 Best-Fit Alkalinity Calibration Functions and Corre-sponding R2 Values . . . . . . . . . . . . . . . . . . . . 48Table 2.9 Analytical Functions used to Determine Alkalinity Con-centration . . . . . . . . . . . . . . . . . . . . . . . . . 50Table 3.1 Best-Fit pH Calibration Functions and CorrespondingR2 Values . . . . . . . . . . . . . . . . . . . . . . . . . 63Table 3.2 Analytical Functions used to Determine pH . . . . . . 66Table 3.3 Analytical Functions used to Determine Free ChlorineConcentration . . . . . . . . . . . . . . . . . . . . . . . 68Table 3.4 Analytical Functions used to Determine Total Chlo-rine Concentration . . . . . . . . . . . . . . . . . . . . 68Table 3.5 Best-Fit Alkalinity Calibration Functions and Corre-sponding R2 Values . . . . . . . . . . . . . . . . . . . . 71Table 3.6 Analytical Functions used to Determine Alkalinity Con-centration . . . . . . . . . . . . . . . . . . . . . . . . . 71viiLIST OF TABLESTable 4.1 Specifications of Test Strips, the Attached Sensor, theWireless Sensor, and the Hach Colorimeter . . . . . . 76Table 4.2 Performance Comparison between Test Strips, the At-tached Sensor, the Wireless Sensor, and the Hach Col-orimeter . . . . . . . . . . . . . . . . . . . . . . . . . . 78Table 4.3 Analysis of Measurement Error for the Attached andWireless Sensors . . . . . . . . . . . . . . . . . . . . . 79viiiList of FiguresFigure 1.1 The Electromagnetic Radiation Spectrum . . . . . . . 6Figure 1.2 Spectral Sensitivity of Retinal Cone Cells . . . . . . . 7Figure 1.3 Wright-Guild Color Matching Experiments and Cor-responding Color Matching Functions . . . . . . . . . 9Figure 1.4 CIE XY Z Color Matching Functions . . . . . . . . . 10Figure 1.5 CIE XY Z Chromaticity Diagram . . . . . . . . . . . 11Figure 1.6 RGB Color Cube . . . . . . . . . . . . . . . . . . . . 13Figure 1.7 Color Metamers due to Trichromatic Vision . . . . . 14Figure 1.8 Opponent Process and the Creation of After-Images . 15Figure 1.9 Optical Illusion due to Color Constancy . . . . . . . . 16Figure 1.10 Operation Principle of a Spectrophometer . . . . . . . 17Figure 1.11 Operation Principle of a Spectrometer and RGB ColorSensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Figure 1.12 Bayer Color Filter Arrangement . . . . . . . . . . . . 19Figure 1.13 Hach DR/890 Colorimeter . . . . . . . . . . . . . . . 21Figure 2.1 Smart-Phone-Attached Sensor Design Overview . . . 30Figure 2.2 Spectrum of the Sensor Light Source . . . . . . . . . 32Figure 2.3 Internal Geometry of the Sensor Attachment . . . . . 34Figure 2.4 Isometric Views of the Smart Phone Sensor Attachment 34Figure 2.5 Smart-Phone-Attached Sensor . . . . . . . . . . . . . 35Figure 2.6 Software Application Design . . . . . . . . . . . . . . 38Figure 2.7 Software Application Measurement Display . . . . . . 40Figure 2.8 Color Gradient Decomposition into RGB Channels . 41Figure 2.9 pH Calibration Data and Best Fit Approximations . . 42Figure 2.10 Free Chlorine Calibration Data and Best Fit Approx-imations . . . . . . . . . . . . . . . . . . . . . . . . . 44Figure 2.11 Total Chlorine Calibration Data and Best Fit Ap-proximations . . . . . . . . . . . . . . . . . . . . . . . 46Figure 2.12 Total Alkalinity Calibration Data and Best Fit Ap-proximations . . . . . . . . . . . . . . . . . . . . . . . 49ixLIST OF FIGURESFigure 2.13 Measurement Steps for the Smart-Phone-Attached Sen-sor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Figure 3.1 Wireless Smart Phone Sensor Design Overview . . . . 54Figure 3.2 Sensor Enclosure Design . . . . . . . . . . . . . . . . 55Figure 3.3 Wireless Sensor Circuit Diagram . . . . . . . . . . . . 56Figure 3.4 Wireless Sensor Circuit Components and Schematic . 57Figure 3.5 RGB Color Sensor Spectral Response . . . . . . . . . 58Figure 3.6 Complete Circuit Mounted into the Enclosure . . . . 60Figure 3.7 Software Application Title Screens . . . . . . . . . . . 62Figure 3.8 Software Application Measurement Display . . . . . . 64Figure 3.9 pH Calibration Data and Best Fit Approximations . . 65Figure 3.10 Free Chlorine Calibration Data and Best Fit Approx-imations . . . . . . . . . . . . . . . . . . . . . . . . . 67Figure 3.11 Total Chlorine Calibration Data and Best Fit Ap-proximations . . . . . . . . . . . . . . . . . . . . . . . 69Figure 3.12 Alkalinity Calibration Data and Best Fit Approxima-tions . . . . . . . . . . . . . . . . . . . . . . . . . . . 70Figure 3.13 Measurement Steps for the Wireless Smart PhoneSensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Figure 3.14 Image of Wireless Smart Phone Water Quality Sensor 73Figure 4.1 Four Colorimetric Water Quality Sensors . . . . . . . 75xAcknowledgmentsI 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 mysupervisor Dr. Kenneth Chau for his guidance, motivation, and enthusiasmduring our work together over last five years. His attention to detail anddrive for perfection have helped me become a better engineer, succeed inthis work, and will have a lifelong positive impact. I would like to thankmy committee members Dr. Thomas Johnson and Dr. Jahangir Hossainfor 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 helpingme set up and complete the calibration of the sensors. I would also liketo thank my capstone project teammates Yannick Letailleur and AurelienSchilles who helped bring this project to life, and their enthusiasm whichhas motivated me to further develop the idea of a mobile color-based waterquality sensor. I want to thank Dr. Peter Ott of Heilbronn University andClaude Labine of Campbell Scientific Canada Corp. for their suggestionsand helpful discussions. I am also very thankful to Dr. Jonathan Holz-man for his support in my NSERC-CGS scholarship application. I am verygrateful for the help I received from Dr. Deborah Roberts and Dr. RayTaheri.I have truly enjoyed working with my fellow graduate students, ReyadMehfuz, 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 offeringus a subscription to the LinuxLink Pro service which was a great help in thedevelopment 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 myentire life. Without the support from my mother and siblings, I would nothave been able to complete the work I have done. Their guidance, motiva-tion, and love will continue to shape my life and career.xiDedicationIn loving memory of my dadAugust SchaeferThen 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, 17xiiChapter 1IntroductionThe goal of this thesis is to develop cost-effective sensor technologiesthat will enable a user with minimal training to make rapid measurementsof 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 acontrolled setting. In contrast to other stand-alone water quality sensorsthat 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 approachthat 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 forman aggregate metric of overall water quality include the concentration oforganic and inorganic species, temperature, pH, conductivity, and turbid-ity [1]. When any of these parameters exceed regulatory limits, the qualityof water is compromised and there are risks of short- and long-term ad-verse effects to human health. Although most urbanized populations indeveloped countries obtain their water from distribution systems that arecentrally regulated and monitored, the availability of affordable technologiesto allow individuals to make rapid water quality measurement at the pointof sampling would benefit the majority of the world’s population residingin developing countries, who use and consume ground water that is neithermonitored nor treated. In addition, the rural population in developed coun-tries (in Canada and US alone, this amounts to approximately 40 millionpeople [2, 3]) frequently obtain water from private wells and could poten-tially benefit from timely access to drinking water quality data. Rapid andon-site water quality measurements are also important for house-hold usessuch as pool, spa, and aquarium maintenance.We have developed two iterations of a water quality sensor that haveachieved portability, cost-effectiveness, and ease of use by integration withmobile smart phone systems. The sensors are based on colorimetric mea-11.1. Water Quality Measurementsurement 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 phoneand the second-generation prototype is based on a sensor node that canwirelessly interface to any smart phone. The distinguishing features of ourprototypes include high portability (both fit into the palm of a hand), op-eration without instruction manuals by interaction with a user through agraphical interface, high data mobility by exploiting the internet connectiv-ity of smart phones, and rapid colorimetric water quality measurements withsensitivity and accuracy comparable to that of commercially-available col-orimeters. The prototypes can potentially be used to monitor water qualityparameters relevant for water consumption or recreational use.1.1 Water Quality MeasurementGenerally, water quality is determined by the presence of entities inwater that are harmful to human health. In this section, we will discusswater quality in terms of contaminants that are either biological or chemicalin nature, and introduce standard methods to quantify the presence of thesecontaminants.1.1.1 Biological ContaminantsBiological contaminants include pathogenic micro-organisms such asbacteria, protozoa, viruses, and algae that can cause illness and death inhumans [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, whosepresence is quantified through a multi-stage process that involves water sam-ple collection, incubation, and enumeration. A water sample is incubated ina medium that is selectively nutritious to a particular indicator organism.Over the course of days, single cells multiply into entire colonies, which canthen be counted by visual inspection. Based on the number of colonies, itis possible to indirectly determine the concentration of the indicator micro-organism in the original water sample. While this method is relatively simpleand cost-effective, the incubation period required to grow the sample is onthe order of several days. There are currently no viable technologies thatcan enable rapid, on-site measurement of biological contaminants, althoughsome recent research progress suggests the possibility of direct visualization21.1. Water Quality Measurementof individual micro-organisms using automated high-power microscopes andcomputer algorithms [4–8].1.1.2 Chemical ContaminantsChemical (or inorganic) contaminants can have negative long-termhuman health effects in addition to adverse effects in industrial and house-hold settings through equipment damage. Chemical contaminants includecarcinogens, 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 alsobe used as indirect indicators of biological contamination. In contrast toindirect 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, electrodemeasurement, or radiation measurement. Instruments that measure chemi-cal contamination in water vary dramatically in terms of cost, accuracy, andportability.ChromatographyChromatography instruments (chromatographs) provide the greatestsensitivity 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 vesselconsisting of a long column is filled with a material known as the station-ary phase. The water sample is mixed with another fluid having knownconcentration of ions and fed through the column. A third fluid known asthe eluent is added to the top of the column to wash the sample mixturethrough the column. The stationary phase is selective and preferentiallybinds to the ions in the sample solution, separating the ions as they traveldown the column at different rates. A detector placed at the bottom of thecolumn detects the arriving ions of the sample. Differences in the arrivaltime (retention times) of the ions are used in conjunction with a calibrationstandard to identify the ion concentrations and sample composition. Thedetector can be a colorimetric sensor, a conductivity sensor, or a mass spec-trometer [9]. The ion chromatograph is a very powerful tool and, combinedwith an autosampler (a device that enters the sample into the column), a31.1. Water Quality Measurementconcentrator, and analysis algorithms, can be highly automated and performrapid measurements. However, due to the complex nature of the system, itis very expensive and requires careful sample preparation and highly trainedpersonnel. The system is also very bulky due to a large array of complimen-tary components.Electrode MeasurementsIon-selective electrode measurement is another technique to quan-tify chemical contamination in water. This technique works on the basisof a redox reaction and uses two electrodes. One electrode is immersed ina reference solution with known ion concentration and a second electrodeis encased in a selectively permeable housing and immersed in the samplesolution. Only the desired ions pass through the housing to the secondelectrode. Knowing the concentration and standard potential of the refer-ence solution and the measured potential between the two electrodes, onecan determine the concentration of the targeted ion species in the samplesolution. Depending on the construction of the selective membrane, vari-ous ion concentrations can be measured. One variation of this technologyis the popular electrode-based pH meter [10]. Ion selective electrode mea-surements are very accurate, but require frequent calibration, are limited tomeasurement of a few ionic species, are notoriously fragile, and are costly.Radiation MeasurementsPerhaps the simplest and most widely-used method for measuringchemical contamination is based on radiation or light-based measurement.There are several forms of light-based water quality measurement. The mostuniversal is based on direct observation of a water sample either by eye orby using a color-sensitive image sensor to arrive at a qualitative descriptionof water quality (for example, “the water is murky” or “the water is crystalclear”). Quantitative descriptions of water quality can be obtained throughphoto-sensitive measurements usually expressed in terms a parameter knownas absorbance given byA = log(P0P), (1.1)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 or41.2. Color Theoryphoto-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 onthe magnitude of color change. Due to the availability of color indicatorsfor a wide range of water quality parameters, light-based measurement is avery powerful and versatile tool for water quality determination and will beused here to realize an inexpensive, portable, and easy-to-use water qualitysensor.1.2 Color Theory1.2.1 What is Color?Although the concept of color is intuitive to nearly all humans, itcan be difficult to answer seemingly simple questions about color (“what iscolor?”, “how is color generated?”, “how is color measured?”) without anappreciation of color theory. Color describes an aspect of visual perceptionrelated to the sensitivity of the eye to different spectral components (wave-lengths) of light. Figure 1.1 shows the electromagnetic spectrum, of whichlight visible to the human eye occupies a very small range. The visible lightspectrum spans a range of colors including indigo (≈390 nm), blue (≈410nm), green (≈520 nm), yellow (≈580 nm), and red (≈680 nm). A particularcolor can be a single spectral component or a combination of componentswith different intensities (a spectrum).1.2.2 Color VisionThe 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 colorsare distinguished based on the response of three types of cones, giving riseto tristimulus vision. The three types of cones are distinguished by theirpigments which predominantly absorb one of three colors: reds (long wave-lengths), greens (medium wavelengths), and blues (short wavelengths). Theillumination response of the cone cells is shown in Fig. 1.2. Nerve impulsesfrom the cones are sent to the brain, which can then distinguish roughly 10million colors [11].51.2. Color Theoryλ 700 nm 600 nm 500 nm 400 nm106 107 108 109 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 f (Hz)AM radio waves FM radio waves radarmicrowaves infraredvisibleterahertz wavesultravioletX rays gamma raysλ 1km 10m100m 1m 10cm 1cm 1mm 100μm 10μm 1μm 100nm 10nm 1nm 1Å 0.1ÅFigure 1.1: The electromagnetic spectrum spans frequencies from low-frequency radio waves to high-frequency gamma radiation. Only a smallfraction of this spectrum from 4.0 × 1014 Hz to 7.9 × 1014 Hz is visible tothe human eye.1.2.3 Color ModelsBetween 1928 and 1932, the first experiments were conducted byWright and Guild in an attempt to quantify every perceptible color in termsof 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 lightcentered at 546.1 nm, and a blue light centered at 435.8 nm - and presentedto an observer. The intensities of the primary lights were adjusted until theobserver determined that the combined light spot had a color exactly match-ing the color of a light spot from a monochromatic test lamp. The resultingcolor matching functions (CMF) obtained from these first experiments areshown in Fig. 1.3(b). Interestingly, these results revealed that a negativeintensity 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 themonochromatic test lamp in order to desaturate it and make a color matchpossible [16]). This implied that not all visible colors could be created bythe addition of three primary monochromatic lights. Nevertheless, these ex-periments lead to the first color model, assigning to each perceptible colorthree values defining the relative intensities of the primaries (where one ofthe values could be negative).In 1931, the International Commission on Illumination (CIE) released61.2. Color TheoryFigure 1.2: The retina located at the back of the human eye consists of 7million cones. Cones are categorized by their sensitivity to long wavelengths(L), medium wavelengths (M), and short wavelengths (S). The figure plotsthe spectral sensitivity of the different cone types. Perceived color is deter-mined by the relative response of the three cone types, giving rise to thetristimulus response of the human eye. Data obtained from [12].71.2. Color Theorythe 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¯(λ), y¯(λ), and x¯(λ)) are alwayspositive, which implies that they encompass the entire color gamut of thehuman eye and 2) the CMF corresponding to the Y color would match theillumination response of the human eye. The XY Z primaries are not phys-ical light sources but rather mathematical constructs, more saturated thanmonochromatic light, that enable the definition of the entire color gamut ofhuman vision in terms of three positive values. For a given light spectrum,Φ(λ), the relative intensities of the three primaries can be calculated byconvolving Φ(λ) with the color matching function over visible wavelengthranges given byX =∫ 760360Φ(λ)x¯(λ)dλ, (1.2)Y =∫ 760360Φ(λ)y¯(λ)dλ, (1.3)andZ =∫ 760360Φ(λ)z¯(λ)dλ, (1.4)where the limits of integration are expressed in units of nanometers.If we examine the case of pure monochromatic light (a spectrum with asingle wavelength component), we can apply the Eqns. 1.2, 1.3, and 1.4 todetermine the outermost visible X, Y , and Z tristimulus values. The spaceenclosed by this locus is a three dimensional representation of all colorsvisible to the human eye. In order to visualize the range of colors in a twodimensional plane, the color model can be normalized to yield x, y, and zvalues given byx =XX + Y + Z, (1.5)y =YX + Y + Z, (1.6)andz = 1− x− y, (1.7)respectively, and plotted as just a function of x and y. The result of thisnormalization is the familiar horseshoe-shaped CIE color model shown inFig. 1.5. The two-dimensional plot includes all visible colors bordered by81.2. Color Theory relative intensity− (nm)400 500 600 700a) b)observerrgb tristimuluslampsmonochromatic test lampFigure 1.3: Initial work by Wright [14] and Guild [15] led to the developmentof the CIE RGB color observer functions. (a) Three monochromatic lightsources (red, green, and blue) with variable intensities are combined to aspot, which is then color matched to a monochromatic test spot accordingto 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 astraight line, known as the line of purples, describing colors that can becreated as a combination of other colors, but do not have a wavelengthassociated with them. All colors within the gamut can be created as acombination of colors. A color outside the gamut cannot be perceived bythe 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 SpacesWhile an absolute color model maps out all colors in terms of a setof primaries (such as the CIE XY Z colour model presented in the previoussection), 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 areuseful because in any practical application it is necessary to use real physicalprimary colors, as opposed to the artificial colors that define the entire thecolor gamut. A well-known color space is the RGB color space, based on the91.2. Color Theory tristimulus values00.511.52wavelength (nm)400 500 600 700Figure 1.4: The XY Z tristimulus color matching functions describe thehypothetical tristimulus response of an observer to three primary artificiallight sources X, Y , and Z. These primaries are not physically realizable,but are rather mathematical constructs designed to produce only-positivecolor matching functions.101.2. Color TheoryFigure 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 locusof the diagram is the limit of the human color gamut. All of values withinthe locus include colors that can be synthesized by addition of the threeprimaries X, Y , and Z. The numbers along the curved edge correspond tosingle units of wavelengths in nm.111.3. Color Measurementselection of red, green, and blue as the primary colors. Placing the intensitiesof the red, green, and blue primary colors on three orthogonal axes yieldsa three-dimensional volume that includes all possible colors of that colorspace. Figure 1.6 shows the RGB color cube and the different possiblecolor combinations. By normalizing the RGB cube in a manner similar tothe normalization applied to the XY Z model, the RGB color space canbe visualized by a triangular region inside the two-dimensional color gamutwith vertices defined by the three primary colors. Since the triangular regionlies within the boundaries of the color gamut, it is impossible to reproduceall visible colors using only three primary colors. There are several RGBcolor spaces whose color extent depends on the choice and saturation of theprimary color values. A very common RGB color space is the sRGB space,which has relatively small coverage of the color gamut. Other spaces includethe Adobe RGB space and ProPhoto RGB space. It should be noted thatthe RGB color space is additive, meaning that the primaries add togetherto 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 MeasurementAlthough human vision is color sensitive, factors such as color met-amers, opponent process, color constancy, and color blindness make colormeasurement by human vision subjective and error-prone. Objective colorquantification 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 spectroscopyand colorimetry. The former describes absolute color quantification basedon intensity measurement as a function of wavelength. The latter describesrelative color quantification in terms of the relative intensity of color sub-components, often with connection to the tristimulus response of the humaneye.1.3.1 Limitations of Human Color PerceptionColor MetamersColor perception in the human eye is based on the integrated spectralresponse 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 is121.3. Color Measurement(a)(b) (c)BGRBlue(0,0,1) Cyan(0,1,1)Magenta(1,0,1)Red(1,0,0) Yellow(1,1,0)Green(0,1,0)White(1,1,1)Black(0,0,0)BGRBGRFigure 1.6: The RGB color space can be visualized according to three or-thogonal axes mapping the intensities of the primary colors. (a) shows thecolor combinations of different primary intensities resulting in the main col-ors of the conventional color wheel. The possible color combinations areshown on the color cube when viewed from the (b) front and (c) back.131.3. Color MeasurementS M LLight SourceSensor ResponsePerceived ColorS M Lx x= =Figure 1.7: Two different spectra can be perceived as the same color by atrichromatic observer. In the first column, a single wavelength light sourceemits yellow light, which is perceived as yellow by the observer. In thesecond column, a broadband light source emits light that is also perceivedas yellow by the observer.shown in Fig.1.7, where the yellow produced by a pure monochromatic lightsource appears identical to the yellow produced from a computer monitor,which is actually a combination of red, green, and blue primary colors.Opponent Process TheoryMost humans perceive four colors to be naturally pure: red, yellow,green, and blue. If these four colors are arranged in a conventional colorwheel, all the colors in between these four are a result of mixing either redwith 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 a141.3. Color MeasurementFigure 1.8: The opponent process in human vision can be demonstratedby looking at the black spot on the left for 30 seconds and then focussingon the black spot on the right. A number of colors will appear adjacentto the black spot on the right for a short time. This illusion is a result ofthe response of the eye, which subtracts the colors seen previously from thewhite background, giving the appearance of the opponent colors.blue-yellow color mixture. This led to the development of Hering’s opponentprocess theory [18]. According to this theory, nerve impulses from the conesare pre-processed before being sent to the brain. This encoding process (1)combines all of the cone responses as brightness values, (2) subtracts the longcone response from the sum of the short and medium cone responses (red-green opponent signal) and (3) subtracts the short cone response from thesum of the long and medium cone responses (blue-yellow opponent signal)[16]. Figure 1.8 demonstrates how the opponent process in human visioncan create after-images of different colors. Another result of this process isthat opponent colors used together will appear brighter than when they areused individually. A red color on top of a green color will appear to be astronger red than a red color on top of a white color. This process can leadto incorrect color perception by the human eye.Color ConstancyFigure 1.9 demonstrates yet another artifact that makes it difficultfor the human eye to absolutely quantify color. For given light conditions,the brain automatically adjusts perceived color according to the brightnessand chromaticity of the entire scene. A ripe tomato, for example, appears151.3. Color MeasurementABFigure 1.9: The effect of color constancy is demonstrated by comparingsquares A and B. Square A appears to be a much darker gray than squareB. In reality, the color of both squares is identical. The human brain adjuststo the shade in the scene and assumes square B to be a white square due tothe surrounding scene.red under bright sunlight as well as under a yellow sodium vapour streetlamp. This effect is very important as it increases the dynamic range andenables identification and recognition of objects even under different lightingconditions. In terms of color sensing, color constancy means that perceivedcolors are dependent on surrounding light conditions, which can lead toincorrect observations.Color BlindnessApproximately 8% of males and 1% of females have some degree ofcolor blindness [19]. Color blindness is a genetic condition that results in theabsence of certain proteins responsible for the development of the pigmentsin the cone cells [20, 21]. Depending on the type of genetic defect, a colorblind individual may not be able to see certain colors, or may have no colorvision altogether.1.3.2 SpectrophotometrySpectrophotometry describes the absolute quantification of color interms of the intensity of light over the visible wavelength range. Spec-161.3. Color Measurementsamplereferencediractiongratinglight sourcebeam splittermirrorchopperdetectoraperturemirrorFigure 1.10: The spectrophotometer relies on a monochromator (such asprism 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 intensityof both components is measured using a photo-sensitive detector and usedto quantify the absorbance of the sample. By repeating this measurementover a wide range of colors, the complete absorption spectrum of the sampleis measured.tral measurements can be performed using either a spectrophotometer or aspectrometer. The former works by illuminating a sample with a variablesingle-wavelength light source and measuring the reflected/transmitted lightintensity as a function of wavelength (as shown in Fig.1.10). The latter worksby illuminating a sample with a white light source, dispersing the spectralcomponents of the reflected/transmitted light using a prism or grating, andmeasuring 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 hasinteracted with a sample is measured as a function of wavelength.1.3.3 ColorimetryColorimetry describes the relative quantification of color in termsof the intensity of selective portions of the visible spectrum. One of themost common colorimetric technologies is the RGB image sensor found inmost digital cameras. These image sensors consist of an array of photodi-odes based on either complementary metal oxide semiconductor (CMOS) orcharged coupled device (CCD) technology. The individual photodiode sitesare covered by red, green, or blue color filters, which have filter functions171.3. Color Measurementlight sourcegratingphotodiode arrayresulting spectral dataresultingRGB valuesphotodiode arrayred, green, and blue lterlight source(a)(b)Figure 1.11: Operation principles of a spectrometer and RGB color sensor.(a) A spectrometer spatially decomposes light into its spectral componentsusing a prism or grating), which are then directed onto a large photodiodearray that outputs the spectral intensity distribution of incident light. (b)The RGB sensor measures the relative intensities of the red, green, and bluecomponents of incident light, using photodiode pixels covered with eitherred, green, or blue color filters. The RGB sensor mimics the tristimuluscolor response of the human eye.181.4. Colorimetric Water Quality SensorG BR GFigure 1.12: The Bayer filter arrangement uses two green filters, one red,and one blue filter. The filter arrangement most closely matches the humaneye luminance response.closely matching the illumination response of the three types of cones in thehuman eye (Fig. 1.11). Light incident onto an RGB sensor is quantified interms of the relative intensities of green, red, and blue filtered light. Themost 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 madeof two green filters, one red filter, and one blue filter arranged accordingto 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 singleeffective pixel. It should be noted that many RGB sensors are designed toinclude hardware and software to mimic subjective color perception of thehuman eye. White balancing of raw image information, exposure control,sensitivity manipulation (in the form of camera ISO) manipulate the colormeasured by the sensor to more closely approximate human vision.1.4 Colorimetric Water Quality SensorIn this work, we have chosen colorimetric measurements as the basisof a portable, cost-effective water quality sensor. Although spectral mea-surement provides the most rigorous means to quantify color, devices suchas 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 devicesconsisting of cost-effective optoelectronic components. Currently, there areseveral commercially available colorimeters capable of water quality mea-surements. The most popular version is the one manufactured by Hach,191.5. Smart Phone Sensorsshown 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 ismixed with a colorimetric indicator for a selective chemical species and illu-minated in a light-tight enclosure using various light sources. The intensityof light transmitted/scattered from a water sample is measured and com-pared to calibration curves to estimate the concentration of the chemicalspecies.Current portable colorimeters have several drawbacks. First, thehigh cost is prohibitive to wide-spread use. Second, they are not intuitive touse and thus lack mass appeal. Each device comes with a large instructionmanual and the user requires a fair amount of training before establishinga comfort level with its operation. Third, they lack higher functionalitiescommon 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 ofthese limitations, we will develop a colorimetric water quality sensor thatoperates in conjunction with a mobile smart phone, leveraging its compu-tational power, connectivity, and intuitive touch-based display. In the nextsection, we will review some of the latest developments in sensor technologiesbased on mobile smart phones.1.5 Smart Phone SensorsSmart phones are advanced cellular phones that run operating sys-tems capable of high-level computational tasks such as downloading andrunning mobile application software (apps), internet browsing, and emailing.In late 2012, the number of smart phones in operation worldwide surpassedone billion, and last year alone, another one billion smart phones were sold.Smart phones are broadly classified by their operating system, with thevast majority of smart phones currently using Google’s Android operatingsystem (81%), followed by Apple’s iOS operating system (13%), and thenMicrosoft’s Windows operating system (4%). Due to the rising popularityof apps and the open accessibility of app development tools, there has beena 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 thosebased on software implementation, physical sensor attachment, and wireless201.5. Smart Phone SensorsFigure 1.13: The Hach DR/890 is an industry-standard colorimeter used forwater quality measurements. The colorimeter can measure over 60 waterquality parameters using standard methods described in the accompanyinghandbook.211.5. Smart Phone Sensorssensor nodes.1.5.1 Software-Based Smart Phone SensorsOne approach to realizing a sensor based on smart phones is to writesoftware applications (apps) that use sensors already integrated onto smartphones to perform measurements. There are a large number of commerciallyavailable applications that can be downloaded (through online vendors suchas Google Play for Android devices or the App Store for Apple devices) totransform smart phones into portable sensors. Pelegris et al. created anapplication that monitors the heart rate of a user by analyzing the colorchange of a finger placed on the camera [24, 25]. Delaney et al. developed amicrofluidic sensor to measure chemiluminescence by using the camera of asmart phone in conjunction with a paper-based chip [26]. For applications intele-medicine, Martinez et al. built an application to capture an image of anassay and to tag it with relevant information. The image can subsequentlybe sent electronically to health-care professionals for analysis [27]. Lopez-Ruiz et al. designed a portable sensor to detect gaseous oxygen levels basedon an illuminated membrane placed over the smart phone camera [28]. Avariety of smart-phone-based colorimetric sensors have also been realizedfor water quality measurement. For validating the effectiveness of waterdisinfection, Copperwhite et al. developed a UV dosimeter that uses asmart phone to take color images of a colorimetric sensing substrate [29].Similarly, Shen et al. created a smart-phone-based pH meter by takingcolor images of pH reagent test strips [30]. A commercially available app bythe company LaMotte also operates on the same principle [31]. Recently,Sumriddetchkajorn et al. developed an app that enables measurement ofchlorine concentration by imaging a water sample mixed with a colorimetricreagent [32].Generally, software-based smart phone sensors are easy to imple-ment and have a low cost of distribution. However, they have a couplesignificant disadvantages. First, the sensing hardware is located inside thesmart phone and cannot be accessed or modified. Available literature on theperformance 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 environmentalcontrol. Measurements are typically performed in open environments andcan be detrimentally affected by ambient light, heat, noise, or vibrations.221.5. Smart Phone Sensors1.5.2 Smart Phone Sensor AttachmentsAn alternative route to realizing smart phone sensors is based on cus-tom hardware attachments physically interfaced to a phone. One commonapproach is to construct the attachment with all the necessary hardwareto perform measurements and then wire the attachment to a smart phoneto enable control of the attachment. For example, the company OsciumAnalyzers has recently released an oscilloscope, a spectrum and logic ana-lyzer, and a power meter that operate by connection to the serial port ofthe iPhone or iPad [33]. Other examples of sensors interfaced with smartphones through the serial port include blood glucose monitors developed bySanofi [34] and pH meters developed by Sensorex [35]. Moreover, a widerange of smart phone sensor attachments have been designed for connectionthrough the 3.5 mm audio input/output port (which is universal to nearlyall mobile devices and has analog input capabilities). This includes creditcard readers [36] and oximeters [37, 38].Smart phone sensor attachments have also been developed to aug-ment the measurement capability of components already integrated ontothe smart phone. For example, the camera in most smart phones can bevastly improved by using additional external optical components. Breslaueret al. first demonstrated that a camera phone (a precursor to the smartphone) can be used as a portable microscope by mounting a microscopeobjective in front of the camera [39]. A research group from UCLA hascreated 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 devicesto enable virus detection [42], blood analysis [43], allergen testing [44], andurine analysis [45]. Lee et al. developed a phone-based DNA detector byattaching a custom-built sample holder, including an excitation light sourceand emission filter, to the back end of a mobile phone [46]. Sumriddetchka-jorn et al. created a colorimetric water quality sensor to quantify chlorineconcentration based on holding a smart phone to an aperture in the sensorand capturing images of a water sample mounted against a white back-ground [47]. Several crowd-funding projects have been proposed based onlens attachments to smart phones to enhance imaging capabilities [48–50].1.5.3 Wireless Smart Phone SensorsSmart phone sensors that require a physical attachment are specificto the dimensions and specifications of current smart phone models. Due231.6. Sensor Prototyping Platformsto the rapid evolution of smart phones, these sensors can quickly becomeobsolete and out-of-date. One way to overcome this limitation is to developsensor nodes that wirelessly interface with smart phones through standardwireless protocols (such as WiFi or Bluetooth). There are many benefitsof this approach: the sensor is universally compatible with all smart phonesystems, sensor operation is more elegant due to the absence of physicalconnection, and the smart phone can communicate with multiple sensors atonce.There has been tremendous research and development in wireless sen-sors spanning a wide range of applications. The GoPro series camera andthe Nikon DSLR cameras, for example, now have wireless interfaces to en-able camera control and data transfer with mobile devices [51, 52]. Nike andApple 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 readingsthat are wirelessly sent to a smart phone [54]. A variety of biomedical de-vices have been demonstrated based on wireless communication with smartphones, including pulse rate monitors [55, 56], electrocardiograms [57–60],stethoscopes [61], and health monitoring stations [62]. Due to the diversityof applications for wireless sensors [63], some have endorsed the idea of cre-ating an open wireless sensor platform to enable developers and designersto rapidly create and prototype new concepts [64]. Indeed, the potentialimpact of wireless sensors in a diverse range of applications is enormous.1.6 Sensor Prototyping PlatformsSmart phone sensors generally require on-board or embedded com-putation to collect, store, analyze, or transmit sensor data. Depending onthe amount of processing required, several prototyping platforms with vary-ing capabilities can be used. In this section, we will discuss prototypingplatforms based on simple microcontroller units (MCU) and more powerfulsystem-on-chip (SOC) computer systems.1.6.1 Microcontroller ArchitectureMicrocontroller units (MCU) account for the majority of embeddedelectronic systems and are ideal for applications that require low data ratesand simple calculations. They generally consist of a microprocessor capableof simple computational tasks and a number of interfaces, input and output(I/O) pins, displays, and sensors. While MCUs have been in use for several241.7. Wireless Device Communicationdecades, it has only been in the last few years that portable and low costprototyping platforms have become widely available. One of the most popu-lar is the Arduino prototyping platform [65]. The Arduino hardware consistsof a microcontroller with general input and output pins and its software iswritten in a C-based programming language. A large community of devel-opers have been attracted to the Arduino platform because the hardwareand software are both open-source and the development interface is simpleand easy to use. The open-source hardware has spurred the development ofa number of add-on boards (shields) that connect to the Arduino and con-trol peripherals such as motors, displays, wireless and wired communicationplatforms, and input devices. Table 1.1 outlines some of the specification ofa typical Arduino micro-controller platform.1.6.2 System-On-Chip Computer SystemsSystem-on-chip (SOC) systems are suited for applications that re-quire on-board computation to perform more intensive tasks such as signalprocessing at high data rates, video acquisition, image processing, high-bandwidth communication, and user interaction. SOCs are basically entirecomputer systems on a single chip capable of running an operating system.Compared to the MCU development process, the SOC development processis significantly longer due to increased hardware and software integrationand includes time-intensive tasks such as customization of the hardwaresystem components, boot optimization, kernel development, and applica-tion development. Recent developments in open-source integrated hardwareand software systems have led to the proliferation of single-board computingsystems. One of the most popular low-cost SOC options is the BeagleBoneprototyping platform. The BeagleBone system includes a central processorwith on-board RAM and ethernet, USB, HDMI, and general purpose I/Opins [66]. Add-on hardware allows for the integration of camera systems,wireless connectivity, motor control, touch-screen technology, and externalstorage. Software development resources are open-source and readily avail-able. Table 1.1 outlines some of the specifications of a typical Beagleboneplatform.1.7 Wireless Device CommunicationWireless connection protocols and standards have been developedin the last few years for general use in electronic devices. In this section,251.7. Wireless Device CommunicationTable 1.1: Comparison of specifications for the Arduino microcontroller andBeagleBone embedded computer system.Beaglebone BlackArduinoProcessorClock SpeedRAMFlash StorageInput/OutputOperating SystemUSBEthernetVideoPower ConsumptionCostSizeATmega 32816 MHz2 Kbyte32 Kbyte14 GPIO, 6 Analog--------0.15 W$3053 mm x 75 mm 55 mm x 90 mmARM Cortex - A81 GHz512 Mbyte2 GByte 69 GPIOLinux110/100Mini-HDMI1.5 W$45261.7. Wireless Device Communicationwe will review the most widely used wireless standards applicable for devicecommunication.1.7.1 Wireless Networking (WiFi)Wireless LAN (WLAN) is the most widely used wireless connectionstandard. 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 connectionallows multiple devices to be connected to a wireless access point (hotspotor router). WiFi is most commonly used to connect consumer electronicdevices to local networks, which can then access the internet. Due to pricereduction of wireless LAN chipsets over the last few years, wireless accessis now ubiquitous for a large number of devices. WiFi is very well suitedfor high data rates and the latest official standard supports speed up to600 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 powerrestrictions. In order to guarantee secure transmission of data between de-vices several encryption technologies are available, including the passwordprotected Wireless Equivalent Privacy (WEP) standard and, more recently,the WiFi Protected Access II (WPA2) [67, 68]. Although powerful, the mainlimitations of WiFi hardware include high power consumption and complexinfrastructure requirements.1.7.2 BluetoothThe Bluetooth wireless communication standard is a short range,point-to-point communication system suited for low data rates that wasprimarily designed to eliminate the need for short cables. Bluetooth specifi-cations are maintained by the Bluetooth Special Interest Group (BluetoothSIG). The Bluetooth system transmits data on the unlicensed 2.4 GHz fre-quency band using a frequency hopping spread spectrum (FHSS) to reducethe effects of interference and fading. A Bluetooth device can be connectedto several other devices, but can only communicate with a single deviceat 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 allowsecure communication of devices, two devices must be paired using a pass-code before any information can be transmitted. In 2013, the BluetoothSIG released the Bluetooth Low Energy (BLE) standard to further reduce271.7. Wireless Device Communicationpower consumption [70], which is attractive for mobile devices running onbatteries.1.7.3 Additional Communication StandardsAnother wireless standard is the IEEE 802.15.4 wireless standard.The aim of this standard is to facilitate simple, low power, and low datarate communication between sensors and devices. Implementations includeZigBee and WirelessHART. Devices operate at 2.4 GHz and are connectedin 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 thatof 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 NorthAmerica) and the FM band (87.0 MHz to 108 MHz in North America).The frequencies in these bands are licensed. The benefits of radio includevery long range (up to 100’s km) and simple receiver architecture, but thelarge transmitter infrastructure, cost, low data rate makes it unattractivefor mobile device applications.Mobile communication protocols have evolved as the use of mobilephones has expanded. Global System for Mobile Communication (GSM) hasbeen a very common set of standards used for mobile phone communication.To meet consumer demand of higher data rates and to enable data accesson phones, new standards have evolved to allow faster and more securecommunication. Examples include 3G, 4G, and the latest LTE networks.The satellite communication system is another system that can beused to transmit information. Two-way satellite communication allows de-vices to send and receive data using satellite communication. For sensorapplications this is largely impractical due to high power consumption, highcost of implementation, and maintenance. However, as a result of the in-novations in chip design, many consumer devices now come with one waysatellite communication in the form of GPS. GPS is a very powerful toolas it allows very precise location measurements. When implemented onto asensor, it allows for geo-tagging of measurements, a useful feature for manysensing applications.281.8. Thesis Outline1.8 Thesis OutlineThe goal of this thesis is to develop a portable, easy-to-use, low-costcolorimetric water quality sensor that enables a user to make measurementsof multiple water quality parameters immediately at the point of sampling.To achieve this goal, the water quality sensor will leverage the computationpower, 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 iPhone4S. In Chapter 3, we describe our second-generation water quality sensorbased on a sensor node and a custom software application that can wire-lessly interface through Bluetooth to any Android device. Both water qualitysensors are capable of measuring pH, chlorine concentration, and alkalinitywith 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 availablecolorimetric water quality sensors: a high-tech colorimeter and low-tech teststrips.29Chapter 2Smart-Phone-AttachedWater Quality SensorIn this Chapter, we will present the design, fabrication, calibration,and validation of a water quality sensor that operates in conjunction witha smart phone through a physical attachment and custom-written applica-tion software. The sensor has been designed to operate with the iPhone 4or 4S. This choice was made due to the simple exterior form of the iPhoneand its high-quality optical components (flash and camera). The sensorperforms colorimetric measurements of water samples spiked with color in-dicators sensitive to selective chemical species. Water quality parametersthat are measured include pH and the concentrations of chlorine and al-kalinity. These parameters have been selected due to their widespread useand availability of colorimetric indicators. The sensor attachment has threepurposes: to provide a stable mount for the water sample, to re-direct lightfrom the flash of the smart phone through the water sample and onto thecamera, and to provide a light-tight enclosure. Application software per-forms the colorimetric measurement through control of the smart phoneflash and camera, data acquisition and interpretation, and graphical displayof the parameter measurement. The software has been designed to be easyto use and visually pleasing. The key conceptual components of the sensorare shown in Fig. 2.1.light source water sample& reagentcolor sensor(camera)raw image datadata interpretation result outputhardware softwareFigure 2.1: Overview of the phone-attached water quality sensor. The hard-ware includes a light source, a sample holder, and a color sensor. Thesoftware performs data acquisition and analysis and displays measurementresults.302.1. Sensor Hardware2.1 Sensor HardwareThe basic hardware components of the sensor include a light source, asample mount, and a color-sensitive camera. Because the sensor will beused in conjunction with a smart phone, an elegant method to minimize thesensor power consumption is to employ the flash light source and cameraalready integrated onto the smart phone. Given this constraint, the criticalcomponent of the sensor is the sample mount, which must be designed tosecurely fasten to the smart phone in a way such that the flash and cameracan be used for controlled and repeatable colorimetric measurement of watersamples.2.1.1 Light SourceThe sensor uses the flash onboard an iPhone for the light source. Theoperating system on the iPhone only allows the flash to be used at either lowor high brightness levels. The light source is a light emitting diode (LED)producing white light. Although the color appears relatively white to thehuman eye, the spectrum of the light is not uniformly distributed over thevisible spectrum, as shown in Fig. 2.2. The spectral distribution peaked inthe blue is common for white LEDs, which consist of a diode emitting bluelight and fluorescent phosphors emitting green and red light upon excitationwith blue light.2.1.2 Color SensorThe sensor uses the camera onboard an iPhone for color determination.Use of the integrated camera eliminates the need for external electronichardware. The specifications of the camera are listed in Table 2.1. Notethat the camera has features such as exposure compensation, auto-focus, andwhite balance compensation which mimic the human eye but are detrimentalfor objective color quantification.2.1.3 Sample MountFigures 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 froman opaque black plastic. The sample mount slides over the top of an iPhone4 or 4S like a sleeve, with the bulk of the mount covering the top portion of312.1. Sensor HardwareFigure 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.ResolutionPixel SizeImage SizeAperture SizeSensor SizeFocal LengthAutofocusExposure CompensationWhite Balance Compensation8 Megapixel1.4 µm3264 x 2448f/2.41/3.2 ”35 mmYesYesYes322.2. Reagentsthe back of the iPhone where the camera and flash are located. The sides ofthe mount clamp onto the iPhone and provide a snug compression fit. Theside 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 anddismounted from the iPhone without leaving scratches. Inside the mount,there are three mirror surfaces which are aligned in a way so that the lightfrom the camera flash is directed through the sample and directly onto thecamera. The sample mount contains a square slot to accommodate a stan-dard cuvette (with a square cross section having 10 mm sides) containingthe water sample. The cuvette slot is positioned close to the camera so thatthe 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 diffusingelements blur the image of the sample taken by the camera, which reducesthe sensitivity of the camera measurement to inhomogeneities in the watersample and imperfections such as scratches, defects, and dirt on the mirrorsand 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 bythe camera is representative of the transmissivity of the water sample. Thesample mount is sealed by an opaque lid to completely block out ambientlight during the measurement. The device has been designed with ease ofmanufacturing in mind and can be readily manufactured through standardpolymer processes such as injection molding. Figure 2.5 shows an image ofthe fabricated mount attached to an iPhone 4S.2.2 ReagentsColorimetric indicators enable quantitative color-based analysis ofwater samples. Reagents react with a targeted species in the water sampleand produce a characteristic color change proportional to the concentrationof the species. A large number of colorimetric indicators have been developedto determine concentrations of metals, oxidizers, and acidity. In this work,we will use indicators for pH, chlorine, and alkalinity, widely used waterquality parameters for determining the suitability of water for recreationaluse in swimming pools.2.2.1 pHpH 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 common332.2. ReagentsmirrormirrormirrordiuserdiuseriPhone ash(light source) iPhone camera(sensor)iPhonewater sampleinside cuvettelight enclosureFigure 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 thesensor attachment. The device prototype consists of ABS plastic, which isopaque to visible light.342.2. ReagentsFigure 2.5: Image of the actual sensor attached onto an iPhone 4S runningthe custom application software.352.2. ReagentspH indicator is phenol red, which ranges from yellow at a pH of 6.5 to pinkat a pH of ChlorineChlorine is commonly used as a water disinfectant. Chlorine, in theform of chlorine gas, or hypochlorous acid, oxidizes biological contamina-tion, removes odors, and reduces turbidity. When free chlorine reacts withammonia (present in urine or perspiration), it forms chloramines, which arealso known as combined chlorine. Chloramines are odorous and harmful forhuman 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 indicatesthe presence of combined chlorine must be oxidized using a shock treat-ment. Chlorine concentrations can be colorimetrically determined using theN,N-diethyl-p-phenylenediamine (DPD) method. When DPD reacts withchlorine, a dye known as Wu¨rster is produced. The intensity of the dyechanges from clear when no chlorine is present to a strong pink when thechlorine concentration is above 7 mg/L. The DPD method is sensitive to freechlorine and can be directly used to measure the free chlorine concentrationin a water sample. The DPD method is insensitive to combined chlorine.To measure the total chlorine concentration, iodide is added to the watersample to react with the chloramines to produce triiodine ions (I3− ) whichreact with the DPD forming an observable color change [71].2.2.3 AlkalinityAlkalinity describes the buffering capability of water. Alkalinity iscaused by the presence of carbonates and bicarbonates and is generally mea-sured as equivalents of mg/L of calcium carbonate (CaCO3). Low alkalinitywater is susceptible to large changes in the pH. High alkalinity water issusceptible to precipitation. In swimming pools, a desirable range for alka-linity is between 80-120 mg/L. Alkalinity can be measured colorimetricallyby titrating a water sample with a strong acid and determining the titrationendpoint using a pH indicator. Based on the amount of acid titrated, thealkalinity concentration can be determined.362.3. Phone Application Software2.2.4 Indicator-Bearing CuvettesIn this work, we will we use commercially available powdered indi-cators for pH, chlorine, and alkalinity which are pre-filled into disposableplastic cuvettes (supplied from LaMotte Inc.). The amount of indicator ineach cuvette is designed to produce an observable color change when mixedwith a 3 mL water sample. The content of the vials are proprietary, butare based on the chemical reactions described above. To correlate the colorresponse of the indicators to the species concentration, the sensor will becalibrated with standard samples having known concentrations.2.3 Phone Application SoftwareWe next discuss the application software to enable operation of thesensor. All software applications developed for the iPhone (and other mobileApple devices) are made for the iOS operating system. Apple has releasedthe Xcode software development kit to allow developers to create, test, anddistribute software through the Apple App Store. For our sensor, the soft-ware provides a platform for user interaction, allowing the user to controlthe sensor, obtain measurements, and view results. In the background, thesoftware 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 theapp 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. Afterselection of a particular parameter, the app then guides the user throughthe measurement process in two user-initiated steps: a first step to ensurethat the sensor is attached to the phone and a second step in which thesample is inserted into the mount and the measurement is performed. Thescreenshots corresponding to these steps are shown in Fig. 2.6. An inter-nal algorithm, which will be described below, computes a measurement ofthe desired parameter and displays the result both numerically and on ananimated scale with an indicator arrow. Examples of measurement resultsfor the four different types of parameters are shown in Fig. 2.7. After themeasurement result has been displayed, the user can immediately initiateanother measurement using the button labeled “MEASURE” located abovethe displayed result. The navigation bar at the top of the app also allowsthe user to quickly navigate back to the title screen containing the list ofparameters to perform a measurement of another parameter. At any point372.3. Phone Application SoftwareFigure 2.6: The software app guides the user through the measurement pro-cess. The user selects a water quality parameter, initiates the measurementby attaching the sensor, and then performs a measurement after insertingthe cuvette into the mount.during the measurement procedure, the user can press the home button onthe iPhone to exit the app completely.Unseen by the user, the app performs colorimetric measurement througha two step process where it first obtains a reference image and then obtainsan image of the water sample. The reference image step is particularly im-portant due to the limited software control over the camera. As mentionedbefore, the camera onboard the iPhone has features such as automatic ex-posure (the phone will detect the ambient brightness level and adjust theexposure setting on the camera), auto-focus (the phone will adjust the opticsof the camera in an attempt to obtain a sharp image), and white balancing(chromaticity adjustment to more closely match human vision), which areall detrimental for quantitative color determination. While it is not possibleto set the exposure value, focus, white balance temperature value for thecamera directly through software, it is possible to lock these settings at anytime to their current values while the camera is in use by the phone (forexample, you can lock the focal position of the camera while attemptingto capture an image). However, every time the camera function is closedand re-initiated, the camera settings are again unlocked and subject to au-tomatic settings. To alleviate this problem, the app initiates the camerafunction on the iPhone the moment the user presses the “START” buttonand takes a reference image with the mount attached to the phone but no382.4. Calibrationwater sample in place. After the reference image is taken, the app locks allcamera settings (exposure, focus, and white balance) under the conditionsin which the reference image was taken. The reference image is cropped toisolate a region of interest and the average red, green, and blue componentsof the region of interest are calculated and stored.In the next step, the water sample is inserted into the mount and theuser presses the “MEASURE” button. The app will then take an image ofthe water sample using the locked camera settings. The image is croppedover 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, andblue values are each subtracted from their reference values. The three differ-ence values are then mapped onto three separate pre-determined calibrationcurves to produce three measurements of the parameter concentration. Agood 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 userthat an error has been detected (for example, the mount was not properlyattached, the reference measurement was made incorrectly, or the wrongreagent was used) and prompt the user to repeat the measurement. Be-cause the sensitivity of the red, green, and blue channels will be differentfor different colorimetric indicators, weighting factors (determined from thecalibration process to be discussed next) are placed on the measurementfrom each channel and the weighted average is displayed to the user.2.4 CalibrationIn this section, we will describe the calibration of our water qualitysensor by correlating the color of standard water samples with known con-centrations. The quantification of color change in terms of red, green, andblue intensity values can yield non-intuitive behavior. For example, the toppanel of Fig. 2.8 illustrates, from left to right, a gradual change in colorfrom red, to yellow, to pink, to white. Although the color transition fromred to white appears gradual, decomposition of this color change into threeprimary red, green, and blue channels yields strikingly different behavioracross the channels. In particular, the red channel is at a constant highvalue, the blue channel monotonically transitions from low to high values,and the green channel varies in a non-linear manner from low values to highvalues to low values and back to high values again. Due to the possibilityof non-linear variations in the red, green, or blue channels, calibration re-392.4. CalibrationFigure 2.7: Upon successful completion of the measurement, the concen-tration of the selected water quality parameter is displayed along with ananimated color bar that indicates the position of the measurement relativeto the overall range of the sensor. Example screenshots from the softwareapplication are shown for all four parameters.402.4. Calibrationredchannelbluechannelgreenchannelcolor changeFigure 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. Tominimize errors due to the camera itself, the calibration is performed usingnormalized values of the red (R), green (G), and blue (B) channels given byR = Rmeas −Rref , (2.1)G = Gmeas −Gref , (2.2)andB = Bmeas −Bref , (2.3)where the subscript “ref” corresponds to channel measurements withoutthe water sample in the reference step of the algorithm and the subscript“meas” corresponds to channel measurements with the water sample in themeasurement step of the algorithm.2.4.1 pH CalibrationWe calibrate our sensor to measure pH values ranging from 6.5 to8.5. Standard samples within the desired pH range are created using varyingconcentrations of two buffer solutions. The buffer solution 0.2 M monobasicpotassium phosphate (KH2PO4) is used to controllably lower the pH, and412.4. CalibrationFigure 2.9: Intensity variations of the R, G, and B channels as a function ofthe pH of standard solutions, along with lines of best fit.the buffer solution 0.2M dibasic potassium phosphate (K2HPO4) is used tocontrollably raise the pH. The buffers are added to Type 1 ultra-pure filteredwater. An Oakton pH 500 meter (model WD-35617-00) is used to verify thepH of the standard solutions. For a given measurement, a 3 mL sample ofthe standard solution is mixed with the phenol red indicator in the Lamottereagent cuvette (model: 4310) and the R, G, and B values from the sensorare recorded. 24 samples with different pH values are measured. Figure 2.9shows the R, G, and B measurements over pH values ranging from 6.5 to8.5. Although there are slight oscillations in the calibration curves for theR, G, and B measurements, the overall trend for all three channels is fairlylinear. Thus, we employ linear functions to model the sensor response overthe pH range. The linear calibration functions for each channel and theircorresponding R2 are given in Table 2.2.The calibration results show that the blue and green channels exhibit thelargest sensitivity to the color change of phenol red over the pH range. Thered channel, on the other hand, is relatively insensitive. As a result, only thegreen and blue channels are used by the software algorithm to calculate the422.4. CalibrationTable 2.2: Calibration of the smart-phone-attached sensor for measurementof pH, [pH]. Best fit functions and corresponding R2 for the R, B, and Gchannels as a function of [pH].Model R2Red Channel R = −4.81× [pH] + 65.17 0.371Green Channel G = −109.81× [pH] + 738.52 0.985Blue Channel B = 44.57× [pH]− 414.91 0.978pH value. Based on the linear fits to the calibration data, analytical linearexpressions are developed for the pH concentration based on the green andblue channel values, as shown in Table 2.3. The weighting factors for thepH 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 linearfit to the calibration data for the green channel.Table 2.3: Analytical functions used by the software algorithm to calculatepH based on the green and blue channels. The final pH measurement isbased on a weighted average of the pH measurements from the green andblue channels.Analytical FunctionGreen Channel pHgreen = −0.0091×G+ 6.73Blue Channel pHblue = 0.022×B + 9.31pH = 0.7× pHgreen + 0.3× pHblue2.4.2 Chlorine CalibrationFor swimming pool water, the desired chlorine concentration range is1-4 mg/L. To distinguish free and total chlorine, therefore, the sensor shouldbe capable of detecting chlorine concentrations over the range 1-7 mg/L.We thus prepare 9 standard solutions having chlorine concentrations varyingfrom 1 to 9 mg/L. The solutions are created by diluting sodium hypochlorite(NaClO) in Type 1 ultra-pure filtered water. The chlorine concentrationin the standard solutions are verified using an iodometric titration. Thestandard solutions can be used to calibrate the sensor for both free and432.4. CalibrationFigure 2.10: Intensity variations of the R, G, and B channels as a functionof the free chlorine concentration of standard solutions, along with lines ofbest fit.total chlorine concentrations.Free ChlorineFor a given calibration measurement, a 3 mL sample of the standardsolution 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 chlorineconcentrations, the water sample is clear, and for high chlorine concentra-tions, the water sample is saturated pink. The calibration data is shown inFig. 2.10 along with linear fits to the data for the three channels. Althoughthe 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 lowchlorine concentrations up to 6.5 mg/L. The linear calibration functions foreach channel and their corresponding R2 are given in Table 2.4.Like the case for pH, the blue and green channels exhibit the greatestsensitivity to chlorine concentrations. As a result, only the green and bluechannels are used by the software algorithm to determine the free chlorine442.4. CalibrationTable 2.4: Calibration of the smart-phone-attached sensor for measurementof free chlorine concentration, [Clfree]. Best fit functions and correspondingR2 for the R, B, and G channels as a function of [Clfree].Model R2Red Channel R = 0.12× [Clfree] + 0.41 0.011Green Channel G = −24.05× [Clfree]− 4.59 0.974Blue Channel B = −9.582× [Clfree] + 14.58 0.972concentration. 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 from1 mg/L up to 7 mg/L. The free chlorine concentrations measured from thegreen and blue channels are given equal weighting factors to determine theweighted average free chlorine concentration.Table 2.5: Analytical functions used by the software algorithm to calculatefree chlorine concentration based on the green and blue channels. The finalfree chlorine concentration is based on a weighted average of the chlorineconcentrations from the green and blue channels.Analytical FunctionGreen Channel FCgreen = −0.0416×G− 0.191Blue Channel FCblue = −0.104×B + 1.52FC = 0.5× FCgreen + 0.5× FCblueTotal ChlorineThe same standard solutions used to calibrate the sensor for freechlorine 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 Lamottetotal chlorine reagent cuvette (model: 4312) and the R, G, and B valuesfrom 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 functionsfor each channel and their corresponding R2 are given in Table 2.6. The452.4. CalibrationFigure 2.11: Intensity variations of the R, G, and B channels as a functionof the total chlorine concentration of standard solutions, along with lines ofbest fit.total chlorine concentration is determined from the green and blue chan-nels using the analytical expressions shown in Table 2.7. The total chlorineconcentrations measured from both the green and blue channels are givenequal weighting factors to determine the weighted average total chlorineconcentration.2.4.3 Alkalinity CalibrationAlkalinity is generally defined as the equivalent concentration of calciumcarbonate (CaCO3). However, calcium carbonate is not soluble in water andprecipitates at room temperature when the concentration exceeds 15 mg/L.As a work around, we use sodium carbonate (Na2CO3), which has betterwater solubility, to create standard solutions with known alkalinity. To de-termine the alkalinity of the standard solutions in terms of the concentration462.4. CalibrationTable 2.6: Calibration of the smart-phone-attached sensor for measurementof total chlorine concentration, [Cltotal]. Best fit functions and correspondingR2 for the R, B, and G channels as a function of [Cltotal].Model R2Red Channel R = −0.047× [Cltotal] + 33.94 0.003Green Channel G = −19.20× [Cltotal]− 16.93 0.9647Blue Channel B = −9.62× [Cltotal] + 13.89 0.981Table 2.7: Analytical functions used by the software algorithm to calculatetotal chlorine concentration based on the green and blue channels. The finaltotal chlorine concentration is based on a weighted average of the chlorineconcentrations from the green and blue channels.Analytical FunctionGreen Channel TCgreen = −0.052×G− 0.882Blue Channel TCblue = −0.104×B + 1.44TC = 0.5× TCgreen + 0.5× TCblue472.5. Measurement ProcedureTable 2.8: Calibration of the smart-phone-attached sensor for measurementof alkalinity concentration, [Alk]. Best fit functions and corresponding R2for the R, B, and G channels as a function of [Alk].Model R2Red Channel R = −1.046× [Alk] + 16.75 0.988Green Channel G = −0.404× [Alk] + 12.52 0.992Blue Channel B = 0.458× [Alk]− 91.42 0.970of calcium carbonate, we use the relation[CaCO3]MCaCO3=[Na2CO3]MNa2CO3(2.4)where MCaCO3 = 100.09 g/mol and MNa2CO3 = 105.09 g/mol are the respec-tive molar masses of calcium carbonate and sodium carbonate. 11 standardsolutions with alkalinity ranging from 0-200 mg/L CaCO3 are prepared. Fora given measurement, a 3 mL sample of the standard solution is mixed witha 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 changefrom yellow to deep blue with increasing alkalinity concentrations. The cal-ibration data is shown in Fig. 2.12. The data from all three channels arefitted 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 channelsto the alkalinity of the standard solutions, all three channels are used by thesoftware algorithm to determine alkalinity based on the analytical expres-sions shown in Table 2.9. The weighting factors for the alkalinity measuredfrom 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 thelinear functions to the calibration data and the slope of the linear functions.2.5 Measurement ProcedureWe will now discuss the entire measurement procedure (outlined inFig. 2.13) using the water quality sensor developed in this Chapter. Themeasurement procedure consists of 12 steps: (1) the attachment is pushedonto the iPhone and the app is initiated; (2) a parameter is selected formeasurement from the app title screen; (3) after ensuring that the mount482.5. Measurement ProcedureFigure 2.12: Intensity variations of the R, G, and B channels as a functionof the alkalinity of standard solutions, along with lines of best fit.492.6. ConclusionTable 2.9: Analytical functions used by the software algorithm to calculatealkalinity concentration based on the red, green, and blue channels. Thefinal alkalinity concentration is based on a weighted average of the alkalinityconcentrations from the red, green, and blue channels.Analytical FunctionRed Channel Alkred = −0.956×R+ 16.02Green Channel Alkgreen = −2.474×G+ 30.97Blue Channel Alkblue = 2.183×B + 199.6Alk = 0.35×Alkred + 0.5×Alkgreen + 0.15×Alkblueis closed, START is selected to capture a reference measurement; (4) thecuvette lid is removed from the attachment; (5) the cuvette lid is insertedonto a cuvette, which breaks the seal on the cuvette; (6) the cuvette isfilled with water using a dropper inserted into the lid opening; (7) filling thecuvette up to the rim of the lid yields exactly 3 mL; (8) the cuvette is invertedto 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 ofthe water sample is measured and correlated through calibration functionsto the concentration of the selected parameter, which is displayed on screen.2.6 ConclusionWe have designed, created, and validated a sensor prototype that op-erates in conjunction with an iPhone to perform colorimetric water qualitymeasurements. Colorimetric measurements are performed by exploiting thelight source and camera integrated onto an iPhone. A physical attachmenthas been designed to provide a light-tight enclosure to perform controlledand repeatable measurements. The attachment has been designed to housestandard cuvettes containing colorimetric indicators that produce charac-teristic color changes due to pH, chlorine, and alkalinity. The cuvettes areavailable for bulk purchase and can be disposed upon completion of themeasurement. The developed sensor provides several benefits over othercolorimetric measurement tools. First, the measurement process is quickand intuitive. The total measurement procedure for one parameter takesless than thirty seconds and requires no precise measuring of chemicals.502.6. ConclusionFigure 2.13: The measurement process for a single water quality parameterusing the phone-attached water quality sensor. The average time for themeasurement of one parameter is under a minute.512.6. ConclusionThe instructions are given to the user on-screen, which largely eliminatesthe 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 fromplastic and contains no active electronic components, the manufacturingcosts are low and the performance of the device is robust. We anticipatethat this sensor could be used to determine water quality for recreationaluses such as swimming pools.Our prototype sensor also has several limitations. The attachmentis designed for the iPhone 4/4S. To work with another smart phone model,the attachment must be re-designed and tailored to the specific dimensionsof 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 usermust remove any cases and covers before using the sensor. Moreover, themeasurement requires the user to bring the iPhone near open water, whichincreases the risk of water contact. Like other smart phone sensors that relyupon hardware integrated onto the phone, our implementation suffers fromlimited access to the hardware. As we have discussed, the camera settingsof the iPhone cannot be directly adjusted, which necessitated the referencemeasurement step. Finally, the operation of the sensor relies upon commer-cially available reagent-filled cuvettes. Reliance on third-party equipmentcould potentially hinder wide-spread use of the sensor.52Chapter 3Wireless Smart Phone WaterQuality SensorIn this Chapter, we will present the design, fabrication, calibration,and validation of a water quality sensor that operates in conjunction witha smart phone through a wireless connection and custom-written applica-tion software. The key difference between the prototype described in theprevious Chapter and the one described here is that water quality measure-ments are made by a stand-alone sensor node that can wirelessly connectto any device (phone, tablet, or computer) through a Bluetooth connection.The sensor node will contain all necessary hardware to perform colorimetricmeasurement and wireless communication. The sensor node will be fullyautomated and controlled by the user on a mobile device through a soft-ware application. In this Chapter we have chosen to interface the sensorwith an Android smart phone. We have chosen to use an Android smartphone, as opposed to an iPhone which was used in the previous Chapter,due to the overwhelming popularity of Android devices. The key conceptualcomponents of the sensor are shown in Fig. Sensor HardwareThe critical component of the sensor is the wireless sensor node. Asshown 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 colorimetricreagent cuvettes used in the previous Chapter. On one side of the slot isa light source that illuminates the water sample. On the other side of theslot is a color sensor to detect the color of the light transmitted throughthe water sample. In addition to basic components to perform colorimet-ric measurement, the sensor node contains a suite of off-the-shelf electroniccomponents that enable data processing, data transmission, and commu-533.1. Sensor Hardwarelight source water sample color sensor microcontroller wireless interfacewireless interface data analysis result displayFigure 3.1: The wireless water quality sensor consists of a portable sensornode containing the sensing hardware, a sample mount, and a wireless inter-face. Application software on the smart phone wirelessly receives data fromthe sensor node, analyzes the data, and displays the measurement result.nication with a mobile smart phone. Details of the electronic componentsare 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 communicationcomponent to wirelessly interface with a smart phone, and a power systemto enable battery operation and battery charging. In this section, we willdescribe the details of each of these components.3.1.1 Light SourceThe light source is a diffused white light-emitting diode (LED). Asmentioned in the previous Chapter, white LEDs do not provide a broadvisible spectrum (like that of sunlight). However, LEDs are extremely energyefficient and available at low cost. A diffused LED is used, as opposed toa directional LED, to broaden the illumination angle and provide greaterillumination uniformity. The alignment of the LED is critical due to thecompact size of the colorimetric setup and the narrow acceptance angle ofthe color sensor. Once the LED has been mounted, it is affixed with opticalglue to prevent further movement.3.1.2 Color SensorColor measurement is performed using a RGB color sensor (AvagoTechnologies, model: HDJD-S822-QR999). There are several advantagesto using a color sensor for colorimetric measurement as opposed to a colorcamera, which was used in the previous Chapter. First, color sensors require543.1. Sensor HardwareFigure 3.2: The enclosure, constructed from black ABS plastic, houses thelight source, color sensor, microcontroller, wireless module, and battery cir-cuit.553.1. Sensor HardwareFigure 3.3: A visual diagram of the circuitry of the wireless smart phonesensor system. The circuit consists of a light source, color sensor, microcon-troller, wireless communication system, and power supply. The circuit caninterface to a micro-USB charging circuit, has a power switch to turn on thesensor, and a wireless Bluetooth interface to connect to a smart phone.563.1. Sensor HardwareFigure 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 eachphotodiode is covered by either a red, green, or blue filter. The photodiodearray outputs an amplified analog voltage signal in the red, green, and bluechannels proportional to the intensity of light in the red, green, and bluespectral regions as defined by the response of the filters. An aggregatemeasure of color is obtained based on the relative voltage values from thered, blue, and green channels of the color sensor. The spectral responseof the red, green, and blue channels is shown in Fig. 3.5. Note that theblue channel is the least sensitive followed by green and then red. Thisis due to the inherent photo-electric response of the photodiode and thetransmissivity of the filters. Due to the small size of the active area of thesensor (approximately 1 mm2), the sensor must be carefully aligned withrespect to the center of the light beam from the LED. Once the sensor hasbeen mounted, it is affixed with optical glue to prevent further movement.573.1. Sensor HardwareFigure 3.5: Response of the three color channels of the HDJD-S822-QR999sensor.583.1. Sensor Hardware3.1.3 MicrocontrollerWe use a simple MCU to control the light source and color sensorand perform all communication tasks with the smart phone. The MCU usedin our system is the 16 MHz Arduino Pro Micro (model: DEV-12640), whichis based on the ATmega32U4 microcontroller chip. The board is equippedwith a JTAG debugging USB interface to allow rapid loading and prototyp-ing of software programs. Three analog input pins and their corresponding10 bit analog to digital converters are used to read the three voltage signalsfrom the RGB color sensor. The color sensor and light source are controlledthrough digital input and output pins. The platform is also equipped withserial communication pins to handle serial communication with the Blue-tooth module to be described in the next section. The entire MCU has asmall foot print (approximately 2 × 3 cm) and fits inside the sensor case.3.1.4 Wireless CommunicationCommunication between the sensor node and smart phone is per-formed through a wireless connection. A Bluetooth connection is suitablefor 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 simplesetup (no routing hardware is required and communication is direct). TheBluetooth chipset used in our system is the JY-MCU module. The module isdesigned to operate as a class 2 device (≈ 10 m range) under the BluetoothV2.0 standard. Because the Bluetooth module operates at a logic level of3.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 Vand down-converts signals from the MCU from 5 V to 3.3 V) is used tointerface the two systems.3.1.5 Power SupplyThe sensor node requires additional electronics to provide portablepower to the device for extended periods of time. We have incorporated arechargeable lithium polymer 1000 mAh battery (model: PRT-00339) intothe electronics of the sensor. When the battery is fully charged, a boostconverter (model: PRT-10255) allows the circuit to fully run from batterypower. The boost converter ensures a consistent supply voltage and turnsoff when the battery is empty. We have also included a micro USB chargingcircuit (model: PRT-10217) that allows the user to charge the battery when593.2. ReagentsFigure 3.6: An image of the complete circuit inside the sensor enclosure withthe lid removed. A switch on the outside of the sensor allows the user toturn the device on and off. A micro-USB interface is available to charge thebattery when the sensor is not in use.the sensor is not in use. A switch fastened to the outside of the enclosureenables 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 enclosureof the sensor.3.2 ReagentsThe wireless sensor will perform measurements of pH, chlorine, andalkalinity concentration using similar colorimetric reagent chemistries as dis-cussed in the previous Chapter. We will use reagent cuvettes supplied fromLaMotte Inc.603.3. Phone Application Software3.3 Phone Application SoftwareThe phone application software performs two main functions: 1) itanalyzes raw data from the sensor and 2) it provides a touch-based interfacefor the user. Because the colorimetric measurements do not depend onthe hardware of the smart phone, the sensor node can operate with anysmart phone model running the phone application software. For our initialprototype, we have chosen an Android-based Samsung Galaxy S2 smartphone.When the phone application is launched on the phone, it first checksto ensure that the phone is a Bluetooth-enabled device. The application im-mediately ceases if the phone does not have Bluetooth connectivity. Oncethe software has confirmed Bluetooth connectivity, a title screen is displayedconsisting of a list of measurable parameters and a button labeled “Con-nect”, which initiates an attempt by the phone to establish a connectionwith the sensor node. Prior to establishing the Bluetooth connection, allbuttons on the title screen are inactive except for the “Connect” button.Once the user initiates a connection, the application enables the Bluetoothradio on the phone and searches for the device. The application assumesthat the sensor has previously been paired with the phone and the Bluetoothdevice 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 sensorhave been successfully connected, the phone sends out a request to the sen-sor node to perform a reference measurement. This reference measurementis made with no sample in place and relayed back to the phone. The connec-tion sequence and reference measurement are performed in the backgroundwithout any input from the user and usually take 1-2 seconds. Figure 3.7shows screenshots of the title screen before and after connection with thesensor node. Once the sensor has been connected, the “Connect” buttonchanges to a “Connected” button and the buttons for the water qualityparameters are activated.After connection with the sensor node, the user can perform waterquality measurements by selecting a desired parameter from the title screen.One the parameter is selected, the app sends a measurement request to thesensor 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 and613.3. Phone Application SoftwareFigure 3.7: Title screens of the software application (left) prior to and (right)after establishing Bluetooth connection with the sensor node.623.4. Calibrationgraphically. Some example screenshots of measurement results displayed bythe app are shown in Fig. CalibrationCalibration curves for pH, chlorine, and alkalinity concentrations areestablished by measuring the sensor output using standard solutions withknown concentrations. The preparation methods for the standard solutionsare identical to those used in the previous Chapter. The sensor response isquantified according to average voltage signals from the red, green, and bluechannels sent from the sensor to the phone, each normalized (by a simpledifference as shown in Eqns. 2.1-2.3) to reference values obtained when thephone first connects to the sensor.3.4.1 pH CalibrationTo calibrate the wireless sensor for pH, 15 standard solutions withpH varying from 6.5 to 8.5 are prepared. The pH values of the solutions areverified using a pH meter (Oakton pH 500). The solutions are injected intothe reagent-bearing cuvette and the color of the water sample is quantifiedusing the wireless sensor. Figure 3.9 displays the normalized red, green, andblue channels measured by the wireless sensor as a function of pH. Fromthese results, we derive the calibration curves shown in Table 3.1. Based onslope and quality of fit of the calibration curves, only measurements fromthe red and green channels are used by the application software to determinepH. The analytical functions used by the application software to calculatepH, along with the relative weights of the pH measurement from the redand 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 afunction of [pH].Model R2Red Channel R = 22.81× [pH]− 184.29 0.966Green Channel G = 103.64× [pH]− 640.60 0.951Blue Channel B = −4.97× [pH] + 168.41 0.129633.4. CalibrationFigure 3.8: Upon successful completion of the measurement, the concen-tration of the selected water quality parameter is displayed along with ananimated color bar that indicates the position of the measurement relativeto the overall range of the sensor. Example screenshots from the softwareapplication are shown for all four parameters.643.4. CalibrationFigure 3.9: Intensity variations of the R, G, and B channels as a function ofthe pH of standard solutions, along with lines of best fit.653.4. CalibrationTable 3.2: Analytical functions used by the software algorithm to calculatepH based on the red and green channels. The final pH measurement isbased on a weighted average of the pH measurements from the red andgreen channels.Analytical FunctionRed Channel pHred = 0.044×R+ 8.08Green Channel pHgreen = 0.0096×G+ 6.18pH = 0.55× pHred + 0.45× pHgreen3.4.2 Chlorine CalibrationTo calibrate the wireless sensor for chlorine, 11 standard solutionshaving 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 chlorineconcentrations to a strong pink for higher chlorine concentrations.Free ChlorineFigure 3.10 displays the normalized red, green, and blue channelsmeasured by the wireless sensor as a function of free chlorine concentration.The evolution of color as a function of chlorine concentration is non-linearin all three channels. To obtain analytical functions that can be used bythe software to determine chlorine concentration, the calibration data isinverted (concentration on the vertical axis and normalized red, green, andblue channels on the horizontal axis) and fit to an exponential function ofthe formy = y0 +Aex−x0t , (3.1)where x and y are the respective horizontal and vertical coordinates, x0and y0 are the respective horizontal and vertical shifts, A is the amplitudescaling 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 tothe calibration data. The resulting exponential functions and the qualityof fit of these functions to the calibration data are shown in Table 3.3. Allthree channels provide good sensitivity to the chlorine concentration, withthe green and blue channels having higher sensitivity for higher chlorineconcentrations. Accordingly, the chlorine measurement from the green and663.4. CalibrationFigure 3.10: Intensity variations of the R, G, and B channels as a functionof the free chlorine concentration of standard solutions.blue channels are given greater weights than that from the red channel forthe computation of the nominal chlorine concentration.Total ChlorineFigure 3.11 displays the normalized red, green, and blue channelsmeasured by the wireless sensor as a function of total chlorine concentration.Like the case for free chlorine, we fit the inverted total chlorine calibrationdata with exponential functions having a general form given by Eqn. 3.1.The exponential functions and the quality of fit of these functions to thecalibration data are shown in Table 3.4. Data from all channels is usedto determine the total chlorine concentration. The nominal total chlorineconcentration consists of a weighted sum of measurement from all chan-nels, where approximately equal weights have been applied to each channelmeasurement. It should be noted that the exponential fit functions for thecalibration data for chlorine concentration provide significantly better fitsthan the linear functions used in the previous Chapter. As a result, thewireless sensor can measure a larger range of chlorine concentrations than673.4. CalibrationTable 3.3: Analytical functions used by the software algorithm to calculatefree chlorine concentration based on the red, green, and blue channels. Thefinal free chlorine concentration is based on a weighted average of the freechlorine concentrations from the red, green, and blue channels.Analytical Function R2Red Channel FCred = −0.34 + 1.75× eR+37.5129.13 0.954Green Channel FCgreen = 0.33 + 0.68× eG−25.7473.99 0.990Blue Channel FCblue = −0.29 + 5.04× eB−109.4784.66 0.995FC = 0.2× FCred + 0.4× FCgreen + 0.4× FCblueTable 3.4: Analytical functions used by the software algorithm to calculatetotal chlorine concentration based on the red, green, and blue channels. Thefinal total chlorine concentration is based on a weighted average of the totalchlorine concentrations from the red, green, and blue channels.Analytical Function R2Red Channel TCred = −0.28 + 6.96× eR+2.9327.51 0.996Green Channel TCgreen = 0.41 + 0.95× eG−63.6662.30 0.987Blue Channel TCblue = −0.073 + 1.27× eB−14.6068.73 0.992TC = 0.3× TCred + 0.3× TCgreen + 0.4× TCbluethe phone-attached sensor.3.4.3 Alkalinity CalibrationTo calibrate the wireless sensor for alkalinity, 11 standard solutionswith alkalinity ranging from 0-200 mg/L CaCO3 are prepared. Figure 3.9displays 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 channelwith a single linear function and the data from the red and green channelswith 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 in683.4. CalibrationFigure 3.11: Intensity variations of the R, G, and B channels as a functionof the total chlorine concentration of standard solutions.693.5. Measurement ProcedureFigure 3.12: Intensity variations of the R, G, and B channels as a functionof the alkalinity concentration of standard solutions, along with lines of bestfit.Table Measurement ProcedureWe will now discuss the entire measurement procedure (outlined inFig. 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 smartphone is initiated and the smart phone connects to the sensor after theuser touches the “Connect” button on the title screen. The wireless sensornode must be turned on and the smart phone Bluetooth adapter enabledto establish a connection. (2) After establishing a connection, the userremoves the cuvette lid from the sensor. (3) The cuvette lid is inserted overthe cuvette, piercing the seal on the reagent-bearing cuvette. (4) A sampleof water is added to the cuvette through the opening in the lid. (5) Thecuvette is filled with water until the meniscus level reaches the bottom ofthe lid, indicating 3 mL. (7) The cuvette is inverted to mix the water sample703.6. ConclusionTable 3.5: Calibration of the wireless sensor for measurement of alkalinity,[Alk]. Best fit functions and corresponding R2 for the R, B, and G channelsas a function of [Alk].Model R2Red Channel (0-80 mg/L) R1 = 1.34× [Alk]− 10.10 0.983Red Channel (80-200 mg/L) R2 = 0.31× [Alk] + 73.99 0.937Green Channel (0-80 mg/L) G1 = 1.18× [Alk] + 14.84 0.956Green Channel (80-200 mg/L) G2 = 0.32× [Alk] + 84.41 0.954Blue Channel (0-200 mg/L) B = −0.43× [Alk] + 123.76 0.934Table 3.6: Analytical functions used by the software algorithm to calculatealkalinity concentration based on the red, green, and blue channels. Thefinal alkalinity concentration is based on a weighted average of the alkalinityconcentrations from the red, green, and blue channels.Analytical FunctionRed Channel (0-80 mg/L) AlkRed1 = 0.74×R+ 7.51Red Channel (80-200 mg/L) AlkRed2 = 3.20×R− 237.03Green Channel (0-80 mg/L) Alkgreen1 = 0.85×G− 12.58Green Channel (80-200 mg/L) Alkgreen2 = 3.09×G− 260.57Blue Channel Alkblue = −2.33×B + 288.51Alk = Wred ×Alkred +Wgreen ×Alkgreen +Wblue ×Alkbluewith the colorimetric reagent. (8) The mixed water sample is then insertedback into the sensor. (8) A parameter is selected from the title screen ofthe phone app. (9) The sensor performs the measurement and wirelesslysends the raw data back to the phone. (10) The phone application analyzesthe raw data based on pre-programmed calibration curves and displays themeasurement result on screen.3.6 ConclusionThe wireless water quality sensor has several advantages comparedwith the phone-attached water quality sensor developed in the previous713.6. ConclusionFigure 3.13: The measurement process for a single parameter has beenstreamlined to be completed in few steps in under one minute.723.6. ConclusionFigure 3.14: Image of the wireless water quality sensor and a SamsungGalaxy 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 measurementsto be performed without a physical attachment to the smart phone, whichreduces risk of phone damage due to exposure to water. Like the phone-attached prototype, the wireless sensor is light-weight and portable, fittinginto the palm of a hand. Although this prototype requires battery power,the circuit has been designed to minimize power consumption and runs ona rechargeable battery that can be charged using the common micro-USBinterface. An image of the final completed sensor is shown in Fig. 3.14.73Chapter 4ConclusionThe goal of this thesis was to create water quality sensors that wouldenable a user with minimal training to make immediate measurements ofwater quality at the point of sampling. We have developed water qualitysensors based on the quantification of the color of water samples mixed withindicator reagents, a standard procedure widely used to estimate the pres-ence of chemical contaminants in water. Color has been quantified throughcolorimetry, a technique based on measurement of the relative intensity oflight over selective portions of the visible spectrum. To achieve a colorimet-ric water quality sensor that is highly portable, cost-effective, and easy touse, 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 aphysical sensor attachment to a smart phone and a second-generation pro-totype based on a wireless sensor node that communicates to any smartphone through a Bluetooth interface.74Chapter 4. ConclusionFigure 4.1: Image of four colorimetric water quality sensors (from left toright): a Hach DR/890 colorimeter and accompanying user manual, thewireless sensor presented in Chapter 3, the phone-attached sensor presentedin Chapter 2, and test strips.75Chapter 4. ConclusionTable4.1:Specificationsoffourcolorimetricwaterqualitysensors:teststrips,theattachedsensor,thewirelesssensor,andtheHachcolorimeter. TestStripsAttachedSensorWirelessSensorColorimeterParameters34a4a60Pricelow--highDimensions(mm)-60×60×50110×70×50240×90×50Weight(g)negligible50150500PowerSource--rechargeablebattery4AAbatteriesBatteryLife--2months6monthsMeas.Duration(sec)b304535120aNumberofparameterscanbeextended.bMeasurementtimeincludesreagentmixingandcorrespondstothemeasurementofoneparameter.76Chapter 4. ConclusionHow do the sensors developed in this work compare to other water qual-ity sensor technologies? Let’s take for comparison the industry-standardHach DR/890 colorimeter and conventional test strips commonly used toassess pool water quality. Both the colorimeter and test strips determinewater quality through color measurement. Test strips are rectangular piecesof 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 canbe visually inspected to estimate the concentration of the targeted chemi-cal species. The inherent disadvantage of test strips is that they rely uponhuman vision, which has been shown in Chapter 1 to be subjective anderror-prone due factors such as metamerism, opponent process, color con-stancy, and color blindness. The colorimeter works in a similar manner toour 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 toour prototypes, however, the colorimeter is not intuitive to use as the usermust consult a large instruction manual to operate the device. Colorimetersare also costly, which prohibits widespread adoption especially in developingcountries. Finally, the colorimeter lacks advanced features that are standardin most smart phones such as touch-based displays, GPS-tagging, and datasharing through email. Table 4.1 summarizes the key features of test strips,the prototype sensors developed here, and the colorimeter. Figure 4.1 showsan 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 measurementquality of our sensors to that of the colorimeter and test strips, we set up acomparative experiment using three test samples of varying pH. The nom-inal pH values of the test samples have been determined using a calibratedpH meter (Oakton pH 500). Using each of the four sensors, six independentmeasurements of pH are made for each of the three test samples (yieldinga 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 thecolorimeter and test strips are given by the resolution of the measurements.The accuracy of the measurement made by each sensor is quantified by theaverage discrepancy between the average pH values from the three sets ofsix measurements and the nominal pH values. The results of the compara-tive experiment are shown in Table 4.2. Not surprisingly, test strips providethe least accurate and least precise pH measurements. Both prototypes77Chapter 4. ConclusionTable 4.2: Estimated accuracy and precision of pH measurements madeusing test strips, the phone-attached water quality sensor, the wireless waterquality sensor, and a Hach DR/890 colorimeter.Average Error Precision ofof pH Measurements pH MeasurementsTest Strips 0.56 0.4Attached Sensor 0.09 0.15Wireless Sensor 0.13 0.15Colorimeter 0.23 0.1provide pH measurements with accuracy and precision comparable to thatof the pH measurements made with the colorimeter. Based on the limiteddata of this test, the phone-attached sensor provides the most accurate pHmeasurements, 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 thethree test solutions with varying pH, we analyze the behavior of two types ofdata from the sensors: 1) raw R, G, and B values obtained under referencemeasurement conditions when no sample cuvette is in place and 2) normal-ized R, G, and B values obtained under measurement conditions when thefilled sample cuvette is in place. As shown in Table 4.3, under referencemeasurement conditions the raw color data from the phone-attached sensorshown much larger variations than the raw color data from the wireless sen-sor. This is due to white-balancing, exposure compensation, and automaticfocussing inherent to the camera onboard the iPhone, which re-adjusts thecamera settings for each reference measurement. Normalizing the R, G, andB values largely eliminates this source of error for the phone-attached sen-sor, which explains the dramatic reduction in the variation of the color dataunder measurement conditions. Color data from the wireless sensor, on theother hand, exhibit low variation under reference measurement conditionsand relatively high variation under measurement conditions. The low vari-ation under reference measurement conditions is due to the stability of thecolor sensor chip. The high variation under measurement conditions is dueto the sensitivity of colorimetric setup. The active area of the color sen-sor is approximately 1 mm2, which measures color corresponding to a very78Chapter 4. ConclusionTable 4.3: Summary of the measurement variation for the attached andwireless sensors under reference measurement conditions with no sample inplace and measurement conditions with a sample in place. Also shown isthe average measurement discrepancy between the various color channels.Attached Sensor Wireless SensorAvg. Std. Dev.2.94 0.06with No Samplea (%)Avg. Std. Dev.1.21 0.40with Samplea (%)Channel6.5 7.5Discrepancyb (%)aStandard deviation is calculated as a percentage of the sensor range.bDiscrepancy 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 sensoris 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 measurementsobtained from the different color channels for both sensors are small andcomparable, which suggests that the calibration procedures and functionsused for both sensors are equally good.In conclusion, we have realized two versions of a colorimetric waterquality sensor achieving portability, ease-of-use, and cost-effective imple-mentation by operating in conjunction with smart phones. One sensor isbased on physical attachment to a smart phone and another sensor is basedon a wireless node that communicates to a smart phone through Bluetoothconnection. 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 accessibleand ubiquitous water quality monitoring technologies that could potentiallybe 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 easily79Chapter 4. Conclusionimproved by incorporating diffusing elements or lenses into the path betweenthe light source and the color sensor, which would reduce the sensitivity ofthe measurement. The power consumption of the wireless sensor can also beimproved by using a more energy efficient Bluetooth implementation (suchas the new Bluetooth Low Energy Standard) and by optimizing the circuitwith custom-built electronics. Future work should also extend the numberof measurable parameters and include those parameters that are relevantfor water contamination by industrial and agricultural processes such asturbidity, nitrates, and metals.80Bibliography[1] R. D. Letterman, Water Quality and Treatment: A Handbook of Com-munity Water Supplies. New York: McGraw-Hill, 5 ed., 1999. → pages1, 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; accessed16-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, May2012. → pages 3[5] J. Selinummi, J. Seppala, O. Yli-Harja, and J. Puhakka, “Softwarefor quantification of labeled bacteria from digital microscope imagesby 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 imageanalysis,” 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. → pages81Bibliography[8] L. L. Drey, M. C. Graber, and J. Bieschke, “Counting unstained, conflu-ent cells by modified bright-field microscopy,” Biotechniques. → pages3[9] D. A. Skoog, D. M. West, and J. F. Holler, Analytical Chemistry - AnIntroduction. Philadelphia: Sauders College Publishing, 5 ed., 1990. →pages 3[10] D. C. Harris, Exploring Chemical Analysis. New York: W.H. Freemanand 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 ofthe 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,” PhilosophicalTransactions 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, “Selectedcolorimetric 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: HarvardUniversity Press, 1 ed., 1964. → pages 1582Bibliography[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 retinalcone 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 artand 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-generationimaging, diagnostics and measurement tools,” Lab Chip, pp. –, 2014.→ pages 20[24] P. Pelegris, K. Banitsas, T. Orbach, and K. Marias, “A novel methodto detect heart beat rate using a mobile phone,” in Engineering inMedicine and Biology Society (EMBC), 2010 Annual InternationalConference 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, “Electrogeneratedchemiluminescence 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. Lo´pez-Ruiz, A. Mart´ınez-Olmos, I. P. de Vargas-Sansalvador,M. Ferna´ndez-Ramos, M. Carvajal, L. Capitan-Vallvey, and A. Palma,“Determination of O2 using colour sensing from image processing withmobile devices ,” Sensors and Actuators B: Chemical, vol. 171172, no. 0,pp. 938 – 945, 2012. → pages 2283Bibliography[29] R. Copperwhite, C. McDonagh, and S. O’Driscoll, “A camera phone-based UV-dosimeter for monitoring the solar disinfection (SODIS) ofwater,” Sensors Journal, IEEE, vol. 12, pp. 1425–1426, May 2012. →pages 22[30] L. Shen, J. A. Hagen, and I. Papautsky, “Point-of-care colorimetricdetection 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, “Mobiledevice-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 aprototype 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 2384Bibliography[39] D. N. Breslauer, R. N. Maamari, N. A. Switz, W. A. Lam, and D. A.Fletcher, “Mobile phone based clinical microscopy for global healthapplications,” 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,” AnalyticalChemistry, 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. Go¨ro¨cs, L. A.Bentolila, T.-T. Wu, R. Sun, and A. Ozcan, “Fluorescent imaging ofsingle 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, andA. 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,” LabChip, vol. 13, pp. 636–640, 2013. → pages 23[45] A. F. Coskun, R. Nagi, K. Sadeghi, S. Phillips, and A. Ozcan, “Albumintesting 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 inwater,” Sensors and Actuators B: Chemical, vol. 191, no. 0, pp. 561– 566, 2014. → pages 23[48] V. Chalenko, “Beastgrip. Universal lens adapter for most cameraphones.” https://www.kickstarter.com/projects/107650693/beastgrip-universal-lens-adapter-for-most-camera-p?ref=live, November 2013. [Online; accessed 05-February-2014]. → pages2385Bibliography[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 ratesensor,” 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 andaccelerometer data,” in Wearable Computers, 2005. Proceedings. NinthIEEE International Symposium on, pp. 220–221, 2005. → pages 2486Bibliography[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,” inNew Circuits and Systems Conference (NEWCAS), 2012 IEEE 10thInternational, 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 VLSIDesign, 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 mobileelectrocardiogram 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 monitoringwith Android based mobile devices,” in Information CommunicationTechnology 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 phonesensing 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 andTechnology (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 2787Bibliography[68] “IEEE Standard for Information technology–Telecommunications andinformation exchange between systems Local and metropolitan areanetworks–Specific requirements Part 11: Wireless LAN Medium AccessControl (MAC) and Physical Layer (PHY) Specifications,” IEEE Std802.11-2012 (Revision of IEEE Std 802.11-2007), pp. 1–2793, March2012. → 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 3688


Citation Scheme:


Citations by CSL (citeproc-js)

Usage Statistics



Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            async >
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:


Related Items