Introduction

Electrochemical double-layer capacitors (EDLCs, also denominated as supercapacitors) excel at high power densities, fast charge/discharge rate and exceptionally long cycle life [1, 2]. Compared to battery systems in which time-consuming redox reaction happen, the energy storage mechanism in EDLCs is based on the fully reversible and fast electrosorption of electrolyte ions on the surface of a charged carbonaceous electrode material [3]. Unfortunately, as electric layer capacitance (EDLC) materials, common carbon materials with low specific capacitances and low energy densities can hardly meet the actual demand [4]. Currently two effective approaches are adopted to improve their energy density and capacitance.

One approach is to design and control structures to obtain favorable morphologies of carbon materials. The designed hierarchical porous carbons have received much more attention in catalysis [5, 6], water purification [7, 8], gas adsorption [9, 10], biological and medicine fields [11, 12] due to ultrahigh specific surface area, chemical/thermal stability and cost effectiveness. Besides, carbon materials with excellent electrical conductivity are attractive candidates in electrochemical energy storage devices, especially supercapacitors [13]. In the hierarchical porous carbons, the micropores, mesopores and macropores are crucial to supercapacitors with the excellent electrochemical performance [14]. The rich micropores accessible to the electrolyte ions can effectively elevate charge storage capability and is indispensable for high energy storage [15]. The existence of mesopores can ensure rapid diffusion of ions to achieve superior power performance at high current densities [16]. Macropores, as ion-buffering reservoirs, can provide a short diffusion distance to facilitate rapid transport of electrolyte ions [17]. Commonly, hierarchical porous carbons are fabricated widely by the hard template methods due to the simple operations, the controllability of morphologies and the chemical/thermal stability in high temperature [18, 19]. For example, Wang et al. mixed sucrose as a carbon source and nano-zinc oxide as a hard template [20]. After the mixture was carbonized, hierarchical porous carbon (HPCs) is obtained. HPC exhibits excellent electrochemical performances, even at ultrahigh current density and ultrahigh sweep rate.

The other approach is the introduction of heteroatom, including nitrogen [21, 22], sulfide [23], oxygen [24], boron [25], phosphorus [26], and fluorine [27]. Among these heteroatoms, nitrogen is most widely introduced into carbon-based materials to improve the electrochemical properties. Negatively charged pyridinic nitrogen and pyrrolic nitrogen can serve as faradaic reaction sites and contribute pseudocapacitance, whereas positively charged quaternary nitrogen can boost electron transport in carbon matrix [28, 29]. In addition, the reasonable heteroatom content make carbon materials possess superior hydrophilicity to increase effective interface between electrode and electrolyte, thus problem about pure carbon materials with the poor hydrophilicity can be overcome [30]. For instance, Yu et al. combined gelatin as a carbon and nitrogen source with nano-zinc oxide as a hard template [31]. The composite was carbonized to produce hierarchical porous carbons (GZnCs). The nitrogen content of GZnC-750 reaches up to 8.01 at% and the BET surface area of it is 2020 m2 g−1. At a current density of 1 A g−1, the specific capacitance of GZnC-750 reaches up to 256 F g−1 in 6 M KOH.

Besides, low cost and environmentally benign synthetic strategies are crucial to nitrogen-doped hierarchical porous carbons for next generation supercapacitors [32]. Various natural substances, such as bacterial cellulose [33], cellulose [34], glucose [35] and silk proteins [36] have been applied in the fabrication of porous carbons with varied morphologies. For example, Hu et al. mixed the lotus seed shell as a carbon source with sodium phytate to get a gel [37]. The gel was carbonized and then activated. Meanwhile, time nano-sodium carbonate and nano-sodium phosphate as templates were generated. Biomass-derived porous carbons (HBCs) are obtained by acid treatment. HBC (3188 m2 g−1) shows a specific capacitance of 286 F g−1 at a current density of 1 A g−1 and maintains high specific capacitance (241 F g−1) even at a current density of 200 A g−1. Chitosan is a renewable natural biopolymer originated from seafood processing wastes [38]. Chitosan with high nitrogen element content is a favorable precursor to obtain nitrogen-doped carbons for high performance supercapacitors [39].

However, the recent researches about design of nitrogen-doped hierarchical porous carbons are heavily limited by complex synthesis steps and expensive carbon precursors. Common hard templates such as silicon dioxide are removed by toxic HF, and there is no doubt that it can greatly increase risks of operation in large-scale production and produce more chemical wastes. The metal oxide and insoluble salt templates such as Al2O3, MgO, CaCO3, etc., become an ideal substitute for silica because they are simply removed with dilute acids. Hydroxyapatite is one of the insoluble salt templates that exhibits superior thermal stability and chemical stability in high temperature and is an alternative green template. In addition to the advantages of a hard template, hydroxyapatite is simply synthesized in situ and can homogeneously distributed in the carbon precursors.

Herein, nitrogen-doped hierarchical porous carbons (NPC-MHK) derived from chitosan hydrogel are successfully synthesized via a simple strategy of in-situ growing hydroxyapatite template and one-step carbonization. First, genipin as the cross-linker, the chitosan hydrogel contains calcium nitrate tetrahydrate, diammonium hydrogen phosphate and melamine as templating precursors and dopants. Then, hydroxyapatite as hard template can grew in-situ with addition of KOH solution. During the pyrolysis of the freeze-dried hydrogel, the cooperation of hydroxyapatite template, KOH activation and decomposition of the chitosan with rich functional prevented the formation of monolithic carbon while forming porous morphologies. The resulting NPC-MHK features a large specific surface area of 2165.5 m2 g−1 and high nitrogen contents of 3.30 at.%. As expected, NPC-MHK showed outstanding electrochemical performance (specific gravimetric capacitance of 306.4 F g−1). Remarkably, the assembled solid-state symmetric supercapacitor can successfully power the light-emitting diodes. With a view to the simple synthetic procedures and the favorable electrochemical properties of the NPC-MHK, this synthetic protocol offers a cost-effective and scalable approach for future industrial manufacture.

Experimental section

Materials

Aladdin Industrial Co. (Zhejiang, China) provided chitosan with 95% degree of deacetylation (Mw 1 000 000) and melamine (C3H6N6). Genipin (C11H14O5) was purchased from Chengdu ConBon Bio-tech Co., Ltd. (Chengdu, China). Sinopharm Chemical Reagent Co., Ltd. (Shanghai, China) supplied calcium nitrate tetrahydrate (Ca(NO3)2·4H2O), diammonium hydrogen phosphate ((NH4)2HPO4), acetic acid (CH3COOH), potassium hydroxide (KOH), polyvinylalcohol (PVA), hydrochloric acid (HCl), and ammonia (NH3·H2O). All chemicals were analytical grade and were used without further treatment.

Sample preparation

In a water bath of 45 °C, 0.4 g of chitosan was dissolved in 40 mL 2 vol % acetic acid solution with vigorous stirring to form a homogenous and transparent mixture. Subsequently, 0.30 g of (NH4)2HPO4, 0.94 g of Ca(NO3)2·4H2O and 0.04 g melamine were dissolved in the previous mixture. Afterwards, 0.04 g of genipin was added to the mixed solution to obtain hydrogel. Then, the solidified hydrogel was subjected to 3 M KOH solution and stayed overnight. After that the hydrogel was frozen in a liquid nitrogen bath and then lyophilized in a freeze drier (Free Zone, Labconco, USA) at − 50 °C and less than 10 Pa. Finally, the obtained samples were carbonized in a tube furnace with a nitrogen gas atmosphere at 800 °C for 2 h with a ramp rate of 5 °C min−1. The dark solid was grounded to powder, washed with 10 wt.% hydrochloric acid and ultrapure water, and dried at 80 °C in air. The samples were denoted as NPC-MHK (M is melamine, H is hydroxyapatite, and K is KOH). The three control groups NPC-HK, NPC-K, and NPC-H were set up to compare with NPC-MHK. NPC-HK was prepared by the same process but without melamine. NPC-K was prepared by the same process without diammonium hydrogen phosphate, calcium nitrate tetrahydrate and melamine. NPC-H was prepared by the same process without melamine and 3 M KOH solution was replaced with liquid ammonia.

Characterization

The morphology of the prepared samples was characterized by Field Emission Scanning Electron Microscopy (Sigma, Zeiss, Germany) and Transmission Electron Microscopes (JEM-2100 (HR) JOEL Ltd, Japan). The nitrogen adsorption and desorption isotherms of the samples were measured on a Micrometrics Tristar II3020 system (USA) at 77 K. All of the samples were degassed in vacuum at 200 °C before the measurements. Specific surface area was calculated using the Braunauer–Emmett–Teller (BET) equation, and the pore size distribution plot was determined by the methods of Barrett-Joyner-Halenda (BJH). The surface composition and chemical states of the element was confirmed by X-ray Photoelectron Spectroscopy (Thermo ESCALAB 250Xi with an Al-monochromic X-ray source) and Electron Probe Micro-analyzer (JXA-8530F Plus, Japan). The phase was examined from 10 to 90° by X-ray Diffraction (XRD) (PANalytical, Holland) with Cu Kα (1.5406 Å) radiation. HR JY-Evolution Raman spectroscopy (LabRAM) examines the structures of samples.

Eletrochemical measurement

The CHI 660E Electrochemical Workstation (Chenhua Shanghai, China) supported electrochemical tests of all samples. The all samples were measured in a three-electrode system with a Pt counter electrode and a reference electrode of Ag/AgCl in 6 M KOH. The mixture of 80 wt.% active materials, 10 wt.% carbon black, and 10 wt.% PTFE was coated onto ultrathin nickel foams as current collector. Samples serve as negative electrode, so the voltage range of cyclic voltammetry (CV) tests and galvanostatic charge-charge (GCD) was from − 1 to 0 V. The frequency range of electrochemical impedance spectroscopy (EIS) was 0.01–105 Hz. The specific gravimetric capacitances (C, F g−1) was calculated by the following equation

$$ C = \frac{I\Delta t}{{m\Delta V}} $$
(1)

where I (A) is the charge–discharge current, Δt (s) is the time of discharge, m (g) is the mass of the active material in electrodes, and ΔV (V) is the voltage window [40].

The energy density (E, W h kg−1) and power density (P, W kg−1) of the assembled symmetric supercapacitors were calculated by the following equations

$$ E = \frac{1}{7.2}C\left( {\Delta V} \right)^{2} $$
(2)
$$ P = 3600\frac{E}{\Delta T} $$
(3)

where C, ΔV, and Δt are the same meaning as described in Eq. 1 [41].

Results and discussion

The synthetic strategies of NPC-MHK are schematically illustrated in Scheme 1. For NPC-MHK, an in-situ hydroxyapatite template growth process was adopted to obtain nitrogen-doped hierarchical porous carbon. Diammonium hydrogen phosphate, calcium nitrate tetrahydrate and melamine were dissolved in chitosan solution, where melamine served as the nitrogen source and diammonium hydrogen phosphate and calcium nitrate tetrahydrate served as a precursor of hydroxyapatite. Genipin was then added to it as a crosslinker. Subsequently, KOH solution is added into the solidified hydrogels. The abundant nucleophilic groups from chitosan, such as amino and carboxyl, acted as special active sites for the coordination of Ca2+ to form ion complexes by electrostatic interactions [42]. Meanwhile, nano-hydroxyapatite grew in-situ and distributed throughout the hydrogel substrates. The chemical reactions occurred as follows:

$$ {1}0{\text{Ca}}^{{{2} + }} + {\text{6HPO}}_{{4}}^{{{2} - }} + {\text{8OH}}^{ - } = {\text{ Ca}}_{{{1}0}} \left( {{\text{PO}}_{{4}} } \right)_{{6}} \left( {{\text{OH}}} \right)_{{2}} \left( \downarrow \right) + {\text{6H}}_{{2}} {\text{O }}\left( {{\text{pH}} > {1}0} \right) $$

The potassium hydroxide solution diffused from top to bottom and formed anisotropic pores simultaneously. The rationale that ammonia diffusion created anisotropic pores has been reported in our previous work [43]. With ammonia diffusion from the top to the bottom, the three-dimensional honeycombed penetrative pores were formed by the migration of solid − liquid interface. The same phenomenon happened under KOH treatment (Figure S1). Therefore, the generated hydroxyapatite as templates were uniformly inserted into the carbon matrix after high temperature annealing, and hierarchical pores were also generated by the activation of KOH and removal of hydroxyapatite template. Consequently, a typical nitrogen-doped hierarchical porous carbon framework was obtained. Throughout the synthesis process, potassium hydroxide played three different roles: precipitant of hydroxyapatite, activator, and pore-forming agent of penetrated holes. And carbonization and activation occur simultaneously at a high temperature.

Scheme 1
scheme 1

Schematic illustration of the preparation processes of NPC-MHK

The morphologies of the NPC-K, NPC-H, NPC-HK and NPC-MHK are shown in Fig. 1. From Fig. 1a and d, it can be seen that the surface morphologies of NPC-K and NPC-H both appear to be smooth under low magnification. However, compared to NPC-K, the surface of NPC-H is observably rougher under high magnification (Fig. 1b, e). This is due to introduction of hydroxyapatite. As can be observed from Fig. 1c, f, NPC-K subjected to activation of KOH has abundant micropores, while NPC-H without the activation process has abundant mesopores. It indicates that mesopores were retained after the obtained nano-hydroxyapatite template was removed. Compared to NPC-K and NPC-H, the morphologies of NPC-HK and NPC-MHK are distinctly different in low magnification and have more complicated structures. As shown in the SEM images of high magnification (Fig. 1h, k), they possesses large amount of macropores less than 1 μm. This is due to coordination of hydroxyapatite template and KOH activation. Compared with NPC-HK, the introduction of melamine makes the pores of NPC-MHK denser and the size of the pores smaller (Fig. 1h, k). The TEM images of NPC-HK and NPC-MHK clearly indicate that micropores and mesopores exist in these two samples. This hierarchical porous structure of NPC-HK and NPC-MHK can promote efficiency of electrolyte ions transmission and provide a higher surface areas and more active sites. As expected, they exhibit outstanding electrochemical properties and these will be discussed in detail in the electrochemical test section below.

Figure 1
figure 1

a, b SEM images of NPC-K with different magnification and c TEM image of NPC-K; d, e SEM images of NPC-H with different magnification and f TEM image of NPC-H; g, h SEM images of NPC-HK with different magnification and i TEM image of NPC-HK; j, k SEM images of NPC-MHK with different magnification and l TEM image of NPC-MHK

Figure 2a displays XRD data from the four samples. All samples (Fig. 2a) show two peaks containing ~ 22° broad peaks and ~ 43° weak peaks. These peaks corresponded to the (002) graphitic stacking and the reflections of the (100), (101) overlapped faces, respectively [44]. The diffraction intensity of the 43° peaks of NPC-K, NPC-HK, NPC-MHK became weaker observably. It indicates that KOH can affect the crystallization of carbon [45, 46]. Furthermore, Raman spectra (Fig. 2b) of the four samples clearly display a broad D-band peak at 1350 cm−1 and an in-plane vibration G band at 1580 cm−1 [47]. Under the KOH activation, the ID/IG of NPC-K, NPC-HK, and NPC-MHK were relatively lower than NPC-H, suggesting that KOH can decrease the crystallization of carbon (Table S1). Pore structures were tested by the nitrogen adsorption–desorption measurement. As can be noticed in Fig. 2c, the NPC-K exhibited typical type I isotherms, suggesting the existence of prominent micropores. The NPC-H, NPC-HK and NPC-MHK showed a composite isotherm containing type I and IV isotherms. The sharp increase in adsorption curves within the low-pressure range (P/P0 < 0.01) and evident H4-type hysteresis loops (P/P0 = 0.6–0.9) manifest that micropores and mesopores coexists simultaneously [48]. The pore size distribution calculated from it is clear to confirm the view (Fig. 2d). The micropores with a pore size below 2 nm took up predominant pore volumes of the NPC-K and were considered to be very beneficial for the electrical double layer capacitance. Except for micropores, NPC-HK and NPC-MHK possessed ~ 4 nm mesopores, which provide effective channels for fast ion diffusion to raise specific capacitance and rate capability. Compared with them, only NPC-H have unique mesopores of approximately 9 nm, while the 9 nm mesopores disappeared in the NPC-HK and NPC-MHK samples. It indicates that KOH activation destroyed mesopores around 9 nm while created rich mesopores at 4 nm and micropores below 2 nm. For more details, the morphological parameters about the four samples are listed in Table S2. While the specific surface area of NPC-K and NPC-H are both near 900 m2 g−1, the specific surface area of NPC-HK and NPC-MHK are both near 2200 m2 g−1. It demonstrates coordination of hydroxyapatite template and KOH activation that can increase surface area considerably. Although NPC-HK and NPC-MHK have specific surface areas that are nearly the same, they show different electrochemical properties in later electrode tests.

Figure 2
figure 2

a XRD patterns, b Raman spectrums, c Nitrogen adsorption–desorption isotherm and d pore size distributions of NPC-K, NPC-H, NPC-HK and NPC-MHK

The elemental composition and chemical state of all samples were determined by XPS and EMPA. The XPS survey scans (Fig. 3a) and the WDS mapping (Fig. 3b) reveal that four samples contains C, O and N elements, which is distributed homogeneously to the carbon frameworks. The more detailed XPS data about four samples are listed in Table S3. Due to liquid ammonia treatment, the nitrogen content of NPC-H is highest among them. Except for NPC-H, the nitrogen content increases gradually from NPC-K to NPC-HK and from NPC-HK to NPC-MHK, indicating that introduction of hydroxyapatite template and melamine as nitrogen source can effectively improve the nitrogen content. The N 1s spectra for NPC-K, NPC-H, NPC-HK and NPC-MHK (Fig. 3c–f) exhibit four peaks at 398, 400, 401 and 403.2 eV, corresponding to pyridinic nitrogen (N-6), pyrrolic nitrogen (N-5), graphitic nitrogen (N-Q) and nitrogen associated with an oxygen (N–O), respectively [49]. The sum of N-5 and N-6 combined is 76.06% for NPC-K, 86.31% for NPC-H, 90.25% for NPC-HK, 89.00% for NPC-MHK, respectively. It is demonstrated that the introduction of hydroxyapatite template can prevent the loss of N-5 and N-6. The exposed N-6 and N-5 species have reported to be able to create extrinsic defects and active sites for the pseudocapacitive effect, while N-Q can enhance the conductivity of carbon materials [36, 50].

Figure 3
figure 3

a Full-scale XPS spectrums of NPC-K, NPC-H, NPC-HK and NPC-MHK; b SEM and WDS mapping images of NPC-MHK; the high-resolution XPS spectra of N1s for c NPC-K, d NPC-H, e NPC-HK and f NPC-MHK

Based on the unique hierarchical porous structure with a proper specific surface area and the beneficial doping of heteroatoms, NPC-MHK is expected be a promising electrode material for supercapacitors with high capacitance and high energy density. The electrochemical performances of the four nitrogen-doping porous carbons were evaluated in a three-electrode system. For comparison, all samples were sent to carry out the CV measurements at 100 mV s−1 and GCD tests at 1 A g−1, as shown in Fig. 4a, b. NPC-MHK exhibits the largest CV-circulated area in the CV curves and the longest discharge time in the GCD curves, therefore possesses the highest capacitance among all samples. It proves that KOH activation, hydroxyapatite template and melamine have a positive effect on the electrochemical performances. Specifically, even at 200 mV s−1, the CV curves still remain in rectangular-like shapes, implying the benign ion diffusion and the superior electrical conductivity (Fig. 4c). Moreover, the GCD profiles of NPC-MHK at different current densities (Fig. 4d) are shown in approximate isosceles triangle shapes, verifying the typical electrical double-layer capacitance. In addition, the low IR drop delivers a low equivalent series resistance. NPC-MHK exhibits a promising specific capacitance 306.4 F g−1 at 0.5A g−1. Even at 20A g−1, its specific capacitance can reach to 216 F g−1, which indicates that NPC-MHK possesses a favorable rate capability. As shown in Fig. 4e, Nyquist plots of all samples contains a typical steep line in the low frequency region and semicircles in high frequency region, which verifies the dominance of the electric double layer capacitance again. NPC-K, NPC-HK and NPC-MHK lack the conspicuous Warburg curve with a 45° slope intermediate frequency region, which demonstrates that the diffusion resistance of electrolyte ions from solution into the internal pore channels is so small that it can be ignored [31]. However, the diffusion resistance of NPC-H is cannot be ignored, which is related with the lack of KOH activation. Smaller semicircles in the NPC-K and NPC-MHK signify a faster process of charge transfer, which benefits from suitable nanostructure [51]. Moreover, the NPC-MHK electrode reveals a promising capacitance retention of more than 93.0% after 10 000 cycles at 10 A g−1 (Fig. 4f). The NPC-MHK exhibits superior electrochemical stability and its coulombic efficiency consistently retain over 99% during the whole cycling process.

Figure 4
figure 4

Electrochemical characterization of the samples in 6 M aqueous KOH electrolyte in a three-electrode system. a CV curves of NPC-K, NPC-H, NPC-HK and NPC-MHK at a scan rate of 100 mV s−1; b galvanostatic charge–discharge curves of NPC-K, NPC-H, NPC-HK and NPC-MHK at a current density of 1 A g−1; c CV curves of NPC-MHK at various scan rates; and d galvanostatic charge–discharge curves of NPC-MHK at different current densities; e Nyquist plots of NPC-K, NPC-H, NPC-HK and NPC-MHK (insert the magnified high-frequency region of the impedance spectra and the equivalent circuit); f cycling performance and coulombic efficiency of the as-synthesized NPC-MHK electrode at a current density of 10 A g−1

To investigate the application of NPC-MHK for supercapacitors, a symmetric solid-state capacitance was fabricated (denoted as NPC-MHK// NPC-MHK) for evaluation. The CV curves show quasi-rectangular shapes with no distinct distortion even at 500 mV s−1 which implied a typical electric double layer behavior and stability at high sweep rate (Fig. 5a). All GCD profiles (Fig. 5b) exhibit symmetric linear and negligible voltage drop, especially at high current density, indicating superior electrochemical stability and less internal impedance. The SSC device possessed a maximum specific capacitance 68.6 F g−1 at 0.5A g−1. Even at 10A g−1, the capacitance still remained 62.7% of the maximum value.

Figure 5
figure 5

Electrochemical characterization of the NPC-MHK in a two-electrode symmetrical supercapacitor: a CV curves at different scan rates; b the GCD curves at different current densities; c cycling performance and coulombic efficiency of the assembled NPC-MHK symmetrical supercapacitor at a current density of 10 A g−1; d Ragone plots of symmetrical supercapacitor (insert: a red LED lightened by two NHPC-MHK symmetrical supercapacitors connected in series)

In addition, EIS tests of the symmetric solid-state capacitance were performed and results are illustrated in Figure S2, showing its superior electrochemical performances. The Rs and Rct were 0.30 Ω and 0.28 Ω, respectively, calculated from the enlarged data in high frequency regions (the inset in Figure S2). Furthermore, as observed in Fig. 5c, the assembled device also exhibits outstanding cycling performance with 87.3% capacitance retention after 5000 charge–discharge cycles at the current density of 10 A g−1. Notably, the coulombic efficiency almost remains at 100% due to its excellent rate capability.The NPC-MHK//NPC-MHK device delivered an impressive energy density of 9.52 W h kg−1 at a power density of 250 W kg−1, whereas it still retained an energy density of 5 kW kg−1 under a higher power output of 10 000 Wkg−1. Compared to recently carbon-based SSCs reported, the SSC of the NPC-MHK possesses considerable higher power density at the same high-energy density [42, 52,53,54,55]. The inset in Fig. 5d demonstrates that the red light-emitting diodes (LEDs, 1.8 V) was powered by the tandem device of two cells and delivered a dazzling light. This indicates that NPC-MHK materials have a great potential in practical application.

Conclusion

A novel and cost-effective approach is developed for the synthesis of nitrogen-doped hierarchical porous carbon via one-step pyrolysis of precursors. KOH that have three roles of activator, precipitant and pore-forming agent is key to obtain hierarchical porous structure during synthetic process. The green and economical synthetic protocol employs hydroxyapatite, which is a hard template that can be moved by dilute acid instead of toxic reagents such as hydrofluoric acid. More importantly, the resulting hierarchical porous carbons show high performance in both electrode characterization and application evaluation. The synthesized product NPC-MHK featuring high surface area, optimized hierarchical porosity and homogenous nitrogen doping exhibits favorable specific capacitance of 306.4 F g−1, as well as superior cycling performance (capacitance retention of 93.0% after 10 000 cycles). The assembled symmetric SSC with a long cycle life delivers a maximum energy density of 9.52Wh kg−1 at a power density of 250Wkg−1.