{'fraction_non_alphanumeric': 0.022850382915136042, 'fraction_numerical': 0.01432040346180188, 'mean_word_length': 4.594566353187043, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Development of Optical Transducer on Fabrics for The Application of Liquid Clustering Using Reflectance Spectroscopy

Recently the method of reflection spectroscopy is very popular and effective to be used to identify the properties of a surface. It is commonly used in surface applications of solid materials and with NIR or VIS-NIR excitation sources. In this study, the reflection spectroscopy method was used to determine differences in the content of liquids. Then we designed an optical transducer system with an excitation source in the form of a 405nm blue-violet diode laser and an Adafruit AS7262 light detector. We tested the fluid samples on a variety of fabrics which were white flannel, red flannel, and white cotton. With the PCA program, the measured intensity results are clustered until a graph is obtained and can be observed. The clustering results show that the types of liquids can be clustered with the largest ∆X 0. 0036. White flannel can cluster different types of liquids with the widest distance between each cluster 0. 0036. Reflectance spectroscopy method at optical transducers to measure the difference of liquid performed with a visible light source with a low wavelength (405 nm) could be used to detect and differentiate the content of the liquid sample. Keywords—clustering, optical, reflectance, spectroscopy, transducer, wearable.


I. INTRODUCTION
Spectroscopy is a method often used to identify the properties of a surface material. This method refers to the resultant reflected light. When light hits a surface, it is either absorbed or reflected [1]. Light is an electromagnetic radiation. Energy absorbed by an object is then converted into the object's internal energy. This conversion causes the object to release excitation energy in the form of reflected light [2].
Reflection spectroscopy method can be applied to solid materials. According to the study done by Cortes (2016), reflection spectroscopy method was done in order to learn about the condition of a mango fruit without peeling it. In that study, observed reflection spectrums were grouped into three parts, visible light spectrum (400 − 700 nm), VIS (Visible) -NIR (Near Infrared) light spectrum (600 − 1100 nm), and NIR spectrum (900 − 1750 nm) [3] [4].
Application of the reflection spectroscopy method is mostly done using infrared light. Photon energy in infrared light's range has the right energy level to be absorbed by an object. In infrared light with wavelengths of 2.3 − 25 μm, structural and functional changes of molecules or gas can be distinctly differentiated [5]. Reflection spectroscopy method can also be used to find out chemical contents in soil by looking at reflected light from the growth of plants on it [6]. Another study method is also proposed, by taking a sample from the soil and performing a sampling test on it. The soil that was prepared beforehand is illuminated using infrared light. The resulting reflection intensity becomes the analyzed data. The range of reflected light spectrum that is observed is on the scale of 350 ~ 2500 nm [7].
Principle Component Analysis (PCA) program is a very effective method to analyze the intensity of reflected light. This method is capable of showing an accurate data cluster from a given variable [8]. Classification of textile fibers can also be observed using reflectance spectroscopy method analyzed with PCA program. Classification result shows an accurate data regarding the difference of fabric fibers such as cotton, wool, silk, linen, viscose, and polymer [9].
In this study, reflectance spectroscopy method at optical transducer to measure the difference of liquid performed with a visible light source with a low wavelength (405 nm). The results of the measurement is the difference in the content of the liquid sample, are clustered using the PCA program. The results of this study can be used as a reference for the use of light with low wavelengths in the reflection spectroscopy method with liquid subjects.

II. METHODS
The developed instrumentation consisted of laser, the observed fabric, the tested substrate, gathering lens, detector, microcontroller, and PC. A violet-blue laser diode with 405 nm 100 mW was used as a monochrome light source because it has a short wavelength.
A gathering lens with a diameter of 5 cm was used to gather the scattering of reflected light from the laser after hitting the fabric surface. The characteristic of reflectance spectroscopy is the low intensity scattering of light, because of that the gathering lens was required to gather the scattering so it could be detected by the light detector.
To detect the gathered light scatterings, Adafruit AS7262 was used as a detector that can detect six visible lights with a range of wavelength between 430 ~ 670 nm using a sensor array. The six kinds of wavelengths were 450 nm, 500 nm, 550 nm , 570 nm , 600 nm , and 650 nm [10]. The microcontroller that was used was an Arduino UNO. The PC was used to connect to the Arduino and to collect raw data from the detector.
The design of the instrumentation system, shown in Fig 2., was made using a 3D printer for each part. It essentially consisted of five parts. Each part was used to put a laser, fabric, lens, light detector, and microcontroller.
The fabric part is designed with an inclination of 45° from the direction of the arriving light so that the light from the laser will hit the fabric surface at the angle of 45°.
According to Snellius's law, the direction of angle of incidence is the same as the direction of angle of reflection, so the angle of reflection after hitting the fabric surface is 45° to the lens's direction. The illustration of Snellius's law shown in [11]. The microcontroller part was designed so that the system is covered to prevent noise light from coming in from outside the system during data extraction.
Before performing data acquisition, control variables are determined. In this case, they are the kind of fabrics and substrates. The fabrics used consisted of three variations: white flannel, red flannel, and white cotton. Each fabric was cut into the size of 2 × 2 cm so that their whole surface can be exposed to light from the source. Flannel and cotton were used because they can represent materials used in everyday clothes. They also make for good wearable device materials [12]. The substrate variations used were 100 mL of water with 10 g of salt, 100 mL of water with 5 g of salt, and 100 mL of water with 10 g of sugar.
Applying variations with the salted water represents salt contained in sweat, so various amounts of salt were used to indicate the difference in the amount of salt contained in sweat [13]. Sugar water substrate represents glucose contained in sweat.
Each fabric variation was tested on each substrate. Data is recorded after the laser is turned on. Before the laser is turned on, make sure that there is no noise light entering the system by observing the detector's response which shows the value of 0. Plasticine is then applied to the upper part of the detector and lens to make sure the instrument's position does not change during data extraction so that the extracted data is stable. After all conditions are fulfilled, laser is then turned on to begin data extraction.
First, all parts of the instrument are assembled so that it resembles the one shown in, after that violet laser is turned on. Light from the laser is reflected by fabric. The light intensity value passed by the lens will be detected by Adafruit AS7262 light detector and shown on PC. This intensity value consists of the intensity of six visible light channels at once.   Data acquisition is grouped into three data variations: white flannel, red flannel, and white cotton. The first variation is white flannel fabric. The first data acquisition is done to white flannel without substrate. Data from fabric without substrate variation are used as control data against fabric with substrate variation. This step is repeated three times to obtain enough control data which are processed using the PCA method.
Next, data acquisition on white flannel fabric variation is done with the following criteria: dripped with 100 mL water with 10 grams salt substrate until the wet surface is equally spread, this data is repeated 20 times, with 5 minutes of pause between each iteration to normalize the laser's strength. Similar steps are then done to the other variations.   After that, obtained data are processed using the Principal Component Analysis (PCA) program. PCA method is used to statistically analyze a group of data [14]. The expected result is a visible pattern that explains the difference between each substrate. This method requires a large amount of samples from each variable [15]. In this study, 20 data samples were given from each variation and 20 control variation data samples obtained from reflectance spectroscopy scattering on fabric without substrate as comparison.
PCA value is obtained by using equation: is normalized data with as data d with the highest value, m as row index and n column index. After normalizing the data, the average value of is calculated. is a normalized data set matrix.
Then the PCA calculation is done using MATLAB software. After normalization, the data is then reduced by the average. The calculation is the value that will be the input PCA. This can be done by determining the value of : is the input value matrix for PCA calculations. by using the PCA toolbox in matlab, the latent values, coefficients, and scores are obtained. The values used are the two highest values of the six samples. These values are taken based on the two highest latent values. These values are multiplied by the coefficient of the PCA calculation results. The calculation result will be the value of PC1 (Principal Component 1) and PC2 (Principal Component 2) for each sample. PC1 and PC2 values that will be used as a graph. To analyze the data, the difference in the peak to peak (∆ ) and (∆ ) value was calculated using the equation:      The graph shown in Fig. 8, Fig. 9 On white fabrics, the highest intensity values were detected in the purple and blue channels. While in the red and yellow channels, the intensity is detected in a lower value than other channels. The opposite happens to fabrics that are not white (red). The highest intensities were detected in the purple, green, and yellow channels. Different fabric colors cause different intensity values to dominate because the characteristics of the scattered light depend on the characteristics of the fabric.
Cotton fabric surface is softer compared to flannel fabric. The resultant light scatter on cotton fabric had a higher intensity on the majority of the wavelength detected by the light detector. On white fabrics, scatter intensity in violet and blue channels would always dominate because a white surface would reflect or scatter light in a color composition similar to the light source.
The value of the scattering intensity of all the fabrics before and after being given the substrate was reduced. This shows that the addition of a substrate will reduce the amount of scattering and light will be refracted due to a change in the refractive index, from air to water. Light from air hitting the water medium is not completely refracted. Some will be reflected back, as described in Fig. 4.
Based on the three fabric samples, the increase in intensity only occurred in white flannel. Based on the salt content, at lower concentrations, the intensity values in most channels tend to decrease. Compared to the condition before the substrate is given, the intensity values of the green and yellow channels increased dramatically in the white cotton fabric.
The pattern of intensity changes caused by changes in substrate concentration may differ depending on the type and color of the fabric. This is because the scattering formed on each type of fabric will follow the nature of the fabric, especially on non-white fabrics. This is in accordance with the theory that the reflection spectroscopy method can be used to detect the properties of a surface. The addition of a liquid substrate will also affect the scattering intensity.
The graph of the intensity value of the sugar solution substrate has a pattern that is almost the same as the salt water substrate. In the flannel, the pattern of dominance intensity in certain channels is still the same as the variation of the saltwater substrate. The only difference detected was the rise and fall of the intensity values in the purple, blue, green, and yellow channels. In contrast to white cotton cloth, the intensity values of the green and yellow channels again showed a decrease as before being given the substrate. Comparing the graphs of all fabrics before and after being given a saltwater substrate will show that the intensity values of all channels decrease. The decrease in intensity is less than the addition of a sugar solution substrate.
Based on the three fabric variations, flannel fabrics showed a change of data contrary to the other fabric variations. As shown by the difference between graphs from Fig. 8 and Fig. 9, in which other variations show decreasing intensity in violet and blue channels, while white flannel variation shows an increase. This might be caused by the structure of flannel fabric that has the roughest surface.
These are the results of plot clustering from each fabric after data processing using PCA has been done. These graphs show that the optical transducer system could form a scatter and detect difference in the given substrate variance. Difference in fabric texture and color gave different scatter intensity values detected by the detector.  The results of grouping white cotton cloth with 5 g of substrate and 10 g of salt water are too close to each other. This is because the intensity value of the channels does not give a big difference with the variation of the salt content of 5 grams compared to the increase in the channels that occur in the addition of the sugar solution. While in other fabric variations, changes in each substrate variation are clearly clustered.
The clusters between the salt solution substrate and the sugar solution substrate formed on variations of white flannel fabrics are seen to be clustered at a distance that is not close together like white cotton fabrics. This shows that the difference in content in a liquid will be very detectable in all variations of the fabric.
To find out how well the data is clustered, calculations using (4) and (5) are used to find the lowest peak to peak value. For example, to obtain how well the data is clustered in liquid of 5 g salt on white flannel: 1.2350 − 1.2314 = 0.0036 That means the gap value between data is 0.0036. After that, to calculate the quality between fabrics, we can calculate and compare the gap value between fabrics for the same liquid. If the gap value is higher, it means the fabrics can be used to cluster a substrate. For example, we will test and compare the value between white flannel and white cotton using the value of 10 g salted liquid and 5 g salted liquid: Using a minimum value of 10 g salted and 5 g salted liquid in white flannel, 1.2350 − 1.2314 = 0.0036 After that we can also calculate the minimum value of 10 g salted and 5 g salted liquid in white cotton, Based on those values, we can compare the gap between white flannel and white cotton. White flannel has a higher gap value than the gap value of white cotton. It means, white flannel is a better fabric to cluster a substrate than white cotton.

IV. CONCLUSION
Reflectance spectroscopy method at optical transducers to measure the difference of liquid performed with a visible light source with a low wavelength (405 nm) could be used to detect and differentiate the content of the liquid sample, with the PCA program it is known that the types of liquids can be clustered with the largest ∆ 0.0036 . White flannel can cluster different types of liquids with the widest distance between each cluster 0.0036.