1 Introduction

At present, nitrogen and sulfur doped microporous carbons are known as very effective adsorbents in the field of environmental pollution control due to their developed porosity and variable surface chemical characteristics (Gao et al. 2015; Sun et al. 2020; Tian et al. 2016a, b). According to previous studies, N-doping enhanced the electronic properties and improved the hydrophobic characteristics of carbon materials, while S-doping induced high chemical reactivity (Kasera et al. 2022; Liang et al. 2012). The pore filling of microporous structure and the complexation of N functional groups contribute to the immobilization of organic compounds on carbon materials (Ahamad et al. 2019; Luo et al. 2019). For example, Luo et al. fabricated N-doped carbon with high BET surface area (3046 m2/g) and N content (10.8%), which exhibited high BPA adsorption capacity (909 mg/g) (Luo et al. 2019). In addition, effective S are essential for improving the heavy metal adsorption due to the complexation. Jia et al. reported that N/S-co-doped microporous carbon with high S content (10.9%) could effectively remove Pb2+ from wastewater (Jia et al. 2021).

In recent years, the preparation methods of N/S doped carbon materials were mainly divided into two categories: (i) the organic precursors rich in N and S were directly pyrolyzed without activator (Gao et al. 2015; Ma et al. 2019; Zhou et al. 2016) and (ii) the pore forming agent was combined with organic dopants (such as urea, melamine or thiourea) to prepare carbon materials (Tan et al. 2018; Tian et al. 2016a, b). However, these two methods brought some disadvantages, such as low doping efficiency of heteroatoms and the need to add excessive dopants, resulting in high investment and energy consumption. Our recent research found that potassium thiocyanate (KSCN) could be used as both porogen and N/S dopant in the preparation of N/S co-doped microporous carbon materials (Jia et al. 2021). Research results confirmed that KSCN realized pore formation by activation reaction and efficiency N/S co-doping by oxygen replacement reaction (2KSCN + CxHyOz → K2SO4 + Cx + 2HyOz-4N2S).

At present, the synthesis approaches of carbon materials with target properties depended on trial and error, preparing predictable material was a challenge. Biomass and its derived carbon materials were considered as renewable precursors of carbon materials because of their abundant content and sustainability in the environment (Hu et al. 2020; Maliutina et al. 2021; Xiong et al. 2021). Previous studies had proposed that carbonaceous precursors properties strongly affected the as-prepared carbon materials physicochemical properties, which would finally affect its application performance (Adeleye et al. 2021; Alsewaileh et al. 2019; Lu et al. 2019; Teong et al. 2021). Therefore, it is necessary to further study the influence mechanism of carbonaceous precursor on the structure and adsorption properties of N/S doped microporous carbon, so as to directly synthesize carbon materials with specific applications.

For this purpose, N/S co-doped microporous carbons were prepared from different carbonaceous precursors by KSCN activation method and used for BPA and Pb2+ adsorption. The influence mechanism of carbonaceous precursors properties (including thermal stability and polarity) on the properties (including surface area density, microporous surface area and N/S doping amount) of N/S co-doped microporous carbon was explored. The adsorption mechanism of BPA and Pb2+ on N/S co-doped microporous carbon was also discussed. Finally, based on the relationship between carbonaceous precursors properties and the adsorption capacity of N/S doped microporous carbon, the adaptability of raw materials to the target application was judged.

2 Materials and methods

2.1 Carbonaceous precursor for KSCN activation

Cellulose (CL), walnut shell (WS), sawdust (SD) and sawdust derived biochar with different thermal stability abilities and elemental compositions were used for KSCN activation. Walnut shell and sawdust were collected from rural areas in Shanghai. Cellulose powder and other reagents were purchased from Shanghai Aladdin Biochemical Technology Co., Ltd. Pyrolysis derived biochar was prepared in a tube furnace at a heating rate of 10 °C/min to 300 °C with a N2 atmosphere. Air flow carbonization derived biochar was synthesized by heating to 300 °C or 400 °C in a N2 atmosphere, then exposed to a flow of air for 10 min, after which the sample was cooled under a flow of nitrogen gas. Sawdust derived biochar prepared in this way was named N-X and A-X, where X represented the reaction temperature, N represented the sample activated in a nitrogen atmosphere and A represented the sample activated in air atmosphere.

Hydrothermal carbonization (HTC) derived biochar was prepared at a 1: 20 weight ratio between sawdust and deionized water in an autoclave with 180 °C or 300 °C heating temperature for 2 h. After the reaction, the products were washed with deionized water several times and dried overnight at 80 °C. The prepared hydrochar was represented by H-X, and X was the HTC experimental temperature (°C).

2.2 Preparation N/S co-doped microporous carbon materials by KSCN activation

Cellulose, walnut shell, sawdust and sawdust derived biochar with various properties were chemically activated by KSCN to prepare N/S doped microporous carbon. The mixture of carbonaceous precursor and KSCN at 1:1 weight ratio was activated at 700 °C for 90 min under 100 mL/min N2 flow with a 10 °C/min heating rate in a tube furnace. The carbonized samples were then washed by 2 M HCl and deionized water to nature pH. The samples were finally being dried to constant weight in an oven at 100 °C.

2.3 Characterizations of carbonaceous precursor and N/S co-doped microporous carbon

Elemental and thermogravimetric analyses were used to characterize the carbonaceous precursor. Elemental composition (C, H, N, S) was analyzed with an elemental analyzer (Vario EL III). The ash content was measured by heating the sample in an air atmosphere at 600 °C for 2 h. Specifically, the O/C molar ratio was used to estimate the polarity of carbonaceous precursors. In order to quantitatively calculate the thermal stability of carbonaceous precursor, TG analysis in air atmosphere was carried out with heating from 30 ~ 800 °C at a rate of 10 °C/min by a thermogravimetric analyzer (SDT Q600). The thermal stability of carbonaceous precursor indicated by R50 index was quantitatively calculated as follows (Harvey et al. 2012),

$${R}_{50}=\frac{T_{50,\kern0.5em \mathrm{precursor}}}{T_{50,\mathrm{graphite}}}$$

where T50, precursor, and T50, graphite were the temperature values corresponding to 50 % weight loss by oxidation and volatilization of carbonaceous precursor and graphite, respectively. The values of T50, precursor and T50, graphite were obtained directly from TG thermograms corrected for water and ash content. A more detailed account for the calculation of R50 was given in previous literature by Harvey et al. (2012).

The characterization of the N/S co-doped microporous carbon was done using N2 adsorption/desorption, elemental analyzer, powder X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS) and Raman spectra. The surface area and porosity of N/S doped carbons were conducted on a Quantachrome Autosorb iQ2 instrument with N2 adsorption/desorption isotherms at − 196 °C. The specific surface area (SBET) and total pore volume (VT) were determined by the Brunauer-Emmett-Teller (BET) equation. Micropore surface area (Smic < 2 nm) was calculated via the t-plot analysis. Pore size distribution was evaluated via density functional theory (DFT) method (Zhu et al. 2015). The crystal structure of unwashed activated samples was performed by powder X-ray diffraction (XRD) with Cu Kα radiation at 40 kV, 40 mA in the 2θ range of 10–80° (X’ Pert PRO, Nalytical, Netherlands). Raman spectra were carried out using a XploRA Raman spectrometer with a 532 nm laser source, and the parameters were fitted five distinctive Gaussian peaks, corresponding to G (~ 1580 cm− 1), D (~ 1350 cm− 1), I (~ 1220 cm− 1), D′ (~ 1620 cm− 1) and D″ (~ 1490 cm− 1) bands. The O, N and S-containing functional groups of activated samples were determined by X-ray photoelectron spectroscopy (XPS) technique (Thermo ESCALAB 250 XI). In detail, the O 1 s spectra (including C = O, C-O-C and COOH), the N 1 s spectra (including pyridinic N, pyrrolic N, quaternary N, and oxidized N) and S 2p spectra (including C-SO2, C-SO3, C-S-C 2p1/2, and C-S-C 2p3/2) in the activated samples were fitted by the deconvolution method. The binding energies of high resolutions spectra were calibrated at C 1 s of 284.6 eV.

2.4 Adsorption experiments

Organic pollutant (bisphenol A, BPA) and heavy metal (Pb2+) were selected to explore the water purification ability of N/S doped microporous carbon. For BPA adsorption isotherms, 3 mg material was dispersed in 30 mL BPA solution with different initial concentrations (2 ~ 200 mg/L). The mixture was shaken at 150 rpm for 12 h until adsorption equilibrium. The supernatant was filtered using a 0.45 μm polytetrafluoroethylene (PTFE) membrane filter to analyze the BPA concentration. The filtrate was measured by a UV–visible spectrometer (CARY 300, Agilent, USA) at 280 nm absorbance. In addition, the adsorption kinetics was achieved at 2, 5, 10, 30, 60, 120, 240, 480 min in the concentration of 150 mg/L BPA and 100 mg/L N/S co-doped microporous carbon at 25 °C. The adsorption isotherms were fitted to the Langmuir model and the adsorption kinetics were interpreted by the pseudo-second-order model, as detailed in our previous work (Zhu et al. 2014a, b).

In Pb2+ adsorption, 20 mg material was added in 40 mL Pb2+ solution with different initial concentrations (20 ~ 600 mg/L). 10 mM MES solution was used to stabilize the solution pH at about 5. The solution was continuously stirred at 150 rpm for 12 h to reach adsorption equilibrium and then the filtrates were measured by using Inductively Coupled Plasma-Atomic Emission Spectrometry (ICP-AES, Hitachi P4010) to determine the resultant Pb2+ concentration. The transmission electron microscopy (TEM, Tecnai G2 F20 S-Twin, FEI) and X-ray photoelectron spectroscopy (XPS, Thermo ESCALAB 250 XI) were used to characterize the Pb-adsorbed N/S co-doped microporous carbon to explore the adsorption mechanism.

3 Results and discussion

3.1 Thermal stability and polarity of carbonaceous precursor

Pyrolysis, air flow carbonization and hydrothermal carbonization were selected for carbonizing the raw sawdust into biochar, and the sawdust derived biochar together with cellulose, walnut shell and sawdust were used as activated carbonaceous precursors. The aim was to achieve carbonaceous precursors with different thermal stability (expressed by R50 index) and polarity (indicated by O/C). Based on previous study (Hirst et al. 2018; Zhu et al. 2015), pyrolysis, air flow carbonization and HTC increased the thermal stability ability of samples but reduced O/C. Moreover, the changes increased with the rise in reaction temperature.

As shown in Table 1, the R50 index was in a wide range of 0.3 ~ 0.53, and the value of A-300 (from air flow carbonization at 300 °C) was the largest, indicating that it had strongest thermal stability, while cellulose had weakest. These conclusions showed that the biochar derived from high reaction temperature had stronger thermal resistance. In addition, compared with the O/C of untreated precursors, the O/C of carbonized precursors decreased. The A-400 with the lowest O/C was derived from air flow carbonization and high reaction temperature, consistent with the conclusion that the carbonization process reduced the O content and increased the C content of carbon materials (Balahmar et al. 2017; Balahmar and Mokaya 2019; Hirst et al. 2018; Zhu et al. 2015). In addition, all carbonaceous precursors contain almost little N/S element (Table S1).

Table 1 Ash contents, elemental compositions, and R50 index of different carbonaceous precursors

3.2 Porosity and doping evolution of N/S doped microporous carbon

Table 2 provided the yields, pore structure characteristics and element composition of N/S doped microporous carbon. As expected, N/S co-doped microporous carbon had high BET surface area (832 ~ 1532 m2/g) and pore volume (0.46 ~ 1.21 cm3/g). As shown in Fig. S1, the N2 adsorption isotherm of all samples exhibited type I, revealing the presence of a large number of microporous structures. And the pore size distribution of N/S doped microporous carbons was mainly about 1 ~ 2 nm, which indicated that the samples were microporous materials. Based on the previous study (Altwala and Mokaya 2020), the surface area density (the ratio between BET surface area and pore volume) was a parameter that defined porosity and measure the sensitivity of carbonaceous substances to activation. The high surface area density of porous materials was usually produced by the preponderance of micropores. Therefore, the higher the surface area density, the more micropores of carbon materials. As shown in Table 2, the surface area density of N/S co-doped microporous carbon was changed within the range from 967 to 2187 m2/cm3. The results of elemental analysis showed that the prepared material possessed similar N (4.66 ~ 5.28%) but various S (9.43 ~ 14.44%) doping ability.

Table 2 Elemental compositions and textural properties of different N/S doped microporous carbon

3.2.1 Thermal stabilization effect criterion

The literature had well documented that the thermal stability of carbonaceous precursors affected the formation of pore structure in carbon materials (Harvey et al. 2012; Zhu et al. 2015). High surface area density indicated that more micropores in N/S co-doped microporous carbon materials. The positive linear correlation between the surface area density of N/S co-doped microporous carbon and R50 index of the carbonaceous precursors (R2 = 0.89, Fig. 1a) proved that the carbonaceous precursor with high R50 was conducive to the formation of developed micropores. This was because that unstable carbonaceous precursor was easy to volatilize and lack of effective carbon matrix for pore-forming. The carbonaceous precursor with high R50 occurred intense thermal stabilization effect, more carbon matrix was better activated by KSCN to form micropores. High graphitization degree corresponded to high activation degree. The increased graphitization degree (expressed in reduced ID/IG value) of N/S co-doped microporous carbon with the increased R50 further proved that carbonaceous precursors with high R50 were easier to be activated (Fig. 2b and S2a). In a word, the different degrees of thermal stabilization effect occurred during the activation of the carbonaceous precursor by KSCN regulated the pore structure in N/S doped microporous carbon. The stronger the thermal stabilization effect, the more micropores in N/S doped microporous carbon. In addition, the positive linear correlation between the microporous surface area of N/S co-doped microporous carbon and R50 index of the carbonaceous precursors (R2 = 0.72) indicated that the N/S co-doped microporous carbon materials produced by carbonaceous precursors with high thermal stability had high micropore surface area (Fig. S2b).

Fig. 1
figure 1

a Linear correlation between the R50 index of carbonaceous precursors and the surface area density (defined as the ratio between total surface area and total pore volume) of N/S co-doped microporous carbon and b Raman spectrum of N/S co-doped microporous carbon was fitted using the five Gaussian peaks (color lines) (A: NSC-CL, B: NSC-WS, C: NSC-SD, D: NSC-H-180, E: NSC-N-300, F: NSC-A-300, G: NSC-H-300)

Fig. 2
figure 2

a XRD patterns of the unwashed N/S doped microporous carbon, b S2p spectra of N/S co-doped microporous carbon (S1: C-S-C 2p3/2, S2: C-S-C 2p1/2, S3: C-SO2 S4: C-SO3) and c linear correlation between the O/C of carbonaceous precursors and the S content of N/S co-doped microporous carbon (A: NSC-CL, B: NSC-WS, C: NSC-SD, D: NSC-H-180, E: NSC-N-300, F: NSC-A-300, G: NSC-H-300)

3.2.2 Oxygen replacement reaction criterion

The existence of K2SO4 in unwashed N/S co-doped microporous carbon indicated that oxygen replacement reaction occurred during the carbonaceous precursor activated by KSCN (Fig. 2a). As a result, O in carbonaceous precursor can be substituted by S and N heteroatoms from KSCN, the generated S and N can be doped into the carbon materials. Three peaks were observed in representative N/S co-doped microporous carbon (NSC-CL) by deconvolution of O1s spectra, including C=O (531.3 eV), C-O-C (532.3 eV) and COOH (533.5 eV) (Fig. S3). And Four peaks, including pyridinic N, pyrrolic N, quaternary N, and oxidized N, were observed in the N/S doped microporous carbons via deconvolution of N 1 s spectra (Fig. S4). The deconvolution spectrum of S 2p showed that O can complex with S to form sulfur-oxygen functional groups (C-SO2 and C-SO3, Fig. 2b). The above results indicated that N was mainly doped on the carbon skeleton, while S could complex with O to improve the stability. Therefore, it should be noted that N and S had different sensitivities to heating, S was more stable during the reaction, while N would further occurred thermally decompose. This lead the contents of N and S in the carbon showed different trends, and the N contents were similar in various carbon precursors. The strong positive linear relationship observed between the S content of N/S doped microporous carbons and O/C of carbonaceous precursors (R2 = 0.90, Fig. 2c) indicated that carbonaceous precursors with high O/C were more prone to occur oxygen replacement reaction in the KSCN activation. Meanwhile, the oxygen replacement reaction could adjust the S content in carbon materials, so the higher the content of S in N/S co-doped microporous carbon materials prepared from carbon precursor with high polarity.

As described above, the thermal stabilization effect and oxygen replacement reaction could together regulate the synthesis of N/S doped microporous carbon, especially affecting the surface area density, micropore surface area and S doping ability of carbon materials. Carefully selecting the carbonaceous precursors and clarifying the mechanism of their properties affecting the properties of N/S doped carbon were conducive to the directional synthesis of carbon materials with target functions.

3.3 N/S co-doped microporous carbon for water purification

BPA and Pb2+ were selected as typical pollutants to explore the water purification ability of N/S co-doped microporous carbon materials. The adsorption kinetic and isotherms experiments of BPA for N/S co-doped microporous carbon in aqueous solution were demonstrated in Fig. S5 and the calculated parameters were shown in Table S2. Results indicated that the adsorption equilibrium time was about 60 min (Fig. S5a). The results of isothermal adsorption showed that the maximum adsorption capacity of N/S co-doped microporous carbon materials for BPA reached 714 mg/g, indicating that N/S co-doped microporous carbon had excellent removal ability for BPA in aqueous solution.

Figure S6 showed that the qBET of N/S co-doped microporous carbon materials was higher than that of porous carbon, indicating that N doping could improve the adsorption performance. Due to the similar content of N in prepared carbon materials, we did not conduct further correlation analysis of N. As shown in Fig. 3a, a positive correlation (R2 = 0.97) between micropore surface area and BPA maximum adsorption capacity indicated that materials with high micropore surface area usually correspond to high adsorption performance, which may be dependent on the pore-fitting mechanism (Luo et al. 2019). Further, a positive correlation can be observed between the R50 of carbonaceous precursor and the adsorption performance of N/S doping microporous carbon materials for BPA (Fig. 3b). This result showed that the carbonaceous precursor with high R50 was suitable for the preparation of N/S co-doped microporous carbon materials with strong adsorption capacity for BPA.

Fig. 3
figure 3

a Linear correlation between BPA-qm and micropore surface area of N/S co-doped microporous carbon and b linear correlation between R50 of carbonaceous precursors and BPA-qm of N/S co-doped microporous carbon (A: NSC-CL, B: NSC-WS, C: NSC-SD, D: NSC-H-180, E: NSC-N-300, F: NSC-A-300, G: NSC-H-300)

Adsorption isotherm experiment results of Pb2+ onto prepared materials were shown in Fig. S7a. Using the Langmuir model to fit the adsorption isotherm, it can be seen that the maximum adsorption capacity of N/S co-doped microporous carbon for Pb2+ varies from 286 mg/g to 357 mg/g (Table S3). Interestingly, a positive correlation (R2 = 0.78) was observed between S content of N/S co-doped microporous carbon and maximum adsorption capacity for Pb2+ (Fig. 4a). Meanwhile, the N content of N/S co-doped microporous carbon prepared from different carbonaceous precursors was stable. It was speculated that Pb2+ was fixed by complexing with S-containing functional groups in N/S doped microporous carbon. The uniform changes in the distribution and mass transfer of S and Pb, the non-uniform changes of N and Pb showed by TEM-EDS and the existence of PbS showed by XPS proved the above conclusion (Figs. 4b and c). In addition, as shown in Fig. S8, the adsorption capacity of N/S co-doped microporous carbon for Pb2+ was much greater than that of porous carbon without S doped, indicating that the S functional group rather than oxygen-containing functional group played promoting role in Pb2+ adsorption. According to previous studies, N/S doped microporous carbons exhibited stronger adsorption efficiency for Pb2+ than porous carbon in water and its adsorption equilibrium time was only 60 min (Jia et al. 2021). Therefore, it was concluded that the excellent adsorption capacity of Pb2+ on the N/S co-doped microporous carbon might be attributed to the the S containing functional groups toward Pb2+. Further, a positive correlation was observed between O/C and Pb2+-qm (Fig. 4d), it revealed that carbonaceous precursor with high O/C was suitable for the preparation of N/S co-doped microporous carbon with strong adsorption capacity for Pb2+.

Fig. 4
figure 4

a Linear correlation between Pb2+ maximum adsorption capacity (Pb2+-qm) and S content of N/S doped microporous carbon, b representative TEM-EDS line profiles of elements in the selected NSC-CL (derived from cellulose activated by KSCN) after Pb2+ adsorption, c XPS profiles of PbS in the selected NSC-CL after Pb2+ adsorption, A: PbS (Pb 4f7/2), B: PbSO3 (Pb 4f7/2), C: PbS (Pb 4f5/2), D: PbSO3 (Pb 4f5/2) and d linear correlation between O/C of carbonaceous precursors and Pb2+ maximum adsorption capacity (Pb2+-qm) of N/S co-doped microporous carbon (A: NSC-CL, B: NSC-WS, C: NSC-SD, D: NSC-H-180, E: NSC-N-300, F: NSC-A-300, G: NSC-H-300)

According to the above discussion, the developed microporous structure and high N doping in N/S co-doped microporous carbon were conducive to adsorb BPA, while the high S doping promoted Pb2+ adsorption. Meanwhile, the thermal stability and polarity of carbonaceous precursor control the microporous structure and N/S doping content of N/S doped microporous carbon, respectively. Therefore, it can be further concluded that the adsorption capacity of N/S co-doped microporous carbon for BPA and Pb2+ can be predicted directly by the properties of carbonaceous precursor. The carbonaceous precursor with high thermal stability was suitable for preparing N/S co-doped microporous carbon with strong adsorption capacity for BPA, and the carbonaceous precursor with high O/C was suitable for preparing N/S co-doped microporous carbon with strong adsorption capacity for Pb2+.

4 Conclusion

In the present study, we found that the thermal stabilization effect and oxygen replacement reaction during the activation of carbonaceous precursor by KSCN significantly regulated the microporosity (express by surface area density and micropore surface area) and N/S doping ability of N/S doped microporous carbon. Results confirmed that the carbonaceous precursor with high R50 index occurred strong thermal stabilization effect during activated by KSCN, which produced more micropores. The carbonaceous precursor with high O/C occurred strong oxygen replacement reaction in the process of being activated by KSCN, which increased the S content. Further, high micropore surface area was essential for improving the BPA adsorption ability and high S doping was essential for improving the Pb2+ adsorption ability. In summary, the carbon material suitable for organic pollutants adsorption derived from the carbon precursor with high R50 index, while the carbon material with high adsorption capacity for Pb2+ derived from the carbon precursor with high O/C. Our results provided new insights into the directional, predictable and controllable activation of carbon materials, and provided a new way to solve the challenges of microporous material development.