Introduction

Organic dyes have been extensively used in many industries such as textile, paper, printing, food, and cosmetics [1, 2], which contribute to large and main pollutants in the aquatic ecosystem with over 7 × 105 tons produced annually [3]. The discharge of dyes into the environment was currently one of the world’s major environmental problems for both toxicological and esthetic aspects. Various techniques have been reported for dye removal such as photocatalytic degradation [4], adsorption [57], and oxidation catalysis [8]. Among them, adsorption was considered as the most promising option for its efficient capacity, available/various adsorbents, easy operation, low-energy requirement, insensitivity to toxic substances, and no external formation of harmful substances [9]. Thus, selection of suitable adsorbent was the important guarantee for adsorption process.

Adsorbent structure, especially pore structure, was one important factor that affected the adsorption performance to pollutants. Commercial activated carbon was the most widely used adsorbent; however, restricted by its abundant microporous nature, large molecular pollutants could not easily penetrate its micropores and effectively adsorbed, resulting in the low adsorption capacity on the activated carbon [10, 11]. Mesoporous carbons materials with open pore structure and large pore size have shown remarkable improvement in the adsorption of bulky dyes [12]. For the benefits of easy separation and the reuse of the adsorbent, the magnetic mesoporous carbon materials have been developed in pollution abatement [13]. Besides the pore structure, the surface chemistry of the adsorbent also played an important role in adsorption process [14]. The different classes of dyes had distinct adsorption behaviors on the adsorbent with different surface chemistry characteristics [15]. Due to the increased surface hydrophilicity, the oxygen-containing acid group mesoporous C improved the adsorption capacity to anionic dyes [16]. Peng et al. studied the effect of N-doped CMK-3, which was fabricated by ammonia treatment, on the adsorption to acid dye of black 1 and found the N-containing CMK-3 enhanced the interaction between carbon material and acid molecules [17]. However, the fabrication of N-functional mesoprous C still constituted a major challenge compared with easy synthesis of O-containing groups that were prepared by oxidation post-treatment [18]. Furthermore, there was little study on systematic adsorption influences of anionic/cationic or acidic/basic dyes on N-modified mesoporous carbon in comparison with the extensive O-containing mesoporous carbon. Various strategies were developed for the generation of N-containing surface groups, such as ammine post-treatment [19], chemical vapor deposition method [20], and carbonization of some containing nitrogen molecule [21]. However, the facile and direct synthesis of N-modified mesoporous carbon is attractive for practical applications.

Polyaniline (PANI), as the most commonly investigated azo polymer in that its low cost of monomer, easy polymerization, and high environmental stability, was attracted as favorable precursor to prepare N-modified carbon. In this contribution, magnetic mesoporous polyaniline composite (Fe3O4@mPANI) was synthesized by the polymerization of aniline with modified Fe3O4 particles using P123 and sodium dodecylsulfonate (SDS) as structure-directing agents. Thereafter, magnetic and N-functionalization were facilely and simultaneously introduced into the mesoporous C by carbonization of Fe3O4@mPANI to obtain the Fe3O4@N-mC composite. Fe3O4@N-mC was systematically investigated to adsorb various dyes of acidic methyl orange (MO), basic methylene blue (MB), and basic rhodamine B (RhB) with different sizes. Besides the surface composition effect, influences of solution pH and dye concentration on the adsorption performance were studied in detail. Moreover, the kinetic and equilibrium adsorption studies were conducted to clearly elucidate the adsorption mechanism for dye molecules. Moreover, the introduced magnetic property in N-doped mesoporous C made the absorbent easily separated after the adsorption by the external magnetic field. The efficient adsorption performance of mesoporous C coupled with N-containing group and magnetic functionalizations render Fe3O4@N-mC adsorbent appealing in the practical applications for the wastewater remediation.

Experimental section

Synthesis of magnetic N-doped mesoporous C (Fe3O4@N-mC) composite

Ferric chloride hexahydrate, sodium acetate, ethylene glycol, polyvinyl pyrrolidone (PVP), ammonium persulfate (APS), sodium dodecyl sulfonate (SDS), methyl orange (MO), methylene blue (MB), rhodamineB (RhB), and aniline were purchased from Sinopharm Chemical Reagent Co. Ltd., China. PEO20-PPO70-PEO20 (P123) was supplied from Sigma-Aldrich. All of the regents except aniline were of analytical grades and used as received without any further purification, and aniline was purified by twice distillations.

First, magnetic mesoporous polyaniline composite (Fe3O4@mPANI) was synthesized by one-step aniline polymerization around Fe3O4 particles formed beforehand. Then, Fe3O4@mPANI composite was carbonized to obtain N-modified magnetic mesoporous carbon denoted as Fe3O4@N-mC, the detailed synthesis procedure is shown in Scheme 1.

Scheme 1
scheme 1

Schematic illustration for the synthesis of Fe3O4@N-mC composite

Synthesis of Fe3O4-PVP particles

Fe3O4 modified by PVP were synthesized by solvothermal method according to the previous work [22]. Ferric chloride hexahydrate (1.5 g), sodium acetate (2.0 g), and PVP (1.0 g) were dissolved into ethylene glycol (30 mL) under vigorous stirring. The homogeneous yellow solution was obtained and transferred to Teflon-lined stainless-steel autoclave for crystallization at 200 °C for 8 h, then the autoclave was cooled to room temperature. The obtained black magnetic particles were washed with ethanol several times and dried in vacuum at 60 °C for 12 h to obtain PVP grafted Fe3O4 particles denoted as Fe3O4-PVP. PVP acted as the linker to benefit the subsequent coverage of polyaniline shell around Fe3O4 core.

Synthesis of Fe3O4@mPANI and Fe3O4@N-mC

Fe3O4@mPANI composite was prepared by in situ polymerization of aniline in the presence of SDS and P123 mesostructure-directing agents. In a typical synthesis, the dilute HCl was first prepared by mixing 0.17 g 12 M HCl in 140 g deionized water. Then, P123 (0.15 g) and SDS (0.288 g) were dissolved into 100 mL the above HCl, then Fe3O4-PVP particles (0.10 g) were slowly added. The mixture was then ultrasonically dispersed for 30 min to obtain a uniform mixture. At the same time, aniline (0.187 g) was dispersed into the dilute HCl solution (40 mL) with magnetic stirring at room temperature for 30 min, then the solution was added into the above mixture under vigorous stirring to obtain a uniform mixture. The mixture was then placed in an ice-bath to maintain at 3–5 °C. Then an ice-cold APS aqueous solution (0.92 g in 100 mL) was dropped slowly and the mixture was stirred to become homogeneous. The polymerization was performed under mechanical stirring for 12 h at 3–5 °C. The resultant precipitates were washed with deionized water and ethanol several times. Thereafter, the solids were refluxed in ethanol solution of ammonium acetate to remove mesostructure-directing agents then dried in vacuum at 60 °C for 24 h to obtain the dark Fe3O4@mPANI composite.

Finally, the Fe3O4@mPANI composite was carbonized in a tube furnace under nitrogen with heating rate of 3 °C min−1 then maintained at 400 °C for 4 h and further programmed to 620 °C with 2 °C min−1 and kept at 620 °C for another 4 h. The black product was N-doped magnetic mesoporous carbon composite, designated as Fe3O4@N-mC.

Characterization

X-ray diffraction (XRD) pattern was obtained on Bruker D8 Advance X-ray powder diffractometer with Cu-Kα radiation (40 kV, 40 mA). Nitrogen adsorption/desorption isotherms were measured at −196 °C on ASAP 2020 volumetric analyzer. The surface area was calculated using BET method, the pore size distribution was derived from the desorption branch of the isotherms based on the BJH model, and total pore volume was determined from the amount of nitrogen adsorbed at P/P 0 ca. 0.99. Scanning electron microscopy (SEM) and EDX were recorded using a JSM-6700F scanning electron microscope. Transmission electron microscopy (TEM) was recorded on JEM-2010 electron microscope operating at 200 kV. Raman spectra were obtained on a LabRAM XploRA Raman microscope with 0.15 mW power and an argon-ion laser at excitation wavelength of 532 nm. The magnetization curve was measured on Quantum Design MPMS-7 SQUID magnetometer at 300 K under varying magnetic field. Adsorption amounts and equilibrium concentrations were quantified by Perkin Elmer Lambda 750 UV–Vis spectra. Fourier transform infrared spectroscopy (FTIR) was obtained on Perkin Elmer 100 spectrometer. X-ray photoelectron spectroscopy (XPS) measurements were recorded on Phi Quantera spectrometer with Al Kα radiation ( = 1486.6 eV). pHpzc values of adsorbent were determined using pH drift method by pH meter. Adsorbent was put in 100 mL 0.1 M NaCl solution, and the pH value of the mixture was adjusted to 2–12 using 0.1 M HCl or 0.1 M NaOH solution. Afterward, the flask was sealed and shaken in thermostat shaker for 48 h, the pH value of the mixture was measured and pHpzc was taken as the point where the curve was zero. The zeta potential of the adsorbent was measured using dynamic light scattering analysis, the analysis was undertaken using a Malvern Zeta-sizer Nano zeta potential system.

Dye adsorption experiments

The acidic anionic dye MO, basic cationic dyes MB and RhB were selected as target molecules to investigate the dye adsorption behaviors on the magnetic N-doped mesoporous carbon composite. Their molecular sizes as well as structures were illustrated in Fig. 1.

Fig. 1
figure 1

Chemical formula and 3D representations of the selected dyes. Molecular sizes of the dyes were estimated using ChemSketch

Batch experiments for adsorption were performed in a set of flasks, each one containing 100 mL different initial concentrations of dyes and 10 mg adsorbent. The flasks were kept at 25 °C for 24 h to reach complete adsorption equilibriums. After that, the solution was filtered and the residual concentration was determined by UV–Vis spectra at the maximum wavelengths (λ max) of light adsorption for each dye (665, 465, and 546 nm for MB, MO, and RhB, respectively). The adsorbed capacity at equilibrium was calculated through equation of \( q_{\text{e}} = (C_{0} - C_{\text{e}} )\frac{V}{{m_{\text{s}} }}, \) where C 0 is the initial dye concentration (mg/L), C e is the equilibrium concentration (mg/L), V is the volume of dye solution (L), and m s is the adsorbent weight (g). The sorption kinetics of the dyes were investigated using pseudo-first-order, pseudo-second-order, and intraparticle diffusion models. And the adsorption isotherms were analyzed by Langmuir and Freundlich model equations.

Regeneration of the adsorbent

To investigate the regeneration of the adsorbent, dye-loaded adsorbent was separated using an external magnet and then transferred into ethanol solution to release the adsorbed dye. Subsequently, the adsorbent was washed with deionized water and ethanol, then reused for another run directly.

Results and discussions

Structure, morphology, and magnetic properties of Fe3O4@N-mC composite

The crystalline nature and composition of the samples were characterized by XRD. Figure 2 showed the wide-angle XRD patterns of Fe3O4-PVP, Fe3O4@mPANI, and Fe3O4@N-mC samples. For Fe3O4-PVP, five diffraction peaks appeared at 2θ = 30.0°, 35.4°, 43.1°, 56.9°, and 62.5°, which were, respectively, corresponded to (220), (311), (400), (511), and (440) planes for the cubic lattice of Fe3O4 (JCPDS no. 19-0629). In the case of Fe3O4@mPANI, there were two new broad peaks observed at 20.6° and 25.6°. The peak centered at 20.6° was ascribed to periodicity parallel to the polymer chain, while the 25.6° peak was caused by the periodicity perpendicular to the polymer chain [23]. The wide-angle XRD pattern of Fe3O4@N-mC also showed a broad diffraction between 20 and 30° ascribed to the amorphous carbon, which proved that polyaniline was carbonized successfully. Furthermore, small angle XRD patterns (insert) of Fe3O4@N-mC sample exhibited one broad peak at ca. 2.4°, suggesting worm-like mesopores existence, in good agreement with the mesostructured carbon material reported previously [5].

Fig. 2
figure 2

XRD patterns of a Fe3O4-PVP, b Fe3O4@mPANI, and c Fe3O4@N-mC composite. Inset is the small angle XRD pattern for Fe3O4@N-mC sample

BET surface area and porous structure of Fe3O4@N-mC composite were provided by N2 adsorption–desorption isotherms as shown in Fig. 3. Type IV isotherm with a distinct hysteretic loop between the relative P/P0 pressure of 0.4-1.0 clearly verified the presence of mesopores in the composite. The BET surface area of Fe3O4@N-mC composite was 166.9 m2 g−1, and the corresponding mesoporous sizes appeared at 3.2 nm and 6.0 nm.

Fig. 3
figure 3

Nitrogen adsorption–desorption isotherms of Fe3O4@N-mC composite. Inset is the pore size distribution

The FTIR characteristic peaks of Fe3O4-PVP are displayed in Fig. 4a. The two peaks at 470 and 585 cm−1 were attributed to Fe–O stretching vibrations of Fe3O4 [21]. The peak at 1642 cm−1 was observed due to the carbonyl group of pyrrolidone on PVP chains, indicating that PVP was successfully grafted onto Fe3O4 surface. In the case of Fe3O4@mPANI composite, major bands were at 1605, 1494, 1296, 1235, and 1148, 830 cm−1. The characteristic peaks at 1605 and 1494 cm−1 were assigned to the stretching vibrations of quinoid ring and benzenoid ring [22]. The peaks at 1296, 1235, and 1148 cm−1 were corresponded to C-N stretching vibrations [24]. The band at 830 cm−1 was ascribed to 1, 4-disubstituted benzene moiety [25]. Due to the carbonization process, the peaks characteristic of PANI became weaker or disappeared in Fe3O4@N-mC composite (Fig. 4c). The peak at 1590 cm−1 ascribed to –NH2 deformation vibration demonstrated the successful N-functionalization on the composite surface [26]. Besides, the typical Fe–O stretching vibration of Fe3O4 at 585 cm−1 also proved the existence of Fe3O4 in the Fe3O4@N-mC composite.

Fig. 4
figure 4

FTIR spectra of (a) Fe3O4-PVP, (b) Fe3O4@mPANI, and (c) Fe3O4@N-mC composite

XPS technique was powerfully used for the determination of surface composition for unique elemental markers of the material. The survey spectra of Fe3O4@N-mC composite are shown in Fig. 5a, which indicated the existences of C, O, N, and Fe elements. The binding energy of Fe2p was detected at 710.2 eV (insert), and N1 s spectra were deconvoluted into two peaks at about 400.5 and 399.2 eV, which were, respectively, assigned to the aromatic amine and the pyridine nitrogen in the Fe3O4@N-mC composite [27, 28]. XPS characterization further testified that N was successfully modified into the magnetic mesoporous C.

Fig. 5
figure 5

a Survey XPS spectra, inset for enlarged Fe 2p spectrum and b N1s spectrum for Fe3O4@N-mC composite, the content percentage of the nitrogen functional groups was shown in bracket

To gain more information of the carbon structure, Raman spectrum is measured in Fig. 6. The peak at 1348 cm−1 labeled as D-band was usually ascribed to the vibration of carbon atom with dangling mode for the in-plane terminations of disordered graphite. The peak at 1602 cm−1 labeled as G-band was due to the sp2-bonded carbon–carbon stretching mode in a two-dimensional hexagonal lattice for graphene sheet [29]. Moreover, the G/D intensity ratio was regarded as a measurement for the graphitization degree [30]. For Fe3O4@N-mC composite, the IG/ID band ratio was ca. 1.56, higher than active carbon (AC) at 1.19, indicative of the improved graphitization degree in the Fe3O4@N-mC composite.

Fig. 6
figure 6

Raman spectra of (a) Fe3O4@N-mC composite and (b) AC

The morphology of Fe3O4@N-mC composite was further elucidated by SEM and TEM results. SEM images displayed the uniform and aggregated spherical morphologies (Fig. 7a, c). In TEM image, it was obviously observed that the spherical and agglomerated Fe3O4 particles were covered by light carbon shell layers of about 20–30-nm thickness. Besides, EDX analysis further evidenced the presence of N, O, Fe, and C elements in the Fe3O4@N-mC composite, consistent with the XPS results.

Fig. 7
figure 7

a, c SEM images, b TEM image, and d EDX analysis for the rectangle area of Fe3O4@N-mC composite

The magnetic behavior of the obtained material was investigated using vibrating sample magnetometer shown in Fig. 8. All the magnetic hysteresis loops were S-like curves, indicating that there were almost no remaining magnetizations when the external magnetic field was removed. At 25 °C, the saturation magnetization of Fe3O4-PVP particle was 76.8 emu g−1. After polymerization of aniline, the saturation magnetization of Fe3O4@mPANI reduced remarkably to 13.4 emu g−1, because Fe3O4 was encaged within the mesoporous polyaniline networks. Through the calcination of Fe3O4@mPANI, PANI was carbonized and the thinner carbon layer was formed, resulting in the increased saturation magnetization at 20.0 emu g−1 of Fe3O4@N-mC composite. The high saturation magnetizations were favorable for the easy separation of adsorbent from the solution after the adsorption by external magnetic field, which was very attractive to the practical applications.

Fig. 8
figure 8

Magnetic hysteresis loops of (a) Fe3O4-PVP, (b) Fe3O4@N-mC and (c) Fe3O4@mPANI composite

Adsorption test and mechanism analysis

The capacities of various dyes adsorbed onto Fe3O4@N-mC and AC are shown as a function of time in Fig. 9. All the dyes were absorbed quickly by Fe3O4@N-mC composite within 10 min. Thereafter, adsorption capacity almost unchanged and achieved the equilibrium within 30 min. The sharp increase adsorption within the first 10 min was due to the abundant porosity of Fe3O4@N-mC. Although the commercial AC displayed much higher surface area at 430.8 m2 g−1 than Fe3O4@N-mC at 166.9 m2 g−1, the remarkable reduced adsorptions were observed on AC, suggesting the leading roles in adsorption behavior of the composite are porosity structure and surface composition. The dominant microporous nature of AC made the bulky-dye molecules difficultly penetrate into the pores and only adsorbed on the AC surface. In comparison with magnetic mesoporous C, the adsorption capacities of reported Fe3O4@mC [5] and Fe@MC [6] to RhB were higher than Fe3O4@N-mC, the high adsorption capacity was mainly ascribed to the high surface areas of the former two reference samples at 971 and 742 m2 g−1, respectively. However, compared with other adsorbents although with high surface areas (Table 1), Fe3O4@N-mC exhibited higher adsorption capacity [2, 7, 3133]. In the case of Fe3O4@N-mC, the adsorption capacity was in the order of MO > MB > RhB. Concerning the dye molecular size, it was understandable for the adsorption of RhB to need longer time and adsorption amount was significantly reduced compared with MO and MB. For similar molecular sizes of MO and MB, the acid–base properties of dyes affected the adsorption performances over the adsorbent. The adsorption capacity of acidic MO was higher than basic MB on Fe3O4@N-mC, which was explained that N-modified mC composite possessed basic property, which was favorable for the adsorption to acidic dye.

Fig. 9
figure 9

Effects of contact time on the adsorption capacity (T = 25 °C, rpm = 120, pH 7.0, C 0 = 20 mg L−1)

Table 1 Comparison of the adsorption capacities on various adsorbents

The solution pH significantly affected the adsorption extent [34], in order to investigate the pH influence, the surface charge of Fe3O4@N-mC composite via pH was conducted and pHpzc was 8.95 (Fig. 10a). When pH < pHpzc, the Fe3O4@N-mC surface became positively charged, while pH > pHpzc, it was negatively charged. Moreover, the relationship of Fe3O4@N-mC zeta potential with pH showed that the isoelectric point was near to pH 8.85 (Fig. 10b). The zeta potential was positive at pH values lower than 8.85 and negative at pH values higher than 9. Figure 10c exhibited the adsorption behavior with different pH over Fe3O4@N-mC composite. In the case of cationic dyes MB and RhB, the adsorption capacities increased with pH increment. At low pH, cationic dyes were protonated in the presence of excess H+ and the protonated dyes were more repulsed with positively charged absorbent, leading to the low adsorption capacity [35]. As pH > pHpzc, the Fe3O4@N-mC surface became negative, the electrostatic interaction increased the cationic dyes of MB and RhB adsorptions [36]. Nevertheless, the opposite trend was observed for anionic dye MO adsorption. The maximum uptake value to MO solution appeared at low pH, the result was also well explained by electrostatic interactions between MO dye and adsorbent. At pH < pHpzc, the adsorbent surface was positively charged, thereby increasing electrostatic attraction between MO molecular and the positively charged adsorbent and causing the high adsorption at low pH. With the gradual increase of the solution pH, the removal efficiency to MO decreased, which was attributed to the enhanced OHand more electrostatic repulsion between the negatively charged adsorbent and the anionic MO dye molecules [32, 37]. Hence, at pH > pHpzc, the negatively charged Fe3O4@N-mC surface was favorable to the adsorption of cationic dyes, while at pH < pHpzc, the positive-charged surface benefited the adsorption of anionic dyes. Based on the interaction between the adsorbent and dyes, it was comprehensible that at pH lower than 9, the adsorption capacity to MO was higher than MB and RhB, whereas the capacity to MB was higher than MO at pH > 9. The integrated influences of charge interaction and molecular size resulted in the similar adsorption behaviors to MO and RhB at pH 10.

Fig. 10
figure 10

a pHpzc plot and b Zeta potential of Fe3O4@N-mC composite; c Effect of solution pH on the adsorption performance (T = 25 °C, rpm = 120, C 0 = 20 mg L−1)

To investigate the effect of dye concentration on the adsorption, batch experiments were carried out by adding 10 mg adsorbent to 100 mL different initial concentrations of dyes at 25 °C in Fig. 11. The adsorbed amounts of dyes improved with the initial concentration increasing. With the enhancement from 16 to 50 mg L−1, the adsorbed equilibrium amounts were improved from 78 to 163 mg g−1 for RhB, 85 to 165 mg g−1 for MB, and 99 to 198 mg g−1 for MO adsorptions.

Fig. 11
figure 11

The effect of initial dye concentration on the adsorption capacity (T = 25 °C, rpm = 120, pH 7)

For the adsorbent, easy separation and recycling stability are the key factors for practical applications. The adsorption–desorption recycles are displayed in Fig. 12, which demonstrated that after five recycles Fe3O4@N-mC composite still kept good stability. The efficient adsorption property together with easy separation and excellent regeneration made Fe3O4@N-mC composite promising adsorbent candidate for the removal of organic dyes in wastewater.

Fig. 12
figure 12

The capacity of the adsorbed dyes over Fe3O4@N-mC composite in five cycles (T = 25 °C, rpm = 120, pH 7.0, C 0 = 20 mg L−1)

Adsorption kinetics and adsorption isotherms

The adsorption equilibriums for various dyes over Fe3O4@N-mC composite were analyzed by Langmuir and Freundlich isotherm models and the corresponding parameters are listed in Table 2. All the adsorption results were more fitted Langmuir isotherm model with the best correlation regression coefficients than Freundlich model. According to the Langmuir isotherm, the maximum adsorption capacities to RhB, MB, and MO were at 178.8, 185.1, and 200.0 mg g−1, respectively, consistent with the experimental capacity order of MO > MB > RhB. Due to its basic property, N-modified mesoporous C resulted in stronger affinity to acidic dye of MO than to basic dyes of MB and RhB. Moreover, the higher K L value and Langmuir constant further evidenced higher affinity to MO than to the other two dyes. Freundlich constant K F was used as a relative measurement for the adsorption capacity and 1/n parameter was related to the sorption intensity [17]. The higher K F value to MO also suggested that Fe3O4@N-mC possessed higher adsorption capacity to acidic dye than basic dyes. All 1/n values were less than 1, indicative of all the favorable adsorptions to various dyes on Fe3O4@N-mC composite [38].

Table 2 The isotherm parameters and correlation coefficients for the adsorption to various dyes over Fe3O4@N-mC composite

The adsorption process generally includes three steps: (I) film diffusion; (II) intraparticle diffusion or pore diffusion, and (III) sorption onto interior sites [17]. In order to elucidate the adsorption rates over Fe3O4@N-mC composite, the kinetic data of adsorption were investigated by pseudo-first-order, pseudo-second-order, and intraparticle diffusion models (Table 3), respectively. It indicated that the calculated equilibrated adsorption amounts q e and correlation coefficients R 2 values by pseudo-second-order model were more consistent with experimental q e values than pseudo-first-order model. Thus, the pseudo-second-order kinetics model was more suitable to describe the adsorption kinetics data, revealing that adsorption rate was controlled by the chemical adsorption process. During the adsorption, chemical interaction between the adsorbent and dyes did work [39]. After the adsorption through surface reactions, dye molecules diffused into the adsorbent pores for further adsorption [40]. During this process, the intraparticle diffusion model [33] was used to identify the diffusion effects in adsorption process. In Fig. 13, there appeared two distinguishable intercepting lines, a fast increasing step at beginning, then a relatively slow increase and until equilibrium. The plots of q t versus t 0.5 were linear relationships in the first rise period; moreover, the linear did not pass through the origin, suggesting that intraparticle diffusion was not the rate-controlling step during the whole adsorption process and some other factors might be involved [17]. The second portion in intraparticle diffusion model was the gradual equilibrated adsorption stage, which was resulted from the extremely low-dye concentration residual in the solution. For the intraparticle diffusion kinetic model in Table 3, K i represents the intraparticle diffusion rate constant and C is the intercept. All R 2 by the intraparticle diffusion models were lower than those of the pseudo-second-order kinetics, further proving that the surface chemical interaction was suitable to the whole adsorption process besides the pore diffusion effects. The large and spacious mesopores of the composite benefited the dye diffusions to the adsorbent pores. Moreover, the surface interactions between adsorbent and dyes played the main roles in the whole adsorption process on Fe3O4@N-mC composite, basic N-functional mesoporous C improved the adsorption to acidic dyes.

Table 3 The kinetic parameters for the adsorption to dyes over Fe3O4@N-mC
Fig. 13
figure 13

Intraparticle diffusion model of adsorption dyes over Fe3O4@N-mC composite

Conclusion

Magnetic mesoporous polyaniline Fe3O4@mPANI was synthesized by aniline polymerization around Fe3O4 particles using P123 and SDS as mesoporous-directing agents, where magnetic Fe3O4 was encaged into the mesoporous polyaniline networks. Then basic N-doped magnetic mesoporous carbon (Fe3O4@N-mC) with core–shell structure was facilely obtained by the carbonization of Fe3O4@mPANI composite. Fe3O4@N-mC composite showed much higher adsorption rate than commercial AC and reference mesoporous C because of its spacious mesoporous structure and surface modification. Concerning the dye molecular size, it was understandable that the adsorption of bulky RhB needed longer time and adsorption amount was reduced compared with small-sized MO and MB. In the case of similar sizes of MO and MB, the adsorption capacity to acidic MO was higher than basic MB over Fe3O4@N-mC composite, which was explained that basic Fe3O4@N-mC was favorable to the adsorption of acidic dye. The adsorption kinetic was fitted by the pseudo-second-order kinetics model, revealing that the overall rate of the adsorption process was controlled by the chemical adsorption interaction. Moreover, the experimental adsorption capacities were well fitted by the Langmuir adsorption model. Additionally, the introduced magnetic Fe3O4 rendered the Fe3O4@N-mC composite easily separated from solution by the external magnetic field. Furthermore, excellent reusability together with the fast and high adsorption performance made Fe3O4@N-mC composite promising candidate for efficient remediation of wastewater.