*From Sophisticated Analysis to Colorimetric Determination: Smartphone Spectrometers… DOI: http://dx.doi.org/10.5772/intechopen.82227*

Styrene polymer using a 3D printer (Zortrax M200) with a 150-g polymer. Two pieces of plastic fiber cables were used in the design. The first 1.5-mm-diameter fiber carried the light from the smartphone flash to the cuvette while the second fiber cable with a diameter of 0.25 mm transmitted the light from cuvette to the camera which passed through the assay. The diameter of the second cable was critical as the light for spectral data was carried with this cable. Therefore, the effect of diameter on spectral data was analyzed using 0.25-, 0.5-, and 1.0-mm cables as given in **Figure 1b**, and 0.25-mm diameter was found to be adequate based on this experiment. A custom cradle was specially designed to align plastic optical fibers with smartphone optical components. As the cradle was solid, the solution could be placed into the cuvette slot. In order to simplify the spectrometer system design, no collector lens or mirrored components were placed in the light path. Besides cost, the most important factor in choosing plastic optical fibers instead of glass-based fiber optics was the ability to use plastic optical fibers without special tools for stripping and cutting.

To test the performance of the system, methylene blue (MB) solutions were prepared with different amounts and their respective spectral views are given in **Figure 2**. At the top row, the concentration of the solution varies from 0 ppm (most left), which

**Figure 2.** *MB solutions with a spectral view from 0.1 to 10 ppm.*

*Color Detection*

**2. Hardware designs**

**2.1 Spectrometer**

The rest of this chapter is organized as follows. The next section introduces the hardware designs for smartphone-based spectrometer and colorimetry. Section 3 presents the mobile apps and image processing algorithms to be used in smartphones. Section 4 describes assay preparation to be used in testing the performance of both spectrometer and colorimeter. Section 5 details the metric to evaluate the performance of the proposed designs. Closing remarks are given in Section 6.

In this section, a brief review of hardware designs of smartphone spectrometer and colorimetry is presented. Because of space constraints, only two examples of spectrometer and colorimetry are demonstrated in Section 2.1 and 2.2, respectively.

Recently, there has been a growing variety of spectrometer designs for specific applications. In [19], a compact imaging spectrometer was reported equipped with motorized selfie stick for remote sensing. Another spectrometer was designed to calculate spectra and quantify analytes by the assembly of medium-densityfiberboard, a DVD slice for diffraction grid, and mini incandescent lamps [20]. A flexible fiber bundle probe was integrated with a custom-designed cradle to convey

The next design [6] is illustrated in **Figure 1a**, which is a low-cost, portable, plastic fiber-based spectrometric smartphone to analyze dye adsorption for fielddeployable environmental and wastewater management. In the design, the rear camera of LG G4 (1/2.6″ sensor size with 5312 × 2988 resolution, 1.12 μm pixel size)

The smartphone was fitted into a custom-designed cradle assembled with hotplug apparatus toting a diffraction grating, and the whole part was connected with smartphone case and cuvette holder manufactured from Acrylonitrile Butadiene

*(a) The smartphone spectrometer with the inset (top-left) of a plastic fiber assembled into the built-in flash.* 

spectra data to smartphone camera for food quality monitoring [18].

was used to collect the spectral data of the assays.

*(b) The spectral images from different-sized plastic fibers are shown.*

**68**

**Figure 1.**

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 quite visible.

This design was further improved to make it compatible with immersion probe, which made it more practical and user-friendly as illustrated in **Figure 3** [29]. 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

**71**

**Figure 4.**

*illumination tests.*

*From Sophisticated Analysis to Colorimetric Determination: Smartphone Spectrometers…*

of blank solution (left) and 5-ppm BPA solution (right) are given in **Figure 3d** to demonstrate color variation can be detected with the spectrometer system.

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.

replacing the strips in six different orientations as in **Figure 4b**.

respect to the camera flash.

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

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

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

*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 dual-*

*DOI: http://dx.doi.org/10.5772/intechopen.82227*

**2.2 Colorimetry**
