Introduction

Nitrogen dioxide (NO2) is a hazardous oxidizing gas that is primarily emitted from the combustion of fossil fuels in motor vehicles, industries, power plants, etc [1]. It poses serious health risks by causing damage to the lungs, upper respiratory tract and cardiovascular system [1, 2]. In addition, it also has detrimental effects on the environment because it is a significant cause of acid rain and photochemical smog [3, 4]. Thus, it is imperative to develop efficient techniques for the real-time sensing of this notorious gas for the sake of human safety, protection and proper environmental monitoring. Many gas sensing methods, such as colorimetric [5, 6], conductometric [7], potentiometric [8], chemiresistive [9] and organic field-effect transistor-based (OFET) [10, 11] methods, have been employed to detect this vapor. Among these, chemiresistive sensors, which measure the change in resistance of the sensing materials when exposed to an analyte, have attracted much attention due to their simple operating principle, compact but straightforward device structure, low cost, and low power requirements [12]. Resistive sensors can also be integrated with complementary metal-oxide-semiconductor (CMOS) platforms that offer vast opportunities for miniaturization and portability [13, 14]. The critical component in a resistive sensor is the sensing layer, which significantly influences the sensing ability of the sensor. Thus, employing the appropriate materials is necessary for achieving superior and selective sensing. In pursuit of such sensing layers, several materials have been designed and explored over the last few decades. Metal oxides are one of the most widely studied sensing materials. These semiconductor-based chemiresistive sensors have also been tested for NO2 and were found to be highly sensitive for this environmental pollutant [15,16,17]. Unfortunately, these materials primarily operate at only high temperatures (100–500 °C), which leads to increased power consumption [15, 16]. Recently, many efforts have been made to discover sensing materials that can sense gases at room temperature [18, 19].

In addition, as a specific interest, organic π-conjugated materials such as carbon nanomaterials [20] and one-dimensional (1D) organic semiconducting polymers [21, 22] have been widely investigated as chemiresistive gas sensing materials due to their easy synthesis procedures, low cost, high sensitivity, flexibility and room temperature operation. The 1D conducting polymers that have been explored for sensing include polyaniline (PANI) [22, 23], poly(3,4-ethylene dioxythiophene) (PEDOT) [24], polythiophenes (PThs) [21], polypyrroles (PPys) [25], etc. The sensors developed by these polymeric sensing layers exhibited promising results for a wide range of analytes; however, their sensitivities and selectivities are inferior to those of metal oxides, possibly due to a lack of adequate coordinating/interacting sites for the analytes in the polymeric backbone. However, one molecular design strategy that has been successfully demonstrated to improve the sensitivity and selectivity of sensors (optical and fluorescent sensors, etc.) [26, 27] in general is to attach coordinating/functional groups to the polymeric backbone to induce strong interactions with the analyte(s). Along this line, chemiresistive sensors based on functionalized organic polymers, polymer/graphene oxide, and polymer/carbon nanotubes have been developed with improved selective sensing of various analytes [28,29,30,31,32,33]. However, the number of examples reported is extremely scarce. Moreover, to the best of our knowledge, coordinating unit integrated organic 1D polymers have never been tested for chemiresistive sensing. It is worth noting that coordinating unit-embedded porous organic polymers (two-dimensional polymers), such as covalent triazine frameworks (CTFs) [34, 35], covalent organic nanosheets (CONs) [36], graphitic carbon nitride (g-C3N4) [37], heptazine-based organic frameworks [38], and imine-linked covalent organic frameworks (COFs) [39], have exhibited improved sensing performance toward various analytes, although they are not very relevant in the context of conducting 1D polymers. Because of the ease of synthesis and the ability to effectively propagate π delocalization, 1D polymers are expected to have a distinct advantage over porous organic polymers for sensing applications.

In this work, we designed and developed three new 1D polymers consisting of nitrogen atom-loaded tetrazines as sensing layers for the chemiresistive sensing of NO2. The structural, optical and electronic properties of the polymers were found to be significantly different from each other as the aryl units (from p-phenylene to m-phenylene and thienyl) varied between the tetrazine units. Most importantly, the aromatic units allowed the tetrazine polymers to stabilize in varying proportions of (unoxidized) dihydrotetrazines (55% to 0) and (oxidized) tetrazine units. All three tetrazine-based polymers were thoroughly tested for their capabilities to detect different concentrations of NO2 ranging from 25 to 150 ppm at ambient temperature. One of the three polymers was discovered to have the best performance toward NO2. These polymers were also assessed for their selectivities towards the obnoxious gas by exposing them to different gases present in the environment, such as NH3, humidity and a few other volatile organic compounds (VOCs). The detailed results are presented and discussed in the subsequent sections.

Experimental section

Material synthesis

Synthesis of tetrazine polymers: Aryl dicarbonitrile (1.56 mmol, 1 eq), sulfur powder (6.24 mmol, 4 eq) and 75% hydrazine hydrate (15.6 mmol, 10 eq) in ethanol were refluxed for three days. The reaction mixture was then concentrated under reduced pressure, and the crude product was used in the next step without further purification.

The crude product was suspended in an acetic acid/water (2:1) solution of NaNO2 (7.6 mmol, 5 eq) under ice-cold conditions and stirred at room temperature for two days. Next, the solid was collected by vacuum filtration and washed with hot DMF, water, methanol and acetone and by Soxhlet extraction in toluene and ethanol for 2 and 1 days, respectively, to remove the sulfur and oligomeric units. Finally, the solid was vacuum-dried for two days.

Poly[(1,4-phenylene)-alt-(3,6-(1,2,4,5-tetrazine)/3,6-(1,2,4,5-dihydrotetrazine))] (pPTz)

Reddish-brown solid, yield: 76%; 13C cross-polarization magic-angle-spinning (13C CPMAS) NMR (100 MHz, δ in ppm) 120-140, 162, 167; IR (KBr pellet): νmax = 1604, 1450, 1390 cm−1; UV–Vis-NIR (powder): red edge – 645 nm (band gap − 1.92 eV).

Poly[(1,3-phenylene)-alt-(3,6-(1,2,4,5-tetrazine)/3,6-(1,2,4,5-dihydrotetrazine))] (mPTz)

Pink solid, yield: 30%; 13C CPMAS NMR (100 MHz, δ in ppm): 121-140, 163, 166.8; IR (KBr pellet): νmax = 1603, 1455, 1373 cm−1; UV–Vis-NIR (powder): red edge – 642 nm (bandgap – 1.93 eV). The low yield from this reaction can be attributed to the steric factors caused by 1,3-substitution.

Poly[(2,5-thiophene)-alt-(3,6-(1,2,4,5-tetrazine))] (TTz)

Dark red solid, yield: 80%; 13C CPMAS NMR (100 MHz, δ in ppm): 21-146, 161.4; IR (KBr pellet): νmax = 1601, 1453, 1384 cm−1; UV–Vis-NIR (powder): red edge – 714 nm (band gap − 1.73 eV).

Synthesis of Model Compound: 3,6-di(thiophen-2-yl)−1,2,4,5-tetrazine (MTTz) [40]

To a dry round-bottom flask was added thiophene-2-carbonitrile (100 mg, 0.75 mmol), sulfur powder (47.8 mg, 1.49 mmol), 75% hydrazine monohydrate (3.72 mmol, 5 eq) and ethanol (15 ml). The mixture was refluxed at 80 °C for two hours and cooled to room temperature. The red precipitate was collected via filtration and thoroughly dried under vacuum. It was used directly for the next step of oxidation without further purification.

The red precipitate was added to a round bottom flask followed by isoamyl nitrite (5 ml) and chloroform (10 ml). The mixture was stirred at room temperature for 12 h. The solvent was then removed by rotary evaporation, and the collected residue was subjected to silica gel column chromatography to afford the target molecule as red crystals in 55% yield (125 mg). 1H NMR (400 MHz, CDCl3, δ in ppm): 8.28-8.27 (m, 2H), 7.69-7.67 (m, 2H), 7.28-7.26 (m, 2H); 13C NMR (400 MHz, CDCl3, δ in ppm): 161.6, 136, 132.6, 131.0, 129.1; UV–Vis (CHCl3 solution): red edge – 424 nm.

Electrode fabrication

For electrochemical measurements, the insoluble pPTz polymer was coated on a glassy carbon electrode using the following procedure. First, the electrode was thoroughly washed with water and dried in air. Later, pPTz (5 mg; 75%), Nafion binder (1 mg; 20%), and carbon black (0.66 mg) were mixed in ethylene glycol (500 μl) and stirred for 12 hr to generate a homogenous solution. In the next step, 0.5 μl of the solution was drop-casted on the glassy carbon electrode, and the electrode was dried under vacuum for 6 h.

Material characterization

An Agilent Cary 5000 UV-Vis-NIR spectrophotometer was employed to study the optical properties of the synthesized polymers. The NMR spectra for the polymer structural characterizations were obtained on a JEOL Resonance ECZ-400R spectrometer. Infrared spectra were recorded on a Nicolet Impact-400 FTIR spectrometer. Solid samples were recorded as KBr wafers and analyzed. Morphological studies of the sensing materials were carried out using field emission scanning electron microscopy (FESEM; Carl Zeiss Gemini-300). Thermogravimetric analysis (TGA) was carried out on an SDT Q600, TA Instruments, USA. Cyclic voltammetry studies were performed on a CHI instrument (model no: 660E). Density Functional Theory (DFT) calculations of the molecular structures (in the gas phase) and the molecular orbital energies were carried out at the B3LYP/6-31 G(d) level as implemented in Gaussian 16. The figures were generated with GaussView 6.0.

Gas sensing setup and measurements

The synthesized polymer samples were dispersed in ethanol and coated on interdigitated electrodes (IDEs) by drop-casting the former on the latter and dried until the solvent was evaporated. Then, the polymer-coated IDEs were probed inside an airtight stainless-steel chamber. The test chamber was connected to a data acquisition unit (Keithley 6510 data acquisition (DAQ)), which facilitated continuous recording the sensing layer’s resistance at a time interval of 1 s. The gas inlet of the stainless steel chamber was connected to a gas mixer that received input from multiple mass flow controllers (MFCs). This study required two MFCs—one of the MFCs, MFC1, was utilized to flow the calibration gas, which was dry air in our case; the other MFC, MFC2, was used to introduce the target gases. After the sensor devices were mounted inside the test chamber, the chamber was evacuated before conducting any experiments to avoid contamination. Then, the sensors were purged with dry air at a flow rate of 100 standard cubic centimeters per minute (sccm) for one hour to stabilize the baseline resistance of the sensing layer. Next, different concentrations of the target gases NO2, NH3, 2-NT, ethanol, methanol, acetone, and H2O were introduced into the test chamber by varying the ratios of the flow rates MFC1 and MFC2. The sensors were exposed to a particular gas concentration for 5 min, followed by 10 min of purge with the calibration gas.

Results and discussion

The tetrazine-based polymeric sensing materials, 1,4-phenylene tetrazine (pPTz) [41], 1,3-phenylene tetrazine (mPTz) and thiophene tetrazine (TTz) polymers, were synthesized (Scheme 1) in two steps by using Pinner synthetic protocols using aryl dicarbonitriles (1,4-dicyanobenzene, 1,3-dicyanobenzene and 2,5-dicyanothiophene, respectively). The appropriate aryl dicarbonitrile was reacted with hydrazine hydrate (75%) and sulfur in ethanol for three days to achieve the unoxidized dihydrotetrazine polymers. The intermediates were then oxidized using aqueous sodium nitrite for 48 h to generate the tetrazine polymers. The resulting intensely colored solids (pink to reddish-brown) were filtered and purified with hot DMF and by Soxhlet extraction (toluene and ethanol over 24 h). The thermal stability of the polymers was evaluated by TGA, which showed that the decomposition temperatures of these polymers were above 250 °C (Fig. S1).

Scheme 1
scheme 1

Synthesis of polymers pPTz, mPTz and TTz and the model compound MTTz

The successful preparation of the polymers was verified by Fourier transform infrared (FT-IR) spectroscopy and 13C CP-MAS NMR spectroscopy. The appearance of characteristic tetrazine signals corresponding to -C = N- and -N-N- at ~1603 cm–1 and ~1380 cm–1, respectively, along with the other customary signals of -C = C- and -C-H at ~1453 cm–1 and ~2920 cm–1, confirmed the formation of the polymers (Fig. 1a). On the other hand, the 13C CP-MAS NMR spectrum of the polymers displays a tetrazine carbon (-C = N-) signal at ~162 ppm, again confirming the formation of the polymers. The weak signal at ~115 ppm corresponds to the end-group nitrile (-C ≡ N) and is indicative of the presence of a long polymeric chain. For all the polymer phenylene/thienyl groups, carbon signals appeared between 120 and 140 ppm (Fig. 1b). The 13C NMR peak pattern and the positions of the polymers were also identical to the solution soluble model compound (MTTz). However, pPTz and mPTz showed an additional signal (b) at ~167 ppm belonging to unoxidized dihydrotetrazine units. This indicates that the polymers were not completely oxidized during the reaction of dihydrotetrazine with aqueous sodium nitrite but instead consisted of both tetrazine and dihydrotetrazine units. Furthermore, the peak intensity of the dihydrotetrazine signal was higher for pPTz (equivalent to the signal of oxidized tetrazine) than for mPTz, but vanished completely for TTz. Peak deconvolution fitting of these NMR signals indicated that pPTz contains a high percentage of dihydrotetrazines (55%) compared to as little as 25% in mPTz (Fig. S2).

Fig. 1
figure 1

Overlay of (a) FT-IR, (b) 13C CP-MAS NMR, (c) diffuse-reflectance UV–Vis absorption spectra and (d) Kubelka-Munk spectra of pPTz, mPTz, TTz and the model compound MTTz. The absorption spectrum of MTTz was measured in a dilute CHCl3 solution (1 × 10−5 M)

To understand the incomplete oxidation process of the polymers, density functional theory (DFT) calculations were carried out on model polymeric fragments that were unoxidized, partially oxidized, and oxidized (Fig. 2a). The DFT-evaluated HOMO energies indicated that among all three unoxidized and partially oxidized fragments, the thiophene congeners (–5.48 eV and –5.72 eV) possessed relatively higher HOMO energies, which provides a higher driving force for the oxidation to yield a fully oxidized material. On the other hand, the HOMOs are somewhat higher for the partially oxidized phenylene fragments (–5.92 eV), allowing the stabilization of the intermediate partially oxidized forms. Moreover, such systems also gain additional stability via donor-acceptor interactions between unoxidized (D) and oxidized (A) species. As depicted in Fig. 2a, the HOMOs are localized on the dihydrotetrazine units, while the LUMOs are centered around the tetrazine units. However, the variable oxidation ratios for para- and meta-phenylene systems, despite having the same HOMO energies, could be attributed to weak D-A interactions arising from cross-conjugation in the meta-system.

Fig. 2
figure 2

DFT-calculated HOMO energy levels and Frontier molecular orbitals plots of (a) representative fragments of the polymers pPTz, mPTz and TTz and (b) polymers pPTz, mPTz and TTz

The diffuse reflectance optical properties of the solid polymers were studied using UV–Vis-NIR spectroscopy (Fig. 1c). All of the polymers displayed broad and strong absorption spectra covering most of the visible region with a red edge at ~650–725 nm. pPTz and mPTz showed dual-band features (~300 to 450 nm and ~550 nm) while this feature merged and appeared as one broad band for TTz. The former was ascribed to the π-π* transition, while the latter refers to the n-π* transition originating from tetrazine units. The optical band gaps calculated from the onset absorption of the polymers (pPTz, mPTz and TTz) were 1.92, 1.94, and 1.75 eV, respectively (Fig. 1d). mPTz vs. pPTz showcased a higher bandgap due to the cross-conjugation arising from meta-connection. However, among the three, the thiophene congener (TTz) possessed the narrowest bandgap, which was attributed to heteroatom-assisted enhanced π-delocalization.

DFT calculations of the molecular structures of the model compounds and polymers were optimized. The optimized structures revealed a planar backbone for all three polymers due to alternating aryl and tetrazine units (Fig. 2b). However, pPTz and TTz possess a linear chain conformation, while mPTz has a zigzag arrangement due to the meta connections. The HOMOs/LUMOs of the polymers were predicted to be −5.97 eV/−2.96 eV, −6.08 eV/−2.92 eV and −6.18 eV/−3.66 eV, leading to band gaps of 3.01, 3.17 and 2.51 eV, respectively, for pPTz, mPTz and TTz. The observed trend in the predicted bandgaps was in line with the experimentally deduced optical bandgaps. However, the overestimation of the DFT-predicted bandgaps compared to the experimental bandgaps can be attributed to the gas phase DFT calculations. The high HOMOs and low LUMOs indicate that the polymers are electron deficient and are ideal for p-type chemiresistive sensing materials. To validate the HOMO and LUMO energy levels evaluated by DFT, we performed cyclic voltammetry of pPTz. The polymer exhibited a reduction potential at –1.39 V vs. Fc/Fc+. The corresponding LUMO energy was calculated to be 3.01 eV, matching well with the DFT-deduced LUMO energy (Fig. S4). Since the polymer is electron deficient, no oxidation potential was observed within the measured solvent window (dichloromethane); thus, the HOMO and the bandgap could not be evaluated.

The morphology of the polymers was studied by FESEM (Fig. S5). The polymers showed polymeric aggregates leading to sheet/flake-like morphologies with high surface areas. This can be attributed to the polymers’ planar geometry, which allows strong intermolecular interactions.

The N-rich tetrazine polymers are expected to be suitable sensing layers for the chemiresistive sensing of various analytes. Thus, the synthesized polymers were tested against several gaseous analytes. Starting with NO2, the sensing layer was exhaustively tested with four different concentrations of NO2 (25–150 ppm) at 25 °C. The resistances of the sensors were observed to decrease in the presence of NO2, and the response of the sensors was calculated using Formula (1).

$$Response\,({{{{{{{\mathrm{\% }}}}}}}}) = \left| {\frac{{R_a - R_g}}{{R_a}}} \right| \times 100$$
(1)

where Rg is the resistance of the sensors in the presence of the target gas and Ra is the baseline resistance.

Figure 3a shows the dynamic response of pPTz to NO2 at concentrations of 25–150 ppm. The pPTz polymer’s response for NO2 was found to vary between 10.6% (25 ppm) and 37% (150 ppm). The response of the semiconducting polymer was found to increase almost linearly with the concentration of NO2, as is evident from the inset in Fig. 3a. The adj R2 value was found to be 0.96399, which expresses a good degree of fit. Due to the experimental setup limitations, the sensors could not be tested with lower concentrations of NO2. That is why the limit of detection (LOD) of the developed sensor was statistically calculated following a previously reported method [42]. The LOD of the pPTz-based sensor for NO2 was 5.67 ppm.

Fig. 3
figure 3

a Response of the pPTz polymer to different concentrations of NO2 at room temperature (25 °C). The inset shows the linear fitted graph of the concentration vs. response. b Variations in the responses of the four different sensor devices for 25–150 ppm NO2

To confirm the reproducibility, we prepared four sensor devices and tested them with 25–150 ppm NO2. The standard deviation for the four sensor devices was calculated and plotted, as shown in Fig. 3b. The deviation in the response of the sensors was found to be a maximum of 2.95% for 150 ppm NO2, whereas it was the lowest (1.05%) in the case of 25 ppm NO2. Along with the response and reproducibility, other essential attributes of gas sensors are the response times and recovery times. A resistive vapor sensor’s response time (τres) is the time required to attain 90% of the steady-state response for a particular vapor concentration. The recovery time (τrec) is defined as the time taken by the sensor to recover to 10% of the baseline resistance after the target gas is removed from the proximity of the sensor. The response times and recovery times of four different devices developed with pPTz for different concentrations of NO2 were calculated and are shown in Fig. 4a. The τres was observed to get shorter with an increase in the concentration of NO2 and was found to be 428 s for 25 ppm NO2, which was reduced to 115 s when the concentration of the gas was increased to 150 ppm. This result perhaps occurred because as the concentration of NO2 increased, more number of gas molecules were present in the proximity of the sensing material for reaction, thereby expediting electronic exchanges. However, the opposite trend was observed in the case of recovery time. The τrec was calculated to be 94 s for 25 ppm of the target analyte, but the recovery time increased to 560 s while attempting to recover the sensor after exposing it to 150 ppm NO2.

Fig. 4
figure 4

a Response times and recovery times of the four devices developed with pPTz for different concentrations of NO2. (b) Repeatability test results of the pPTz-based sensor to 150 ppm NO2

The slower recovery with increasing concentration of NO2 can be attributed to more desorption of gas molecules from the material’s surface that happens after the exposure. More variations in response time were found in the case of 25 ppm of NO2 with a standard deviation of 105 s, and the deviation was lowest (7.2 s) in the case of 150 ppm NO2. However, in the case of recovery time, the maximum deviation of 71.6 s was found for 150 ppm analyte, and the lowest variation of 8.5 s was observed for 100 ppm. The variations in the response, response times and recovery times across the devices could be attributed to multiple factors, including the variation in the number of layers coated on the electrodes and the extent of the overlap between the polymer layers.

It is equally important to ascertain whether the sensor’s response repeats if exposed to the same concentration of the target gas multiple times. Hence, the pPTz-based sensor was exposed to five cycles of NO2 (150 ppm) at room temperature, and the results were found to be highly repeatable with a maximum variation of ~3% of the response (Fig. 4b).

The primary advantage of a gas sensor that works at room temperature is reduced power consumption, which eliminates heating elements from the sensor devices and the accessories required to maintain and monitor the required temperature. However, the performance of room temperature operable sensors is expected to be affected by humidity. Hence, evaluating the response of the gas sensor in the presence of moisture is very important. The pPTz-based sensor was exposed to 30%, 50%, and 70% RH, and the response was found to be 4%, 4.8%, and 6.6%, respectively, as shown in Fig. 5a. This response is much lower than the sensor’s response to NO2. In addition to humidity, the developed sensor was tested against five more vapors, including pollutants such as NH3, and gases that are present in the environment such as 2-nitrotoluene (2-NT) and certain volatile organic compounds including ethanol, methanol and acetone. pPTz showed absolutely no response toward 2-NT at any concentration tested (up to 200 ppm), and hence, Fig. 5b does not represent any response corresponding to 2-NT. For the other compounds, an observable response was achieved at only very high concentrations. For example, NH3 exhibited a detectable response only after the concentration reached 500 ppm (Fig. 5b), which was also found to be very low (~3% for 500 ppm NH3). Similarly, for ethanol, methanol and acetone, a detectable response was observed at 3500 ppm, 7500 ppm and 14,000 ppm, respectively, which was also very low compared to the response observed for NO2. Hence, pPTz was found to be highly selective for NO2.

Fig. 5
figure 5

a Response of the pPTz polymer to different RH values. b Selectivity test results of the pPTz sensor

A rapid decrease in the sensor’s resistance in the presence of NO2 and its return to the initial stage upon venting the analyte gas indicates that the sensor has p-type semiconducting behavior. Typically, the oxidizing NO2 upon its adsorption onto the surface of the sensing layer annihilates the electrons from the surface of the sensing layer and accumulates more holes. As a result, the concentration of the holes on the surface of the sensing layer increases, and thus, the resistance of the p-type sensor decreases.

In addition to the pPTz polymer, we also tested the mPTz and TTz polymers. These sensing layers were tested with 25–150 ppm of NO2. Among the three, pPTz exhibited the best response, as is evident from Fig. 6. No change in the resistance was observed in the mPTz sample until it was exposed to 150 ppm of the pollutant. Similarly, the response of TTz (~18% to 150 ppm NO2) was also found to be lower than the response exhibited by pPTz.

Fig. 6
figure 6

Response of pPTz, mPTz, and TTz polymers to 25–150 ppm NO2

The rationale behind the high selectivity of pPTz toward NO2 over other analytes (NH3, ethanol, methanol, acetone, 2-NT and water) and the superior performance of pPTz over the other sensors (mPTz and TTz) can be attributed to the unique structural arrangement associated with this polymer. The presence of both tetrazine units (~50%) and dihydrotetrazine units (~50%) in pPTz induces N-heteroatom (tetrazine) and hydrogen bonding (dihydrotetrazine) interactions with NO2 (Fig. 7a), which promotes efficient adsorption of the analyte onto the polymer surface and subsequently leads to superior sensing performance. However, such hydrogen bonding interactions may not be feasible for other tested analytes. Similarly, mPTz and TTz cannot induce hydrogen bonding interactions with NO2 due to the low concentration or absence of the dihydrotetrazine units. The presence of tetrazine units is also crucial, as they play a critical role in conducting properties and for effective analyte binding. To show the role of tetrazine units in the polymeric backbone, we employed a tetrazine-free polymer. fully dihydrotetrazine-loaded polymer (UpPTz) for NO2 sensing (Fig. S6). It was found to exhibit much lower performance (~14% response toward 150 ppm NO2) than what was demonstrated by pPTz. This indicates that dihydrotetrazine and tetrazine moieties are key to inducing the synergetic interactions of H-bonding and N-heteroatom interactions (and enhancing the polymer conducting properties) for the binding of NO2 onto the sensing layer, thereby leading to superior sensing.

Fig. 7
figure 7

Schematic representation of the interaction of pPTz with NO2

To understand the interactions between NO2 and the dihydrotetrazine units, DFT calculations were used to optimize the different modes of the interactions and evaluate the critical parameters such as adsorption energy (Eads) and the average energy gap variation (Ega). As Fig. 8 depicts, NO2 interacts with NH and N atoms (mode a); two NH atoms (mode b); one NH atom (outward NO2 orientation, mode c); and one NH atom (inward NO2 orientation, mode d) of the dihydrotetrazine unit. In the optimized structures, the minimum distance between the tetrazine units and NO2 is ~2.50 Å, which is well within the secondary bonding interactions (physisorption), and the negative Eads values (~5 kJ/mol) indicate that the analyte-compound interactions are stable. Typically, when an analyte interacts with a sensing layer, there is a considerable influence on the energy levels (bandgap) of the material; as a result, the resistance of the material will vary, and the stronger the interactions are, the higher the bandgap variation between the host layer and the analyte adsorbed host layer will be. The bandgap variations (Ega values) for the modes of interactions a-d were calculated to be 1.2%, 2.5%, 2.6% and 7.9%, respectively (Fig. 8). The electronic energy levels of the tetrazine compound were greatly affected when NO2 interacted with one NH moiety of the dihydrotetrazine unit in an inward orientation. Such an orientation allows NO2 to develop multiple interactions with the neighboring tetrazine units.

Fig. 8
figure 8

Different modes of interaction between NO2 and the partially oxidized model compound. The calculated bandgap variations between the free system and the adduct were (a) 1.2%, (b) 2.5%, (c) 2.6%, and (d) 7.9%

Conclusions

We developed three new N-heteroatom functionalized tetrazine-based polymers for the selective sensing of NO2 gas. The polymers exhibited deep colors and narrow optical bandgaps (1.7–1.9 eV), indicating that they are suitable for semiconducting applications. All of the polymers were tested with different concentrations of NO2 at room temperature. Among the three, pPTz was found to exhibit the highest response to NO2 in the concentration range from 25 to 150 ppm. The response ranged from 10.6% for 25 ppm to 37% for 150 ppm NO2. Furthermore, this novel polymer exhibits a fast response, recovery properties, and excellent repeatability at room temperature. Moreover, pPTz vs. mPTz and TTz demonstrated superior sensing ability due to the tetrazine and dihydrotetrazine units in the polymeric backbone, enabling strong N-heteroatom and hydrogen bonding interactions with NO2. The polymer also discriminates NO2 over a range of analytes, such as NH3, EtOH, MeOH, acetone, 2-nitrotoluene and water. We believe that this work may open up new design strategies for developing 1D organic polymer-based gas sensing materials with specific functional groups that effectively bind to a particular analyte.