*2.3. Characterization of Thin Films*

Optical constants (refractive index *n* and extinction coefficient *k*) and thickness of the films *d* were calculated simultaneously using previously developed two-stages nonlinear curve fitting method using measured reflectance spectra with UV-VIS-NIR (ultraviolet-visible-near infrared) spectrophotometer (Cary 5E, Varian, Australia) [24]. The sensing properties of the films were studied through recording reflectance spectra at different values of relative humidity (RH) in the range from 5% to 95% RH. The sample was placed in a quartz cell inside the spectrophotometer and the humidity decreased from ambient to 5% *RH* by purging dry argon in the cell. Then the recording of reflectance (or transmittance) value as a function of humidity was started. The continuous increase of humidity from 5% to 95% RH was achieved by bubbling argon through distilled water kept at 60 ◦C. In these experiments the reflectance/transmittance was measured at fixed wavelength that is preliminary chosen as the wavelength of the highest humidity responses. To determine this wavelength for each thin film (λmax), along with optical constants and thickness (and its change), the reflectance spectra (320–800 nm) of the samples were measured at humidity of 5% and 95% RH in another set of humidity experiments and optical constants and thickness were determined.

To quantify and compare studied samples, three parameters were used. The sensitivity of the sensors, *S*, was calculated according to the following equation:

$$S = \frac{\Delta R}{\text{RH}\_2 - \text{RH}\_1} \tag{1}$$

where Δ*R* (or Δ*T*, if transmittance *T* is measured) is the change of film's reflectance (or transmittance) in % for humidity variation from RH1 to RH2. Accuracy/resolution (Δ*RH*) of detection depends on the sensitivity and measurement accuracy in the signal and was calculated from:

$$
\Delta RH = \frac{errR\text{ (\%)}}{S\text{ (\%)}},
\tag{2}
$$

where *errR* = 0.3% (or *errT* = 0.1%, if *T* is measured) is the experimental error (accuracy) of *R* or *T* and *S* is the sensitivity, calculated by Equation (1).

Sometimes it is possible unwanted hysteresis to occur that is expressed in different values of *R* (or *T*) measured at the same values of humidity depending of the history of humidity, i.e., depending whether humidity increases or decreases. The percentage of hysteresis, *H* was determined through:

$$H(\%) = \frac{\max \left| R\_{up-} R\_{down} \right|}{\Delta R\_{max}} \cdot \frac{\Delta R H\_{hyp}}{\Delta RH} \cdot 100,\tag{3}$$

where *R*up and *R*down are reflectance (or transmittance) values measured for increasing and decreasing humidity, respectively, Δ*R*max is the reflectance (or transmittance) change in the whole range Δ*RH* of measured humidity and Δ*RH*hyst is the humidity range where hysteresis is observed.

It is obvious from Equations (1)–(3) that the goal is to obtain the highest sensitivity and accuracy of detection and the lowest percentage of hysteresis.
