**2.2 Colorimetry**

*Color Detection*

quite visible.

**70**

**Figure 3.**

*smartphone spectrometer.*

*(a) The custom-designed cradle for smartphone-based spectrometer. Immersion probe for absorbance measurement is given in (b) and overall design is illustrated in (c). (d) The spectral images obtained from* 

corresponds to distilled water (DW), to 10 ppm (most right). The spectrum views are given at the bottom row where the reduction in red intensity with the concentration is

This design was further improved to make it compatible with immersion probe,

Schematic diagram of the 3D printed cradle is described in **Figure 3a**. The immersion probe was attached to the fiber-coupled smartphone flashlight and the reflection caused by radiation is carried to the camera via the grating. Plastic (PMMA)-based bifurcated fiber bundle was used to manufacture the probe with the diameter of 0.5 mm (also known as Y-cable) as shown in **Figure 3b**. The overall design is illustrated in **Figure 3c**. It was reported that no additional optical components were used in the reflection-based smartphone spectrometer system. The spectrum views

which made it more practical and user-friendly as illustrated in **Figure 3** [29].

As an alternative to spectrometric analysis, colorimetry is also widely used in many applications including food allergen testing [48], albumin testing in urine analysis [14], blood analysis [12], pH quantification [41], and water monitoring [45].

A digital tube reader designed in the 3D printer was equipped with two interchangeable LEDs to illuminate the test and control tubes so that the absorption spectrum of the colorimetric assay could be analyzed [48]. An albumin tester platform was proposed in [14] using an optomechanical attachment aligned with a smartphone camera. The 3D printed cradle was integrated to a compact laser diode, two AA batteries, a plastic lens, and an emission interference filter. An albumin-based fluorescent signal was obtained from the test tube by a digital fluorescent tube reader to calculate the albumin concentration values after comparison with a control tube. In [12], blood analysis was implemented with an integration of red blood cell counting, white blood cell counting, and hemoglobin measurement devices to smartphone cradle.

Smartphone-based colorimetric detection of pH, which varies between 0 and 14.0, was investigated with paper-based test [41]. The performance of the system was tested under two conditions: controlled and ambient illumination environments. To create controlled illumination settings, 3D printed cradle was equipped with apparatus which eliminates the interference of the present light as shown in **Figure 4a**. Four strips of same pH level were located side by side for imaging with an apparatus, then color calibration and white balancing were performed for those strips with the X-Rite ColorChecker Passport. The imaging was continued with replacing the strips in six different orientations as in **Figure 4b**.

Later, random orientations as shown in **Figure 4c** were used to mimic scenarios that could happen when untrained users take a picture. The reason for using a group of four strips is to see the effect of luminance variation due to their positioning with respect to the camera flash.

For the ambient illumination environments, no apparatus was used, and instead of using the smartphone flash as a light source, sunlight and fluorescent and halogen sources were used. To test the system under challenging conditions, the light sources were used in solo and in dual and triple combinations. The images captured in both controlled and ambient illumination environments with a different

## **Figure 4.**

*The overall smartphone-based colorimetry with apparatus and X-rite ColorChecker passport for color correction are shown in (a). The pH strips with various orientations used in imaging are given in (b), and (c) shows random orientations and positions of the test strips inside the smartphone field of view for dualillumination tests.*

**Figure 5.** *Experimental setup proposed in [45].*

replacement of the strips were used to train the machine learning algorithm which was designed to quantify the pH values accurately. Since the training set was enriched with the images captured in various and complicated scenarios, it was reported that pH values were detected with 100% accuracy.

One possible drawback of the colorimetry method in [41] is its computational cost due to its large training dataset. To address this issue, single-image referenced colorimeter was proposed in [45]. The system was simplified in the sense of both hardware and software design. Instead of using machine learning algorithm which needs a large dataset, it used local dataset created by a user with a single reference image. In addition, images from the local dataset were compared with test images using color-matching algorithms computationally cheaper than machine learning algorithms. The hardware design was also simplified into a cardboard box as shown in **Figure 5**. It was painted white, and white light-emitting diodes were mounted to the box ceiling to minimize the ambient illumination effects. A holder platform with the same height as the camera was placed for the assays to maintain the same distance for imaging. The system was tested on four different (nitrite, phosphate, chromium, and phenol) assays, and it was reported that the performance accuracy was between 76 and 100% depending on the assay types.
