1 Introduction:

Phosphorus pollution in water bodies has become a critical environmental issue in recent years. Although phosphorus is an essential nutrient for plant growth, excessive amounts in water bodies can cause significant ecological imbalances (Min et al., 2020). Eutrophication, driven by an influx of nutrients such as phosphorus, leads to an overgrowth of algae and aquatic plants. This bloom obstructs sunlight from reaching deeper waters, affecting photosynthesis and the survival of submerged plants and organisms. Additionally, the decomposition of algae depletes dissolved oxygen in the water (Zeng & Kan, 2022).

Current phosphorus treatment technologies include electrolysis, chemical precipitation, and adsorption (Li et al., 2023a). Among these, adsorption technology effectively captures and removes phosphorus from contaminated water using specialized materials. This method is noted for its simplicity, cost-effectiveness, and environmental friendliness. Unlike complex biological treatments or chemical methods that might introduce additional pollutants, adsorption requires minimal setup and maintenance, avoiding harmful byproducts. Its high phosphorus removal rates make it a sustainable and practical solution for phosphorus pollution (Yang et al., 2021).

Biochar, with its porous structure and stability, is a promising material for phosphorus adsorption (Yu et al., 2022). The environmental issues associated with the disposal of sewage treatment by-products, such as sludge, necessitate alternative management strategies. Pyrolysis of sludge to produce biochar is seen as a viable option for resource recovery and waste reduction (Shi et al., 2023).

Research indicates that co-pyrolysis with materials such as bamboo (Hu et al., 2021), straw (Peng et al., 2022), and poplar (Yu et al., 2023) can improve biochar's stability and increase its specific surface area. Almond shells, abundant agricultural waste rich in alkaline earth metals, effectively promote organic matter decomposition but remain underexplored as a means to improve the adsorption capacity of sludge biochar.

The negatively charged surface of sludge biochar can create electrostatic repulsion with phosphate, impacting adsorption efficiency. Metal loading can change the surface charge and improve adsorption capacity. For example, nano-zero-valent iron-modified reed biochar has a maximum phosphorus adsorption capacity of 95.2 mg/g (Ren et al., 2021). Aluminum-impregnated biochar made from red pine residue and sludge achieves a capacity of 11.9 mg/g (Van Truong et al., 2023). Magnesium-pretreated cypress wood biochar shows capacities of 62.6 mg/g (Haddad et al., 2018). The calcium-modified corn straw biochar has a phosphorus adsorption capacity of 33.94 mg/g. Lanthanum-modified wheat straw biochar exhibits high selectivity for phosphorus. Polymetallic composite modifications, such as aluminum-iron (Huang et al., 2024), lanthanum-iron (Xu et al., 2023), magnesia-aluminum (Huang et al., 2023), and calcium-aluminum-lanthanum (Cheng et al., 2023), demonstrate different adsorption capacities. The sensitivity of the metal to phosphate (Ca > Mg > La > Al > Fe) and its availability (Fe ≈ Al ≈ Ca > Mg) should be considered during metal modification (Wu et al., 2020). Thus, calcium and magnesium emerge as the most suitable phosphate adsorbents for modified metals.

Adding metals to biochar production increases costs. These metal-infused adsorbents exhibit high selectivity for phosphate capture through precipitate formation. Despite their effectiveness, high cost and limited reusability have hindered their widespread adoption. Therefore, it is essential to promote the practical use of these adsorbents while considering their removal efficiency, accessibility, cost-effectiveness, environmental compatibility, and options for reusing saturated adsorbents.

The presence of antibiotics in aquatic environments has gained significant attention due to their widespread occurrence. Consequently, phosphorus in recycled wastewater often becomes contaminated with antibiotics, posing a potential hazard for its reuse (Cai et al., 2020). Therefore, developing techniques capable of simultaneously adsorbing phosphorus and degrading antibiotics is urgently needed.

The objective of this study is to create a highly efficient phosphate adsorbent using sludge and almond shells to remove excessive phosphate from water. This approach aims to promote the resourceful use of waste materials. Additionally, the study investigates the effectiveness of P-loaded biochar in removing antibiotics from water.

2 Materials and Methods

2.1 Reagents and Instruments

The sludge used in this study was obtained from the dewatered sludge of a sewage treatment plant located in Taiyuan City. Almond shells were sourced from rural areas, and ultra-pure water was utilized throughout the experimental procedures. The equipment used included an ultraviolet–visible spectrophotometer (UV–VIS) (752G, Shanghai Yidang Analytical Instrument Co., LTD.), an X-ray diffractometer (XRD) (Aeris, PANalytica, Netherlands), a Fourier transform infrared spectrometer (FTIR) (Spectrum Two, PerkinElmer, USA), a scanning electron microscope (SEM) (MERLIN Compact, ZEISS, Germany), a specific surface area and pore size analyzer (BET) (ASAP 2460, Micromeritics, USA), and an X-ray photoelectron spectrometer (XPS) (K-Alpha,Thermo Fisher Scientific Inc., USA).

2.2 Biochar Preparation

Almond shells were subjected to a series of processes including washing, crushing, drying, and grinding with sludge samples at 60°C. Both materials were then passed through a 100-mesh sieve. Various mass ratios of sludge to almond shells (10:0, 8:2, 5:5, 2:8, 0:10) were prepared and the resulting mixtures were soaked in a 1 mol/L MgCl2/CaCl2 solution (m(mixture): V(solution) = 1:3) for 12 h. After filtration and drying, the samples underwent pyrolysis at 800°C for 2 h under limited oxygen conditions. The resulting products were allowed to cool naturally, yielding Mg/Ca modified biochar. Subsequently, they were washed with deionized water until neutral, dried again and ground through a 100-mesh sieve. The obtained products were designated as SSMg/Ca, SA8:2 Mg/Ca, SA5:5 Mg/Ca, SA2:8 Mg/Ca, and SAMg/Ca. Additionally, mixtures of sludge and almond shell in a ratio of 2:8 were impregnated with CaCl2 and MgCl2 solutions, resulting in samples designated as SA2:8Ca/Ca and SA2:8 Mg/Mg, respectively. For comparison, biochar derived exclusively from sludge was denoted as SS.

2.3 Adsorption Experiment

The study investigated the adsorption of phosphate by co-pyrolyzed sludge-almond shell biochar. The experimental setup involved adding KH2PO4 solution and a predetermined quantity of biochar to a conical flask. Samples were collected at regular intervals, filtered using a 0.22 μm filter membrane, and analyzed for KH2PO4 concentration via ultraviolet spectrophotometry.

Initially, the influence of the sludge-to-almond shell mass ratio on phosphate adsorption was evaluated. Subsequently, the adsorption performance was examined across a pH range of 1 to 12. To assess the stability of the adsorbent in real-world scenarios, adsorption experiments were conducted in the presence of various coexisting ions (10 mM). The adsorption process was modeled using established adsorption isotherm models, and the effects of temperature were explored at 288K, 298K, and 308K. Adsorption kinetics studies were also undertaken to explore the dynamic aspects of the adsorption mechanism. The pseudo-first-order dynamics and pseudo-second-order dynamics models are shown in formulas (1) and (2):

$${q}_{t}={q}_{e}{\text{k}}_{1}(1-{\text{e}}^{-{\text{k}}_{1}\text{t}})$$
(1)
$${q}_{t}={\text{k}}_{2}{{q}_{e}}^{2}\text{t}{(1+{\text{k}}_{2}{q}_{e}\text{t})}^{-1}$$
(2)

where qt(mg/g) represents the adsorption quantity at time t, qe(mg/g) represents the equilibrium adsorption capacity, k1(min−1) represents the rate constant of pseudo-first-order dynamics. k2(g/(mg·min)) represents the rate constant of the pseudo-second-order dynamics.

The equation of Langmuir isothermal adsorption model is shown in Eq. (3):

$${q}_{e}=\frac{{\text{k}}_{\text{L}}{q}_{m}c}{1+{\text{k}}_{\text{L}}c}$$
(3)

where c represents the concentration of phosphate at adsorption equilibrium (mg/L), qm represents the maximum adsorption capacity (mg/g), qe represents the adsorption capacity at equilibrium (mg/g), KL represents the Langmuir constant (L/mg).

The equation of Freundlich isothermal adsorption model is shown in Eq. (4):

$${q}_{e}={\text{k}}_{\text{F}}{c}^{\frac{1}{\text{n}}}$$
(4)

where c represents the concentration of phosphate at adsorption equilibrium (mg/L), qe represents the adsorption capacity at equilibrium (mg/g); KF stands for adsorption constant (mg/g), n stands for the strength constant (L/g).

The parameters of adsorption thermodynamics are calculated by formulas (5)-(7):

$$\Delta {\text{G}}^{0}=-{\text{RTlnK}}_{\text{d}}$$
(5)
$$\Delta {\text{G}}^{0}=\Delta {\text{H}}^{0}-\text{T}\Delta {\text{S}}^{0}$$
(6)
$$Ln{K}_{d}=\frac{\Delta {\text{S}}^{0}}{\text{R}}-\frac{\Delta {\text{H}}^{0}}{\text{RT}}$$
(7)

where, Kd is the thermodynamic equilibrium constant, qe(mg/g) is the equilibrium adsorption capacity, Ce(mg/L) is the residual concentration of equilibrium phosphate. ∆G0(kJ/mol)、∆H0(kJ/mol) and ∆S0(kJ/mol) represent changes in free energy, enthalpy and entropy, respectively. R(8.314 J/(mol \(\bullet\) K)) is a constant, T(K) is the thermodynamic temperature.

According to formula (8), the adsorption amount of phosphate is calculated:

$${Q}_{e}=\frac{({C}_{0}-{C}_{e})V}{m}$$
(8)

where Qe is the adsorption amount (mg/g), C0 and Ce are the concentration of phosphate in the initial and equilibrium solution (mg/L), respectively. V and m are solution volume (L) and biochar mass (g).

3 Results and Discussion

3.1 Characterization of Samples

3.1.1 Surface Morphology of Biochar

The microstructure characteristics of SS and SA2:8 Mg/Ca were examined using SEM. Figure 1(a) and (b) show the unmodified biochar surface as smooth, with irregular, flaky particles lacking a clear pore structure. In contrast, Fig. 1(c) and (d) reveal that the modified biochar surface has regular spherical particles and a well-defined pore structure. These features contribute to an increased specific surface area and improved adsorption properties of the material.

Fig.1
figure 1

SEM images of SS: (a) and (b), SA2:8 Mg/Ca: (c) and (d), P-loaded SA2:8 Mg/Ca: (e) and (f)

The porous structure and specific surface area of biochar play a crucial role in determining its adsorption capacity. The Nitrogen adsorption–desorption experiment assessed these properties in both SS and SA2:8 Mg/Ca. As shown in Table S1, the BET specific surface areas of SS and SA2:8 Mg/Ca are 5.80 m2/g and 9.01 m2/g, respectively, indicating that co-pyrolysis significantly increases the specific surface area compared to sludge biochar alone. Additionally, there was an increase in the proportion of micropores in the co-pyrolytic biochar (Fig. 2(a)). The adsorption–desorption isotherm of SA2:8 Mg/Ca aligns with the IUPAC Type IV, suggesting the presence of mesoporous pores. The predominant pore structures include slit and crack pores formed through particle accumulation. These mesoporous pores reduce mass transfer resistance and promotes the migration of phosphate ions toward the adsorbent in aquatic environments, thereby increasing the phosphate adsorption capacity of the biochar. Previous research has highlighted that adding biomass can increase the pore volume of sludge biochar (Fan et al., 2023). This is because sludge tends to produce significant carbon deposition during calcination. By integrating almond shells, which have a low density, the resultant biochar exhibits dispersed pores formed during pyrolysis that are less prone to blockage (Li et al., 2023b).

Fig.2
figure 2

(a) The Nitrogen adsorption–desorption curves of synthetic materials, (b) Adsorption properties of synthetic materials

3.1.2 Surface Structure and Element Composition of Biochar

The infrared spectrum of the sample, shown in Fig. 2(b), reveals several significant peaks. The broad peak between 3410 and 3440 cm−1 corresponds to the stretching vibration of the -OH group (Deng et al., 2021), indicating the presence of hydroxyl groups in organic matter. The peak at 1619.

cm−1 signifies the tensile vibration of C = C bonds. The peak at 1029 cm−1 suggests C-O oscillation (Biswas et al., 2023). Additionally, the characteristic peak between 700 and 800 cm−1 corresponds to the out-of-plane bending vibration of C-H in olefins and aromatics (Li et al., 2023c). The irregular multi-peak distribution from 400 to 1000 cm−1 is associated with the vibration of complex components in the sludge (Wen et al., 2021). Peaks near 600 cm−1 may be attributed to X-O tensile vibrations in metal oxides (Zhang et al., 2023). These findings provide insights into the surface structure and elemental composition of the biochar.

3.2 Phosphate Adsorption Experiment

3.2.1 Influence of Sludge-Almond Shell Mass Ratio

The specific surface area and functional groups of biochar are crucial in determining its adsorption capacity. Surface modification is an effective method to increase this capacity. Previous research has shown that the biomass-to-sludge mass ratio significantly affects the adsorption capacity of co-pyrolysis biochar (He et al., 2022). As shown in Fig. 2(b), the adsorption capacity of SS is only 0.43 mg/g, while metal-modified sludge biochar SSMg/Ca has an adsorption capacity of 1.77 mg/g, indicating a modest improvement in phosphate adsorption. This improvement could be due to the irregular flaky structure of the SS surface, which impedes metal loading (Fig. 1(b)). However, co-pyrolysis with almond shell significantly increases the adsorption capacities of SA8:2 Mg/Ca, SA5:5 Mg/Ca, and SA2:8 Mg/Ca to 3.11 mg/g, 11.09 mg/g, and 24.35 mg/g, respectively, compared to SS. This increase is attributed to the substantial improvement in the specific surface area and pore structure of co-pyrolysis biochar compared to SS (Fig. 1(d)), which promotes metal loading and subsequently increases adsorption capacity (Bao et al., 2021). Despite SS having a variety of functional groups such as -OH, C-H, C = C, etc., SAMg/Ca has a limited number and type of functional groups (Fig. 3(a)), resulting in a modest adsorption performance of only 1.33 mg/g.

Fig.3
figure 3

(a) FTIR spectra of synthetic materials, (b) Effect of dosage on adsorption capacity of synthetic materials

By optimizing the mixture ratio of sludge and almond shell, the adsorption capacity of biochar for phosphate can be significantly increased through co-pyrolysis and metal impregnation under the same conditions. Specifically, the adsorption capacity increased from 0.43 mg/g to 24.35 mg/g, demonstrating the excellent adsorption capacity of metal-impregnated co-pyrolysis biochar for phosphate and its considerable potential for environmental applications.

3.2.2 Influence of Biochar Dosage

Based on the experimental findings, this study further investigated the performance of modified biochar derived from a 2:8 mixture of sludge and almond shells. As shown in Fig. 3(b), increasing the dosage of SA2:8 Mg/Ca and SA2:8Ca/Ca from 1 g/L to 2 g/L significantly improved the removal rate, rising from 61.2% and 59.3% to 95.6% and 94.2%, respectively. This considerable improvement is due to the increased number of active sites. However, further increasing the dosage to 4 g/L resulted in only a slight rise in the removal rate to 98.5% and 98.4%, with a decrease in adsorption capacity from 24.35 mg/g and 22.65 mg/g to 12.30 mg/g and 11.75 mg/g, respectively. This suggests a reduction in the efficiency of adsorbent utilization at higher dosages.

Interestingly, across the dosage range of 1 g/L to 4 g/L for SA2:8 Mg/Mg, the removal rate consistently remained below 15% (2.9%, 10.5%, and 13.3%). This could be due to the conversion of MgCl2 into MgO during the pyrolysis process, as shown in Fig. 8(d). The resulting MgO particles are relatively large and may block the pores, hindering the effective entry of most metal particles into the micropores (Zhu et al., 2020). Consequently, subsequent experiments will primarily focus on SA2:8 Mg/Ca and SA2:8Ca/Ca, with the optimal biochar dosage established at 2 g/L.

3.2.3 Influence of Solution pH Value

The pH value of the solution greatly affects the adsorption behavior of biochar towards phosphate. Figure 4(a) demonstrates the phosphate adsorption characteristics of biochar prepared with different mixing ratios under acidic, neutral, and alkaline conditions. Notably, SA2:8 Mg/Ca exhibited strong adsorption performance across pH values of 4, 7, and 10. To identify the optimal pH for phosphate adsorption, a series of experiments were conducted over a wider pH range.

Fig. 4
figure 4

(a) Effect of initial pH on adsorption capacity of synthetic materials, (b) Effect of solution pH on the phosphate adsorption onto SA2:8Ca/Ca and SA2:8 Mg/Ca, (c) Forms of phosphate in the solution at different pH values, (d) The pHpzc of SA2:8Ca/Ca and SA2:8 Mg/Ca

As shown in Fig. 4(b), the solution pH significantly impacts the adsorption properties. At an initial pH of 1, the adsorption capacity of phosphate on SA2:8 Mg/Ca and SA2:8Ca/Ca was negative (-6.6 mg/g and -5.4 mg/g), possibly due to the release of phosphorus from the sludge and almond shell components. As the initial pH increased to 3, the adsorption capacity rose rapidly, peaking at pH 8 with maximum adsorption capacities of 24.35 mg/g and 22.65 mg/g, respectively. Both biochar variants demonstrated strong adsorption capabilities under alkaline conditions, indicating their effectiveness for phosphate removal in such environments.

The adsorption of phosphate by biochar is significantly influenced by both the surface charge of the biochar and the forms of phosphate in the solution. As shown in Fig. 4(c), phosphates exist in various forms depending on the pH of the solution. The dissociation equilibria of phosphate in different pH environments are represented by Eqs. (9) – (11).

When the pH is below 3, phosphate predominantly exists as H2PO4, which has limited reactivity with calcium and magnesium ions, resulting in relatively low adsorption capacity. However, as the pH increases above 4, phosphate primarily exists as HPO42−, which readily reacts with calcium ions to form CaHPO4. This compound is a common phosphate precipitate in various water bodies and soils. The stability and prevalence of this reaction lead to a significant increase in adsorption capacity within this pH range (Li et al., 2020).

As the pH increases above 10, phosphates in the solution mainly exist as PO43− and H2PO4. Under these conditions, the concentration of OH ions in the solution rises, competing with phosphates for adsorption sites, leading to a gradual decrease in adsorption capacity. However, the solubility product of CaHPO4 (2.57 × 10–7) is lower than that of Ca(OH)2 (5.5 × 10–6), indicating that calcium ions on the biochar surface preferentially react with HPO42−. Therefore, the decrease in adsorption capacity is not substantial.

$${\text{H}}_{2}{{\text{PO}}_{4}}^{-}+{\text{H}}_{2}\text{O}\leftrightarrow {\text{H}}_{3}{\text{PO}}_{4}+{\text{OH}}^{-}$$
(9)
$$\text{H}{{\text{PO}}_{4}}^{2-}+{\text{H}}_{2}\text{O}\leftrightarrow {\text{H}}_{2}{{\text{PO}}_{4}}^{-}+{\text{OH}}^{-}$$
(10)
$${{\text{PO}}_{4}}^{3-}+{\text{H}}_{2}\text{O}\leftrightarrow \text{H}{{\text{PO}}_{4}}^{2-}+{\text{OH}}^{-}$$
(11)

To examine the effect of surface charge on the adsorption behavior of biochar, the zero charge points (pHpzc) of SA2:8 Mg/Ca and SA2:8Ca/Ca were determined, with values of 9.07 and 8.75, respectively (Fig. 4(d)). Figure 4(b) shows that as the initial pH of the solution approaches 8, the phosphate adsorption capacity of both SA2:8 Mg/Ca and SA2:8Ca/Ca increases. This trend is linked to the positive surface charge of the biochar when the solution pH is below its pHpzc, which favors the adsorption of phosphate (Jellali et al., 2023).

During the adsorption process, the hydrolysis of phosphate and the interaction of calcium and magnesium ions on the biochar surface with water release OH- ions, causing a gradual increase in the solution pH (Zhu et al., 2023). However, when the solution pH exceeds the pHpzc, the biochar surface becomes negatively charged, potentially causing electrostatic repulsion with phosphate and thus affecting adsorption efficiency.

Both SA2:8Ca/Ca and SA2:8 Mg/Ca maintain high phosphate adsorption capacities over a broad pH range (3 ~ 12). Considering that the pH of municipal sewage and eutrophic water typically ranges from 6.5 to 9 (Samaraweera et al., 2023), these composite materials show significant potential for phosphate removal in real-world wastewater treatment applications.

3.2.4 Influence of Co-existing Anions

To assess the practical applicability of adsorbents, the effects of commonly co-existing ions on phosphate adsorption in wastewater were examined. As shown in Fig. 5, the presence of Cl, NO3, and CH3COO ions had little impact on phosphate removal. In contrast, SO42− ions significantly reduced phosphate adsorption efficiency, decreasing the removal rate from 95 to 60%. This reduction can be attributed to the similar ionic radii of SO42− and phosphate, leading to strong competition for adsorption sites. Additionally, the low solubility product of CaSO4 (9.1 × 10–6) indicates a high affinity of SO42− ions for the active sites (Kang et al., 2021).

Fig. 5
figure 5

The phosphate adsorption capacity of SA2:8Ca/Ca and SA2:8 Mg/Ca in the presence of competitive anions (Experiments were conducted with 2 g/L adsorbents and 50 mg/L phosphate solution (pH = 8.0))

The presence of HCO3 ions also decreased the phosphate removal rate. HCO3 forms stable complexes, such as CaCO3 (solubility 16.6 g/100 g), with metal ions on the biochar surface, occupying the adsorption sites. Furthermore, studies have shown that humic acid, containing many active functional groups like carboxyl and hydroxyl, can interact with the active sites on biochar, potentially reducing adsorption efficiency (Zhi et al., 2021). However, experimental data revealed that both SA2:8 Mg/Ca and SA2:8Ca/Ca maintained strong phosphate adsorption capacities, even in the presence of humic acid.

In conclusion, specific co-existing ions, particularly SO42− and HCO3, can significantly affect phosphate adsorption. Nevertheless, the robust adsorption capacity of SA2:8 Mg/Ca and SA2:8Ca/Ca suggests their potential for practical applications in wastewater treatment, even in the presence of interfering substances like humic acid.

3.2.5 Adsorption Kinetics

To understand the phosphate adsorption behavior of biochar, two commonly used adsorption kinetic models were applied: the pseudo-first-order model and the pseudo-second-order model. These models were used to fit the adsorption data for SA2:8 Mg/Ca and SA2:8Ca/Ca.

Figure 6 demonstrates that the pseudo-second-order kinetic model provided a better fit for the experimental data, with R2 values ranging from 0.94 to 0.99 across all temperature ranges. In contrast, the pseudo-first-order kinetic model showed lower R2 values, between 0.88 and 0.96. Additionally, as detailed in Table S2, the absolute differences between the experimental data and the adsorption capacity predicted by the pseudo-second-order model (ranging from 0.09 to 2.02) were consistently smaller than those predicted by the pseudo-first-order model (ranging from 0 to 1.00).

Fig. 6
figure 6

Kinetic models for phosphate adsorption on (a) SA2:8Mg/Ca and (b) SA2:8Ca/Ca with (temperature of 288, 298 and 308 K (Experiments were conducted: g2 g/L adsorbents and 50 mL phosphate solution (pH = 8.0))

These findings indicate that the adsorption of phosphate onto SA2:8 Mg/Ca and SA2:8Ca/Ca is primarily governed by chemisorption processes (Wei et al., 2023). The strong correlation between the experimental data and the pseudo-second-order model highlights its suitability for describing the phosphate adsorption kinetics of these biochar.

3.2.6 Adsorption Isotherm and Thermodynamics Analysis

Increasing temperature generally increases the interaction between the active sites on the biochar surface and ions, thereby improving adsorption capacity. To investigate this effect, the adsorption capacity of biochar for phosphate was assessed at temperatures of 288 K, 298 K, and 308 K. Both the Langmuir and Freundlich isothermal adsorption models were applied to the experimental data, and adsorption thermodynamics were analyzed.

Figure 7 shows that the Langmuir model fits the adsorption isotherms at various temperatures better than the Freundlich model, with R2 values ranging from 0.92 to 0.97. This suggests that phosphate adsorption by biochar primarily involves uniform surface chemisorption. As the temperature increased from 288 to 308 K, the theoretical maximum phosphate adsorption capacities for SA2:8 Mg/Ca and SA2:8Ca/Ca rose from 68.12 mg/g and 66.49 mg/g to 78.27 mg/g and 75.22 mg/g, respectively, as listed in Table S3. These results indicate that higher temperatures promote phosphate adsorption by biochar, with theoretical maximum adsorption capacities comparable to those reported for other modified materials (Table 1).

Fig. 7
figure 7

The phosphate adsorption isotherm fitting of (a) SA2:8 Mg/Ca and (b) SA2:8Ca/Ca (Experiments were conducted: 2 g/L adsorbents and 50 mL phosphate solution (pH = 8.0) for 24 h)

Table 1 Phosphate adsorption effects of different biochar

Thermodynamic analysis (Fig. S1), based on data from different temperatures, showed that the adsorption enthalpy change (∆H0) for SA2:8 Mg/Ca and SA2:8Ca/Ca is 34.55 kJ/mol and 22.02 kJ/mol, respectively, as reported in Table S4. Both values are positive, indicating that the adsorption process is endothermic and primarily chemisorptive. The free energy change (ΔG0) being less than zero suggests that the adsorption process is spontaneous. Furthermore, the adsorption entropy change (ΔS0) being positive indicates an increase in randomness and degrees of freedom at the interface during the adsorption process, consistent with an increase in entropy.

3.3 Adsorption Mechanism

Based on the test results, bimetallic-modified SA2:8 Mg/Ca exhibits superior phosphate adsorption capacity and rate compared to monometal-modified SA2:8Ca/Ca, consistent with previous studies (Yin et al., 2022). This improved performance is due to the ability of bimetallic-modified biochar to adsorb phosphate via electrostatic attraction through protonated MgOH+ at lower pH values, as described by Eq. (12). Additionally, SA2:8 Mg/Ca has a higher zero charge point (pHpzc = 9.07) compared to SA2:8Ca/Ca (pHpzc = 8.75), allowing for efficient phosphate adsorption across a wider pH range.

To further investigate the adsorption mechanism, SA2:8 Mg/Ca was characterized before and after adsorption. Figure 1(e) and 1(f) show numerous regular aggregate particles on the biochar surface post-adsorption, indicating successful phosphate adsorption onto SA2:8 Mg/Ca. The increase in diffraction peak intensity of O1s after adsorption suggests an ion exchange between HPO42− and OH (Wang et al., 2022). The decrease in diffraction peak intensity of Cl2p after adsorption (Fig. 8(a)) implies the involvement of chlorine in the reaction process, supporting findings that chloride addition can increase phosphorus availability (Xia et al., 2020).

Fig.8
figure 8

XPS spectra of SA2:8 Mg/Ca before and after phosphate adsorption

The binding energy of P2p3/2 at 133.8 eV (Fig. 8(b)) corresponds to the characteristic peak of phosphorus in CaHPO4 (Wang et al., 2021b), and the marked increase in diffraction peak area suggests the formation of strong chemical bonds. The shift in the calcium diffraction peak before and after adsorption (Fig. 8(c)) indicates the formation of CaHPO4 (Wu et al., 2021), confirming successful phosphate adsorption onto SA2:8 Mg/Ca and the creation of CaHPO4 on its surface.

During phosphate adsorption, Ca2+ ions act as Lewis acids with their empty electron orbitals, while the oxygen atom in HPO42− acts as a Lewis base. This Lewis acid–base interaction promotes phosphate adsorption onto the active sites (Gupta et al., 2020). The peak at 1304 eV is attributed to surface-loaded MgO on the biochar, and the emergence of a new peak in Mg1s after adsorption (Fig. 8(d)) may be due to the reaction of surface-loaded MgO with OH in solution, forming Mg(OH)2.

$$Biochar-MgO+{H}^{+}\to Biochar-MgO{H}^{+}$$
(12)

The infrared spectrum results showed a significant reduction in the intensity of the OH absorption peak at 1029 cm−1 on SA2:8 Mg/Ca after phosphate adsorption (Fig. 3(a)), likely due to a ligand exchange reaction between OH and phosphate (Wang et al., 2021c). Additionally, the general rise in pH during the experiment supports this hypothesis. Reductions in the absorption peaks at 1619 cm−1 and 781 cm−1 were also observed, possibly due to the increased production of OH. After phosphorus adsorption, the decrease in the tensile vibration absorption peak of X-O on the biochar suggests the formation of complex compounds between metal oxides and phosphate groups. This interaction might be influenced by the presence of positive charges on the biochar surface and the resulting electrostatic attraction with the phosphates.

If electrostatic attraction were the sole driver of the adsorption process, an increase in OH content would significantly affect phosphate adsorption. However, findings indicate that, even in solutions with high pH values, the amount of phosphate adsorbed remains consistently high (Fig. 4(b)). Thus, it can be inferred that electrostatic attraction is not the primary adsorption mechanism for SA2:8 Mg/Ca with respect to phosphate (Li et al., 2023a).

The adsorption capacity of biochar is closely related to the supported metal ions. To further understand the relationship between phosphorus and minerals on the biochar surface, XRD analysis was used to inspect the surface phase of biochar before and after adsorption. As shown in Fig. 9, after adsorption, phosphate primarily appears on the biochar surface as calcium salt, specifically CaHPO4 (PDF#89–5969), with a significant increase in diffraction peak intensity. This suggests that the addition of calcium promotes the formation of monomeric phosphate on the biochar surface (Nan et al., 2023). Notably, no distinct characteristic peak of magnesium salt was observed on the biochar, which could be due to the relatively low magnesium loading and particle size, as well as ionic interactions during adsorption that may have interfered with the detection of characteristic peaks. The reaction processes involved are shown in Eqs. (13) ~ (16).

Fig.9
figure 9

XRD spectra of SA2:8 Mg/Ca before and after phosphate adsorption

$${H}_{2}P{O}_{4}^{-}+O{H}^{-}\to HP{O}_{4}^{2-}+{H}_{2}O$$
(13)
$$HP{O}_{4}^{2-}+C{a}^{2+}\to CaHP{O}_{4}$$
(14)
$$P{O}_{4}^{3-}+C{l}^{-}+2C{a}^{2+}\to C{a}_{2}P{O}_{4}Cl$$
(15)
$$C{a}^{2+}+2HP{O}_{4}^{2-}+{H}_{2}O\to Ca{H}_{2}{P}_{2}{O}_{7}+2O{H}^{-}$$
(16)

Based on the characterization results, a proposed adsorption mechanism for phosphate onto biochar is presented. As illustrated in Fig. 10, the surface of the biochar gains a positive charge through metal loading, increasing its electrostatic attraction towards phosphate. Additionally, the functional groups in the biochar and the introduction of active ions through metal loading promote the binding of phosphate to SA2:8 Mg/Ca via an ion exchange mechanism. Furthermore, the Ca2+ ions loaded onto SA2:8 Mg/Ca act as Lewis acids, adsorbing phosphate through Lewis acid–base interactions. At the same time, the incorporated metal ions contribute to the stable binding of phosphate to the surface of SA2:8 Mg/Ca through chemical precipitation.

Fig.10
figure 10

Adsorption mechanism

3.4 Phosphorus-Loaded Biochar as a Catalyst for the Degradation of Organic Pollutants

Municipal and agricultural wastewater often contains nutrients like N, P, and K, as well as pollutants such as antibiotics, especially in aquaculture wastewater (Cai et al., 2020). Phosphorus recovered from wastewater containing organic pollutants is often contaminated and unsuitable for direct application to soil, water, and plants. Therefore, exploring biochar's potential for removing organic pollutants is necessary.

As depicted in Fig. 11, SA2:8 Mg/Ca, before and after phosphate adsorption, was used to catalyze the degradation of OFX by PS in different pH environments, examining the effect of phosphate adsorption on the catalytic process. At a solution pH of 9, the OFX removal rate by SA2:8 Mg/Ca is 78.3%. As the pH increases, the OFX removal rate improves, indicating that higher pH levels favor OFX removal. The removal rate of phosphate-adsorbed SA2:8 Mg/Ca for OFX is 81.4%, possibly because phosphate-adsorbed SA2:8 Mg/Ca presents more P-O functional groups, increasing the potential of biochar to adsorb pollutants through organic complexation (Wang et al., 2021a). In an acidic environment (pH = 3), the OFX removal rate in the SA2:8 Mg/Ca-PS system is 23.7%, influenced by the pH of the solution, which affects the state of OFX in water and the production and distribution of free radicals. The low removal rate at low pH aligns with findings reported in the literature (Dung et al., 2024). However, the OFX removal rate of phosphate-adsorbed SA2:8 Mg/Ca (61.7%) is significantly higher than that of non-adsorbed SA2:8 Mg/Ca, because the presence of phosphorus can alter the electron density and improve electron mobility (Wang et al., 2021a). PS can effectively bind to the unsaturated bonds and aromatic structures on the biochar, generating electron transfer intermediates that promote the non-radical degradation of OFX (Zhang et al., 2024). Therefore, the SA2:8 Mg/Ca-PS system can effectively remove OFX in water and has potential for addressing multiple pollutants in complex aquatic environments.

Fig.11
figure 11

(a) SA2:8 Mg/Ca and (b) P-loaded SA2:8 Mg/Ca catalyzed the degradation of OFX by PS at different pH

4 Conclusion

This study successfully developed a highly effective phosphate adsorbent, SA2:8Mg/Ca, using sludge and almond shells in an optimal 2:8 mass ratio. The biochar, modified by metal support and co-pyrolysis, exhibits strong phosphate adsorption capabilities across different pH levels. Although the presence of HCO3 and SO42− ions reduces adsorption, it still maintains a removal rate of over 50%. The adsorption process follows the quasi-second-order kinetic model and aligns with the Langmuir isotherm, indicating spontaneous endothermic adsorption. The adsorption mechanism involves electrostatic interaction, ion exchange, and chemical reaction. Additionally, phosphorus-loaded biochar can promote the degradation of ofloxacin by persulfate, suggesting broader applications for SA2:8Mg/Ca.