1 Introduction

Detection of volatile organic compounds has been a major concern to evaluate the indoor air quality and outdoor air pollution [1, 2]. Recently, a mass of chemical or physical gas sensors have been designed and fabricated to solve these problems [3,4,5]. Gas sensors with good repeatability, high response ratio among different gases, and fast response and recover time are urgently required [6,7,8,9]. In addition, many factors, such as the natural properties of the semiconductors, the surface areas and microstructure of the materials, can significantly influence the performance of the sensors [10]. Metal oxide semiconductor (MOS), especially ZnO, NiO, TiO2, SnO2, etc, has attracted much attention in the potential applications area of Li-ion batteries [11, 12], supercapacitors [13], UV sensors [14, 15], and gas sensors [16,17,18,19,20,21,22]. Among them, nickel oxide (NiO) is regarded as an ideal alternative material for gas sensor owing to the suitable band gap (~3.6 eV), tunable electric properties, and great electron mobility [23,24,25]. Until now, NiO nanoparticles [26], Cactus-like blocks [27], nanorods [28], and nanoflowers [29] have been reported for gas sensors. However, the relatively low sensitivity, slow response and complicated or energy consuming preparation processes of NiO greatly restrict its further application [30].

Several efforts have attempted to adresses these issues. One way is to construct NiO-based sensors with high surface area, more active sites, and direct charge transfer route [31]. For instance, Lai et al. reported an ordered mesoporous NiO with thin pore walls for formaldehyde (HCHO) gas sensor [32]. The results exhibited that this mesoporous NiO possesses a much higher response to HCHO than the bulk NiO. The greatly enhanced sensing properties of NiO can be attributed to the larger specific surface area and pore size as well as thinner pore walls. Yu et al. found that the multiply continuous networked NiO nanostructures possess an enhanced sensing performance compared to the discontinuous net-like nanorod-assembled NiO structures [19]. Compared with one dimensional nanostructures, two dimensional nanofilms have their special advantages, such as high contact area, large surface area, and excellent structure and chemical stability. Well designed, facile and large-scale fabrication of high performance NiO-based nanofilm is desperately needed. Traditional NiO-based thin films are usually prepared by chemical vapor deposition (CVD), pulsed laser deposition (PLD), sputtering, etc., which require expensive physical device [33]. Besides, the obtained films generally possess low surface area, which also restrict their practical applications. Hence, the facile fabrication of thin film gas sensor with high surface contact area and sufficient porosity is critical for the high quality thin film-based nanodevices. Solution deposition methods are becoming popular in recent years, because these methods can provide high purity products at low cost, starting from easily available materials [34]. Two phase interfacial self-assembly approach is a unique and simple method to prepare high quality ultra-thin nanofilm without using any special equipment [35, 36].

Another concept on ameliorating the sensing properties is heteroatoms doping. In recent years, a series of metal (such as Sn-, Cr-, Ag-, In-, Ni-) doped NiO gas sensors have been reported [37,38,39,40]. The doped metal elements can effectively improve the gas sensing properties of NiO. Magnesium oxide (MgO) is seldom selected as a gas sensor material due to the difficulties of electrons or holes generation [7]. However, it can be used as dopant in other metal oxides to regulate their sensing performance [41, 42]. It is reported that an appropriate proportions of Mg doping could significantly improve the gas sensing properties of other metal oxides [42,43,44]. Unfortunately, no work about Mg-doped NiO thin film has been reported for gas sensor to the best of our knowledge. What is more, its sensing mechanism has never been reported yet.

In this work, we first reported a monolayer honeycomb structured Mg-doped NiO thin film gas sensor via a facile wet chemical interfacial self-assembly approach with polystyrene microspheres as sacrificial agents. The as-prepared nanofilms are uniform and transparent. This high-quality Mg-doped NiO thin film exhibits a superior sensing performance compared to our pure NiO film and some of the previously reported NiO sensors. The incorporation of Mg ions with NiO nanocrystals could adjusts the carrier concentration, and induces the change of the oxygen deficiency in NiO nanofilm. This novel, simple, and fast fabrication method can also be used to prepare other monolayer metal oxide film-based nanodevices.

2 Experimental

2.1 Fabrication of NiO and Mg-doped NiO thin films

The fabrication process underlying the formation of Mg-doped NiO nanostructures from aqueous solutions of nickel nitrate and magnesium nitrate are discussed below. We used the emulsion method to prepare colloid spheres. The obtained colloid spheres are uniform with good dispersion when using this method. PS spheres were selected as templates due to their good dispersion and easily removal character. The monolayer honeycomb structure film has a much higher contact area than the particle-based film, which is beneficial to the gas absorption. Figure 1 shows the illustration of the formation of Mg-doped NiO thin film-based gas sensor. In brief, hexane (5 mL) was slowly dropped into a transparent solution (40 mL) of nickel nitrate (0.5 mmol) and magnesium nitrate (0.15 mmol) to form an interface of water/hexane. Then, polystyrene (PS) spheres (size: 700 nm, 0.5 mg) was dispersed into ethanol (5 mL) and slowly added into the former interface. Then, Ni2+ ions, Mg2+ ions and water can be adsorbed on the undersurface of PS spheres. After that, a monolayer precursor thin film is gradually formed due to the different surface tensions of interfaces. And then, the obtained Mg-doped closely-packed precursor film was transferred into an Au coated alumina ceramic substrate by a lift-up approach. The monolayer honeycomb structure Mg-doped NiO (mole ratio of Mg:Ni is 2:8) thin film was finally obtained after a heat treatment process (400 °C, 2 h). The un-doped NiO thin film was fabricated by the same procedure except the addition of magnesium nitrate. Finally, the honeycomb structured Mg-doped NiO thin film and NiO thin film can be directly used as electrodes for film-based gas sensors. This facile strategy can be used to fabricate other semiconductor nanofilms.

Fig. 1
figure 1

Illustration of the formation of Mg-doped NiO thin film based gas sensor. a Interfacial self-assembly procedure. b Lift-up approach. c Heat treatment process. d Film-based gas sensor

2.2 Characterization

Morphology and crystal structure of the thin films were characterized by scanning electron microscopy (SEM, JEOL JSM-6701F), transmission electron microscopy (TEM, JEOL JEM-2100F), and X-ray diffraction (XRD, D/Max-2400). The light absorption properties and optical band gaps of the monolayer nanofilms were measured by Ultraviolet visible spectrum (UV–Vis, Shimadzu UV-2450 spectrophotometer). Blank quartz was used as reference. The monolayer NiO and Mg-doped NiO nanofilms were coated on quartz substrates and directly used as samples.

2.3 Gas sensing measurement

An alumina ceramic substrate (area: 1.35 × 0.7 cm, thickness: 0.5 cm) with five pairs Au interdigital electrodes (electrode widths: 0.18 mm, electrode spacing: 0.15 mm, Au film average thickness: 5 µm) and a micro-heater was used to raise the temperature. The gas-sensing properties of the thin films were measured by a gas-sensing characterization system (CGS-1TP, Elite Instruments, China). Gas response is calculated by the equation of S = Rg/Ra, where Ra and Rg represent the resistance of the sensor in air and the target gas, respectively [45]. Response and recovery times are marked as the time for 90% of total resistance change on exposure to gas and air, respectively. Before the response measurement, the thin film gas sensors were aged at 300 °C for 4 h to improve the thermal stabilities and strengthen the bonding between the nanofilms and the substrates.

3 Results and discussion

3.1 X-ray diffraction (XRD)

XRD patterns of NiO and Mg-doped NiO are shown in Fig. 2a. Five major sharp diffraction peaks of the (111), (200), (220), (311) and (222) planes can be clearly seen, suggesting that the two samples are highly crystallized. All the diffraction peaks can be readily indexed to the standard diffraction data of cubic NiO (JCPDS card No. 73-1519). No other diffraction peaks can be detected. Besides, as shown in Fig. 2b, compared to the (200) crystal face of pure NiO sample, the (200) crystal face of Mg-doped NiO negatively shifted about 0.21, proving the lattice distortion of NiO due to the dopant of Mg atoms with larger atom radius (0.086 nm) into the NiO crystal cells [46, 47]. The lattice parameter of (200) plane of NiO in NiO-film is 4.168, which is different to that of NiO in Mg-doped NiO film (4.180). The increased lattice parameter confirms the successful fabrication of Mg-doped NiO film. The crystal sizes of NiO and Mg-doped NiO can be calculated using XRD data, The average crystallite sizes, D, were calculated by Scherrer’s formula; D = 0.9λ⁄β cos θ, where β is the width of the diffraction peaks measured at half their maximum intensities due to purely crystallite size and θ is the Bragg angle of the peaks. Information about crystallite size is obtained from (200) diffraction peak. The average crystallite size of NiO was close to 33 nm, while the crystallite size of Mg-doped NiO was 46 nm.

Fig. 2
figure 2

a XRD patterns and b the XRD patterns of the (200) plane of pure and Mg-doped NiO

3.2 UV–Vis spectrum

Moreover, the monolayer honeycomb structure Mg-doped NiO and un-doped NiO thin films can be deposited on quartz substrate (inset of Fig. 3a). The corresponding optical images display the uniform and semitransparent characteristics, proving the high quality of these films. Figure 3a presents the UV–Vis absorption spectra of the thin films, we can see a strong absorption edge of NiO film at about 375 nm. The absorption edge of Mg-doped NiO film is located at about 336 nm. Compared with NiO film, a blue shift of the absorption edge of Mg-doped NiO film can be observed. This variation is caused by the successfully doping of Mg elements, which is consistent with the result of Ji et al. and Yang et al. [46, 47] Fig. 3b exhibits the plot of (αhν)2~hν of the thin films. The optical band-gaps (Eg) of un-doped and Mg-doped NiO monolayer nanofilms are calculated to be 3.47 and 3.8 eV, respectively. It can be infer that the increased band gap of Mg-doped NiO thin film further indicates the successful doping of Mg atoms and the changes in conductivities of the semiconductors.

Fig. 3
figure 3

a UV–Vis spectrum and b optical band gaps of pure and Mg-doped NiO; inset of Fig. 2a: photograph of pure and Mg-doped NiO thin film on quartz substrates

3.3 SEM and TEM study

Figure 4a, b depict the front and side view SEM images of Mg-doped NiO nanofilm. The building blocks of the thin film with an average size of 700 nm are closely packed with each other, indicating the high-quality of the monolayer Mg-doped NiO thin film. A series of honeycomb-like structures can be clearly seen, further proving that we have successfully prepared a highly ordered nanofilm. Moreover, the side view of SEM image indicates the formation of a monolayer nanofilm (Fig. 4b). In Fig. 5a, the TEM image of Mg-doped NiO thin film also demonstrates the high quality of the thin film. The honeycomb like structure were well kept after the annealing process. The SAED pattern of Mg-doped NiO thin film can be seen in Fig. 5b, which exhibits a polycrystalline nature. The characteristic crystal planes can be indexed as the (220), (200) and (111) planes of cubic NiO, which is consistent with the XRD results. EDX spectrum reveals the existence of Mg, Ni and O elements (Fig. 5c). And Cu signals are come from copper grid.

Fig. 4
figure 4

SEM images of Mg-doped NiO thin film: a front and b side view

Fig. 5
figure 5

a TEM image, the corresponding. b SAED pattern and c EDX spectrum of Mg-doped NiO thin film

3.4 Gas sensing properties

The pure NiO and Mg-doped NiO nanofilms are promising candidates for gas sensors. Besides, the unique honeycomb like structure is also capable of providing a large surface to volume ratio and good permeability, which is desirable for the adsorption and desorption of the detected gases. Figure 6 shows the response of pure NiO and Mg-doped NiO thin films to 100 ppm different gases at different temperatures. As increasing of the operating temperature, the two sensors first increase their responses, and then reach a maximum sensitivity, which can be attributed to the gas diffusion-controlled process. Finally, it gradually decrease after further increasing the operating temperature, which can be attributed to the equilibrium of gas diffusion and chemical reaction rate. In addition, pure NiO thin film has a highest response to ethanol gas at 300 °C, whereas the Mg-doped NiO thin film gas sensor has a maximum gas response at 325 °C. Obviously, to 100 ppm ethanol, the sensitivity of Mg-doped NiO thin film sensor is as high as 10.4 at 325 °C, whereas the sensitivity is only 4.1 at 300 °C for pure NiO thin film sensor. This value is also much higher than some reported NiO sensors (the comparative results with references are listed in Table 1) [26,27,28, 42, 48,49,50,51,52,53,54,55,56,57]. Moreover, the methanol, acetone and benzene gases response of Mg-doped NiO thin film gas sensor are also better than the result of pure NiO thin film sensor, respectively. The excellent performance can be attributed to the good contact between the substrate and the thin film, as well as the unique honeycomb-like structure can provide a large surface area. In addition, this result indicates the superior selectivity of Mg-doped NiO thin film sensor.

Fig. 6
figure 6

Response of pure NiO thin film and Mg-doped NiO thin film sensors to 100 ppm gases at different temperature towards different gases: a ethanol, b methanol, c acetone, and d benzene

Table 1 Comparison of the response and recovery characteristics of NiO-based thin film gas sensors to 100 ppm ethanol with other reported works

The resistances of un-doped and Mg-doped NiO thin films at 325 °C to 100 ppm different gases are presented in Fig. 7a, b. The highly enhancement of resistances and the almost vertical lines of the gas sensors after the addition of various gases indicating a high sensing performance in term of high response ratio, great selectivity, and short response-recovery times. Figure 8 exhibits the comparison of single-cycle response and recovery curves to 100 ppm ethanol at 325 °C. The response and recovery times of pure NiO thin film sensor were 7 and 5 s, whereas the values of Mg-doped NiO nanofilm were 13 and 19 s, respectively. As listed in Table 1, these results are also better than some of the reported values [48, 50, 51]. Moreover, the average response and recover times for Mg-doped NiO thin film sensor at 325 °C to 100 ppm different gases are larger than that of un-doped thin film sensor (Table 2), which can be mainly attributed to the better conductivity and lower potential energy of the active material doping [48,49,50].

Fig. 7
figure 7

Resistances of a pure NiO thin film and b Mg-doped NiO thin film sensors at 325 °C to 100 ppm different gases

Fig. 8
figure 8

A single cycle response-recovery characteristic curves of pure NiO thin film and Mg-doped NiO thin film sensors

Table 2 Response and recovery characteristics of NiO and Mg-doped NiO thin films sensors to different gases at optimum temperature

The stability of the Mg-doped NiO thin film sensor at 325 °C to 100 ppm ethanol gas was shown in Fig. 9. After 2 months measurement, the response ratio of the Mg-doped NiO thin film sensor still maintained over 9, proving the good repeatability of the sensor. All the results demonstrate that our Mg-doped NiO thin film sensor can be used for the selective detection of ethanol.

Fig. 9
figure 9

Stability of the Mg-doped NiO thin film gas sensor at 325 °C to 100 ppm ethanol

3.5 Gas sensing mechanism

Based on the principle of adsorption–desorption, the gas sensing mechanism for ethanol gas in NiO-based sensor can be explained and the schematic diagram is depicted in Fig. 10. When the thin film gas sensor is exposed to air, the O2 chemisorbed on the surface of NiO sensor in the form of (O2, O or O2−) by capturing free electrons from the p-type NiO conduction band and thereby leads to the formation of holes (h+) accumulation layer near the surface and decreases the resistance of the sensor. Upon exposure to reducing ethanol gas, the chemisorbed oxygen ions will react with ethanol and releases the electron to the holes (h+). The whole reactions can be described according to the following equations:

Fig. 10
figure 10

Schematic diagram of the NiO-based gas sensors representing gas sensing mechanism

In air,

$${O_{2(g)}}+{e^ - } \leftrightarrow {O_2}^{ - }$$
(1)
$${O_{2(g)}}+{2e^ - } \leftrightarrow 2{O^ - }$$
(2)

In ethanol,

$${C_2}{H_5}O{H_{(g)}}+6{O^ - } \leftrightarrow 2C{O_{2(g)}}+3{H_2}O+6{e^ - }$$
(3)
$${e^ - }+{h^+} \leftrightarrow Null$$
(4)

Therefore, the sensor resistance can be increased by thinning the width of depletion layer [59, 60].

The change in carrier concentration may be the key factor for the enhanced gas response. Two evidences can be given to verify the effect of Mg doping. XPS data was measured and shown in Fig. 11. Figure 11a shows the full spectra of NiO and Mg-doped NiO thin films, which presents the existence and valence state of Mg, Ni, and O elements. It is known that Ni3+ can be formed from adsorbing negatively charged oxygen on the surface of NiO and/or caused by negatively charged interstitial oxygen. In Fig. 11b, c, the Ni3+/Ni2+ ratio increased from 1.49 (pure NiO thin film) to 1.88 (Mg-doped NiO thin film). With the substitution of Mg2+ at Ni2+ sites, electrons are generated to compensate for substituting Mg2+ into Ni2+ sites, which decrease the hole concentration in NiO. When the hole concentration is very low, the injection of equal amounts of electrons will lead to a higher variation in sensor resistance, and thus enhance the gas response.

Fig. 11
figure 11

XPS spectra of pure NiO and Mg-doped NiO nanofilms. a Full spectra; b and c Ni 2p 3/2 of pure NiO and Mg-doped NiO nanofilms, respectively; d and e O 1s XPS spectra of pure NiO and Mg-doped NiO nanofilms, respectively

In addition, as shown in Fig. 11d, e, the O 1s peaks of the two thin films were asymmetric and could be fitted into three components. The binding energies at about 529.4, 531.2, and 532.4 eV were attributed to lattice oxygen (OL), oxygen-deficient regions (OV), and chemisorbed oxygen (OC) species, respectively. The relative percentages of OL, OV and OC components were approximately 24.5, 38.7, and 36.8% in the pure NiO thin film, while they were 12.5, 51.1, and 36.4% in the Mg-doped NiO thin film. Obviously, the content of OV component was greatly increased with Mg doping. This indicated that the gas sensing properties were closely related to the deficient oxygen in NiO material. The increase of OV component could provide more active sites for the gas reaction and adsorption on the surface of the sensing materials. Thus, when doping Mg in NiO thin film, more defects and vacancies could be created, which greatly enhanced the adsorption and desorption of gases [42, 48, 49]. In that case, the changes of gas adsorption and desorption will result in a synchronized changes of the width of depletion layer, which could explain the increase of gas response after Mg doping.

4 Conclusions

Monolayer honeycomb structure Mg-doped NiO thin film has been synthesized by a facile strategy, which shows enhanced performance in terms of good gas selectivity, fast response and recover times, as well as high response ratio, compared with un-doped NiO film based sensor. The response ratio of the Mg-doped NiO nanofilm is 10.4, to 100 ppm ethanol at 325 °C. The Mg-doped NiO gas sensor also presents a very high selectivity to ethanol against other gases, such as methanol, acetone, and benzene. The superior sensor response of Mg-doped NiO nanofilm towards ethanol can be mainly attributed to the combined effects of the honeycomb-like arrays film and increased concentration of defects and vacancies in NiO nanofilm caused by Mg doping.