## 2 Materials and Methods  
A Decagon 10 HS capacitive sensor (Meter Group Inc., Pullman, WA, USA) was used as reference for the soil moisture measurements. This capacitive device is a frequency domain reflectometry (FDR) based electrical sensor. Its operation principle consists of measuring the dielectric constant or permittivity of the soil to calculate its humidity content. It performs soil moisture measurements within a big volume of soil (-6.5 dm\({}^{3}\)) with great moisture range and it is designed for any soil composition. Its measurements have been compared with an optical fiber Fabry-Perot interferometer that was fabricated by splicing a single mode fiber (SMF) to a cleaved four-bridge MOF, as shown in [19]. As shown in [19], the MOF-FP optical fiber core was used as the substrate in a SnO\({}_{2}\) coating-DC-Sputterdeposition process. SnO\({}_{2}\) can be deposited on the walls of the air holes of the short section of the MOF as well as on the top of the sensor head due to the particular structure of the MOF that is used. SnO\({}_{2}\) coating is highly sensitive to humidity changes of the surrounding environment [30]. The interaction between SnO\({}_{2}\) and H\({}_{2}\)O molecules is due to the phenomena called physisorption by means of the adsorption/desorption of these molecules [31]. The molecules of water interact just with the surface of the deposited SnO\({}_{2}\) thin film. The MOF cavity length determines the periodicity of the sensor optical spectrum interference obtained following (1). Where \(\Delta\lambda\): optical spectrum wavelength spacing, \(\lambda\): working wavelength, \(n\): refractive index, and \(d\): MOF cavity length [32]. \[\Delta\lambda=\lambda^{2}/2 nd, \tag{1}\]  
In this particular case, the MOF length used was \(\sim\)700 \(\upmu\)m showing an interference period of 1.24 nm, as Figure 1a shows (after a 10 min SnO\({}_{2}\) deposition). As it can be inferred, the sensing head is very fragile and, moreover, dust inside the MOF holes and in contact with the SnO\({}_{2}\) deposition could lead to measurement errors. In order to avoid this scenario, a protective cap was developed: it consists of a polyvinylchloride (PVC) tube with four arrays of drilled holes (1 mm of diameter) each 5 mm and a cap in one of its ends enabling the access of the optical fiber. Figure 2 shows the real pictures of the protective cap and the final sensor installed inside the cap. This PVC protection prevents the optical sensor from any damage during installation as well as undesired elements polluting the sensing material, creating a cavity inside the tube permeable to humidity, so that it can be measured. Figure 1: (**a**) Optical microstructured optical fiber-Fabry–Pérot (MOF-FP) sensor’s spectral transfer function and (**b**) its Fast Fourier Transform (FFT) module. Figure 2: Optical sensor’s polyvinylchloride (PVC) drilled protective cap. The influence of the protective cap was verified before the installation in the soil in order to verify the correct behavior of the sensing head. The protected sensing head was inserted in a climatic chamber where humidity ranges from 20% to 90% were applied at constant temperature of 25 \({}^{\circ}\)C. Results are shown in Figure 3.  
These results show a correct performance of the sensing head towards humidity changes, but with a reduction of its sensitivity in comparison with the case where no protective cap is employed. The delay of the sensors in relation with the climatic chamber is due to the small hysteresis effect induced by the tube. This performance can be improved by optimizing the sputtering deposition time or through the design of a three-dimensional (3D) printed protective cap to achieve optimal results, as shown in [19]. A commercial FBG (sensitivity of 10 p.m./\({}^{\circ}\)C) was also monitored at the same time in order to measure the temperature variations inside the soil sample and compensate the optical sensor's deviations.