Introduction

One of the most persistent anthropogenic sources of environmental pollution is from the manufacturing sectors such as paper, printing, plastics, food, and textile industries thereby generating a considerable amount of effluents due to the consumption of dyes and water, especially during wet processing of textiles and food processing (Oyekanmi et al. 2019; Rizal et al. 2021). The negative environmental impact as a result of the presence of the residual dyes in aqueous solution is not limited to the poor aesthetic quality of the receiving water but can also create anoxic conditions that can be lethal to the resident aquatic population (Oyekanmi et al. 2022; Wang et al. 2023). The disposal of untreated dye wastewater has therefore become a matter of utmost concern due to the danger these dye pollutants pose to both the flora and fauna including the health of humans upon exposure (Nizam et al. 2022).

Crystal violet (CV) is one of the most common cationic dyes due to its intense colour which is extensively used in textile, paper, and printing ink industries (Sabna et al. 2016); therefore, a low concentration of CV in the solution can distort sunlight penetration and also photosynthetic activities (Mittal et al. 2021). This dye is also known to be carcinogenic; its exposure can potentially be detrimental to the health of humans and other life forms (Ahmad & Ansari 2022). Sunset yellow (SY) is one of the most used synthetic dyes in the food industry mostly used as a food additive in beverages, dairy candies, and bakery products. Consequently, it becomes necessary to decontaminate dye effluents before they are discharged into the natural and unpolluted water bodies. Thus, sustainable cost-effective treatment strategies are urgently required to control the harmful effects of these dyes in order to preserve the ecosystem.

Conventionally, decontamination techniques which include ion exchange, reverse osmosis membrane, nanofiltration membrane, solvent extraction, photocatalytic degradation, and adsorption have been widely applied for the treatment of dying effluent (Ahmadipouya et al. 2022; Katibi et al. 2021; Kumar 2019; Saeki et al. 2021; Thasneema et al. 2021; Wang et al. 2021). Even though these methods are technically viable when suitable materials are used, the cost implication of the treatment process is relatively high, unlike the adsorption method which is known for its simple operation, high treatment efficiency, and environmental friendliness without causing secondary pollution (Li et al. 2022; Jie et al. 2023).

Recently, the synthesis of biochar as a potential adsorbent for the remediation of pollutants from wastewater streams has been receiving much attention due to its high porosity, enhanced surface area, and abundance of active functional groups (Zhang et al. 2021; Hu et al. 2022). However, the major challenge of post-adsorption processes such as filtration or centrifugation in terms of separation and recovery especially biochar in powdered form remains a drawback that limits its wider application (Jung et al. 2016; Mahdi et al. 2018; Fito et al. 2023). Therefore, to proffer a solution to this problem to advance its application for pollutant removal, surface modification via iron oxide precipitation has been proposed to enhance the adsorption capacity and ease the post-adsorption recovery and separation. Several modification techniques to enhance the physical, chemical, and biological properties of biochar using biofilms, clays, and metal salts have been reported (Akgül et al. 2019; Frankel et al. 2016; Xing et al. 2021; Yao et al. 2014). To reduce the cost of synthesizing magnetic biochar, agricultural wastes can be utilized as a precursor for biochar preparation. In this study, a facile synthesis method has been proposed for the preparation of Na2CO3 magnetic biochar for the adsorption of dyes.

Oil palm frond (OPF) could be utilized as a potential raw material to prepare biochar because it is easily sourced waste biomass. It is estimated that about 24 fronds are pruned per palm tree on an annual basis. Most of the OPF biomass are underutilized and are left rotting between the rows of palm trees and the weight of OPF varies considerably with the age of the palm having an average annual pruning of 82.5 kg of fronds/palm/year (Harith Zafrul Fazry et al. 2018). Oil palm mill wastes generate greenhouse gases (CH4, CO2) which can affect the environment, especially air and water resources (Khatun et al. 2017). Annually, approximately 26.2 million tonnes of oil palm frond (OPF) are generated through the oil palm production process in oil mills (Singh et al. 2013; Dong et al. 2022). However, not all OPF residues are utilized for energy applications, they can be a source of greenhouse gas emissions (Isgiyarta et al. 2022). Massive accumulations of biomass pose environmental pollution issues as a result of the high concentration of organic acid in the OPF (Jasri et al. 2023). Burning OPF wastes emit air pollutants harmful to health and the environment (Nordin et al. 2017). Rather than OPF becoming a potential threat and source of environmental pollution, this waste can be utilized as an economically viable raw material for the synthesis of biochar to achieve high surface area adsorbent for pollutant remediation. However, by enhancing the adsorption capacity of biochar by improving its surface properties and enhancement of its effective surface functional groups, magnetically modified biochar has gained considerable attention for pollutant removal (Eltaweil et al. 2020). Nevertheless, most methods of modification such as acid–base activation are usually broad without significant effect on the improvement of pore structure and surface properties of the adsorbent (Li et al. 2022). The synthesis of magnetic biochar derived from OPF offers a novel interfacial surface and enhanced structure for the adsorption of dyes from the solution. Pristine biochar tends to rely on its hydrophobicity in the aqueous phase (Sun et al. 2022). However, loss of adsorbent and the issue of secondary pollution due to desorption limit biochar applications. The recovery of biochar using an external magnet source provides an easy and effective regeneration route (Rubangakene et al. 2023). Oil palm frond have inherent lignocellulosic properties. It is expected that the cellulose composition of OPF to provide a wide functionalizable surface which can enable the incorporation of functional groups onto the surface, thereby enhancing the adsorption capacities of the surface towards pollutant removal (Othmani et al. 2021). Furthermore, the lignin content comprises various functional groups which include carbonyl, carboxyl, methoxy, and hydroxyl groups, which offers promising potential for dye adsorption (Meng et al. 2020).

Furthermore, investigating the interaction of the operational adsorption parameters in a batch adsorption study intends to increase the adsorption capacity of the magnetic biochar for dye removal from an aqueous solution. There have been many studies on magnetic biochar using CCD and RSM. So far, phenol contaminated municipal wastewater treatment using date palm frond biochar optimization using response surface methodology has been reported. From our literature survey, magnetic biochar derived from oil palm frond has rarely been synthesized for pollutant remediation. Our study conducted a facile synthesis of OPF magnetic biochar for the adsorption of crystal violet and sunset yellow dye which has not been reported in the literature. Furthermore, the synergistic interaction of process variables influencing the adsorption capacity of adsorbent through optimization of operational parameters using CCD-RSM was conducted in our study which will provide valuable insight into the synthesis of OPF magnetic biochar as an effective adsorbent for the removal of pollutant species from solution.

Herein, OPFs were utilized as precursory material for the synthesis of novel functionalized Na2CO3-based magnetic biochar which was applied for the adsorption of CV and SY from an aqueous solution. In addition, this work intends to explore the effect of the system parameters for the adsorption of CV and SY on the magnetic biochar using experimental design and optimization of operational variables using the central composite design (CCD) approach of the response surface methodology (RSM) and to study the isotherm, kinetic and thermodynamics of the adsorption process including its regeneration potential.

Materials and method

Preparation and characterization of OPF magnetic biochar

Materials

All chemicals and reagents used in this study were of analytical grade. Distilled water was used for the preparation of all aqueous solutions throughout the experiment. Sodium carbonate (Na2CO3), ethanol (C2H5OH), Iron (III) chloride (FeCl3), and iron sulphate (FeSO4) were procured from Sigma-Aldrich Co. (MO, USA) and utilized without additional purification. The raw oil palm front used in this study was obtained from West Palm Oil Mill in Sime Darby Sdn. Bhd., Carey Island, Selangor, Malaysia. The feedstock was collected and oven-dried at 95℃ overnight after which it was kept in a dry air-tight glass jar at ambient temperature before subsequent procedures.

Synthesis of OPF magnetic biochar

Oil palm frond (OPF) was initially washed using distilled water repeatedly to expunge unwanted foreign materials and other impurities. The OPF biochar was prepared by the pyrolysis method. Then, 20.0 g of washed oil palm front OPF precursor was primarily pyrolyzed between 200 and 600 °C for 3 h under the nitrogen (N2) gas condition at 230 mL/min after which the heater temperature was steadily increased for 60 min at a rate of 5–10℃/min and was enabled to cool (within 120–180 min) even under N2 flow to ambient temperature after initially being held at 500 °C for 60 min. Afterwards, the OPF biochar was milled using a high-energy ball milling technique for 3 h, sieved to a particle size < 60 μm, and rinsed with distilled water and ethanol four times to eliminate impurities. The rinsed OPF biochar was oven-dried at 110 °C for 24 h and then kept in airtight 80-mL borosilicate glass vials prior to further use. Next, 12.5 g of the dried OPF biochar was soaked in a solution containing 100 mL of 0.125 mol. L−1 of FeSO4 and FeCl3 of 0.25 mol. L−1 solution was uniformly stirred via the magnetic stirrer. The mixture was further subjected to heat at 60 °C with steady stirring to allow successful saturation of Fe2+ and Fe3+ into OPF biochar and subsequently allowed to cool to 40 °C. Then, 10 mol/L sodium carbonate (Na2CO3) solution was dropwise added to the mixture under robust magnetic stirring, to raise the suspension pH to 10–11, and the solution transformed from brownish green to black. Fe3O4 precipitation was developed on the surface of biochar materials under alkaline conditions. Upon the completion of the reaction, the Na2CO3-saturated biochar solution was sufficiently stirred for 60 min to attain a homogenous mixture and better dispersion. The resultant solution was separated using an external magnet and washed with distilled water to alter the solution pH to 7 and then dried at 70 °C for 12 h. The final obtained samples were stored in sealed containers and utilized during the adsorption experiments and in the biochar characterization. The synthesis route for the production of magnetic biochar from OPF as precursory material is illustrated in Fig. 1.

Fig. 1
figure 1

Synthesis of OPF magnetic biochar

Characterization of OPF magnetic biochar

The surface properties of the magnetic biochar were examined using the N2 vapour adsorption/desorption method to determine its effective surface area, pore volume, and pore diameter at 77 K using a nano-porosity system (NP-XQ, Mirae Scientific Instruments, South Korea). The morphology at the surface of the Na2CO3 magnetic biochar was obtained using scanning electron microscopy, Hitachi S2300 model which was conducted at 25 kV accelerating voltage. The elemental composition of the surface properties was obtained using a scanning electron microscope equipped with energy-dispersive X-ray spectroscopy (SEM–EDS, Inspect F, FEI Co., USA) analyser. Before SEM–EDX, the test samples were carbon-coated using an Edwards Scancoat machine to reduce the possibility of a charging effect. The degree of crystallinity of the magnetic biochar was evaluated using X-ray diffraction (XRD, D8 Advance Sol-X, Bruker Co., USA). The surface functional properties of the magnetic biochar were investigated using a Fourier transform infrared (FT-IR) spectrometer, (NICOLET iS10, Thermo Scientific, USA). A test sample was used to examine the magnetic moment of Na2CO3 magnetic biochar conducted at room temperature using a vibrating sample magnetometer (VSM, Lake Shore Cryotroni, USA). The functional groups were obtained from the FT-IR spectra in the range of 4000–400 cm−1. X-ray diffraction (XRD) was used to investigate the chemical and phase composition of the synthesized biochar adsorbents at Cu Kα radiation (2ϴ spectrum = 20–80°; phase = 0.05° 2ϴ; time per step = 0.2 s) via X-ray powder diffractometer (Philips, X’pert Pro PANAlytical PW3040 MPD). The specific surface area, pore width, and pore volume of the OPF biochar and the magnetic biochar were obtained, respectively, using the Brunauer–Emmett–Teller (BET) (Micromeritics ASAP 2020 system, USA).

Batch adsorption studies

Synthetic dyes procured from MP Bio-medicals, LLC of high purity grade (> 99.9%) which are CV(C25N3H30Cl) and SY(C16H10N2Na2O7S2) having a molecular weight of 407.979 and 452.37 g/mol, respectively, were used as model adsorbate. The chemical structures of CV and SY are illustrated in Fig. 2. In the study, 1000 mg/L stock solution was prepared in a volumetric flask by dissolving 1.0 g/L of the respective dyes with deionized water to obtain the desired concentrations. Static equilibrium adsorption experiments were performed in a thermostat shaker model HZ-9211 K which was set to 150 r/min at temperature intervals according to the experimental design. The adsorption kinetic study was conducted at a predetermined time interval based on the optimized time condition from the experimental run. At the end of the equilibrium time, the supernatants were drawn for content investigation.

Fig. 2
figure 2

Chemical structure of CV and SY dyes

The adsorption capacity at equilibrium \((q_{e,} {\text{mg}}/{\text{g}}\)) was evaluated from the mass balance equation according to the equation [1].

$$ q_{e} = \left( {\frac{{C_{{i - C_{f} }} }}{m}} \right)v $$
(1)

where Ci and Cf denote the initial and residual dye concentrations (mg/L), respectively, V is the volume of the dye solution (L), and M indicates the weight of the adsorbent (g).

RSM-CCD experimental design and process optimization

The effect of operational variables was determined through batch study to determine the adsorption efficiency of the magnetic biochar for the removal of CV and SY. The effect of pH, initial concentration, and contact time was investigated using the central composite design (CCD) of the response surface methodology (RSM) (JMP Pro 12.2 software, SAS Institute, Inc.). The experimental design showing the low, medium, and high levels of each design variable used to generate a table of experimental runs is presented in Table 1. This is to evaluate the relationship between the process variables as a function of the per cent removal of dyes investigated using a second-order degree polynomial equation. The variables are denoted accordingly as initial concentration \((X_{1} )\), pH \((X_{2} )\), contact time \((X_{3} )\), and temperature \((X_{4} )\). On the basis of this matrix, 30 experimental runs were generated. The experiments were carried out according to the matrix design given by the CCD as an expression for the responses (% dye removal). The interaction of the independent variables is represented using a response surface equipped with the CCD to establish the relationship of the complex function of the responses according to Eq. (2).

$$ Y = \beta_{0} + \mathop \sum \limits_{I = 1}^{K} \beta_{I} X_{i} + \mathop \sum \limits_{I = 1}^{K} \beta_{II} X_{i}^{2} + \sum \mathop \sum \limits_{I > j}^{K} \beta_{Ij} X_{1} X_{j} + \euro $$
(2)
Table 1 Design matrix for CCD: variables, domain, and design interval

where β0 and βi signify the constant coefficient, and Xi represents the linear coefficient of the input parameters. βii denotes the quadratic coefficient of the input parameter, Xiβij is the interaction coefficient between the input parameter Xi and Xj, and  shows the error of the model.

Equilibrium kinetics, isotherm, and thermodynamic studies

To study the kinetics of adsorption of CV and SY on magnetic biochar, four kinetic models were used for the expression of adsorption properties of the magnetic biochar for the removal of CV and SY. The models are the pseudo-first-order model, pseudo-second-order model, Elovich, and intraparticle diffusion model.

The pseudo-first-order and pseudo-second-order equations are given by (7) and (8), respectively.

Pseudo-first-order model:

$$ \ln \left( {Q_{e} - Q_{t} } \right) = \ln Q_{e} - k_{1} t $$
(3)

Pseudo-second-order model:

$$ \frac{t}{{Q_{t} }} = \frac{1}{{K_{2} Q_{e}^{2} }} + \frac{1}{{Q_{e} }}\left( t \right) $$
(4)

\(Q_{e}\) represents equilibrium adsorbate concentration, \(Q_{t}\) expresses the amount of adsorbate adsorbed at time t, and \(k_{1}\) (1/min) and \(k_{2}\) (g/(mg min)) are the adsorption rate constants.

Elovich's model assumed that equilibrium occurs over a long period without giving an account of the rate of desorption. The linearized form of the equation is given by Eq. (5).

Elovich model:

$$ q_{t} = \frac{1}{\beta }\ln \alpha \beta + \frac{1}{\beta }\ln t $$
(5)

where α indicates the initial adsorption rate (mg/g min), and β is the desorption constant. The slope 1/β and the intercept represent ln (αβ)/β were obtained from the plot of ln t versus q.

The mechanism of interaction of the adsorbent and adsorbate was determined using the intraparticle diffusion model according to Eq. (6).

$$ {\text{Intraparticle}}\;{\text{diffusion}}\;{\text{model}}:\; = q_{t} + k_{i} t^{{0.5}} + c $$
(6)

where \(q_{t}\) is the amount of adsorbed CV and SY, kip is the rate constant of the intraparticle diffusion model (mg/g min0.5), and c is the intercept.

The interpretation of the equilibrium process is important to establish the relationship between the analyte and the bio-adsorbent under different experimental conditions. This is to provide an appropriate outline for an optimum operational procedure. In this study, the Langmuir, Freundlich, Temkin, and Dubinin–Radushkevich isotherm models were used to fit equilibrium isotherm data to analyse the adsorption of CV and SY dyes adsorbed on the interface of the magnetic biochar.

The Langmuir isotherm is denoted by:

Langmuir isotherm:

$$ \frac{1}{{ q_{e} }} = \frac{1}{{q_{m} }} + \frac{1}{{K_{L} q_{m} C_{f} }} $$
(7)

where \(q_{m} \) describes the maximum monolayer adsorption capacity (mg/g), and \(q_{e}\) represents the equilibrium biosorption capacity of CV and SY adsorbed on the magnetic biochar. \(C_{f} \) is the equilibrium of dye concentration (mg/L), and \(K_{L}\) indicates the Langmuir constant (L/mg).

The Freundlich isotherm is denoted by:

Freundlich model:

$$ \log q_{e} = \log K_{f} + \frac{1}{n}\log C_{f} $$
(8)

where \( q_{e}\) represent equilibrium biosorption capacity of CV and SY adsorbed on the magnetic biochar \(K_{f} \) indicates the Freundlich constant indicating the degree of adsorption ((mg/g) (L/mg) 1/n), 1/n denotes the adsorption capacity, and \(C_{f}\) represents the Equilibrium concentration of CV and SY in solution (mg/g).

The Temkin isotherm is denoted by:

Temkin model:

$$ q_{e} = \, B\ln A + \, B\ln C_{f} $$
(9)

where B = RT/bb indicates the Temkin constant related to the heat of sorption (J/mol); A represents the Temkin isotherm constant (L/g), R is the gas constant (8.314 J/mol K), and T is the absolute temperature (K). The constants A and b can be obtained from the plot of \(q_{e}\) against \( \ln C_{f}\).

The Dubinin–Radushkevich isotherm is represented by:

Dubinin–Radushkevich model:

$$ \ln q_{e} = \ln q_{m} - \beta \varepsilon^{2} $$
(10)

where β and ε represent the model parameters, ε = RT. \({\text{ln}}\) (1 + \(\frac{1}{{C_{f} }}),\) the adsorption process’s free energy is given by: E = \(\frac{1}{{\surd 2{\upbeta }}}\).

The thermodynamic constants were used to determine the effect of temperature on the rate of adsorption of CV and SY on the magnetic biochar which was derived from the Van’t Hoff equation. The thermodynamic parameters which were the Gibbs free energy of adsorption (ΔG°), entropy (\(\Delta S^\circ\)), and enthalpy (ΔH°) changes were evaluated for the CV and SV dye adsorption data at a temperature interval of 293–303 K. The parameters were represented by Eqs. 1113, respectively.

$$ \Delta G^\circ = - {\text{RT}} \ln K_{d} $$
(11)
$$ \Delta G^\circ = \Delta H^\circ - T \Delta S^\circ $$
(12)
$$ \ln K = \frac{\Delta S^\circ }{R} - \frac{\Delta H^\circ }{{{\text{RT}}}} $$
(13)

where R (8.314 J/mol K) represents the universal gas constant, T (°K) denotes the absolute temperature, and Kd defines the dissociation constant.

Regeneration study of magnetic biochar

To carry out the regeneration study, the saturated magnetic biochar was contacted separately with (0.1 mol/L) 0.1 M HCl, methanol, and NaOH as eluting agent. The adsorbed CV and SY were desorbed under 2 h at an agitation speed of 150rm conducted at 25 °C. After separating the magnetic biochar from the solution, the CV and SY concentration in the supernatant was analysed. The filtered analytes were investigated using a visible spectrophotometer (PerkinElmer Lambda 25 UV/VIS spectrophotometer) to determine the residual dye concentration. For each of the removal cycles under optimal conditions, the magnetic biochar was washed twice with deionized water before the next cycle. The desorption of efficiency of the magnetic biochar in terms of CV and SY was evaluated according to Eq. (14).

$$ {\text{Desorption}}\;{\text{efficiency}}\;\left( \% \right)\; = \;\frac{{\text{Amount of dye desorbed}}}{{\text{Amount of dye adsorbed}}} \times 100 $$
(14)

Results and discussion

Physicochemical characteristics of biosorbents

Elemental dispersive X-ray (EDX) analysis of the synthesized pristine OPF biochar (neat biochar) and the magnetic biochar is presented in Table 2. The EDX spectra are shown in Fig. 1. The elemental composition of C and O in terms of atomic percentage featured predominantly in both the neat and magnetic biochar. It was indicated that the neat biochar exhibited higher total carbon contents (85.60%) which can better be explained as a result of high pyrolysis temperature (500 °C) which tends to form a higher degree of carbonization (Zhao et al. 2019; Wang et al., 2020). Conversely, magnetic biochar was seen to be composed of higher oxygen atoms by 35.31% (Khan et al. 2020). Presumably, more oxygen functional groups on the surface of the magnetic biochar relative to the starting material create the possibility of enhanced adsorption capacity. Notably, the increase in Fe content compared to 0% Fe content in the pristine biochar indicated successful modification of the magnetic biochar and also revealed the incorporation of Fe in the biochar matrix.

Table 2 Elemental analysis of the OPF biochar (wt%)

The surface morphology of the phases of biochar transformation was obtained using SEM analysis. As shown, Fig. 3a–d illustrated the SEM images of pristine OPF biochar, magnetic OPF biochar before adsorption, magnetic biochar after adsorption of SY, and magnetic biochar after adsorption of CV, respectively.

Fig. 3
figure 3

Surface morphology of a OPF, b magnetic biochar c Adsorption of CV on magnetic biochar d Adsorption of SY on magnetic biochar

The structure of pristine OPF biochar (Fig. 3a) exhibited a smooth and porous surface as compared to the surface of magnetic biochar which was expectedly rough, compact, and tightly packed as a result of rich microparticles originating from the accumulation of Fe which was incorporated in the surface of the biochar. The surface of magnetic OPF biochar developed a considerable amount of pore channels as well as interior mesopores as shown in Fig. 4b, providing sites for the binding effect of dye molecules on its surface. The formation of a series of cavities over the surface of OPF was linked to the breakdown of lignocellulosic biomass at elevated temperatures, causing the evaporation of volatile compounds from the freshly formed pores (Arafat Hossain et al. 2017; Kong & Liu 2021). Figures 3c, d illustrated that the surface of OPF biochar was clustered and covered by attachments which were further proven to be iron oxide by the EDX analysis and revealed the binding of dye molecules of CV and SY on its surface samples following the adsorption test. A significant number of nanoparticles were discarded on a porous biochar surface. It is expected that during the adsorption process, the dyes were trapped onto the surface of biochar and the iron (Fe) nanoparticles strengthened the attachment through the interaction with the dye molecules.

Fig. 4
figure 4

Magnetic properties analysis of OPF

The hysteresis loops of OPF magnetic biochar were determined using VSM magnetic measurement system under room temperature to evaluate the magnetic behaviour of OPF magnetic biochar. As demonstrated in Fig. 4, the characteristic saturation magnetization of OPF magnetic biochar was found to be 8.41 emu/g, which implies that OPF magnetic biochar can be facilely separated from an aqueous solution using an external magnetic field. Also, coercivity (Hc) and retentivity (Mr) of 83.106 G and 1.475 emu/g, respectively, revealed that OPF magnetic biochar demonstrated superparamagnetic properties at room temperature and was able to offer suitable magnetic responsive characteristics to an external magnetic field. Therefore, the potential of the OPF biochar to be readily recollected from the aqueous solution by applying the external magnetic field makes its reusability possible in the real wastewater treatment process.

The surface properties were obtained using the assessment of the functional group profiles of OPF biochar and magnetic biochar via FTIR spectra analysis. The predominant functional groups which include C=O, C–OH, C=C, and –OH were dominant features of the adsorbents. In Fig. 5a, the broad peaks around 3800–3000 cm−1 and the peak around 1250 cm−1 denote the presence of hydroxyl and carboxyl groups, respectively, on the surface of the OPF biochar (Zahedifar et al. 2021). The stretching frequency at 2349 cm−1 shows the presence of NH2 symmetric stretching. The peaks at 1740.29 cm−1 are assigned to the stretching vibration of C=C in aromatic rings. The characteristic peaks around 580 and 753 cm−1 typically represent Fe–O, indicating the deformation in the hexagonal sites of iron oxide (Feng et al. 2023) (Fig. 5b). There was no noticeable shift in the FT-IR spectra attributed to C-O groups before and adsorption of CV and SY dye in Fig. 5b and C. The band intensity of COOH decreases after the adsorption of the dyes molecules, respectively, indicating that favourable adsorption occurred as a result of electrostatic interaction between the COOH group on the surface of the magnetic biochar and the dye molecules (Molla et al. 2019).

Fig. 5
figure 5

Surface functional groups on a Neat biochar b magnetic biochar c adsorption of CV d Adsorption of SY

X-ray diffraction analysis illustrates the nature of the planes and size of a material (Shitu et al. 2023). The crystalline structures of both the neat and magnetic OPF biochar were examined using XRD diffraction spectra. The X-ray diffraction patterns (XRD) of neat and magnetic OPF biochar were in the range of 20–80° are shown in Fig. 6. The diffraction spectra of the synthesized neat OPF biochar showed the existence of hematite (Fe2O3). The diffraction peaks of neat OPF biochar at 2ϴ were 18.48° and 44.56° indexed to the (003) and (104) hkL planes, respectively, which corresponds to standard card Inorganic Crystal Structure Database (ICSD No. 98–006-4887). The OPF magnetic biochar exhibited diffraction peaks at 2ϴ of 24.15°, 33.18°, 35.62°, 40.87°, 49.48°, 54.11°, 62.45°, and 72.05° which were found to be indexed to the (012), (104), (110), (113), (024), (116), (214), and (1010) hkL planes, respectively, corresponding satisfactorily with the database of Fe2O3 standard card Inorganic Crystal Structure Database (ICSD No. 98–010-4924) with lattice parameter (a = b = c) of 23.8012 Å with a space group of R-3 m and substantiates the signature peaks of a hexagonal unit cell Fe2O3, respectively, with no impurity peak in the XRD pattern noticed. This signifies that the Fe2O3 particles were favourably crystalline hexagonal spinel structures. There were no other peaks associated with another material detected from the XRD result, which confirmed that the nano-magnetite was pure hematite (Fe2O3). The XRD spectra of Fe2O3 indicated that both Fe2O3 and neat OPF biochar patterns overlapped in the XRD spectra of OPF magnetic biochar, indicating successful synthesis of OPF magnetic biochar. This suggested good agreement with the FT-IR result signifying the successful incorporation of Fe2O3 nanoparticles in the matrix of the OPF biochar (Feng et al. 2023; Shitu et al. 2020).

Fig. 6
figure 6

X-ray diffraction (XRD) analysis of OPF biochar and magnetic biochar

The textural properties of the OPF biochar and the magnetic biochar were obtained from the BET analysis. It was revealed that the major physical factors influencing the adsorption of CV and SY were the specific surface, pore volume, and pore width of the magnetic biochar as shown in Table 3. Relative to the pristine biochar, the specific surface area of the magnetic biochar decreased. This was indicated in the SBET of 280 m2/g, 0.042 as exhibited by the OPF biochar compared to the magnetic biochar (162.1998 m2/g). The specific surface area of the magnetic biochar was expected to decrease, this was attributed to the high carbonaceous surface area and its surface area composed of Fe3O4 (Li et al. 2019). The result was in agreement with the previous study (Zhou et al. 2018).

Table 3 Specific surface area and pore structure variables of neat and magnetic OPF biochar

The N2 adsorption/desorption isotherms for OPF biochar and magnetic biochar are illustrated in Fig. 7. It was revealed that the pristine biochar and the magnetic biochar exhibited type 1 V curves. From Fig. 7a, a slow steady increase in the amount of adsorption was achieved at lower pressures. Meanwhile, as the relative pressure became higher, H4 hysteresis loops were achieved which illustrated the evidence of the existence of a mesoporous surface. This is further confirmed in Fig. 7b, as indicated in the particle size distribution that equivalent particle sizes between the ranges of 18–42 nm were predominant and clustered on the surface of both the neat biochar and the magnetic biochar.

Fig. 7
figure 7

Surface properties a N2 adsorption/desorption isotherms for OPF biochar and magnetic biochar b Particle size distribution of neat biochar and magnetic biochar

Optimization of dye adsorption using RSM

In this study, a second-order quadratic model was used to fit experimental data obtained from the adsorbed CV and SY on the synthesized OPF magnetic biochar using design expert 6.0.4. The result in terms of coded form is presented in Eqs. 15 and 16, respectively.

$$ \begin{aligned} \% Y_{1} \; = & \;{\text{CV}}\;{\text{Removal}}\; = \;81.7 + 1.56\;X_{1} - 1.35X_{2} - 2.78X_{3} - 0.0897X_{4} + 2.87X_{1}^{2} \\ - & \;0.08X_{2}^{2} + 1.75X_{3}^{2} + 4.75X_{1} X_{2} + 1.01X_{2} X_{3} \\ \end{aligned} $$
(15)
$$ \begin{aligned} \% Y_{2} \; = & \;{\text{SY}}\;{\text{Removal}}\; = \;79.58 + 2.72\;X_{1} - 1.37X_{2} - 2.87X_{3} - 1.54X_{4} + 1.83X_{1}^{2} \\ - & \;0.59X_{2}^{2} + 3.27X_{3}^{2} + 1.23X_{1} X_{3} \\ \end{aligned} $$
(16)

The significance and adequacy of the quadratic models were evaluated using the result of ANOVA which analyses the variation between the significance of the model prediction and experimental error compared to the variation in terms of residual error. The positive/negative sign in the quadratic model equation reflects the synergistic and antagonistic effect of the process variables. It was clear that pH and adsorbent dose have a synergistic effect on CV removal efficiency and pH and initial concentration has a profound synergistic effect on the adsorption efficiency of SY which implies that enhanced adsorption efficiency of the magnetic biochar favours the increased adsorption of CV at low pH and increase in adsorption dose. Furthermore, an increase in adsorbent dosage and a low initial concentration increased the adsorption efficiency of magnetic biochar for the removal of CV dye molecules. Meanwhile, low pH and high initial concentration influenced improved adsorption of magnetic biochar for SY removal.

Statistical analysis

The Fisher’s value F-test which expresses the ratio of the mean value and the residual error is used to evaluate this comparison (Motaghi et al. 2021). The result as presented in Table 4 and Table 5 revealed that the F-values for both responses demonstrated high values. As shown, it is revealed that model F-values for CV and SY removal were 10.59 and 14.56, respectively, at P < 0.0001, indicating the adequacy and significance of the model for the prediction of the responses can be explained by the regression equation. The associated P value evaluates whether the F-values were large enough to indicate statistical significance (Dhiman et al. 2017; Wang et al. 2022). Both CV and SY adsorption models exhibit a type of Prob. > F (P values) less than 0.05 which indicated 95% confidence levels, thereby affirming that the proposed models are statistically significant under the designed operational conditions. For the adequacy of the fit model, the R2 value must be greater than 0.80 including the difference between R2 and R2Adj which must be less than 0.20 (Rasuli et al. 2021; Liu et al. 2018).

Table 4 ANOVA model for the second-order quadratic model for the adsorption of CV
Table 5 ANOVA Model for the second-order quadratic model for the adsorption of SV

As shown in Table 6, high correlation coefficient (R2) values of 0.9081 and 0.9315 for the OPF-derived magnetic biochar indicated the suitability of the model to estimate CV and SY removal, respectively. The effectiveness of the model was further demonstrated by the close agreement between the adjusted R2 values (0.8223) and the predicted R2 values (0.6138) for CV removal and the adjusted and predicted R2 values 0.8675 and 0.7359, respectively, for SY removal. Adeq Precision’ which is a measure of the signal-to-noise ratio is desirable if the value is greater than 4 (Wu et al. 2021b). The ratio of 12.79 and 15.59 indicated that the model exhibited adequate signal for CV and SY implying that the model can sufficiently navigate the design space. The magnitude of lack of fit proved to be insignificant for both CV and SY which corresponds to the lack of fit of F-values which was found at 0.72 and 0.54, respectively. Similarly, the lack of fit of P values was found at 0.69 (CV) and 0.81 (SY) indicating that the lack of fits was not significant relative to pure errors. Also, the F-values can be attributed to the noise levels in the model.

Table 6 Summary of model fit for quadratic model data

Interactive effect of the adsorption variables

Three-dimensional response surfaces represent CV and SY removal on the magnetic biochar. Each response surface plot was evaluated as a function of the interactive effect of two process variables. Figures 8a–c illustrated the 3D response surface plots for percentage removal of CV dye on magnetic biochar as a function of pH and adsorbent dose, pH and initial concentration, and adsorbent dosage and initial concentration, respectively. Accordingly, Fig. 8a shows that the response surface plot revealed that the removal percentage increased as pH increased from 7.5 to 11. At lower pH in the acidic condition, a decrease in the percentage removal of dye was achieved. In a basic medium, more hydroxide ions (OH-) are accumulated on the surface of the magnetic biochar which creates a negative surface charge of adsorbent thus favouring the adsorption of positively charged CV through electrostatic interaction (Yamada et al. 2022). The increase in adsorbent dosage significantly improved the removal capacity, because of the availability of excess active sites for CV dye adsorption. Further increase in adsorbent dosage and removal capacity declines due to the agglomeration of adsorbent particles (Sabna et al. 2016). Figure 8b shows that significant removal of CV dye was found to be attributed to the good interactive influence of pH and initial concentration. An increase in pH as the initial concentration was decreased indicated that a lower initial concentration facilitates a larger sum of available adsorption sites on the sorbent surface which consequently increases the per cent removal of CV(Esmaeilian & O'Shea 2022). There was a slight increase but no significant difference in the per cent removal of CV (> 99%) as the adsorbent dosage was increased from 0.5 to 1 g/L at a lower initial concentration (Fig. 8c). Based on our results, it implies that a sorbent dose within 1 g/L at dye concentrations lower than 50 achieved optimum CV removal from the solution under controlled laboratory conditions. Figure 8d–f represents a 3D response surface plot as a function of the interaction of pH and adsorbent dosage, pH and initial concentration, and pH and temperature, respectively, for the removal of SY from the solution. It is revealed in Fig. 8d and e that the effect of the interaction of the process variables proportionately influenced the adsorption efficiency of the magnetic biochar for the removal of SY. High removal efficiency of magnetic biochar favoured the removal of SY at low pH (acidic medium) and low concentration. Similarly, an increase in adsorbent dosage favoured an increase in the per cent removal of SY at low concentrations indicating that sufficient adsorption sites were made available for the attachment of dye molecules on the surface of the magnetic biochar. An increase in temperature from 20 to 40 °C has no significant influence on the adsorption capacity of the biochar at a low concentration of the adsorbate (Fig. 8f).

Fig. 8
figure 8

3D Response surface plot of the interactive effect of factors for 9 a, b, c Adsorption of CV; 9 d, e and f Adsorption of SY

The effect of the interaction of the independent variables on the responses is illustrated in Fig. 9(a and b) which shows that under optimum conditions of pH, adsorbent dose, initial concentration, and temperature at 95% confidence level (P < 0.05), the higher adsorption efficiency of magnetic biochar was achieved for the adsorption of CV and SY indicating that the adsorption of efficiency of the magnetic biochar was influenced optimally by the synergistic interaction of the four process variables.

Fig. 9
figure 9

Interaction of the four process variables for a Adsorption of CV and b Adsorption

Optimization of dye adsorption

The removal efficiency of the magnetic biochar can be rationalized by determining the best operational conditions of the process variables which enhanced the adsorption of CV and SY from the solution. This was achieved using the optimization function of the design expert. The optimum values of the parameters were obtained as a function of the desirability coefficient. The result is presented in Table 7. It was revealed that an increase in pH and adsorbent dosage at a low initial concentration favoured optimum adsorption efficiency of the magnetic biochar for CV removal. Conversely, in the case of SY removal, low pH and an increase in the adsorbent dosage at a low initial concentration significantly influenced the adsorption efficiency of the magnetic biochar. The highest per cent removal of CV was achieved at pH 11 (P < 0.05) in four-factor process variables. This means that under the highest basic condition, the optimum percentage removal of CV was achieved which implies that the dominance of negative charges on the surface of the magnetic biochar under alkaline conditions created the strong electrostatic attraction of the CV dye molecules to the surface of the biochar due to deprotonation of hydroxyl functional groups, most likely electrostatic attraction occurred between the positive charge of the dye molecules and the negative surface of the magnetic biochar (Al-Ghouti & Al-Absi 2020; Uddin et al. 2017). However, due to electrostatic repulsion as a result of the positively charged surface of the magnetic biochar in an acidic medium, less adsorption occurs on the surface of the magnetic biochar. In contrast, increased per cent removal of SY corresponding to 100% was achieved (P < 0.05) on the surface of the magnetic biochar in an acidic medium (pH 4) and the adsorption capacity decreased in an alkaline state (Litefti et al. 2019). An increase in the initial concentration of the dyes from 50 to 150 mg/L resulted in to decrease in the adsorption capacity of the magnetic biochar. The optimum adsorption capacity of the adsorbent for the removal of CV and SV was favoured at low initial concentration and increased dosage. This behaviour can best be attributed to the availability of active adsorption sites which increases as the adsorbent mass increases.

Table 7 Optimum operational conditions for dye adsorption

Adsorption kinetics, isotherm, and thermodynamic studies

Adsorption kinetics

Kinetic study was investigated to understand the adsorption phenomenon of magnetic biochar for the removal of CV and SY. The adsorption kinetic data obtained according to Eqs. 3 and 4 were fitted to the pseudo-first-order (PFO) and pseudo-second-order (PSO). The linear relationship of the models is shown in Table 8. The linear plot of kinetic data expressing PFO and PSO is illustrated in Figs. 10a, b.

Table 8 Kinetic model parameters for CV and SY dye removal
Fig. 10
figure 10

Pseudo-first-order kinetics a adsorption of CV and SY; b Pseudo-second-order kinetics adsorption of CV and SY

The results of the linear fit in terms of the high correlation coefficient of the kinetic models revealed that PSO was found not to be only suitable for the adsorption process for both CV and SY but was also reflected in the equilibrium adsorption capacity of about 228.8 mg/g and 223.2 mg/g, respectively, relative to the result of the experimental adsorption capacities of CV (188.64 mg/g) and SY (221.3 mg/g). These results confirmed that the interaction of CV and SY molecules on the sites of the magnetic biochar followed the PSO model which at best can be described to be chemical in nature. The rate-limiting process may be influenced by the chemical interactions that involve the exchanging of valence forces or by the sharing electrons between magnetic biochar particles and the molecules of the dyes on the surface (Chen et al. 2019). Within the initial 15 min, the adsorption of CV increased rapidly with a removal efficiency of 30.9% achieved after which the rate of adsorption decreased until equilibrium was attained at 75 min of contact time with maximum adsorption efficiency of 85.7% achieved. For the adsorption of SY, adsorption was rapid in the initial 20 min of contact time with a removal efficiency of 63.29% achieved. After then, the rate of adsorption was slow until equilibrium was achieved after 90 min with a maximum removal efficiency of 93.02% achieved. Rapid adsorption of CV and SY at the initial stage of contact time can be attributed to the strong attraction between the dye molecules and the availability of large binding sites from the surface of the biochar. The diffusion of dye molecules drifts into the unoccupied adsorption sites slowly as the contact time increases until equilibrium is achieved after 75 and 90 min of CV and SY dye adsorption. Kumbhar et al. (2022) synthesized magnetic biochar composite from tea waste/Fe3O4 for efficient adsorption of crystal violet dye. Their investigation achieved almost 98.7% adsorption of crystal violet dye at 90 min contact time.

The contact time of adsorption on biochar for pollutant species in the wastewater treatment process depends on the scale, type of treatment system, and the targeted contaminant for remediation. For instance, in the study by Santhosh et al. (2020) titled Synthesis and Characterization of Magnetic Biochar Adsorbents for the removal of Cr(VI) and Acid orange 7 dye from aqueous solution, maximum adsorption of 90 and 95% was achieved at the equilibrium time of 160 min for both pollutants. Oladipo et al. (2018) produced magnetic biochar from chicken bones which achieved 96% adsorption of Rhodamine B at a contact time of 60 min in a two-stage stirred adsorber system. Kumbhar et al. (2022) reported the synthesis of tea waste/Fe3O4 magnetic composite (TWMC) for efficient adsorption of crystal violet dye: Isotherm, kinetic, and thermodynamic studies and achieved 98.7% adsorption of crystal violet dye at 90 min contact time.

It can be inferred that the adsorption of CV and SY on the surface of OPF-derived magnetic biochar was through a chemical reaction that occurred over a relatively long time of 75 and 90 min, respectively, before equilibrium adsorption was achieved for CV and SY adsorption.

To investigate the dynamics of the process of adsorption, intraparticle kinetic and Elovich models were applied according to Eqs. 5 and 6. As shown in Figs. 11a, b, it was revealed that the linear plots of CV and SY dye adsorption fitted to the intraparticle model indicated multi-linear plots. Accordingly, two substantial steps characterized the removal mechanism of both dyes. The first step signified the transfer of CV and SY dye molecules from the solution to the surface of the magnetic biochar otherwise influenced by instantaneous adsorption or adsorption on the external surface (Xu et al. 2021). The second step indicated pore diffusion of the dye molecules into the pores of the active sites of the magnetic biochar. Adsorption of dyes at this stage was predominantly by intraparticle diffusion. There seems to be a slowdown in intraparticle diffusion towards the end of the second stage due to low residual dye concentration in the dye solution (Choudhary et al. 2020). Other adsorption pathways other than only intraparticle diffusion defined the adsorption process of dye adsorption. It is clear that the kinetic data fitted to the intraparticle model revealed that the linearized plots did not pass through the origin for both CV and SY removal indicating that the adsorption rate was controlled by the external surface adsorption and liquid film diffusion (Fan et al. 2017).

Fig. 11
figure 11

a Intraparticle adsorption of CV and SY; b Elovich adsorption of CV and SY

The Elovich model which is the fourth kinetic model used defines expresses heterogeneous surface compatible with chemisorption kinetics (Rahpeima et al. 2018). The R2 value from the model which were 0.747 and 0.814 for CV and SV removal indicates that the irregular microstructure of the magnetic biochar partly may have influenced the adsorption process.

Adsorption isotherm

The equilibrium adsorption models which were Langmuir, Freundlich, Temkin, and Dubinin–Radushkevich (D-R) isotherm models were used to fit experimental data to describe the adsorption process of CV and SY on the magnetic biochar according to Eq. 710. The results from the linearized plots revealed that the Langmuir model exhibited the highest R2 value of 0.991 and 0.98 for the removal of CV and SY, respectively, which indicated the adsorption process occurred on the monolayer surface of the magnetic biochar (Fig. 12a). The high maximum adsorption capacity (\(q_{\max }\)) and \(K_{L}\) values for both dyes (Table 9) confirmed that Langmuir's theory can effectively explain the removal of the dyes on the surface of the magnetic biochar. The values of the dimensionless constant \( R_{L}\) from the expression of \( R_{L}\) \(= \frac{1}{{1 + C_{O} K_{L} { }}}\) for CV and SY removal were 0.00011 and 0.00009 which indicated favourable adsorption of the dyes on the magnetic biochar since 0 < \( R_{L}\) < 1 describes favourable adsorption, \( R_{L}\) > 1 indicates unfavourable adsorption, \( R_{L}\) = 0 implies irreversible adsorption, and \( R_{L}\) = 1 demonstrates linear adsorption (Oyekanmi et al. 2021; Chen et al. 2020). The order of the values of \({ }R_{L}\) which showed that CV > SY indicated consistency with the order of the values of the maximum adsorption capacities of the two dyes which were 149.03 and 342.47 mg/g, respectively, demonstrating that the adsorption process was significant on a monolayer coverage on the magnetic biochar.

Fig. 12
figure 12

Equilibrium isotherms Adsorption of CV and SY; a Langmuir; b Freundlich c Temkin; d D-R

Table 9 Isotherm model parameters for CV and SY dye removal

As shown in Table 10, multilayer adsorption of CV and SV on the heterogeneous surface of the magnetic biochar as represented by the model Eq. (8) described the experimental data fitted to the Freundlich isotherm. The slope of 1/n and the intercept which was obtained from \({\text{ln}} K_{f}\) the linearized plot revealed that occasionally the removal of the dyes occurred on the surface of the magnetic biochar as a result of unequal sites for adsorption on layers of the adsorbent surface (Fig. 12b). The R2 values of 0.9730 and 0.9599 were achieved for the adsorption of CV and SY, respectively.

Table 10 The thermodynamic parameters for the adsorption of CV and SY on magnetic biochar

Temkin isotherm assumed that the heat of adsorption of dye molecules decreased linearly with increased adsorption coverage due to adsorbent–adsorbate interaction. The slope B and intercept \({\text{ ln}}C_{f}\) obtained from the isotherm Eq. (6) were evaluated from the linearized plot as shown in Table 5. This is illustrated in Fig. 13c. The R2 values of CV and SY on the magnetic biochar were 0.9759 and 0.9780, respectively.

Fig. 13
figure 13

a Desorption b regeneration efficiency of magnetic biochar for CV and SY removal

The Dubinin–Radushkevich (D-R) isotherm which describes the mechanism of dye adsorption and the energy of adsorption on the magnetic biochar was evaluated according to Eq. (10). The slope \(K_{ad}\) and the intercept \(q_{s}\) obtained from the linearized plots are shown in Table 5 including the adsorption energy equation (E) expressed \( K_{j} /{\text{mol}}\) as indicated in Fig. 13d. It was revealed that the correlation coefficients were lower than fitted data to other investigated isotherm equations. The nature of the adsorption process is determined by the magnitude of the adsorption energy equation. The nature of the adsorption process is determined by the magnitude of the adsorption energy equation which implies that adsorption is by physisorption process if (2 < E < 8 kJ/mol) but the adsorption is defined by the chemisorption process if (8 < E < 16 kJ/mol). The mean free energy as evaluated from the D-R model indicated that the magnitude of E value was 85.26 and 168.55 for CV and SY, respectively, which affirmed that the adsorption of both dyes on the surface of the magnetic biochar was by chemisorption process.

Thermodynamic study

To better understand the feasibility of magnetic biochar and its thermodynamic behaviour to describe the nature of the adsorption process of CV and SY molecules on its surface, the thermodynamic parameters were evaluated from equilibrium constants.

From the linearized plot of Van’t Hoff equation \(({\text{ln }}K_{d}\) against 1/T), ΔH° and \(\Delta S^\circ\) could be evaluated from the slope, and \(\Delta S^\circ\) is calculated from the intercept, respectively. The results are presented in Table 10. The positive values of ΔH° (change of enthalpy) indicated that the adsorption process was endothermic in nature for both CV and SY removal. Furthermore, the state of disorderliness and spontaneity at the interface of the magnetic biochar and dye molecules as expressed by the positive values of change of entropy \(\Delta S^\circ\) evidently described the adsorption process of CV and SY. It reflected the release of energy during the transfer of the dye molecules from the aqueous phase to the solid phase (Gharbani & Mehrizad 2022). Furthermore, the negative values obtained from the Gibbs free energy confirmed that the adsorption of CV and SY on magnetic biochar was spontaneous at all the studied temperatures.

Regeneration of adsorbent

The economic feasibility of adsorbent depends on its recyclability and desorption potential. In this study, 0.2 mol/L of methanol, HCl, and NaOH were applied, respectively, as desorption solution for the recovery of CV and SY from the dye-saturated magnetic biochar. It was revealed that the desorption efficiency of the magnetic biochar partly increased using the three eluting agents in the order of methanol > NaOH > HCl (Fig. 13a). Optimum desorption efficiency greater than 99% recovery of CV and SY was achieved using methanol as eluent. Therefore, the regeneration potential of the magnetic biochar was examined after each successive adsorption–desorption cycle. The adsorbent was considered fully regenerated after the dyes had been completely desorbed. It is shown in Fig. 13b that a slight decrease without significant difference in the adsorption efficiency of the magnetic biochar was achieved for CV (89.4%) and SY (87.2%) removal in the first cycle of the adsorption study. There was no significant change in the adsorption capacity until the 5th cycle indicating that the adsorption capacity of the magnetic biochar was not reduced relative to the freshly used samples which indicates its high regeneration capacity. Therefore, it can be inferred that methanol can effectively regenerate the adsorbents after the desorption of CV and SY dyes from spent magnetic biochar. The intrinsic property and the remarkable reusability potential showed that OPF-derived magnetic biochar is economically viable and can be utilized as a promising bio-adsorbent in wastewater treatment.

Possible adsorption mechanism

The underlying interactive mechanism is significant for the recovery of dye molecules by applying different adsorbents. Due to unique structural properties and active functional groups, magnetic biochar can interact with different dye molecules via different adsorption mechanisms. The evaluation of adsorption mechanisms enables the design and modification of surfaces of adsorbents to enhance interaction, and diffusion pathways of dye molecules and subsequently to enhance adsorption capacity. The selectivity of removal of dye molecules on the adsorbent–adsorbate interface creates effective design and fabrication of selective adsorbents. This section creates an insight into possible interaction mechanisms for the adsorption of CV and SY on the surface of magnetic biochar.

OPF-derived magnetic biochar mainly comprises cellulose, hemicellulose, and lignin which has oxygen-containing functional groups such as hydroxyl (OH) and carboxylic (-COOH) groups present in abundance on the surface. The possible adsorption mechanism of biochar surface with dye molecules is represented in Fig. 14. In acidic medium pH, the biochar surface was favourable for the removal of anionic dye (Sunset yellow) because the surface charge of biochar was predominated by a positive charge due to the presence of more H+. In this case, anionic dye molecules bind with positively charged biochar surfaces due to electrostatic interaction (Goswami et al. 2022; Inyang et al. 2016; Li et al. 2022).

Fig. 14
figure 14

Possible adsorption mechanism of dye adsorption on magnetic biochar

Biochar-COOH + H+………………… Biochar-COOH2+ (In acidic condition).

Biochar-OH + H+………………. Biochar-OH2+ (In acidic condition).

On the other hand, in basic pH, the biochar surface is favourable for the removal of cationic dye (Crystal violet) because the surface charge of biochar is negatively charged due to the presence of more OH. In this case, cationic dye molecules bind with negatively charged biochar surface with electrostatic interaction (Ma et al. 2020; Wu et al. 2021a).

Biochar-COOH ………………… Biochar-COO (In basic condition).

Biochar-OH ………………. Biochar-O (In basic condition).

Conclusion

The physicochemical properties of magnetic biochar produced from OPF via the facile synthesis co-precipitation method proved to possess effective adsorption capacity for the removal of CV and SY dyes from aqueous solution. The saturation magnetization of OPF biochar was found to be 8.41 emu/g, coercivity (Hc) of 83.106 G, and retentivity (Mr) of 1.475 emu/g which implies that OPF magnetic biochar can be facilely separated from aqueous solution. The result also demonstrated superparamagnetic properties provided suitable magnetic responsive characteristics to an external magnetic field. The influence of operational parameters of pH, adsorbent dosage, the initial concentration, and temperature investigated using the CCD of the RSM optimally enhanced the adsorption capacity of the magnetic biochar as reflected in its high removal efficiency for CV and SY removal. Kinetics of adsorption showed that the pseudo-second-order model best-fitted equilibrium data implying that the adsorption process of both dye molecules was predominated by chemisorption. The isotherm experimental data were fitted best to the Langmuir isotherm model which demonstrated that the removal of CV and SY dyes on the magnetic biochar occurred on monolayer surface coverage. Maximum adsorption capacities of CV and SY dyes (149.03 and 342.47 mg/g), respectively, indicated that the adsorption process was significantly on a monolayer coverage on the magnetic biochar.

Furthermore, the adsorption process was predominantly spontaneous and endothermic in nature. The regeneration potential of the spent magnetic biochar indicated that desorption of the dye molecules and its adsorption capacity was not largely affected after 5 cycles of regeneration relative to adsorption on freshly synthesized magnetic biochar. The adsorption capacity of the OPF-derived magnetic biochar for the adsorption of CV and SY from aqueous solution was attributed to the adsorbent–adsorbate interaction which was achieved by electrostatic attraction. The surface properties demonstrated that OPF magnetic biochar can be effectively utilized for the treatment of dyes containing effluent.