1 Introduction

The development of gas sensors for monitoring dangerous and flammable gases is critical due to environmental concerns and industry safety standards. Generally, electronic sensor devices are related to the physical environment and convert the non-electrical physical and chemical values into electrical signals [1]. As a result, research efforts must advance modern global technology and reduce the negative consequences of industrial developments. One of the most critical solutions is detecting harmful gases at lower operating temperatures and voltages. Currently, metal oxides are one of the most vital materials used as gas sensors, based on the change of their electrical conductivity when exposed to various gases [2, 3].

Semiconductor sensors are of low cost, fast response, high sensitivity, and easy interfacing with the electronic integrated circuits to get portable early detection and warning devices to monitor the concentration of harmful gases [4]. The basis for the gas sensor devices is the interaction between the film surface layer and the ambient gas, leading to a noticeable change in the electrical resistance of the sensor layer. This type of gas sensor defining by its high sensitivity to dangerous and toxic gases and its ability to operate at a wide range of temperatures, so gas sensors are effective warning devices for early air pollution detection [5]. Among the semiconductors, Tin dioxide (SnO2) is an essential inorganic material in many electronic applications such as solar cells [6], gas sensors [7], and a powerful catalyst [8].

SnO2 is one of the most commonly used materials in semiconductors sensing applications ranging from health and safety to energy efficiency and emission control due to its high sensing response, good crystallinity, stability of chemical and thermal characteristics, low cost, and tunable morphologies [9]. Recent developments in nanostructured materials have given a futuristic view towards significantly enhancing the response of these materials since the performance of these materials is directly affected by the surface-to-volume ratio. Due to the increased surface-to-volume ratio of nanomaterials compared to bulk materials, the availability of various metal oxide nanostructured materials offers new suggestions for improving the characteristics and performance of gas sensors [10].

Nowadays, numerous physical and chemical techniques are being employed to synthesize tin oxide nanostructures [11]. These procedures are costly, energy-intensive, and cause the use of a variety of hazardous compounds during the synthesis process. As a result, the development of efficient, environmentally friendly, low-cost procedures has been one of the essential things to eliminate environmental impairment and reduce the cost of production [12]. Thin films deposited using the SILAR technique differ from other preparation techniques, and it is simple, inexpensive, and does not require high temperatures to complete the chemical reaction. This technique produces thin films by coating the substrates with a precursor solution of the materials. Evaporation of the solvent or chemical interaction between the solution's components forms the gel layer. Finally, thermal treatments are employed to eliminate the organic components of the gel, leaving a thin nanostructure coating [13].

SnO2 nanostructures have been developed for NO2 detection in many literatures; for example, Yoshioka et al. [14] investigated the effect of loading La2O3 into a SnO2 element for CO2 sensing at a temperature of 400 °C and a CO2 concentration of 2080 ppm. They discovered that the addition of rare earth oxide improved the sensor response. The operating temperature did not affect the response of SnO2 only but the amount of semiconductor oxide loaded. E. Brunet et al. [15] employed spray pyrolysis to deposit thin films and nanowires of SnO2. They discovered that the SnO2 thin film sensor exhibits the highest response against 1325 ppm of CO2 at an operating temperature of 300 °C, whereas the nanowire sensor was insensitive at the same CO2 concentration. D. Wang et al. [16] reported the use of a co-precipitation method to detect CO2 at a concentration of 2000 ppm and an operating temperature of 600 °C based on SnO2 thick film sensor. They discovered that 600 °C was the effective temperature for achieving the optimal sensor with the highest CO2 response. S. Joshi et al. [17] reported the preparation of heterojunction nanocomposites sensors of CuO and SnO2 by a hydrothermal method for CO2 detection at a temperature of 300 °C. The CuO–SnO2 sensor has a high sensitivity towards CO2 concentrations of 10,000 parts per million and a rapid response and recovery time. They conclude that by decorating the sensor's surface with silver nanoparticles as surface activators, the operating temperature can be decreased to promote the highest CO2 sensing response. However, most studies investigated the sensitivity at high operating temperatures, approximately 150 °C and higher, even though this can be considerably decreased by controlling the sensor engineering and elaborating the designing of nanostructured sensors. Materials' particle size and morphology are well known to have a substantial impact on their thermodynamic and kinetic properties and play a critical role in forming nano-sized morphologies. As a result, the development of nanostructures with controllable sizes and morphologies may improve the results of the chemical and physical investigation properties of materials.

The sensors that operate at high temperatures may be subject to changes in their structural properties and the coalescence characterization due to thermally induced grain development, reducing sensor stability, and lifetime [18]. As a result, sensors operating at low temperatures can prevent structural changes, minimize power consumption, and allow for safer detection of flammable or explosive gases. The gas sensors of relatively low-temperature operation eliminate the need for heating elements, giving practical flexibility to develop cost-effective and small systems. This study aims to develop thin films of undoped tin oxide and tin oxide doped with various nickel oxide concentrations. The influence of NiO concentration on SnO2 films' structural, topographical, and morphological features was investigated. The carbon dioxide sensing characteristics of SnO2 thin films at near-room temperature were also reported. The response and recovery times, as well as selectivity and stability, are recorded. Our study proposes a balanced approach for fabrication and designing chemiresistive gas sensors with improved sensing performance.

2 Experimental details

2.1 Glass substrates cleaning

The glass substrates were firstly cleaned from the bulk residue using a soapy paper towel before being ultrasonically washed in distilled water for 10 min. The following procedure cleaned the substrates ultrasonically in distilled water for 15 min to remove alcohol and liquid detergent traces. Finally, the glass substrates were dried in a drying oven set at 65 °C.

2.2 Preparation of deposition solutions

The used materials were purchased from Sigma-Aldrich (USA) with a purity of 99.95%. The undoped tin oxide film was deposited using an aqueous solution of tin chloride dihydrate (50 ml, 0.15 M) as a cationic precursor, hydrogen peroxide as an anionic precursor (50 ml, 1%) separately, and 50 ml double-distilled water. At room temperature, the glass substrate is first immersed in distilled water for 5 s before being immersed in hydrogen peroxide for 10 s, then in distilled water for 5 s, and finally in tin chloride solution for 20 s. The undoped SnO2 film (S sample) is then annealed in air for one hour at 500 °C. The SILAR method for film deposition is schematically depicted in Fig. 1. NiO-doped SnO2 samples were prepared by repeating the previous steps and replacing the pure tin chloride solution with the doped tin chloride solution at 3, 5, and 7 volume ratios of 0.2 M nickel chloride (SN3, SN5, and SN7 samples, respectively). SnO2 samples doped with varied volume ratios of NiO are annealed for one hour at 500 °C in air.

Fig. 1
figure 1

Schematic diagram of thin film deposition by the SILAR method

2.3 Chemical reaction mechanism and thin film fabrication

The SILAR method's thin film deposition mechanism can be summarized as immersing the deposition substrates separately in different ionic solutions, during which an ion exchange occurs at the site of the submerged surfaces, resulting in thin film deposition. One SILAR cycle of tin oxide thin film deposition comprises four stages: The first stage immerses the glass substrate in the cationic precursor solution. The tin ions will be adsorbed to Sn4+ on the surface of the glass substrate (Eq. 1). The second stage is rinsing the substrate in distilled water to remove unadsorbed tin ions and excess salt. The third stage represents the reaction process with hydrogen peroxide (Eq. 2) to form a monolayer of a stable tin oxide film. The glass substrate is immersed in distilled water in the fourth stage to remove the residue. The thin-film deposition mechanism employing the SILAR method is depicted in Fig. 1.

$${\text{Sn}}^{4+}+4{\text{H}}_{2}\mathrm{O}\to \mathrm{Sn}{(\mathrm{OH})}_{4}+{4\mathrm{H}}^{+}$$
(1)
$$\mathrm{Sn}{(\mathrm{OH})}_{4}+{\mathrm{H}}_{2}{\mathrm{O}}_{2}\to {\mathrm{SnO}}_{2}+2{\mathrm{H}}_{2}\mathrm{O}+\frac{1}{2}{\mathrm{O}}_{2}$$
(2)

In this work, the number of SILAR cycles was repeated 75 times for all prepared samples. The thickness of the prepared films was 125, 141, 157, and 162 nm for the S, SN3, SN5, and SN7 samples, respectively.

2.4 Thin films characterization

The Filmetrics F20 provided by A KLA Company was used to determine the thickness of the developed thin film. An X-ray diffractometer (6000 Shimadzu, Target of Cu–K, λ = 1.54060 Å, V = 40 kV, I = 30 mA, Speed of 5° min) was used to study the structural properties of the films. The surface topography and atom distribution were examined using an atomic force microscope (SPM AA3000 per Å, Advanced Inc. Company-USA). The nanostructured thin film's surface morphology and particle size were evaluated using a scanning electron microscope (FEI-Netherlands Company, Magnification of ×300,000, Holland). A dynamic flow gas sensing measurement was adopted to investigate the sensing efficiency of synthesized materials. An ambient atmosphere for the target gas was prepared in a gas system comprising a synthetic air bottle and carbon dioxide bottle supplied by Air Products, Iraq.

3 Results and discussion

3.1 The X-ray diffraction

Figure 2 illustrates the XRD patterns of undoped and doped SnO2 films at varying NiO vol%. XRD patterns showed the development of a tetragonal crystal structure with diffraction peaks observed at 2θ = 26.62°, 33.92°, 37.96°, and 51.82° corresponding (110), (101), (200), and (211) planes, respectively, in agreement with the reference JCPDS 00-041-1445. The XRD diagram shows that the developed films were polycrystalline of a wide diffraction peak broadening. Broad diffraction peaks imply crystalline structural deformation, which improves sensing performance by increasing the adsorption surface area [7]. Figure 2 shows that the (110) diffraction peak is the dominant growth orientation for all NiO-doped SnO2 samples. No additional Ni or NiOx diffraction peaks were observed, confirming that the prepared films were crystalline and that the Ni atoms were successfully doped into the SnO2 host lattice [19].

Fig. 2
figure 2

XRD patterns of a S, b SN3, c SN5 and d SN7 thin film samples

The crystallite size (D) calculated depending on (110) diffraction peak broadening using the formula of Debye–Scherrer: [20]

$$D=\frac{k\lambda }{\beta {\text{cos}}\theta },$$
(3)

where \(k\) is the correction factor (= 0.94), \(\lambda\) is the wavelength of the X-ray (= 1.5406 Å), \(\beta\) is the full width at a half maximum (FWHM), and \(\theta\) is the diffraction angle.

When the NiO dopant concentration was increased, D decreased from 32 to 26 nm, demonstrating that the diffraction peaks are broadened, suggesting that the developed films have a small nano crystallite size, as shown in Table 1. As a result, it can be stated that nickel oxide had a role in influencing the crystallization size of tin oxide.

Table 1 SnO2 and NiO-doped SnO2 thin films structural parameters

The diffraction peaks shifted towards the higher diffraction angle as the nickel oxide dopant ratio increased, which could be attributable to the stress of the tin oxide lattice contributing to the lattice spacing shrinking due to the effect of the nickel element doping [21]. An increase in stress causes a decrease in the lattice parameter. Table 1 shows the calculated lattice constants (a = b and c) for undoped and NiO-doped SnO2 thin films deposited at various NiO dopant ratios based on XRD data. Figure 3 depicts the decreasing lattice parameters values as the NiO doping ratios increase. It was observed that the lattice parameters for deposited thin films were slightly less than the corresponding values for bulk SnO2 (a = b = 4.737 Å, and c = 3.186 Å). Table 1 also includes the estimated values of stress modulus in percentages\([\mathrm{\sigma \%}=\left(\left({c}_{\text{bulk}}-{c}_{\text{film}}\right)/{c}_{\text{bulk}}\right)\times 100\mathrm{\% }]\), where \({\mathrm{c}}_{\mathrm{bulk}}\) is the lattice constants for bulk tin oxide, and \({\mathrm{c}}_{\mathrm{film}}\) is the lattice constant for deposited SnO2. Table 1 shows that the stress modulus percent increases as NiO dopant concentrations rise from 3 to 7 at vol.%, showing that stress causes lattice contraction [22].

Fig. 3
figure 3

SnO2 lattice parameters as a function of NiO doping ratios

The diffraction peak intensities of the SN3 and SN5 samples increased as the NiO dopant concentration increased, whereas the SN7 sample's peak intensity decreased. Structural stability may have contributed to the initial increase of diffraction peak intensity, resulting in a polycrystalline structure with high intensity. Peak intensity reduced significantly when the concentration of NiO dopants reached 7 at vol.% (SN7 sample), which might be attributed to a change in crystalline growth direction caused by the Ni dopant [23].

3.2 Atomic force microscopic analysis

Figure 4a–d shows typical three-dimensional AFM images of undoped and NiO-doped SnO2 films. AFM images reveal a uniform grain distribution of a nanometer scale. Figure 4a shows the development of elongated grains with an ice-like gradient colour spread on the film surface, showing that the grains combine to form a denser surface. The average grain size (G) and the average roughness (Rs) of the as-deposited SnO2 film (S sample) were 28.16 nm and 12.6 nm, respectively. The average grain size and AFM average roughness of NiO-doped films (SN samples) were varied when the NiO concentration increased from 3 to 7 at vol%, as illustrated in Table 2. The surface morphology of SnO2 was strongly influenced by NiO doping, raising the average grain size and average surface roughness when the NiO dopant concentration increased, as stated in Table 2, except for the sample SN7, the RS decreased to 9.59 nm when the NiO dopant ratio reached 7at vol.%. The increase in the average particle size and average roughness caused by the rise of nickel oxide dopant ratios can be attributed to the increased thickness of the developed films. Increasing the thickness of the film contributes to the agglomerate of smaller grains together, forming large grains, resulting in an increase in grain size and, as a result, an increase in surface roughness [24].

Fig. 4
figure 4

AFM images: a undoped SnO2 and and bd SnO2 doped with various NiO volume ratios

Table 2 The variation of AFM and FE-SEM parameters of the prepared thin films

Island-like nanostructures were observed on the surfaces of the doped films that directly contributed to the formation of the porous surfaces, showing that NiO doping had a significant effect on the topography of film surface. The porous surfaces are effective in gas sensing applications because they significantly contribute to the gas sensitivity response increasing the exposure surface to gas molecules [25]. As the nickel dopant concentrations increased, Table 2 reveals an opposite behaviour between crystallite size (estimated from XRD) and average grain size (estimated from AFM). The decrease in crystal size can explain increased grain boundaries, reducing the number of boundary interfaces and grain boundaries per unit area and consequently increasing the grain size [26].

3.3 FE-SEM characterization

The surface morphology of the produced films was analysed using FE-SEM. Top view FE-SEM micrographs of undoped and NiO-doped SnO2 thin films are shown in Fig. 5a–d. The images show a uniform distribution of nanosphere-like structures aggregated to develop a porous surface. When the tin oxide film was doped with nickel oxide, more nanospheres aggregated into sea-stone-like structures with varying grain sizes, resulting in a highly porous surface. Jimag software was used to determine the grain size of the prepared films. As shown in Table 2, when the nickel oxide dopant ratio reached 7 at vol.%, the estimated grain size improved from 23.85 nm for the undoped film to 42.3 nm. The pores in the structure of the sensor layer increase exposure to gas target molecules, hence increasing the adsorption rate and sensing characteristics [27]. Typically, the thin film surface properties and nanostructure influence gas sensing elements, resulting in a high surface-area-to-volume ratio [28].

Fig. 5
figure 5

FE-SEM top view images of a undoped SnO2 and bd SnO2 doped with various NiO volume ratios

3.4 Gas sensor performance and mechanism

The sensing experiments were carried out using a homemade sensing probe comprising a stainless-steel chamber with aluminium interdigitated electrodes. A hot plate provides heating to the sensing sample on the backside of the silicon substrate. The thermal evaporation technique deposited the aluminium interdigitated electrodes on the active sensor layer. The sensor response is the most critical gas sensor parameter. It is described as the ratio of electrical resistance value when exposed to test gas and when the tested gas is removed. The tested samples showed a response near a CO2 concentration of 500 ppm. In contrast, there was no significant sensor electrical resistance change when the gas concentration was below this limit. The sensor response of undoped and Ni-doped SnO2 thin films at different CO2 concentrations was determined using Eq. (5) [29]:

$$S={(R}_{\text{g}}/{R}_{\text{a}})$$
(4)

Rg and Ra are the electrical resistances of the sensor in gas and air, respectively.

3.4.1 Determine the optimum operating temperature

Because the sensor response to gas is highly temperature dependent, the tests of the prepared film were carried out at various temperatures (298, 323, 373, and 423) K to determine the optimal operating temperature. The obtained data are drowning in Fig. 6, which records the sensor response against 500 ppm CO2. Figure 6 shows that the sensor response increases and subsequently decreases when the operating temperature rises to 323 K, showing that the sensor is sensitive to temperature. At 323 K, the sensor exhibited a maximum sensitivity (183%) for the SN5 sample, which decreased as the temperature was raised above 323 K.

Fig. 6
figure 6

Sensor response of S and SNX thin film samples versus operating temperatures at 500 ppm CO2. The curves are a guide for the eye

The operating temperature is critical in enhancing the sensor response since the activation energy required to complete the chemical reaction on the gas sensor's surface is sufficient at this temperature [30]. Sensor data show that the optimal operating temperature is 323 K, with the SN5 sample exhibiting the highest response. As a result of this finding, we chose the SN5 sample to explain the sensing characteristics and the effect of gas concentration on the surface reaction. Although the sensing response varied with the rise of the temperature and NiO volume ratios, the behaviour of the sensor samples was identical. The electrical resistance increased when the sensor was exposed to 500 ppm carbon dioxide (CO2 ON), then reduced to its initial value when the gas flow was stopped (CO2 OFF). This behaviour confirmed that prepared films have a negative electrical conductivity (n-type).

3.4.2 Gas molecule adsorption mechanism

Figure 7 shows the gas molecule adsorption mechanism schematically on the sensor's surface. When the n-type semiconductor surface is exposed to oxidizing gas such as CO2, oxygen ions (\({\mathrm{O}}^{-}\),\({\mathrm{O}}_{2}^{-}\), and \({\mathrm{O}}^{2-}\)) on the semiconductor surface are adsorbed by the gas molecules, resulting in a decrease in the concentration of charge carriers (electrons) and the formation of a potential barrier at the boundary of the adjacent grains that prevents the electron transfer from one grain to another, increasing electrical resistance [31]. The oxygen ions \({\mathrm{O}}^{-}\) are more stable between 373 and 573 K, but the \({\mathrm{O}}^{2-}\) ions are stable above 573 K and \({\mathrm{O}}_{2}^{-}\) below 373 K [32]. Thus, the low sensing response at an operating temperature above 323 K can be attributed to the weakening reaction on the sensor surface between the oxidizing gas molecules and adsorbed oxygen ions (\({\mathrm{O}}^{-}\) and \({\mathrm{O}}^{2-}\)), whereas the dominant one was with the (\({\mathrm{O}}_{2}^{-}\)) ions. In other words, oxidizing agents like CO2 can react rapidly with \({\mathrm{O}}_{2}^{-}\) ions on the surface, but quite slowly with \({\mathrm{O}}^{-}\) and \({\mathrm{O}}^{2-}\). The temperature dependency of the sensing properties may be due to the change in the oxygen ion adsorption and desorption rates on the metal-oxide surface. In addition, the semiconductor sensor response is well known due to the oxygen chemisorption on the oxide's surface and the corresponding reaction between the adsorbed oxygen and the gas target. As a result, the sensor's resistance and response will change [28].

Fig. 7
figure 7

Schematic of a SN sensor and b mechanism of the sensor response

3.4.3 Sensing characteristics of the selective sample (SN5)

As previously mentioned, the highest sensor response was for the SN5 sample, and Fig. 8 illustrates the electrical resistance behaviour of the SN5 sample when exposed to an oxidant gas. The highest sensor response may be attributed to the fact that the SN5 sample had the smallest crystallite size, in agreement with the result obtained by [33]. Another point can be applied; the AFM results confirmed that the Nickle continent produced the highest average surface roughness for the SN5 sample, which may improve the sensor response [34]. The average surface roughness plays a role in improving the sensor response by increasing the surface area, increasing the diffusion of atoms, resulting in more potential surface reaction sites, additional oxygen molecule adsorption sites, and then improving sensor performance [35].

Fig. 8
figure 8

Resistance variation of the SN5 sample when exposed to 500 ppm CO2 at 323 K

Another critical factor in determining the efficiency of the gas sensor devices is the response and recovery time. The response time is defined as the time taken from the baseline resistance to reach 90% resistance change, and the recovery time is the time taken to recover 10% of the baseline resistance [2]. The response and recovery time were estimated from the transient resistance response plot of the SN5 sample, and it was found to be 13 s and 34 s, respectively.

The CO2 sensing response of the SN5 sample at 323 K operating temperature was replicated three times to investigate the characteristics of the sensor response, as shown in Fig. 9. This figure also shows that the resistance returned to its initial value after several cycles, confirming that CO2 adsorption on the film surface was reversed.

Fig. 9
figure 9

Resistance behaviour of the SN5 sample operated at 323 K

The dynamic response of the SN5 film to various CO2 concentrations, 500–10,000 ppm, is illustrated in Fig. 10. This figure indicates that the sensor response improved as the CO2 concentration increased. When the gas concentration rises, the number of CO2 molecules interacting with oxygen ions rises, creating a more rise in the potential barrier at grain boundaries, preventing more electrons transformation and then increasing resistance.

Fig. 10
figure 10

Variation of the sensor response at different CO2 concentrations operated at 323 K

Finally, the selectivity and stability of the SN5 sensor film were studied, as illustrated in Fig. 11a and b. The selectivity of the gas sensor is an important feature to consider while studying its gas sensing capability. As a result, the gas sensor must have a high selectivity for practical application; thus, the evaluation of the sensor's selectivity has received more attention in this work. At 323 K, the SN5 sensor sample is tested by measuring various interfering gases such as N2, C2H6O, NO2, and NH3 at 50 ppm gas concentration. Figure 11a shows that the sensor has a low gas response to other interfering gases except for CO2, indicating a high specific adsorption capability for CO2. The increased gas response to CO2 can be attributed to its superior electron-withdrawing capabilities compared to other gases. According to the literature, the sensor's selectivity is determined by various factors, including the gas molecules' adsorption onto the sensor surface at varying temperatures and the target gas's LUMO (lowest unoccupied molecules orbit) energy. The orbital energy of the target gas molecules may also impact electron affinity since the ability of gas molecules to capture electrons increases as the LUMO energies decrease [36]. The LUMO energy of CO2 was thus lower than that of other interfering gases at an operational temperature of 323 K. As a result, the sensor's capability to take CO2 electrons is stronger than that of other interfering gases, and the sensor exhibits a high response when exposed to CO2. The stability of the SN5 sensor sample was investigated for 90 days, as shown in Fig. 11b. The result indicated that the SN5 film has exceptional stability in the ambient atmosphere.

Fig. 11
figure 11

a Histogram illustrating the selectivity of the SN5 sensor sample and b the SN5 sample's stability against 50 ppm CO2 at an operating temperature of 323 K

4 Conclusion

The SILAR method was successfully deposited SnO2 and NiO-doped SnO2 thin films for CO2 gas sensor application. Both undoped and NiO-doped SnO2 gas sensors demonstrated outstanding CO2 sensing features at variance concentrations of 500–10,000 ppm at operating temperatures of 298–423 K. The results show that nickel oxide has a role in controlling the size of the tin crystallites in SnO2 and improves the gas sensor's properties. Increased NiO dopant ratios in SnO2 resulted in a porous surface with relatively high toughness, enhancing sensor response. The NiO-doped SnO2 sample at a concentration of 5% at volume displayed the most heightened sensitivity to CO2 at 323 K of all the gas sensors tested. When CO2 concentrations increased, the sensor's response improved. The developed sensor exhibits a high selectivity for CO2 detection and increased stability in the ambient atmosphere. It also can be concluded that nickel dopant has a significant effect on the sensing parameters of SnO2 films and that SILAR is an appropriate approach in developing thin films for gas sensing applications.