Introduction

Carbon aerogels are lightweight porous materials with diverse and tunable morphologies. They possess a three-dimensional hierarchical micro- and mesoporous network [1,2,3,4,5]. Such materials can be obtained, for example, by the carbonization of organic polymer aerogels under an inert atmosphere. Due to many excellent properties, e.g., large surface area, tunable porosity or low bulk density, carbon aerogels are promising materials for various applications, including hydrogen storage, supercapacitors, electrodes in electrocatalytic reactions, etc. [6,7,8,9,10,11,12,13]. Organic aerogels are generally synthesized by sol–gel processes from various organic precursors. Resorcinol–formaldehyde (R–F) gels can be produced via the polycondensation of resorcinol and formaldehyde in a basic aqueous solution. Their pyrolysis may lead to carbon aerogels [4, 5, 14].

Nitrogen-doped carbonaceous matrices have many attractive functional properties; nitrogen can significantly alter the electron distribution of the carbon matrix, even at low concentrations, changing its electrical and hydrophobic/hydrophilic nature [7, 15,16,17,18,19]. Nitrogen doping may provide more active sites to interface electrochemical reactions as it introduces a large number of surface defects. This contributes to the enhancement of lithium intercalation properties which improves energy storage applications, due to the enhanced electrochemical reactivity and electrical conductivity. Thus, nitrogen doping of carbonaceous electrodes has been found to increase the long-term electrochemical stability in lithium-ion batteries and cycling performance in supercapacitors. In addition, nitrogen atoms can be added to the structure of carbon aerogel to induce surface alkalinity and therefore modify the adsorption properties of the aerogel [20].

The nitrogen-containing precursor should be incorporated into the precursor polymer aerogels in thermally stable forms [19]. Nitrogen-doped carbon aerogels can be prepared by using a nitrogen-containing precursor monomer such as melamine, 3-aminophenol, 3-hydroxy-pyridine, urea, l-lysine, among which melamine has the highest nitrogen content, making it a favorable choice [21, 22]. The polymerization reaction between melamine and formaldehyde leads to polymers with only limited surface area. The surface area can be improved if melamine only partially replaces the resorcinol in R–F gels. Thus, nitrogen-doped porous mesoporous nano-structured carbonaceous material can be obtained [20]. The hydroxy methyl groups form a methylene and methylene ether-bridged 3D polymer and thus may result in a homogeneous melamine–resorcinol–formaldehyde network [22].

The thermal behavior of nitrogen-doped polymer aerogels was studied extensively previously [23]. In addition, the preparation and—compared to us, a more limited—characterization of carbon aerogels, including N-containing ones as well, have been published by several authors on various samples [19]. However, here we apply an outstandingly wide variety of classical and cutting edge analytical methods for the characterization of a polymer aerogel and the carbon obtained from it, i.e., all the methods were applied on the same material and its precursor. In addition, the thermal decomposition of the carbon aerogel prepared from the polymer aerogel was not studied. It was expected that since the carbon aerogel is prepared by pyrolysis of the polymer aerogel, the carbon aerogel would be inert, having no functional groups or other moieties, which could leave upon heating. However, when the carbon aerogel is in contact with air, as during usual laboratory storage conditions, it might react with oxygen and functional groups can be formed.

In our research, our aim was to see how nitrogen-doped carbon aerogel would behave upon annealing, i.e., whether there would be no further heat loss following its preparation by pyrolysis at 900 °C, or storing under air would induce the formation of surface functional groups. For comparison, the thermal behavior of the precursor polymer aerogel was also studied. Hence, a resorcinol–melamine–formaldehyde polymer gel was synthetized, to serve as precursor for a nitrogen-doped polymer aerogel, which was obtained by supercritical drying. It was then carbonized, yielding the nitrogen-containing carbon aerogel. The polymer and carbon aerogels were characterized with thermogravimetry/differential thermal analysis coupled with mass spectrometry (TG–DTA/MS), nitrogen adsorption at − 196 °C, Fourier-transformation infrared spectroscopy (FTIR), Raman spectroscopy, powder X-ray diffraction (XRD) and scanning electron microscope–energy-dispersive X-ray spectroscopy (SEM–EDX) techniques.

Materials and methods

Preparation of the aerogels

For the synthesis of the polymer aerogel, 1.5990 g resorcinol, 0.0208 g sodium carbonate, 0.7326 g melamine and 48 cm3 distilled water were put into a beaker. The beaker was placed onto a water bath (70 °C), and the mixture was stirred for 15 min, until the melamine dissolved. Afterward, 6.5 cm3 formaldehyde was added to the solution, and it was stirred for 5 min. The solution was poured into glass tubes with a syringe, and the tubes were sealed and put in a heated cabinet at 85 °C. After 1 week, the gel cylinders were removed from the glass tubes, and they were immersed in acetone for 6 days in order to replace the water in the gels. This was repeated four times, which was crucial for the consecutive drying with supercritical CO2. The supercritical drying was done under 100 bar pressure and at 42 °C temperature for 80 min, which yielded the polymer aerogel. To obtain the carbon aerogel, the polymer aerogel was carbonized under nitrogen atmosphere (25 cm3 min−1) at 900 °C for 1 h (20 °C min−1 ramp rate). These parameters were selected from [7], based on previous research work.

Characterization

TG/DTA–MS measurements were conducted on a TA Instruments SDT 2960 simultaneous TG/DTA device in helium atmosphere (130 cm3 min−1) using an open platinum crucible. The heating rate was 10 °C min−1. EGA–MS (evolved gas analysis) curves were recorded by a Balzers Instruments Thermostar GSD 200T quadruple mass spectrometer (MS) coupled on-line through a heated (T = 200 °C), 100% methyl deactivated fused silica capillary tube with inner diameter of 0.15 mm to the TG/DTA instrument.

FTIR measurements were carried out on a Biorad Excalibur Series FTS 3000 infrared spectrometer. 300 milligrams of KBr pellets were used, which contained ca. 1 mg sample. 64 measurements were accumulated into one spectrum.

Raman spectrum was made by using a Jobin–Yvon Labram Raman instrument equipped with an Olympus BX41 microscope and a green Nd-YAG laser with 532 nm wavelength.

Powder XRD patterns were recorded on a PANanalytical X’Pert Pro MPD X-ray diffractometer using Cu Kα radiation.

SEM–EDX data were obtained by a JEOL JSM-5500LV scanning electron microscope. For the imaging, an Au/Pd layer was sputtered on the samples. The average of EDX data was calculated from 5 different measurements on each sample.

Nitrogen adsorption/desorption isotherms were measured at − 196 °C with a Nova2000e (Quantachrome) computer-controlled apparatus. The apparent surface area (SBET) was calculated using the Brunauer–Emmett–Teller (BET) model [24]. The total pore volume (Vtot) was derived from the amount of nitrogen adsorbed at relative pressure 0.9760 (corresponding to pore width of ~ 85 nm), assuming that the pores were then filled with liquid adsorbate. The micropore volume (W0) was derived from the Dubinin–Radushkevich (DR) plot [25]. The mesopore volume Vmeso was calculated as Vtot − W0. For the sake of comparability, the pore size distribution was calculated by the Barrett–Joyner–Halenda (BJH) method for both aerogels as no kernel files are available for polymers [21].

Results and discussion

Figures 1 and 2 show the chemical structure of the bare resorcinol–formaldehyde and bare melamine–formaldehyde gels [27, 28]. We assume that our resorcinol–melamine–formaldehyde polymer gel contains both of these polymer networks.

Fig. 1
figure 1

Resorcinol–formaldehyde polymer gel structure [27]

Fig. 2
figure 2

Melamine–formaldehyde polymer gel structure [28]

From the thermal analysis coupled with mass spectrometry (Fig. 3a, b), it can be seen that around 75 °C the polymer aerogel loses adsorbed water (m/z: 18). The decomposition of the polymer aerogel has two major steps. The first step begins at 150 °C, where mostly the species belonging to 26 (C2H +2 ), 30 (C2H +6 , NO+) and 58 (C3H6O) m/z can be detected, the sources of these are the residue acetone solvent and the unreacted monomers. The second step begins at around 300 °C, in agreement with data in the literature, where the ion current of the 30, 44 (C3H +8 , CO +2 , N2O+) and 46 (C2H5OH+, NO +2 ) m/z species increase, which come from the decomposing polymer framework and the functional groups [18, 23, 29]. In this region, the DTA curve of the polymer aerogel shows a small endothermic peak at 472.7 °C. The final residue had only 24.5% of the starting mass.

Fig. 3
figure 3

TG/DTA–MS results of the polymer aerogel (a) and the carbon aerogel (b) in helium atmosphere

The mass loss of the carbon aerogel during TG/DTA–MS measurement in helium atmosphere mainly comes from the decomposition of functional groups. After the pyrolysis of the polymer aerogel, the resulting carbon aerogel was stored in ambient condition. Its contact with air resulted in reaction with oxygen. This process produced functional groups on the surface of the carbon aerogel. There are two small peaks at around 500 °C in the ion current curves of the 44 and 46 m/z ions, and the carbon aerogel lost 6% of its mass until the end of the annealing. The DTA curve of the carbon aerogel shows no significant heat effect; most probably, the release of small number of functional groups was an elongated process giving no significant DTA peak at a certain temperature.

The FTIR spectra (Fig. 4) show the vibrational bands of various molecule groups of the aerogels: at 3400 cm−1 the stretching of the O–H and N–H, at 2900 cm−1 the stretching, and at 1460 and 1380 cm−1 the bending of C–H, around 1700 cm−1 the stretching of the C=O and C=C, and the bending of N–H, at 1550 cm−1 the stretching and at 980 cm−1 the bending of the C=C, at 1250 and 1220 cm−1 the stretching of C–O, and at 1100 cm−1 the stretching of C–O and C–N bonds. Most are present in the case of both the polymer and the carbon aerogels, except the C–H peaks, which disappeared after the carbonization process. The presence of many functional groups on the surface of the carbon aerogel is due to the oxidation by the air after pyrolysis, as mentioned previously. The FTIR spectra are comparable to the spectrum of a bare R–F resin [12].

Fig. 4
figure 4

FTIR spectra of the polymer aerogel (a) and the carbon aerogel (b)

From the Raman measurement of the carbon aerogel (Fig. 5), it can be seen that the spectrum has only the D (residual disorganized graphite peak, 1350 cm−1) and G (graphite peak, 1600 cm−1) bands. The intensity ratio of the D/G peaks evaluates the graphitic nature of the sample. In our case, that ratio is 1.20, indicating that the carbon aerogel is amorphous [30]. It was not possible to record Raman spectrum for the polymer aerogel; it showed no Raman activity, neither when it was measured with 532 nm laser, nor when with 633 nm laser.

Fig. 5
figure 5

Raman spectrum of the carbon aerogel

According to the powder XRD diffractograms (Fig. 6), both aerogels are amorphous, but some reflections from the graphite planes can be seen belonging to the Miller indices of 002 (at 23°) and 100 (at 44°) of the disordered carbon [30].

Fig. 6
figure 6

XRD diffractograms of the polymer aerogel (a) and the carbon aerogel (b)

Table 1 shows the elemental composition of the polymer and carbon aerogels calculated from EDX spectra. According to [7], in a polymer aerogel produced with the same parameters as ours, the melamine reacted stoichiometrically in accordance with the N content found from elemental analysis. After carbonization of the polymer aerogel, N and O are still present in the carbon aerogel as shown in Table 1 and on the FTIR spectrum (Fig. 5) as well; however, it is almost entirely carbon. In [7], the elemental composition of a carbon aerogel, synthetized with the same parameters, was measured with elemental analysis and X-ray photoelectron spectroscopy (XPS). The results are comparable to our EDX measurements, particularly the XPS results. The reason for the discrepancies is the difference between the measurement methods. EDX and XPS give information about the surface, while elemental analysis examines the bulk composition; moreover, EDX has a large relative error when measuring light elements like C, N and O. Our EDX detected trace amounts of sodium, which is residue from the sodium carbonate catalyst of the synthesis.

Table 1 Elemental composition of the samples, calculated from EDX spectra, and the composition of a carbon aerogel synthetized with the same parameter as ours from elemental analysis and XPS, which data were taken from [7]

The SEM images (Fig. 7a–d) show the morphology of the specimens. The hierarchical porous nature and the spherical nanostructure of both aerogels are clearly visible [7, 28].

Fig. 7
figure 7

SEM images of the polymer aerogel (a, b) and the carbon aerogel (c, d) at various magnifications

Table 2 shows the apparent surface area (SBET), total, meso- and micropore volumes (Vtot, Vmeso W0, respectively) deduced from the nitrogen adsorption measurements. The compact structure of the melamine resins together with the supercritical drying results in a highly porous polymer gel with a reasonably high apparent surface area [31]. All of the parameters given in Table 2 increase after the carbonization of the polymer aerogel. Similar to resorcinol–formaldehyde gels, the carbonization practically shifts the isotherm to higher adsorbed values, due to the formation of new pores in the micropore region (< 2 nm) (Fig. 8). The mesopore range, however, is unaffected, i.e., the mesoporosity (2–50 nm) is conserved during the carbonization. The most significant growth is in the total pore volume, which is also reflected in the pore size distribution curves (Fig. 9). The spectacular enhancement of the total pore volume is the result of narrow macropores. Wider pores of the polymer gel non-detectable by nitrogen adsorption might have shrunk during the carbonization, thus shifting into the size range measurable by this technique.

Table 2 Results deduced from the low-temperature nitrogen adsorption measurements
Fig. 8
figure 8

Nitrogen adsorption–desorption isotherms of the polymer aerogel (black squares) and the carbon aerogel (red triangles). (Color figure online)

Fig. 9
figure 9

Pore size distribution of the polymer aerogel (black squares) and the carbon aerogel (red triangles) calculated from the desorption branch by BJH model. (Color figure online)

Conclusions

In this study, nitrogen-doped polymer and carbon aerogels were prepared and investigated with TG/DTA–MS, nitrogen adsorption, FTIR, Raman and XRD techniques. Thermal analysis coupled with mass spectrometry of the polymer aerogel showed two decomposition steps at 150 and at 300 °C. At first, evolution of the residual acetone solvent and unreacted monomers was observed, which was followed by the decomposition of the polymer matrix. When the carbon aerogel was annealed, significant mass loss was observed. This was caused by the release of surface functional groups forming after the pyrolysis of the carbon aerogel, as it was stored in air and hence reacted with oxygen. The nitrogen content detected by FTIR and EDX proved that the synthesis of nitrogen-doped carbon aerogel was successful. The Raman spectrum of the carbon aerogel only had the D and G bands. Their ratio indicated that the carbon aerogel was amorphous, which was confirmed by XRD measurement. The porous structure of the carbon aerogel is apparent from the SEM images. Nitrogen adsorption proved the considerable apparent surface area and pore volume of the polymer aerogel, which further increased during the carbonization process.