1 Introduction

Supercapacitors, also called electrochemical capacitors (ECs), as new energy storage devices, have caused widespread concern due to its outstanding features such as long cycle life, short charge/discharge time, high power density [1,2,3,4]. Generally, supercapacitors store electrical energy by two mechanisms: electrical double-layer capacitance, based on the pure electrostatic charge accumulation at the electrode/electrolyte interface, and pseudocapacitance from reversible redox reactions between the electrode and electrolyte ions [2, 5]. At present, researchers are striving to improve the performance of supercapacitors by developing new electrode materials. Among them, carbon materials are still the most prospective electrode materials for industrialization due to their unique properties including relatively low cost, stable physicochemical characteristics, non-toxicity and high electrical conductivity [6, 7]. However, their specific capacitance (C pe ) is still low because of limiting of carbon material structure, in which energy is only stored in one form of electrical double-layer capacitance. Meanwhile, although increasing the specific surface area contributes to higher charge storage capacity at the carbon/electrolyte interface, only the higher specific surface area doesn’t ensure a higher C pe because the ions of electrolytes cannot access all of the pores of carbon materials. Therefore, it is essential and critical for the C pe improvement of carbon materials to introduce the pseudocapacitance and enhance the electrical double-layer capacitance by optimizing pore structures at the same time.

Doping heteroatoms into carbon materials, such as oxygen [8], nitrogen [9], sulphur [10], phosphor [11] and boron [12], can promote desirable interactions and introduce the faradaic pseudocapacitance [13,14,15,16,17]. Generally, heteroatom-enriched carbon is fabricated by the post treatment of carbon materials with reagents containing heteroatoms, such as ammonia, or urea [18, 19], and direct carbonization of carbon precursors containing heteroatoms (such as polymers, biomass, and ionic liquids) [20]. By comparison, the latter is considered to be a promising method because it can realize a homogeneous incorporation of heteroatoms with higher concentration into carbon by a controlled chemistry. Jiang et al. synthesized nitrogen-doped carbon with nitrogen concentration of 20.34 wt% by carbonization of poly (acrylic acid)/methylated melamine-formaldehyde resin [21]. Wang et al. synthesized P/N co-doped porous carbon by direct carbonization of phosphoric acid doped polyaniline, which exhibits high heteroatom concentration of 13.2 at.% and improved specific capacitance of 154.4 F g−1 [22].

Apart from incorporating active heteroatoms into carbon materials, increasing specific surface area and tuning appropriate pore structure have also become central issue in the design and synthesis of carbon materials exhibiting high electric double-layer capacitance [3]. Several recent studies have indicated that high specific surface area attributes to get the higher charge storage capacity at the carbon/electrolyte interface [23,24,25], but in fact the construction of hierarchical pore structures, which enables high effective specific surface area and fast ion diffusion pathways with a minimized resistance during charge/discharge process, is the most important because the hierarchical pore structures can exhibit the advantages of each pore size with a synergistic effect during the electrochemical charge/discharge process. The macropores serve as ion-buffering reservoirs, giving a decreased diffusion distance and the mesopores provide the ion-transport pathways with a minimized resistance. While micropores are more capable of increasing the electrical double-layer capacitance [26,27,28]. Researchers have developed a large number of strategies for the fabrication of high surface area and hierarchical pore structures, mainly including soft templating, hard templating and chemical activation [29, 30]. However, the major hurdles of the post removal of hard templates with time-consuming multiple steps and using rather expensive and non-renewable soft templates (surfactants and block-copolymers) restrict large-scale production potentials of template methods. A large amount of reports have demonstrated that KOH activation is a very effective method for enhancing specific surface area and tuning pore structures [31, 32]. But KOH activation inevitably results in much loss of active heteroatoms. The reports of Yuan et al. and Gao et al. have showed that by KOH activation the heteroatom concentrations within carbon materials decrease from 16 to 8.8 at.% [33]. and from 40.1 to 16.8 wt%, respectively. The decrease of heteroatoms will decrease the contribution of pseudocapacitance. Furthermore, KOH activation also needs complex post removal of potassium salt by HCl and deionized water washing with time-consuming multiple steps [34]. Therefore, it is an valuable work to develop a simple, effective and template-free synthesis strategy to develop hierarchical pores and retain high concentrations of heteroatoms in carbon [35].

Among various heteroatoms, nitrogen and oxygen are easier to be incorporated into carbon and they are effective for the improvement of C pe by providing a pair of electrons that effectively change the electron-donor characteristics of carbon [35, 36], which regulates hydrophilic property or wettability of materials, enhances their electrical conductivity and generates pseudocapacitive contribution depending on the type of formed species [21, 22, 37]. In this study, we choose the mixture of melamine formaldedyde resin (MF) with high concentration of nitrogen and polyvinylpyrrolidone (PVP) with nitrogen and oxygen as carbon, nitrogen and oxygen source. The heteroatom-enriched carbon with hierarchical pores (HPC) was easily obtained by a facile one-step carbonization/activation treatment of PVP/MF mixture with different mass ratios of trehalose as a pore generator. By adjusting different mass ratios of trehalose, we have fabricated the ratio-optimized HPC displaying increased specific surface area of 351.26 m2 g−1, tuned hierarchical pore structures (substantial micropores with a small amount of mesopores and macropores) and increased active heteroatom (pyridinic nitrogen, pyrrolic nitrogen and quinone type oxygen) concentration of 8.17 at.%, which result in its improved supercapacitive performance, displaying high specific capacitance with 46% and 1.2-time enhancement compared to HPC-T0 without trehalose treatment in the cyclic voltammetry test of three-electrode system and galvanostatic charge/discharge test of two-electrode system with 6 M KOH electrolyte, respectively.

2 Experimental

2.1 Preparation of heteroatom-enriched carbon with hierarchical pores

Polyvinylpyrrolidone (PVP, K88-96, 1,300,000 g mol−1, Aladdin Industrial Co., LTD, China) was dissolved in distilled water under magnetic stirring to form a 20 wt% PVP aqueous solution. PVP aqueous solution and melamine formaldehyde resin (MF, 3000–6000 g mol−1, Jinan Chengzheng Group, China) aqueous solution with the content of 40 wt% were homogeneously mixed and stirred at the volume ratio of 1:6.5 to obtain a homogenous viscous solution.

Then a certain amount of trehalose dihydrate (Shanghai Lanji Technology Development Co., LTD, China) was added into the PVP/MF solution and stirred at room temperature for 12 h to obtain the transparent precursor solution. The precursor solution was dried at 60 °C for 12 h in an oven and then was heat-treated at 750 °C for 1 h in a tube furnace under nitrogen with a heating rate of 10 °C min−1 to obtain heteroatom-enriched porous carbon (HPC). The mass ratio of trehalose dihydrate to PVP/MF solution was varied as 0:100, 10:90, 20:80, 30:70, 40:60 and 50:50, and the resulting HPC samples were designated as HPC-T0, HPC-T10, HPC-T20, HPC-T30, HPC-T40 and HPC-T50, respectively. Figure 1 illustrates the preparation process of HPC.

Fig. 1
figure 1

Preparation process of HPC

2.2 Preparation of electrodes

HPC and graphite (ECP-GR-1, Beijing Tebao Conductive Powder Material Development Center, China) with the mass ratio of 9:1 were thoroughly mixed, then 1 wt% polytetrafluoroethylene (Aladdin Industrial Co., China) binder and the required amount of water were added to form the paste. The paste was then coated on a Ni-foam current collector (10 mm × 10 mm). Finally the electrode was dried at 60 °C for 12 h in the vacuum drying oven and pressed with a double roller machine to form a mechanically robust electrode. The mass loading of active materials was about 20 mg cm−2.

2.3 Preparation of symmetric supercapacitors

HPC/HPC symmetric supercapacitors were assembled by putting a battery separator with the thickness of 0.18 mm [PPAT-CN1(2), Shanghai Shilong Science and Technology Co. Ltd, China] between the electrodes, fixing it by organic glass plates and PTFE screws, and then vacuum filling the assembly with 6 M KOH electrolyte. The assembled supercapacitor was kept for 3 days prior to testing.

2.4 Characterization

The microstructure and morphology of samples were characterized by using scanning electronic microscopy (SEM, Hitachi, S-4800, Japan) and transmission electronic microscopy (TEM, JEOL, JEM-2100F, Japan). The thermal transformation process of the precursor was studied by thermal gravimetric analysis (TGA, Mettler, TGA/DSC1, Switzerland), using a heating rate of 10 °C min−1 under the flowing nitrogen from the room temperature to the final temperature of 900 °C. The chemical composition on the surface of samples were obtained by X-ray photoelectron spectroscopy measurement (XPS, Thermo Fisher Scientific, ESCALAB 250, UK). The specific surface area and pore-structural parameters of samples were measured with a physisorption analyzer (Micromeritics Instrument, ASAP2020, USA) by N2 adsorption/desorption measurements at 77 K. The pore size distributions were analyzed from adsorption branch isotherm by applying the density functional theory (DFT) method and assuming the slit-shaped pore model.

2.5 Electrochemical measurements

The electrochemical measurements of electrodes were first studied in the three electrode experimental setup and then in the two electrode experimental setup. The electrochemical measurements were carried out at room temperature in 6 M KOH aqueous electrolyte solution without removal of oxygen from the solution.

For a three-electrode system, platinum electrode, HgO/Hg electrode and measured electrode were used as the auxiliary electrode, reference electrode and working electrode, respectively. Electrochemical impedance spectroscopy measurements (EIS, Zahner, IM6e, Germany) of samples were carried out by using an AC potential of 10 mV amplitude at open-circuit potential of − 0.1 V in the frequency range of 100 kHz–10 mHz. Cyclic voltammetry tests (CV, Tianjin Lanlike, LK98BII, China) were performed at different scanning rates from 1 to 50 mV s−1 in potential window of − 1.0 to 0 V. The specific capacitance (C pe ) of electrode materials was calculated by the following equation [38]:

$$\begin{gathered} {{\text{C}}_{pe}}=\frac{{dQ}}{{mdV}}=\frac{{idt}}{{mdV}}=\frac{{\bar {i}}}{{mv}}=\frac{1}{{2mv\left( {{V_2} - {V_1}} \right)}}\int_{{{V_1}}}^{{{V_2}}} {i\left( V \right)} dV \\ S=\int_{{{V_1}}}^{{{V_2}}} {i\left( V \right)} dV \\ \end{gathered}$$
(1)

where C pe is the specific capacitance of electrode materials (F g−1), i(V) is the scanning current function (A), V 1 and V 2 are the low limit potential and upper limit potential (V), v is the scanning rate (V s−1), m is the mass of the active material (g), S is the area of a CV curve in one circle.

Galvanostatic charge/discharge tests (GC, Shanghai Chenhua, CHI660E, China) of a three-electrode system were conducted in the potential range from − 1.0 to 0 V at different current densities.

For a two-electrode system (symmetric supercapacitors), CV tests (Shanghai Chenhua, CHI660E, China) were performed at different scanning rates from 1 to 20 mV s− 1 in the potential window of − 1.0 to 0 V. Galvanostatic charge/discharge tests of a two-electrode system were conducted in the potential range from 0 to 1.0 V at different current densities (2, 4, 8, 12, 20 mA cm−2) with a Battery Programmed Test Instrument (GC, Landiandianzi,CT2001A, China). The specific capacitance (C p ) of a single electrode, energy density (E) of supercapacitors, power density (P) of supercapacitors were calculated by the following Eqs. (2), (3) and (4):

$${\text{C}}p=\frac{{4 \times I \times \Delta t}}{{m \times \Delta V}}$$
(2)
$$E=\frac{{\Delta V \times I \times \Delta t}}{{7.2 \times m}}$$
(3)
$$P=\frac{{3600 \times E}}{{\Delta t}}$$
(4)

where C p is the specific capacitance of a single electrode, E is the energy density of supercapacitors (W h kg−1), P is the power density of supercapacitors (W kg−1), I is the discharge current (A), Δt is the time difference in the discharge process (s), ΔV is the potential difference excluding the IR drop during the discharge process (V), and m is the total mass of active electrode material in both electrodes (g).

The cyclic performance of symmetric supercapacitors was examined by the same galvanostatic charge/discharge tests for 6000 cycles at a current density of 12 mA cm−2 and then the specific capacitance retention with cycle numbers was analyzed.

3 Results and discussion

3.1 Morphology and structure characterization

Figure 2 presents the typical SEM and HRTEM images of samples. Figure 2a shows irregular and large particle structure of HPC-T0 with a smooth surface. Figure 2b–f show numerous irregular and small particles of HPC samples with the porous honeycomb structure and the increase in surface roughness. Also with the increase of trehalose concentrations, HPC particles become more uniform and porous. It is due to the fact that trehalose is decomposed into the volatile compounds (CO2 and H2O) at 750 °C, which leads to its porous structure and increased specific surface area. The HRTEM image (Fig. 2g) of HPC-T30 clearly reveals a well-defined pore system consisting of disordered, interconnected, and worm-like pores, which are important for the adsorption of electrolyte and the forming of electrical double-layer capacitance.

Fig. 2
figure 2

SEM images showing the morphology of a HPC-T0, b HPC-T10, c HPC-T20, d HPC-T30, e HPC-T40, f HPC-T50, and g HRTEM image for HPC-T30

The thermal stability of trehalose dihydrate and HPC samples was studied by TGA and the corresponding curves were shown in Fig. 3. As shown in Fig. 3a, HPC-T0, HPC-T30 and trehalose dihydrate show residual weights of 21.35, 23.99 and 8.45 wt% at 750 °C, respectively. Figure 3b shows TG and derivative thermogravimetric (DTG) curves of HPC-T30. The DTG curve displays a four-step mass loss, which is about the room temperature to 100 °C, 100–190 °C, 190–370 °C and 370–500 °C. The first peak at around 52 °C corresponds to the weight loss of 2.74 wt%, which can be due to the release of some physical adsorbed and crystal water [39, 40]. The second peak at around 143 °C corresponds to the weight loss of 4.19 wt%, which can be attributed to the elimination of formaldehyde from decomposition of methylol melamine in MF resin [41]. The third peak around 288 °C corresponds to the weight loss of 56.45 wt%, which is because of decomposition of trehalose, elimination of formaldehyde from the ether bridge forming methylene bridge in MF, breakdown of methylene bridges, hydrolysis of isocyanic acid and decomposition of PVP [41, 42]. The last peak at around 420 °C corresponds to the weight loss of 9.97 wt%, which is due to the thermal degradation of triazine ring and further decomposition of PVP [43].

Fig. 3
figure 3

a TG curves of samples and b TG/DTG curves of HPC-T30

The surface chemical composition and relative concentrations of HPC samples were analyzed by XPS. XPS results for nitrogen and oxygen species were shown in Fig. 4 and their chemical formula within carbon matrices was schematically shown in Fig. 4m. The trehalose treatment results in changes in the number and kind of surface species. The chemical state of nitrogen atoms could be assigned to four types of: N-6 (pyridinic nitrogen, 398.7 ± 0.3 eV), N-5 (pyrrolic nitrogen/pyridonic nitrogen, 400.3 ± 0.3 eV), N-Q (quaternary nitrogen, 401.4 ± 0.5 eV) and N-X (N-oxide group, 402–405 eV) [44]. The chemical state of oxygen atoms could be assigned to three types of: O-I (C=O carbonyl functional groups, 531.2 eV), O-II (C–OH phenol groups and/or C–O–C ether groups, 532.3 eV) and O-III (O=C–OH carboxylic groups and/or chemisorbed O2/H2O, 533.5 eV) [45]. The relative concentrations of surface species obtained by fitting the N1s and O1s core level spectra for HPC samples were listed in Table 1. The nitrogen and oxygen concentrations decrease and then increase with the increase of trehalose concentration. In fact, the concentrations of effective nitrogen and oxygen types are the key to enhance the energy storage performance. For the four types of nitrogen atoms, it is suggested that the positively charged N-Q and N-X affect the electron transfer, while the negatively charged N-6 and N-5 are the most important functional groups enhancing pseudocapacitive performance [22]. And among the three types of oxygen atoms, O-I is electrochemically active for the forming of capacitance [22]. The trehalose treated HPC-T30 owns the highest amount (9.95 at.%) of active heteroatom species (N-6, N-5 and O-I), while by comparison the active heteroatom species of HPC-T0 is 8.17 at.%. We think that in our systems the three species of N-6, N-5 and O-I were responsible for the pseudocapacitive behavior. So the pseudocapacitance is expected to be the most pronounced in HPC-T30 and it should own the highest specific capacitance [22]. This will be verified in the following electrochemical measurements.

Fig. 4
figure 4

The N1s and O1s XPS spectra of a and b HPC-T0, c and d HPC-T10, e and f HPC-T20, g and h HPC-T30, i and g HPC-T40, k and l HPC-T50 and m schematic model of nitrogen and oxygen

Table 1 Chemical composition and relative concentrations of heteroatom species obtained by fitting the N1s and O1s core level spectra

Figure 5 exhibits the nitrogen adsorption/desorption isotherms and corresponding pore size distribution curves of HPC-T0 and HPC-T30. The nitrogen adsorption/desorption isotherms (Fig. 5a) of HPC-T0 and HPC-T30 demonstrate similarity with the steep increase of the N2 isotherms at low relative pressures (P/P0 < 0.1) and a rise in the N2 isotherms at relative high pressures from 0.95 to 1.0 (P/P0), which indicates the existence of substantial micropores (< 2 nm) and a small amount of macroporoes (> 50 nm). Compared to HPC-T0, HPC-T30 exhibits the remarkably high absorbed nitrogen quantity, showing its increased specific surface area, and a slow increase of the N2 isotherms and hysteresis loop from 0.1 to 0.95 (P/P0) with a marked H4 character, demonstrating that a certain amount of mesopores (2–50 nm) are fabricated in HPC-T30 due to the treatment of trehalose, which are very necessary for the ion transport with a minimized resistance. In short, nitrogen adsorption/desorption isotherm of HPC-T30 shows a combination of IUPAC Type I (typical of microporous carbon) and Type IV (typical of mesoporous carbon) according to the IUPAC classification. The hierarchical pore structure of HPC-T30 has further been verified by the pore size distribution data based on DFT model (Fig. 5b) [46]. Figure 5b clearly indicates that the as-prepared HPC-T30 has well-developed micropores, mesopores and macropores, while HPC-T0 does not own mesopores, which is critical to ion transport. Pore structure parameters of samples were shown in Table 2. The BET specific surface area (SBET) and total pore volume (Vtotal) of HPC-T30 are 351.26 m2 g−1 and 0.1717 cm3 g−1, much larger than those of HPC-T0 (75.51 m2 g−1 and 0.0325 cm3 g−1), indicating that the treatment of trehalose leads to a fair porosity of samples, which has also been verified by SEM and TG results. It is due to the fact that trehalose is decomposed into the volatile compounds (CO2 and H2O) at 750 °C. The micropore volume (Vmic) and micropore area (Smic) of HPC-T30 (0.1481 cm3 g−1 and 321.68 m2 g−1) are dominant, much higher than those of HPC-T0 (0.0241 cm3 g−1 and 60.81 m2 g−1). Moreover, HPC-T30 shows the mesopore and macropore volume of 0.01164 cm3 g−1, calculated by BJH adsorption cumulative volume of pores between 1.7 and 300 nm, while the mesopore and macropore volume of HPC-T0 is only 0.0023 cm3 g−1. It explores that the treatment of trehalose tends to form substantial micropores and a small amount of mesopores and macropores. As we know, micropores play a important role to enhance electrical double-layer capacitance in the hierarchical pores [26, 47], so HPC-T30 should own higher electrical double-layer capacitance, which will also be verified by the following electrochemical measurements.

Fig. 5
figure 5

a Nitrogen adsorption/desorption isotherms and b pore size distributions based on DFT model of HPC-T0 and HPC-T30

Table 2 Pore structure parameters of samples

3.2 Electrochemical performances

Electrochemical performances were first studied in a three-electrode system and the electrochemical impedance behaviors of HPC samples were shown in Fig. 6. Figure 6a shows Nyquist plots for HPC samples in the frequency range from 100 KHz to 10 MHz and the corresponding fitting curves using the Zview™ software. Figure 6b shows their equivalent circuit, which involves the bulk solution resistance (R s ), charge transfer resistance (R ct ), constant phase element (CPE) and Warburg diffusion element (W). The good fitting results imply that the equivalent circuit model can reasonably reflect the occurrence of the electrochemical process. The Nyquist plots can be composed of a depressed semicircle in the high frequency region and a straight line in the low frequency region. The radius of a semicircle is typically associated with R ct of electrons and ions. The straight line is associated with the mass transfer or diffusion of electrolyte ions in the pores. The enlarged plot in the high frequency region was shown in the inset. From the inset, it can be seen that the treated HPC samples with trehalose present the decreased radius of semicircle and vertical straight lines, indicating the decrease of charge transfer resistance and increase of diffusion rate of electrolyte ions. For HC, HPC-T10, HPC-T20, HPC-T30, HPC-T40, and HPC-T50, R ct fitting parameters are 28.32, 22.27, 16.05, 10.04, 9.323 and 7.69 Ω cm2. Their R s fitting parameters are 0.44, 0.066, 0.69, 0.87, 0.71 and 0.63 Ω cm2, respectively. All samples exhibit very low R s (bulk solution resistance) fitting parameters of < 1.0 Ω, indicating the good electron conductivity in aqueous electrolytes. These are due to the increase of heteroatoms and pore structure [21, 28, 47, 48], as shown in the results of XPS and nitrogen adsorption/desorption measurements.

Fig. 6
figure 6

a Nyquist plots of HPC samples and b the corresponding equivalent circuit

Based on the above results, it is expected that the treatment of trehalose results in the enhanced specific capacitance of HPC as the electrode material for supercapacitor application due to the increased surface area, hierarchical pore structures with substantial micropores and presence of active heteroatoms. In a three-electrode system CV and GC results were shown in Fig. 7. All the CV curves of HPC samples obtained at the scanning rate of 1 mV s−1 (Fig. 7a) exhibit similar quasi-rectangular shapes with some bumps at high potentials, which are related to the presence of redox reactions of the electroactive heteroatoms. According to Eq. (1), the calculated C pe values of HPC-T0, HPC-T10, HPC-T20, HPC-T30, HPC-T40 and HPC-T50 are 121.45, 135.20, 143.38, 177.42, 141.99 and 139.61 F g−1, respectively, as shown in Fig. 7c. The treated HPC samples display higher C pe values than untreated HPC-T0. It is obvious that HPC-T30 exhibits the highest C pe values due to the highest concentration of active heteroatoms (N-6, N-5 and O-I) with the pseudocapacitance (as shown in Table 1) and increased specific area and micropore volume with the electrical double-layer capacitance (as shown in Table 2), and its C pe is about 46% higher than that of HPC-T0. Even at a high scanning rate (50 mV s−1), the CV curves of HPC-T30 still exhibit the quasi-rectangular shape without obvious distraction (Fig. 7b), showing its good rate performance. GC curves of HPC-T0 and HPC-T30 at the current density of 2 mA cm−2 (Fig. 7d) display the quasi-linear appearance suggesting both electrical double-layer capacitive and pseudocapacitive performance. As expected, HPC-T30 exhibits much longer discharge time and better capacitive performance than HPC-T0, also indicating a significant synergistic effect between the electrical double-layer capacitance, arising from increased surface area and micropore volume, and the pseudocapacitance, arising from high concentration of active heteroatoms. Furthermore, GC curves of HPC-T30 at the increasing current densities from 4 to 40 mA cm−2 (Fig. 7e) still retain the quasi-linear shape without obvious distraction.

Fig. 7
figure 7

CV curves in the three-electrode system of a samples at the scanning rate of 1 mV s−1 and b HPC-T30 at different scanning rates; c the specific capacitance of samples in the two-electrode and three-electrode systems; d GC curves in the three-electrode system of samples at the current density of 2 mA cm−2 and e HPC-T30 at different current densities

Symmetric supercapacitors (two-electrode system) were assembled to further evaluate the capacitive performance of HPC samples, as shown in Fig. 8. The CV curves obtained at 1 mV s−1 for HPC-T0/HPC-T0 supercapacitor and HPC-T30/HPC-T30 supercapacitor (Fig. 8a) also display similar quasi-rectangular shapes without an obvious increase in the anodic current, showing that hydrogen and oxygen evolution reactions do not happen under the operation potential of 1 V. And CV curves of HPC-T30/HPC-T30 supercapacitor (Fig. 8b) are still the quasi-rectangular shape even at a high scanning rate (20 mV s−1), showing its good rate performance. GC curves of supercapacitors (Fig. 8c) show triangle shapes with good symmetry, indicating the good capacitive characteristics and fast charging/discharging profile. According to Eq. (2), calculated C p (as also shown in Fig. 7c) of HPC-T0, HPC-T10, HPC-T20, HPC-T30, HPC-T40 and HPC-T50 is 80.47, 90.35, 138.37, 174.24, 103.89 and 93.48 F g−1, respectively, which is accordant with the above electrochemical results of the three-electrode system. In order further investigate the energy density and power density of the optimized HPC-T30/HPC-T30 supercapacitor, the HPC-T30/HPC-T30 supercapacitor devices were assembled using two same electrodes with 2 mg/cm2 of mass loading on one electrode and investigated at different current densities by the GC tests. GC curves of the HPC-T30/HPC-T30 supercapacitor at different current densities from 2 to 20 mA cm−2 are shown in Fig. 8d, showing HPC-T30/HPC-T30 supercapacitor still present triangle shapes even at a high current densities (20 mA cm−2). The Ragone plot of the HPC-T30/HPC-T30 supercapacitor (Fig. 8e) shows that the highest energy density of 6.69 W h kg−1can be achieved at a power density of 249.03 W kg−1 and retains as high as 3.33 W h kg−1 at 999.10 W kg−1 in 6 M KOH electrolyte, which is higher than that of the commercial and previously reported supercapacitors based on carbide-derived carbon in aqueous electrolytes [49,50,51] The long-term cycling stability plays a crucial role in supercapacitors. As shown in Fig. 8f, for the HPC-T30/HPC-T30 supercapacitor about 91.16% of the initial specific capacitance can be reserved up to 6000 cycles, demonstrating its good cyclic stability. Moreover, the coulombic efficiency reaches nearly 100% for each charged/discharged cycle, indicating its high reversibility and cyclic stability. All the electrochemical tests indicate that HPC-T30 prepared by the trehalose treatment and simple one-step carbonization/activation method owns the excellent comprehensive properties and it is suitable as the electrode material for supercapacitors.

Fig. 8
figure 8

a CV curves of different supecapacitors at the scanning rate of 1 mV s−1, b CV curves of HPC-T30/HPC-T30 supecapacitor at different scanning rates, c GC curves of different supecapacitors at the current density of 2 mA cm−2, d GC curves of HPC-T30/HPC-T30 supecapacitor at different current densities, e Ragone plot of HPC-T30/HPC-T30 supercapacitor, f cycling stability of HPC-T30/HPC-T30 supecapacitor at the current density of 12 mA cm−2 in the two-electrode system

4 Conclusions

In summary, HPC has been successfully prepared by using trehalose as a pore-forming agent and a simple one-step carbonization/activation process. Results show that enhanced electrochemical performances are ascribed to increased surface area, hierarchical pore structures with substantial micropores, high effective heteroatom concentration (N-6, N-5 and O-I). It is demonstrated that the ratio-optimized HPC-T30 possesses the highest concentration (8.17 at.%) of active N-6, N-5 and O-I and the highest micropore volume (0.1481 cm3 g−1) than others. The HPC-T30 electrode displays excellent electrochemical performances due to the double-layer capacitance arising from increased surface area and micropore volume, and the pseudocapacitance, arising from high concentration of active heteroatoms. In the three-electrode system, the specific capacitance (177.42 F g−1) of HPC-T30 is about 46% higher than that of HPC-T0 at the scanning rate of 1 mV s−1 by CV test. In the two-electrode system, the specific capacitance (174.24 F g− 1) of HPC-T30 is about 1.2-time enhancement compared to untreated HPC-T0 at the current density of 2 mA cm−2 by GC test. HPC-T30/HPC-T30 supercapacitor shows the highest energy density of 6.69 W h kg−1 at a power density of 249.03 W kg−1 in 6 M KOH electrolyte. Besides, the HPC-T30/HPC-T30 supercapacitor owns a capacitance retention of 91.16% up to 6000 charge–discharge cycles. The HPC-T30 shows excellent comprehensive properties and it is suitable as the electrode material for supercapacitors. This study highlights the promising potential of our facile and simple preparation approach for heteroatom-enriched carbon with hierarchical pores.