1 Introduction

The transition towards cleaner production in the dyeing industry requires the implementation of cost-effective and sustainable treatment methods for complex dyeing wastewater. Azo dyes are a class of synthetic organic chemicals that are extensively employed in the textile and paper industries. They make up a considerable component of the yearly global dye production, which surpasses 7 × 105 tons [1]. It is important to keep in mind that reactive dyes might lose up to 50% of their potency throughout the dyeing process. Organic compounds known as reactive dyes, such as reactive black 5 (RB5), show resistance to aerobic digestion and are well-known for having a high resilience to light, heat, and oxidizing agents [2, 3]. They are also deemed undesirable due to their strong visibility even at low concentrations [4]. The hydrolysis of RB5 hinders its reusability, necessitating its disposal or elimination prior to environmental discharge. This underscores the importance of devising actionable strategies to minimize dye wastage and enhance the sustainability of dyeing operations within these industries [5, 6].

Various technologies have recently been used to remove RB5 from wastewaters such as Fenton oxidation [7], chemical coagulation [8, 9], photocatalytic degradation [10], flocculation [11], anion exchange [12], biodegradability [13], electrochemical oxidation [14, 15], and adsorption [16]. However, most of these technologies suffer high cost and difficulties in safe disposal which restricted their broad implementation. Adsorption is consequently regarded as the most advantageous method among the aforementioned ones due to its affordability, simplicity of use, and adaptability of design [5].

Carbon-based materials have garnered much attention for their potential as effective adsorbents for organic pollutants, such as dyes and antibiotics. Among these materials, traditional carbon-based substances have been extensively studied thus far [17]. Due to its high carbon content, variety of functional groups, large specific surface area, outstanding stability, and exceptional adsorption capacity, biochar (BC) has attracted a lot of interest as a promising adsorbent [18, 19]. However, it is worth noting that BC typically exhibits a negative surface potential over a broad pH spectrum and may reduce its attraction for certain pollutants. Its practical applications have also been hampered by difficulties in recovering and separating BC as well as its restricted adsorption ability as a result of few active sites and a poor pore structure [20]. By integrating several metals, including iron oxide (such as Fe2O3 and Fe3O4), into the BC structure, researchers have created and analyzed magnetically recoverable BC, known as magnetic BC, to solve these difficulties [21].

Magnetic ferrites, such as CoFe2O4, CuFe2O4, ZnFe2O4, NiFe2O4, and others, exhibit interesting chemical, structural, and magnetic properties which have recently piqued the attention of researchers as inorganic phase in the development of magnetic BC [22]. Due to their physiochemical properties’ magnetic ferrite/BC materials have been employed in a variety of applications. For instance, MgFe2O4/BC, CoFe2O4/BC and MnFe2O4/BC have been utilized as magnetic adsorbent for efficient removal of phosphate and heavy metals [23, 24]. NiZnFe2O4 with LDH and its composite with carbon nanotubes are have been applied for efficient removal of azo dyes from wastewater [25]. Additionally, BC was doped with N, and S in order to improve its chemical and physical properties [26].

Green synthesis represents an emerging domain within nanotechnology that focuses on the fabrication of nanomaterials using natural biomaterials like plants, flowers, and microorganisms. This eco-friendly approach is often referred to as "green chemistry," emphasizing its commitment to sustainability and environmentally benign processes [27]. This approach capitalizes on the rich repository of naturally occurring chemical compounds present in plants. According to literature the aqueous extract of Beta vulgaris (Sugar beet) contains different bioactive compounds such as Betalains (e.g., betacyanins and betaxanthins), flavonoids, polyphenols, and saponins [28] which serves as a dual function: as a complexant and a gelling agent in the formation of nanomaterials.

In this prospective, the primary objectives of the study were as follows: i) to develop a novel, cleaner, and sustainable CuZnFe2O4@N,S-doped biochar (CZF@N,S-BC) using Beta vulgaris (Sugar beet) leaf extract and to characterize its morphological and physicochemical properties through various analytical techniques; ii) to optimize the adsorptive removal conditions of RB5 from industrial effluents using the synthesized CZF@N,S-BC; iii) to investigate the selectivity of CZF@N,S-BC toward a spectrum of reactive and azo dyes; iv) to elucidate the interaction mechanisms between CZF@N,S-BC and RB5 through kinetics, isotherm studies, and XPS analyses; v) to assess the efficacy of CZF@N,S-BC in removing RB5 from real wastewater samples in the presence of coexisting ions; vi) to leverage the facile separation of the composite for regeneration and reuse experiments.

2 Materials and methods

2.1 Materials

All chemicals and reagents utilized in this study were of analytical grade as stated in supplementary text S1. The chemical structure of RB5 is depicted in Fig. S1 and the characteristics of RB5 are represented in Table S1.

2.2 Preparation of plant extract

Fresh specimens of Beta vulgaris (sugar beet) were collected from the experimental farm of the Agriculture Research Center (ARC), Alexandria-Egypt during the period of April to June. Plant specimens were washed using tap water then distilled water to remove any dust and impurities. Subsequently, plant leaves were shredded into small pieces and oven dried at 60 ℃. The dried specimens were ground into a fine powder using a stainless-steel mill to ensure homogeneity. The resulting powder was stored in a dark bottle at room temperature for future use. For the extraction process, a specific amount of the fine powder was soaked in distilled water (5%, w/v) and gently stirred at 70 °C for 20 min, resulting in a reddish-brown extract. The extract was then filtered using Whatman filter paper number 1, and the clear solution obtained was stored in sterilized falcon tubes in a refrigerator at 4 °C for subsequent use.

2.3 Synthesis of copper zinc ferrite (CZF) metallic composite

To synthesize the copper zinc ferrite (CZF) composite, Beta vulgaris leaves extract was utilized. In an Erlenmeyer flask, 30 mL of the plant extract was added to a solution containing different concentrations of metal ions: Cu+2 (0.271%), Zn2+ (0.72%), and Fe3+ (4.81%). The plant extract was added dropwise with vigorous stirring for 1 h until the color of the solution changed to dark brown. Subsequently, the solution was heated in a water bath at 90 ℃ for 2 h. After heating, the solution was centrifuged and washed three times using ethanol and distilled water. The resulting black solids were then dried overnight at 80 ℃ in oven. Finally, the powder was calcinated in a furnace at 600 ℃ for 4 h to obtain the CZF metallic composite.

2.4 N, S doped biochar fabrication

Biochar (BC) was prepared using Beta vulgaris leaves. In a typical experiment, 10 g of the plant leaves powder was pyrolyzed under anxious conditions at 400 ℃ for 1 h. The solid product obtained was washed 3 times with ethanol and mixed with 0.1 HCl (1:10, v/v) at room temperature for 24 h for purification. The material was subsequently soaked in distilled water multiple times until the pH became neutral. Finally, BC was obtained by drying at 60 ℃ overnight, and its yield was approximately 50% based on the dry mass of the used plant's powder. Doping of BC was achieved by thermally decomposing thiourea with BC in a ratio of BC to thiourea (2:1, w/w). The mixture was then transferred into a porcelain crucible. The crucible containing the mixture was calcined at 350 ℃ for 1 h under anxious conditions. After calcination, the crucible was allowed to cool naturally to room temperature. The resulting modified BC was purified by washing with ethanol and distilled water to remove impurities, and then dried overnight at 60 ℃. The final product obtained from this process was labeled N,S-BC, indicating the nitrogen and sulfur doping of BC.

2.5 Formation of CZF@N,S doped BC

The CZF@N,S-doped BC composite was synthesized via a simple one-pot hydrothermal method. Initially, 2 g of as-prepared N,S-BC and CZF were immersed in 120 mL of ethanol and 30 mL of deionized (DI) water, separately. Then the solutions were mixed and stirred magnetically for 30 min at room temperature. Subsequently, the solution was sonicated for 30 min and vigorously stirred for another 4 h. Afterward, the solution was thoroughly washed with ethanol and DI water multiple times, followed by oven drying at 60 ℃ overnight to obtain the final CZF@N,S-BC composite product. The fabrication process of the composite is illustrated in Fig. 1. The prepared materials were characterized utilizing different tools as explained supplementary text S2.

Fig. 1
figure 1

Illustrative diagram for the green fabrication of i) CZF, ii) N,S-BC, and iii) CZF@N,S-BC composite

2.6 Adsorption experiments

RB5 was selected as the model pollutant to assess the effectiveness of the fabricated composite, CZF@N,S-BC composite. A stock solution of RB5 with a concentration of 1000 mg/L was prepared and kept in the dark. A series of required dilutions were conducted to obtain solutions of concentrations (10–100 mg/L). The adsorption experiment was carried out in 50 mL conical flasks containing 20 mL of RB5. The flasks were placed on an orbital shaker and shaken at a speed of 200 rpm at a temperature of 298 K. pH was examined in the range (2–11) and the CZF@N,S-BC composite dose was carried out in the range (10–80 mg). To study the effect of temperature on the adsorption capacity, a temperature-controlled shaker was used to adjust the temperature of the solution. The concentration of RB5 in the solution was determined by employing a double beam UV–visible spectroscopy, with a maximum wavelength of 598 nm. The adsorption capacity and the removal efficiency (%R) were calculated using the following equations:

$$\mathrm{\%}R =\frac{{C}_{o}-C}{{C}_{o}}\times 100$$
(1)
$$q =\frac{{(C}_{o}-C)\times V}{m}$$
(2)

where Co and C are the concentration of the RB5 in (mg/L) at the beginning and a specific time, respectively. V symbolizes the RB5 volume in L, and m symbolizes CZF@N,S-BC mass in g.

2.7 Selectivity test

The selectivity was performed to assess the adsorption capacity of the CZF@N,S-BC composite for different anionic dyes. The tested dyes included dark green vat dye 1 (DGV1), red vat dye 03 (RV03), red reactive dye 120 (RR 120), reactive blue dye 19 (BR 19), and dark blue vat dye 44 (DBV 44). The selectivity adsorption study was conducted with an equilibrium time 60 min., pH 2, an adsorbent dose of 10 mg, and fixed RB5 initial concentration of 100 mg/L. The residual concentration of unadsorbed dyes was measured using a double beam UV–visible spectroscopy, with a maximum wavelength as represented in Table S2 concentration of different dyes was. The aim of this study was to evaluate the composite's effectiveness in removing a range of anionic dyes, providing insights into its potential application for the removal of various dye pollutants from wastewater.

2.8 Regeneration experiment

To evaluate the reusability of the adsorbent, desorption of RB5 was performed using a 0.1 M NaOH solution. Initially, 10 mg of CZF@N,S-BC composite was applied for the desorption process of RB5 (100 mg/L). The desorption procedure was carried out for 60 min at room temperature with 200 rpm of stirring. Following desorption, CZF@N,S-BC composite was separated and dried at 50 ℃ for subsequent desorption cycles.

3 Result and discussion

3.1 Characterization of CZF@N,S-BC composite

The proposed interaction mechanism between CZF@N,S-BC composite components is illustrated in Fig. 2A. BC is rich in various functional groups, including carbonyl, carboxyl, hydroxyl, and phenyl which have been identified and verified through FTIR analysis (Fig. 2B). Following the doping process of BC with N, and S via thermal decomposition of thiourea, N was introduced in the form of amine (-NH2) or amide (-CONH2). Similarly, the doping of BC with S resulted in the formation of sulfide (-SH), thiol (-S-), and sulfonic acid (-SO3H) groups. Subsequently, the interaction between N,S-BC and CZF occurred through the coordination bonding between the hydroxyl, and carboxyl, groups present on N,S-doped BC surface. This interaction was facilitated by subjecting the materials to sonication for a duration of 30 min. The formation of coordination bonds was confirmed by both FTIR and XPS analytical techniques (Figs. 2B, 4).

Fig.2
figure 2

(A) Proposed interaction mechanism between CZF@N,S-BC components, (B) FTIR, (C) XRD pattern CZF@N,S-BC and its components, and (D) VSM of CZF and CZF@N,S-BC composite

3.1.1 FTIR

Figure 2B represents FTIR spectra of dry plant biomass, pristine BC, N, S-BC, CZF, and CZF@N,S-BC composite. The FTIR spectrum of plant biomass revealed a broad signal at 3423 cm−1 ascribed to -OH. Additionally, other peaks are observed at 2926, 1639, 1385, and 1095 cm−1, corresponding to C-H (alkanes), -NH2+, C-H, and stretching C-O, respectively. The presence of an absorption peak at 525 cm−1 indicates vibrational bending in aromatic compounds of the plant. Regarding the FTIR spectrum of pristine BC, the -OH group disappears, and the NH2 group shifts to a lower wavenumber (1548 cm−1). Moreover, a new absorbance peak at 470 cm−1 emerges, attributed to the Si–O-Si (siloxane) stretching vibrational band. Following the doping BC with N and S, a new peak at 2140 cm−1 appears which is corresponding to the stretching N = C = S (isothiocyanate), confirming the successful doping process. The FTIR spectrum of CZF revealed two peaks at 461 and 525 cm−1, corresponding to the octahedral M–O stretching vibration site, [29]. FTIR spectrum of CZF@N,S-BC composite shows a distinct shift and decrease in absorbance of the -OH peak from 3423 to 3359 cm−1, indicating the formation of a coordination bond between the metal (CZF) and the OH group in the BC [30].

3.1.2 XRD

In Fig. 2C, the XRD pattern unveils distinctive profiles for pristine BC, N,S-BC, CZF, and CZF@N,S-BC composite. Notably, the pristine BC showcases a broad peak at 2θ = 24.15°, aligning with the C (002) plane index. This alignment is connected to the parallel arrangement of aromatic and carbonized structures. A slightly less intense peak at 2θ = 45.51° also becomes apparent, attributed to the C (100) diffraction of graphite and hexagonal carbons. These observations provide valuable insights into the dimensions of the aromatic lamina within the BC structure [31]. Shifting our focus to N,S-BC, distinct peaks emerge at 2θ values of 31.70°, 56.43°, 66.24°, and 75.19°, correspondingly mapping to the planes (002), (100), (422), (220), and (311). These discernible peaks serve as affirmative markers of the successful doping of nitrogen and sulfur within the BC matrix. Similarly, the CZF and CZF@N,S-BC composite unveil intensified peaks at 2θ values of 30°, 35.43°, 38.79°, 42.95°, 53.45°, 56.81°, and 62.5°. These peaks are in congruence with planes such as [(111), (220), (311), (222), (400), (422), and (511)], as denoted by JCPDS card no: 82–1042 [29]. The alignment of these peaks provides unequivocal evidence for the formation of the magnetic CZF and CZF@N,S-BC composite, confirming their distinct structural composition.

3.1.3 VSM

The magnetic hysteresis loops of pure CZF, and CZF@N,S-BC composite at room temperature are shown in Fig. 2D. The formation of a well-saturated M-H loop demonstrates that all of the samples are ferromagnetic. The coercivity value of pure CZF was 196.48 G, and the value decreased after the interaction with N,S-BC. Additionally, the saturation magnetization of pure CZF was also decreased after the interaction with N,S-BC from 34.88 emu/g to 12 emu/g which can be attributed to its interaction with the non-magnetic N,S-doped BC. The magnetization of (Ms) of the resultant CZF@N,S-BC is substantially lower than that of pure CZF nanoparticles due to the nanomagnetic N,S-BC coating and its crucial function in isolating the magnetic CZF nanoparticles [32]. However, CZF@N,S-BC composite still exhibited strong magnetic properties making it easy to separate it from the medium using an external magnet.

3.1.4 SEM and EDX

The morphologies of dry plant biomass, pristine BC, N, S-doped BC, CZF, and CZF@N,S-BC composite was analyzed using SEM images (Fig. 3). The surface of dry plant biomass (Fig. 3A,B) exhibits a diverse range of textures, ranging from smooth to rough, reflecting variations in the plant's structures and cell types [33]. The pristine BC (Fig. 3C, D) displays a smooth and uniform surface, devoid of visible roughness or irregularities, indicating a well-structured outer layer. It possesses a distinct porous structure consisting of interconnected channels and multilayer formation, with the majority of pores observed at the nanoscale. After doping BC with N and S, aggregates with irregular shapes are formed, uniformly distributed on the surface (Fig. 3E, F). These aggregates contribute to an increase in pore size. Furthermore, the morphology of CZF reveals the formation of sheet-like structures (Fig. 3G), along with aggregates of particles exhibiting spherical and rod shapes (Fig. 3H). The morphology of CZF@N,S-BC composite (Fig. 3K, L) displays an uneven distribution of CZF particles on the surface of the N,S-BC, confirming the successful attachment and formation of the composite structure. To explore the elemental distribution, EDS was performed on a subsurface sample of CZF@N,S-BC composite (Fig. 3M). The EDS analysis confirmed the existence of C, O, N, S, Fe, Cu, and Zn throughout the sample. This indicates successful and uniform incorporation of these elements into the BC matrix, supporting the desired composition of CZF@N,S-BC composite.

Fig. 3
figure 3

SEM images of (A, B) plant biomass, (C, D) BC, (E, F) N,S-BC, (G, H) CZF, (K, L) CZF@N,S-BC composite, and (M) EDX of CZF@N,S-BC composite

3.1.5 XPS

The XPS wide and high-resolution spectra of CZF@N,S-BC composite are shown in Fig. 4A. Wide spectrum reveals the presence of Cu2p, Fe2p, Zn2p, O1s, C1s, N1s, and S2p. The Cu2p spectrum (Fig. 4B) showed two peaks; the first one for Cu 2p3/2 (932.58 eV), and the second for Cu 2p1/2 (953.94 eV), indicating the presence of Cu2+ ions. The Fe2p high-resolution spectrum (Fig. 4C) confirms the existence of both Fe2+ and Fe3+ as evidenced by the specific peaks of Fe2+ 2p3/2, Fe2+ 2p1/2, Fe3+ 2p3/2, and Fe3+ 2p1/2 at 710.9, 724.48, 713.67, and 727.29 eV, respectively. In the Zn2p high-resolution spectrum (Fig. 4D), two peaks are observed: one at 1021.21 eV for Zn 2p3/2, and the other at 1044.21 eV for Zn 2p1/2, confirming the presence of Zn2+ in the CZF. Furthermore, the O1s high-resolution spectrum (Fig. 4E) exhibits three distinct peaks at 529.67, 531.83, and 531.09 eV, corresponding to C-O, O–H, and O-C = O, respectively. The high-resolution spectrum for C1s (Fig. 4F) reveals characteristic peaks for C–C, C–OH, and C-O at 284.45, 275.71, and 287.7 eV, respectively. The N1s high-resolution spectrum (Fig. 4G) indicates the presence of pyridine and pyrrolic at 398.7 and 399.9 eV, respectively. The incorporation of N atoms into the highly congested BC structure results in bond reconstruction [26]. Furthermore, the S2p high-resolution spectrum (Fig. 4H) shows the splitting of the S2p peak into two linked peaks: S 2p1/2 and S 2p3/2. The adjacent peaks at 163.27 and 164.76 eV corresponding to thiophenic S (C-S-C) and S–H, respectively. Additionally, the peaks at binding energy of 165.86 eV for S–O and 168.93 eV for SO3-H are attributed to oxidized sulfur [C-SOx-C (x = 2,3,4)] [34].

Fig. 4
figure 4

(A) XPS wide spectrum of CZF@N,S-BC composite, and high-resolution spectra of (B) Cu2p, (C) Fe2p, (D) Zn2p, (E) O1s, (F) C1s, (G) N1s, and S2p (H)

3.2 The performance of CZF@N,S-BC composite in removal of RB5

3.2.1 Comparison test

In order to scrutinize the effectiveness of the different components (CZF, pristine BC, and N, S-BC) in the CZF@N,S-BC composite for RB5 removal, a comparative study was conducted at RB5 initial concentration 100 mg/L, adsorbent dose 0.01g, pH 2, and equilibrium time 60 min. The removal efficiencies of pristine BC, CZF, N, S-BC, and CZF@N,S-BC composite were found to be 20.36, 51.94, 64.07, and 88.10%, respectively, with corresponding adsorption capacities of 40.73, 103.89, 128.14, and 176.50 mg/g (Fig. 5A). The results clearly demonstrated that the CZF@N,S-BC composite exhibited higher adsorption capacity and removal efficiency compared to its individual components. This could be attributed to the synergistic effect achieved through the incorporation of magnetic ferrite (CZF) and N,S-BC, which provides additional active sites and larger surface area for adsorption. Consequently, CZF@N,S-BC demonstrated a strong affinity for RB5 adsorption, facilitated by electrostatic interactions between the positively charged surface of the composite and the anionic RB5, as well as through coordination and outer-sphere complexation.

Fig. 5
figure 5

(A) Comparison of different components for the removal of RB5 removal, (B) ZP of CZF@N,S-BC composite and effect of (C) pH, (D) initial concentration, (E) dose, and (F) temperature on the removal of RB5 onto CZF@N,S-BC composite

3.2.2 pH influence

The pH of the solution has a significant impact on the adsorption capacity and removal efficiency of reactive dyes. It influences the surface charge of the adsorbent, the ionization of the dye molecules, and the dissociation of functional groups on the active sites of the adsorbent. In the batch experiment conducted with an equilibrium time of 60 min, a constant adsorbent dose of 10 mg and RB5 initial concentration of 100 mg/L were used. Zeta potential measurements (Fig. 5B) revealed that the composite exhibited different surface charges across the pH range of 2 to 11, with a peak at pH 2 (32 mV) and a value of -25.3 mV at pH 11. The point of zero charge for the composite was determined to be approximately pH 5.3 (Fig. 5B). The effect of pH on the adsorption capacity of RB5 was also investigated within the same pH range (2–11). The highest removal capacity of RB5 was observed at pH 2, with a value of 176.50 mg/g and a corresponding removal efficiency of 88.1% (Fig. 5C). As the pH increased, the adsorption capacity gradually decreased, reaching its lowest uptake at pH 11 (46.51 mg/g) with a removal efficiency of 23.25%. This trend can be attributed to the strong electrostatic interaction between the highly positive charge of the composite and the negative charge of the anionic dye. Anionic dyes exist in a dissociated form as anionic dye ions, as depicted by the following equation:

$$\text{RB}5-\text{SO}3\text{Na}\;\left(\text{in water}\right)\rightarrow \text{RB}5-\text{SO}3-+\text{Na}+$$

The obtained results indicate that acidic conditions are favorable for the removal of RB5 due to the presence of the SO3 group in the structure of RB5. Under acidic pH, the positively charged surface of the adsorbent interacts more strongly with the negatively charged RB5 molecules, promoting adsorption. However, under alkaline conditions, the presence of excess OH groups can compete with the anionic RB5 dye for adsorption sites, leading to a lower adsorption capacity. The influence of pH on RB5 removal has been investigated by various researchers using different types of adsorbents, and consistent findings have been reported [25, 35]. have reported that the maximum adsorption of RB5 occurs under acidic conditions.

3.2.3 Initial concentration influence

According to Fig. 5D, increasing the RB5 concentration from 10 to 100 mg/L resulted in a favorable improvement in the removal efficacy. The value of q increased from 18.72 to 176.50 mg/g as the RB5 concentration was raised. This may be due to the augmentation in the dynamic forces, overcoming the ions transfer resistance that occurs in the bulk solution and handicapping the migration of ions to CZF@N,S-BC composite [36]. However, this increase in the initial RB5 concentration resulted in a decrease in the R% of RB5 from 93.6% to 88.1% (as shown in Fig. 5D). This decline can be attributed to the insufficient presence of active sites on the CZF@N,S-BC composite necessary for adsorbing high concentrations of RB5 [37].

3.2.4 Dose influence

Figure 5E illustrates the effect of different doses of the adsorbent on the uptake of RB5. The batch adsorption experiment was conducted with an equilibrium time of 60 min, pH 2, and a fixed initial RB5 concentration of 100 mg/L. The results depicted in Fig. 5E indicate that increasing the dose of CZF@N,S-BC composite from 10 to 80 mg enhances the removal efficiency of RB5 from 88.1% to 96.5%. This enhancement can be attributed to the availability of a higher number of active binding sites on the surface of the composite, facilitating more effective adsorption of RB5. However, it is important to note that increasing the dose of the adsorbent at a fixed RB5 concentration and volume eventually leads to adsorption site saturation, resulting in a decrease in the equilibrium adsorption capacity from 179.20 mg/g to 24.14 mg/g. This implies that an excessive amount of adsorbent beyond a certain point does not significantly contribute to the adsorption process. Furthermore, as the accumulation of the adsorbent increases, the surface area decreases, which also impacts the adsorption capacity. Therefore, determining the optimal dose of the adsorbent is crucial to ensure sufficient active sites for effective adsorption without reaching adsorption site saturation [38].

3.2.5 Temperature influence

Figure 5F depicted the influence of temperature variation in the range (25–65 ℃) onto the sorption capacity and removal efficiency of RB5. A significant change in the adsorption capacity and removal efficiency from 176.50 to 186.27 mg/g and 88.1% to 93.13%, respectively was observed as the solution temperature increases from 25 to 65 ℃. The increase in temperature activates more adsorption sites on the surface of the CZF@N,S-BC composite, leading to enhanced adsorption capacity. Additionally, at higher temperatures, there is increased surface coverage of RB5 molecules on the adsorbent due to more favorable interactions between the dye ions and the composite surface. Furthermore, the increase in temperature promotes the migration of RB5 ions towards the surface of the CZF@N,S-BC composite, facilitating their adsorption. This phenomenon can be attributed to the increased kinetic energy of the dye molecules, enabling them to overcome the energy barrier and reach the adsorption sites more efficiently [1].

3.2.6 Influence of contact time

Fig. 6 (A, B) demonstrates the influence of contact time on the adsorption capacity and efficiency of the CZF@N,S-BC composite for RB5 at different initial concentrations ranging from 10 to 100 mg/L. The adsorption process of RB5 exhibited a fast initial kinetics phase within the first 60 min, followed by a gradual plateau phase that extended until 210 min. The maximum removal efficiency for different initial concentrations (10–100 mg/L) and the adsorption capacity of RB5 ranged from 93.63% to 88.10% and 18.72 mg/g to 176.50 mg/g, respectively. As depicted in Fig. 6(A, B), as the contact time increased, the removal and uptake of the dye initially escalated and eventually reached a state of equilibrium. This behavior suggests that the adsorbent's active sites were readily available at the onset of the adsorption process, owing to the high concentration of the solute [39]. After some time, the dye absorption rate was only very low, with few active sites on the surface of CZF@N,S-BC composite

3.3 Mechanism of RB5 adsorption onto CZF@N,S-BC composite

Attaining a comprehensive insight of the adsorption process and characterizing the interaction between the adsorbent and adsorbate are crucial aspects of any adsorption process. To achieve this, various kinetic and isotherm models were employed, allowing for a thorough investigation of the interactions between these compounds.

3.3.1 Application of different kinetic models to the adsorption data

The experimental data were analyzed using several linear kinetic models, including the Pseudo-first order (PFO), Pseudo-second order (PSO), Fig. 6(C, D), and Elovich models (Fig. S2). The linear calculations for these models can be found in Table S3. The results in Table 1 indicate that the PFO model yielded low R2 values for all RB5 concentrations (Fig. 6A), with K1 values ranging from 0.039 to 0.040. Additionally, the adsorption capacities calculated from the PFO model (qCal) were significantly lower than the experimental data (qexp) for all initial RB5 concentrations. On the other hand, the PSO model exhibited an excellent fit to the adsorption of RB5 onto the CZF@N,S-BC composite, with R2 values close to 1.0 for all concentrations (Fig. 6B). Moreover, there was good agreement between the PSO-calculated adsorption capacities (qcal) and the experimental data (qexp), further confirming the suitability of the PSO model to describe the adsorption process. It was observed that as the initial RB5 concentrations increased, the PSO rate constant (K2) gradually decreased from 0.018 to 0.00032, indicating chemical adsorption of RB5 onto the CZF@N,S-BC composite [5]. Furthermore, the lower value of Chi-square (χ2) suggests a good fit of the data to the PSO model. The Elovich model parameters (α and β) suggest that the adsorption rate of RB5 is higher than the desorption rate (Table 1). This is indicated by the fact that α is greater than β, which signifies the effective adsorption of RB5 onto the composite material. The higher value of α implies a faster adsorption process compared to the desorption process, further confirming the favorable adsorption characteristics of RB5 onto the composite material [40].

Fig. 6
figure 6

Kinetic representation of the removal of RB5 onto CZF@N,S-BC composite; (A) R% versus time, (B) qt versus time, (C) pseudo-first order linear plot, (D) pseudo-second order linear plot

Table 1 Kinetic parameters of the RB5 adsorption CZF@N,S-BC composite

3.3.2 Fitting of adsorption data using numerous isotherm models

In order to assess the theoretically calculated adsorption capacities, the most commonly available isotherm models used were Langmuir, Freundlich, Temkin, and D-R. Fig. S3 shows linearized fits of isotherm models, and Table S4 summarizes the linear equations for these models. According to the R2 values derived from the linear models (Table 2), the adsorption of RB5 in CZF@N,S-BC composite follows Freundlich model as R2 value ~ 1.0 compared to Langmuir model (0.954), Temkin (0.908), and D-R (0.684). The maximum adsorption capacity (qmax) of RB5 on CZF@N,S-BC composite was determined from the Langmuir model was 276.57 mg/g. It was confirmed by Freundlich that RB5 adsorption was favorable onto CZF@N,S-BC composite where n > 2. Temkin model proposed that RB5 adsorption occurred through physical interaction since b < 80 kJ/mol. The intended binding energy calculated from the D-R model \(({\text{E}}=\frac{1}{\sqrt{2 {K}_{ad}}}\)), which is less than 8 kJ/mol, supports this finding.

Table 2 Values of the isotherm parameters for the adsorption of RB5 onto CZF@N,S-BC composite

3.3.3 Thermodynamics of adsorption

The thermodynamic effects of RB5 adsorption onto the CZF@N,S-BC composite was evaluated by calculating the thermodynamic parameters, including the change in enthalpy (ΔH, kJ/mol), change in Gibbs free energy (ΔG, kJ/mol), and standard entropy (ΔS, J/K mol), using the equations summarized in Table S5.

The obtained thermodynamic parameters obtained from the van't Hoff plot are presented in Table 3. The positive value of ΔH (11.91 kJ/mol) indicates that the adsorption of RB5 onto the CZF@N,S-BC composite is an endothermic process. This suggests that the adsorption of RB5 is driven by physical interactions, as the magnitude of ΔH is less than 80 kJ/mol, which is typically associated with chemical adsorption. These findings are consistent with the negative value of ΔG, which confirms the spontaneous nature of the physical adsorption process. The positive value of ΔS indicates that the migration of RB5 ions occurs randomly between the solid–liquid interfaces. Fig. S4 represent Van't Hoff’s plot for adsorption of RB5 on CZF@N,S-BC.

Table 3 Parameters of thermodynamic of the RB5 removal onto CZF@N,S-BC

3.3.4 Selective adsorption study for different anionic dyes

Exploration of the selectivity of the adsorption process can provide a basis for targeting and comparing the adsorption efficiency of the synthesized composite for removing different azo dyes from solution. Figure 7 showed the decrease in UV–visible spectra and the discoloration of different anionic dyes. The adsorption rates of DBV 44, BR 19, RR 120 are very low, less than 40% and 80 mg/g, while the adsorption efficiencies and rates of RV 03, DGV 1, are much higher, more than 50%, and 100 mg/g (Fig. 8A). The adsorption of RB5 onto CZF@N,S-BC composite showed much higher adsorption efficiency and capacity compared to the other dyes (88.25%, 176.50 mg/g). In the light of the results obtained, the selectivity of CZF@N,S-BC composite toward RB5 is much higher than the other dyes.

Fig. 7
figure 7

UV–visible spectra of different anionic dyes before and after the adsorption onto CZF@N,S-BC composite

Fig. 8
figure 8

(A) Removal efficiency and adsorption capacity of CZF@N,S-BC composite towards different anionic dyes, (B) UV–visible spectrum versus time for the removal of RB5 from real water sample by CZF@N,S-BC composite with (C) digital photos before and after adsorption

3.3.5 Adsorption from real water sample

The detailed methodology for the removal of real wastewater sample has been discussed in supplementary text S3. The results demonstrated that the composite successfully removed RB5 from the water sample, as evidenced by the reduction in the UV-absorbance (Fig. 8B). Moreover, visual observations indicated a significant change in the color of the water sample after 270 min of treatment, as depicted in Fig. 8C. The disappearance of the color further confirmed the effective removal of RB5 by the fabricated composite. Additionally, the treatment process led to notable changes in the characteristics of the water sample. The specific alterations observed in various parameters are presented in Table 4, highlighting the positive impact of the treatment on the wastewater quality. Overall, these findings demonstrate the potential of CZF@N,S-BC composite in treating real wastewater samples, particularly in removing reactive dyes like RB5. The significant improvements in water characteristics validate the efficacy of the fabricated composite as an efficient treatment option for industrial wastewater from the textile dyeing industry.

Table 4 Characteristics of real water samples before and after treatment with CZF@N,S-BC composite

3.3.6 Effect of interfering ions

Real water samples often contain various harmful contaminants that can compete with RB5 ions for binding sites on CZF@N,S-BC composite. In order to assess the effectiveness of the adsorbent in removing RB5 in the presence of these competing ions, an investigation was conducted using anionic ions such as Cl, NO3, SO42−, and HCO3, as well as cationic ions including Na+, K+, Ca2+, and Mg2+. Batch adsorption experiments were carried out with the concentration of these ions set at 0.1 M, an initial RB5 concentration of 100 mg/L, pH value of 2, 10 mg of adsorbent, and an equilibrium time of 60 min. Results indicated that the presence of coexisting ions had an insignificant impact on the uptake and adsorption of RB5, as shown in Fig. 9A, B. It was observed that monovalent cationic ions such as Na+ and K+ caused a slight decrease in the removal efficiency, approximately 8.25%. On the other hand, the presence of multivalent cationic ions like Ca2+, and Mg2+ led to a relatively larger decline in the removal efficiency, around 10.5%. This behavior could be anticipated based on the higher charge density and stronger electrostatic interactions of multivalent cations, which might interfere to some extent with the RB5 adsorption process [2, 5].

Fig. 9
figure 9

(A, B) interfering ions effect on RB5 adsorption, (C) Regeneration of CZF@N,S-BC composite, (D) magnetic separation of adsorbent from RB5 solution

3.3.7 Regeneration

Regeneration is an important feature of the composites, which can reflect the stability of the composites to a certain degree, and the high reuse efficiency could also achieve the effect of cost reduction. The regeneration experiment (Fig. 9C) revealed that the resplendent regeneration of CZF@N,S-BC composite since the removal efficiency and adsorption capacity diminished by 30.83%, and 133.93 mg/g, respectively after 6 successive cycles. This propitious demeanor may be attributed to the durability of the synthesized composite along with their easy and impeccable separation (Fig. 9D) efficiency that prevents the loss of mass. The decline in removal efficiency observed after six successive cycles could be attributed to the partial blockage of the composite's pores.

3.3.8 Proposed adsorption mechanism

Based on the previous findings from the kinetics, isotherms, and thermodynamics, it can be inferred that the adsorption process of RB5 onto CZF@N,S-BC composite involves a synergistic interplay between chemical and physical adsorption mechanisms. To elucidate these interactions, the XPS analysis (Fig. 10) was conducted on CZF@N,S-BC composite loaded with RB5. The XPS survey analysis of CZF@N,S-BC composite loaded with RB5 (Fig. 10A) revealed the presence of a peak at 168.98 eV in the S2p spectrum, indicating the precipitation of sulfur in the form of sulfate (SO4) on the surface of the composite [38]. This observation was consistent with the S2p-spectrum (Fig. 10B), which showed characteristic peaks at 167.85 eV, associated with SO4 [41]. Another peak at 162.9 eV, attributed to metal sulfides (CuS, FeS2, ZnS), was also observed, indicating the complexation between metal ions and sulfur groups present in RB5 [42]. The Cu2p, Fe2p, and Zn2p spectra (Fig. 10C-E) exhibited significant shifts after adsorption, further confirming the formation of inner-sphere complexes between the metal ions as a Lewis acid and sulfur groups in RB5 as a Lewis base. The N1s spectrum (Fig. 10F) displayed peak shifts from 398.26 eV and 399.8 eV to 398.32 eV and 399.61 eV, respectively. These shifts are most likely caused by the electrostatic interaction between the RB5 anions and the positively charged composite material. Additionally, the formation of hydrogen bonds between the amine group (NH2) and the pollutant may also contribute to these observed shifts. Additionally, the O1s spectrum (Fig. 10G) showed peak shifts from 529.76 eV, 531.83 eV, and 531.09 eV to 530.41 eV and 532.34 eV, respectively. The disappearance of the peak at 531.09 eV, which corresponds to O-C = O bonds, suggests the formation of coordination bonds between oxygen and the metals in the composite. Furthermore, the adsorption of RB5 onto the composite was facilitated by the abundant OH groups through hydrogen bonding, and the π-π stacking between the aromatic rings of RB5 and the aromatic rings on the surface of the BC [43].

Fig. 10
figure 10

XPS of CZF@N,S-BC composite after RB5 removal; (A) survey, (B) O1s, (C) N1s, (D) S2p, (E) Cu2p, (F) Fe2p, and (G) Zn2p

In summary, the combined interaction of magnetic ferrite (CZF) and N, S doped BC exhibits a synergistic effect in the effective removal of azo dyes from wastewater and enhancing the overall adsorption process. This synergistic effect involves a range of physical and chemical interactions, including hydrogen bonding, electrostatic interaction, coordination, inner-sphere complexation, precipitation, and π-π stacking, as depicted in Fig. 11. These multiple interactions contribute to the overall adsorption process and enhance the efficiency of pollutant removal. These interactions play a crucial role in the adsorption and binding of azo dyes, enhancing the overall efficiency of the removal process.

Fig. 11
figure 11

Plausible adsorption mechanism for the removal of RB5 on CZF@N,S-BC composite

3.3.9 Comparison with other adsorbents

The adsorption performance of the newly developed CZF@N,S-BC composite was compared with that of other relevant adsorbents after proving its propitious capacity and selectivity towards RB5 as well as its superb reusability (Table 5). The results showed that the composite had a higher removal efficiency and adsorption capacity for RB5 compared to other adsorbents, making them an ideal choice for practical applications in environmental remediation.

Table 5 Comparison between the absorbability of CZF@N,S-BC composite and other adsorbents on the removal of RB5

4 Conclusion

In summary, CZF@N,S-BC, a novel trimetallic composite, was synthesized using the aqueous extract of Beta vulgaris (Sugar beet) for the removal of RB5 from industrial wastewater. The morphological and physicochemical properties of the synthesized composite were examined using various techniques, confirming the successful fabrication of the CZF@N,S-BC composite. The adsorption efficiency of RB5 reached 96.5% in the CZF@N,S-BC composite within 60 min and at an adsorbent dose of 80 mg, attributed to the abundant active sites on CZF@N,S-BC. Furthermore, the adsorption capacity of the composite reached 176.50 mg/g under optimal conditions: an equilibrium time of 60 min, adsorbent dose of 0.01 g, pH of 2, and an initial concentration of 100 mg/L. The adsorption process aligned well with the PSO and Freundlich isotherm models. Additionally, thermodynamic studies indicated the favorable and spontaneous nature of RB5 adsorption onto CZF@N,S-BC. The composite also demonstrated significant removal efficiency towards a broad spectrum of reactive and azo dyes. When tested on a real wastewater sample from a textile industrial facility, the composite exhibited promising removal efficiency. Importantly, its ability for multiple recovery and reuse cycles was highlighted, facilitated by its magnetic properties that allow for easy separation from the solution without mass loss. The results of this investigation show that the sustainable magnetic CZF@N,S-BC has the potential to be a successful adsorbent for the removal of RB5 from industrial wastewater.