1 Introduction

In recent times, due to increasing commercial and transportation activities, the quality of air around us decrease significantly. Therefore, to improve the air quality necessary measures should be taken to overcome air pollution. It is necessary to monitor the amount of Formaldehyde (HCOH), an organic pollutant present in the air. It has been observed that the presence of HCHO in air shows the adverse effects on different parts of human beings such as sensory organs that are bare or come in direct contact with the air causing problems such as coughing, gasp, vomiting, and skin irritations are more prominent [1, 2]. Besides these, the momentary health problems of HCOH exposure are known but the long term health effects of HCOH exposure are still part of modern research. Some researches in the past indicate that the HCOH is human carcinogen under a long term exposure and develops certain kind of cancer [3, 4]. Therefore, monitoring and control of HCOH emissions in the living environment are of special interest.

To detect the presence of HCHO in the air sensors based on oxide thin films has been developed which exhibits sensitivities of 10 to 40 ppm [5,6,7]. However, the operating temperature of these thin-film sensors is in the range of 200–400 °C [8].There is a need to decrease the operating temperature so that sensors can operate at room temperature as well as they can maintain their sensitivity too. In this regard, nanoparticles materials like CNTs [9] and inorganic nanowires [10] are used in chemical sensors. Single-walled carbon nanotubes have remarkable, structural and electrical properties. They have various applications in nanoelectronics fields due to their prominent flexibility, unique electronic properties, and large surface area [11, 12]. These nanomaterials have the good capability as environmental sensors, monitoring, and control of exposure also detecting and removing several pollutants like organic chemicals and dioxin from the air [13]. Sensing of fragrant compounds like benzene, xylenes, natural organic materials, and poly aromatics on single-walled carbon nanotubes have been studied [14]. Single-walled CNTs have shows great sensitivity regarding molecules like NO, NOx and NH3 [15,16,17]. However, pure single-walled CNTs may not sense some highly toxic compounds like Formaldehyde. Functionalization of single-walled CNT or doping of atoms like oxygen, nitrogen, boron, etc. further increases their sensing and catalysis properties [18, 19]. For the detection of highly toxic gas, less work has been done including a theoretical study to develop CNT based nanosensors. Wang et al. investigation indicating the suitability of Al as a dopant in SWCNTs for sensing CO. [20] Zhang et al. and Wang et al. investigated chemical sensing of HCN or HCOH with boron-doped (B-doped) SWCNTs (8, 0) by using density functional theory calculations. Compared with the pure SWCNTs, B-doped SWCNTs presents a high response to HCN or HCOH [21, 22].Therefore in the present study of work we use pure and B- and N-doped SWCNTs as a chemical sensor for HCOH and aim to improve the sensitivity of pure single-walled carbon nanotubes by doping with boron and nitrogen.

2 Materials and methods

The density functional theory (DFT) method is the standard model for many computational chemistry software systems. All geometries have been fully optimized at the Density functional theory with B3LYP/6-31G (d, p) level with the help of the Gaussian 09 suite of programs at temperature 298.15 K [23]. We first generate (3, 3) armchair single-walled carbon nanotube (SWCNT) model by using nanotubes structure generator (TubeGen 3.4) [24]. In Fig. 1b, where the C atom in position (1) will replace by a nitrogen and boron atoms respectively to generate nitrogen-doped SWCNT and boron-doped SWCNT models, also the open ends of the nanotubes are bonded with hydrogen atoms to refrain from boundary effects. We performed optimizations and calculations of pure-SWCNTs, nitrogen and boron- doped SWCNTs with and without formaldehyde. To study the possible adsorption between Pure- and doped- SWCNT with Formaldehyde.

Fig. 1
figure 1

Optimized geometry of a Formaldehyde molecule, b Pure- SWCNT (3, 3) armchair nanotube, c B-doped CNT (3, 3) nanotube, d N-doped SWCNT (3, 3) nanotube, e Pure-SWCNT (3, 3)-HCOH(Complex 1), f B-doped CNT-HCOH(Complex 2) and g N-doped SWCNT(3, 3)-HCOH (Complex 3)

3 Results and discussion

3.1 Molecular electrostatic potential (MEP) analysis

The molecular electrostatic potential (MEP) is related to the electron density and it is performed to predict reactive sites of the investigated molecule for electrophilic or nucleophilic attacks. [25] The MEPs of molecule Formaldehyde, pure-SWCNT (3, 3)/doped-SWCNT (3, 3) and complexes were prevailed by theoretical studies with the help of B3LYP-6-31G (d, p) method and the charge distribution were calculated by molecular electrostatic potential (MEP) shown in Fig. 2. It was found from MEP maps of HCOH that O atom shows highest electron density with red color and H has less electron density with green color as compared to O atom. [26] The O atom in formaldehyde molecule O atom is shown reactive sites and provides the possibility for a Formaldehyde molecule to approach the Pure and Doped carbon nanotube. Therefore, the Formaldehyde HCOH molecule can approach the Pure- SWCNT (3, 3) and Doped (B- and N-) CNT (3, 3) with different orientations.

Fig. 2
figure 2

Molecular electrostatic potential (MEP) plot of a Formaldehyde, b Pure-SWCNT (3, 3)-HCOH (Complex 1), c B-doped CNT-HCOH(Complex 2) and d N-doped CNT(3, 3)-HCOH (Complex 3)

3.2 Natural Bond Orbitals (NBO) Analysis

Natural Bond Orbitals study was performed via hybrid function B3LYP and basis set 6-31G (d, p) level. NBO analysis is executed to determine inter- and intra-molecular bonding and interaction between the donor and acceptor molecular system [27]. In NBO analysis the electron delocalization from Lewis valence orbitals (donor) to non-Lewis (acceptor) orbitals describes an extended molecular orbital that increase the stability of the system and explains electron transfer process between complexes [28]. The stabilization energy E(2) of interaction associated with the delocalization between i → j is calculated as

$$\Delta {\text{E}}^{(2)} = \Delta {\text{E}}_{\text{ij}} = {\text{q}}_{\text{i}} \frac{{{\text{F}}^{2} \left( {{\text{i}},{\text{j}}} \right)}}{{\upvarepsilon_{\text{j}} -\upvarepsilon_{\text{i}} }}$$
(1)

where qi and F (i, j) are represent the occupancy of donor orbital and off—diagonal Fock matrix element respectively, and εi and εj are energies of orbital [29].

The NBO analysis for complex 1, complex 2, and complex 3 has been implemented by B3LYP-6-31G (d, p) and the analysis is reported in Table 1. The O atom (LPs) of Formaldehyde molecule interact with the anti-bonding (BD*) orbital σ*(C37–H49) and σ*(C46–H47) of the Pure-CNT (3, 3) in the complex1, σ*(C36–H48) and σ*(C45–H46) of the B-CNT (3, 3) nanotube in the complex 2 and π*(C26–C27) and π*(C37–C38) of the N-CNT (3, 3) nanotube in the complex 3. Charge transfer of electron occurs as LP(1)O62 → σ*(C37–H49), LP (1)O62 → σ*(C46–H47) in complex 1, LP (1)O60 → σ*(C36–H48), LP(2)O60 → σ*(C45–H46) in complex 2, LP(3)O62 → π*(C37–C38), LP(2)O62 → π*(C26–C27) in complex 3 with hyper conjugative energies ∆E(2); 0.21, 0.28, 0.26, 1.15,2.60 and 0.52 kilocalorie per mole respectively. Therefore NBO analysis showed the strong interaction and charge transfer between the HCOH and boron and nitrogen-doped SWCNTs.

Table 1 NBO parameters of, Complex 1, Complex 2 and complex 3 are constricted by B3LYP-6-31G (d, p) method at 298.15 K

3.3 Electronic Properties

To analyze the adsorption between a Formaldehyde (HCOH) and Pure-SWCNT (3, 3) or B-doped SWCNT and N-doped SWCNT, we observe their adsorption energy ∆Eads, defined as

$$\Delta {\text{E}}_{\text{adsorption}} = \, \left[ {\Delta {\text{E}}_{\text{complex}} {-} \, \left( {\Delta {\text{E}}_{\text{SD}} + \, \Delta {\text{E}}_{\text{F}} } \right)} \right]$$
(2)

where E complex, ESD and EF are the optimized energies of the complexes (1, 2 and 3), SWCNTs (pure or doped) and Formaldehyde structure respectively, the calculated adsorption energies are shown in Table 2. Accordingly the adsorption energy value was found to be 0.98156 eV, 0.99785 eV and − 1.3319 eV of complex 1, complex 2 and complex 3 respectively. In complex 1 and 2, a small adsorption energy ∆Ead value indicates that Formaldehyde (HCOH) molecule undergoes physical adsorption on pure and B-doped SWCNT (3, 3) nanotube. The physical adsorption occurs due to weak van der Waals interaction between the pure or B-doped SWCNT (3, 3) and Formaldehyde molecule. The adsorption energy ∆Ead of complex 3 (Formaldehyde (HCOH)-nitrogen-doped SWCNT) has a negative value of about − 1.3319; this means adsorption takes place between them (attraction) and the exothermic reaction performed thermodynamically [30]. The interaction between the complexes can be best explained in terms of HOMO and LUMO energies. HOMO can donate electrons, while LUMO has a similar adverse effect. If a molecule has high HOMO energy then it will be more reactive (unstable) and vice versa [31].

Table 2 The calculated electronic properties of the Formaldehyde molecule, Pure- SWCNT (3, 3), Doped (B- and N-) SWCNT and complex 1, 2 and 3 via B3LYP method and basis set 6-31G (d, p)

HOMO and LUMO of SWCNTs/B- and N-doped SWCNTs before and after interaction with formaldehyde are given in Table 2 and shown in Fig. 3. On the basis of computational results, HOMO energy of N-doped SWCNTs decrease of 0.58 eV, 0.17 eV in B- doped SWCNTs, 0.02 in SWCNTs on sensing Formaldehyde. The weak interaction is observed in SWCNTs/B-doped SWCNTs compared to N-doped SWCNTs (see in Table 2). The corresponding HOMO energy of N-doped SWCNTs decrease on sensing, which indicates electron transfers from formaldehyde molecule to N-doped SWCNTs. The energy band gap (Eg) between the HOMOs and LUMOs calculated using the B3LYP method and 6-31G (d, p) basis set. The energy band gap Eg of pure- SWCNT (3, 3), B-doped SWCNT (3, 3) and N-doped CNT (3, 3) are 1.93 eV, 1.86 eV, and 1.61 eV respectively, after the adsorption of formaldehyde molecule in complex 1 (1.94 eV) and complex 2 (1.90 eV), we do not observe much changes in the energy gaps of complex 1 and complex 2, which indicates in complex 1 and complex 2, no adsorption takes place or adsorptions do not change the electronic properties of the pure- SWCNT (3, 3) and B- doped SWCNT (3, 3), but in complex 3 (N-doped SWCNT- HCOH), we observe the remarkable change in the energy gap (1.24 eV).The energy gap (Eg) value of N-doped CNT (3, 3) decreases after adsorption of HCOH molecule as reported in Table 2. This indicates the strong interaction between the N-doped CNT (3, 3) and Formaldehyde (HCOH).

Fig. 3
figure 3

Calculated results of HOMOs, LUMOs orbitals of the Formaldehyde molecule, complex 1, complex 2 and complex 3

A molecular descriptors of the Formaldehyde (HCOH), Pure- and doped SWCNT (3, 3) armchair nanotube and complex 1, 2 and 3 involve chemical softness (S), ionization potential (I), electron affinity (A), electronic chemical potential (μ), electrophilicity (ω), and global hardness (η) and electronegativity (χ) we can calculate above.

Parameters with the help of following equations:

$$\left[ {{\text{I}} = - {\text{E}}_{\text{HOMO}} } \right],\left[ {{\text{A}} = - {\text{E}}_{\text{LUMO}} } \right],\left[ {\upmu = - \left( {{\text{I}} + {\text{A}}} \right)/2} \right],\left[ {{\text{S}} = 1/2\upeta} \right],\left[ {\upomega =\upmu^{2} /2\upeta} \right]\left[ {\upeta = {\text{I}} - {\text{A}}/2} \right],\left[ {\upchi = {\text{I}} + {\text{A}}/2} \right],$$

as analyzed in Table 2. The electronic chemical potential (μ) and global hardness (η) values decreased after the adsorption of HCOH on the nanotube in complex 3 which indicates the high chemical activity and low chemical stability [32]. Comparatives analysis of ∆Eads, Eg, and HOMO–LUMO energies in complexes reveals that nitrogen-doped SWCNTs have a greater response to the detection of formaldehyde.

4 Conclusion

The computational results of NBO analysis and electronic properties show that nitrogen-doped SWCNTs have a remarkable change in energy gap from 1.61 to 1.24 eV after the adsorption of HCOH reveals that nitrogen-doped SWCNT has a greater response to HCOH, also the complex 3 have lower adsorption energy − 1.3319 kcal/mol indicates strong interaction between the HCOH and nitrogen-doped CNT. In Summary, DFT calculation results show that nitrogen-doped single-walled carbon nanotube is a promising candidate for sensing formaldehyde (HCOH) molecules.