An Automated Toolchain for Camera-Enabled Sensing of Drinking Water Chlorine Residual

ACS ES T Eng. 2022 Sep 9;2(9):1697-1708. doi: 10.1021/acsestengg.2c00073. Epub 2022 Jun 3.

Abstract

Chlorine residual concentration is an important parameter to prevent pathogen growth in drinking water. Disposable color changing test strips that measure chlorine in tap water are commercially available to the public; however, the color changes are difficult to read by eye, and the data are not captured for water service providers. Here we present an automated toolchain designed to process digital images of free chlorine residual test strips taken with mobile phone cameras. The toolchain crops the image using image processing algorithms that isolate the areas relevant for analysis and automatically white balances the image to allow for use with different phones and lighting conditions. The average red, green, and blue (RGB) color values of the image are used to predict a free chlorine concentration that is classified into three concentration tiers (<0.2 mg/L, 0.2-0.5 mg/L, or >0.5 mg/L), which can be reported to water users and recorded for utility use. The proposed approach was applied to three different phone types under three different lighting conditions using a standard background. This approach can discriminate between concentrations above and below 0.5 mg/L with an accuracy of 90% and 94% for training and testing data sets, respectively. Furthermore, it can discriminate between concentrations of <0.2 mg/L, 0.2-0.5 mg/L, or >0.5 mg/L with weighted-averaged F1 scores of 79% and 88% for training and testing data sets, respectively. This tool sets the stage for tap water consumers and water utilities to gather frequent measurements and high-resolution temporal and spatial data on drinking water quality.