*3.3.1 UV–vis and infrared sensors*

The UV–visible and near infrared (NIR) spectra can reflect the electron configurations of CPs. After doping process, the spectral absorbance of CP film is changed with an appearance of new bands due to the formation of polarons and bipolarons [165]. Thus, the interaction of gas analytes at CP film interfaces can be detected by the change in spectra of UV–vis or NIR. When an ultrathin film of CP was deposited on a glass, an optic sensor can be fabricated to record the corresponding spectrum (absorbance or transmittance) by using conventional spectrometers [166]. However, colorimetry is limited in sensitivity to an individual analyte and not useful for in situ applications [167]. For IR sensors, they can only monitor specific analytes of nonlinear molecules; in addition, the measurements are influenced by humidified environment [167]. So far, UV–vis–NIR spectrophotometer has been used to study the sensing characteristics of PANI to a variety of VOCs [168]. Tavoli and Alizadeh designed an optical NH3 gas sensor based on nanostructure PPY doped with eriochrome cyanine R (ECR) thin film as a dopant for optical selectivity of NH3 gas using UV–vis spectroscopy with a fast response time (50 s) and a high sensitivity in the concentration range of 15–260 μg L<sup>−</sup><sup>1</sup> [169]. The sensor showed a low detection limit of 5 μg L<sup>−</sup><sup>1</sup> and a good reproducibility.
