Introduction

Water is an indispensable element for the continued survival of humankind and other organisms in the ecosystem. Based on this, clean and quality water must be ensured for the survival of living organisms. However, pollutants emanating from activities such as agriculture and mining affect the integrity of these water systems. Large portions of these aquatic systems get polluted by wastewater containing dissolved nutrients (phosphate and nitrate). Nutrients which are emerging pollutants stemming from livestock wastewater (Hamoudi and Belkacemi 2013; Onyango et al. 2007), industrial wastewater, agricultural activities such as fertilization (Hamoudi and Belkacemi 2013; Cheng et al. 2017), detergent manufacturing industries, and mineral processing industries released into natural aquatic bodies have attracted attention lately (Hamoudi and Belkacemi 2013; Cheng et al. 2017; Hamoudi et al. 2007; Nguyen et al. 2014).

The excessive intake of nitrate from water by humans can pose a possible public health risk, including newborn methemoglobinemia (“blue baby” syndrome) and the production of carcinogenic nitrosamines and nitrosamides (Cheng et al. 2017; Qiao et al. 2019; Hamoudi et al. 2007; Nguyen et al. 2014). The phosphorus content of over 0.02 mg L−1 in the aqueous medium may lead to eutrophication and degradation of the quality of water, and threats the existence of aquatic animals (Nguyen et al. 2014; Qiao et al. 2019). Again, the occurrence of eutrophication in water impedes penetration of light and decreases the oxygen content needed for the survival of aquatic organisms, hence imperilling them. It is therefore essential to treat effluent before it is discharged into the aquatic environment. According to the World Health Organization (2011), the allowable levels of phosphate and nitrate in portable water are 0.1 mg L−1 and 50 mg L−1, respectively. Consequently, efficient, inexpensive, and practicable methods for nitrate and phosphate uptake are urgently required.

Numerous physicochemical and biological processes such as ion exchange, biological treatment, physicochemical precipitation, and membrane process have been explored to get rid of these noxious wastes from wastewater before they are emptied into aquatic bodies (Trinh et al. 2020). Amid these techniques, adsorption has been discovered as an efficient and effective process for treating wastewater owing to its straightforwardness, economical, green, appropriate for treating large amounts of water, and associated with high efficiency, leading to less sludge production and minimal disposal problems. Traditional adsorbents and agricultural waste (AW) employed to remove phosphate and nitrate exhibited low adsorption capacities (Nguyen et al. 2014; Wang et al. 2021).

Previous works reveal that walnut shell (WNS) was less utilized compared with other agricultural wastes such as peanut husk, rice husk, and bagasse (Aryee et al. 2022; Sud et al. 2008; Mpatani et al. 2020). However, WNS could be considered as a critical agricultural waste content as a result of its large production. Based on the 2019 report issued by the Food and Agriculture Organization of the United Nations (FAO), the world production of walnuts (in a shell) stood at 4.5 million tons with China contributing 56% and being the largest producer. Walnut production creates a considerable volume of waste, which is typically burnt or buried in a landfill (Kamal et al. 2017) as a result of its widespread use. The buried walnut shells take a longer period to decay because they are very hard and could become an irritant to the organisms in the environment (Zhao et al. 2020; Kamal et al. 2017). However, when the wastes are burnt, they may contribute to global warming since a high amount of carbon dioxide may be produced as a result of the burning process. Consequently, using walnut shells, which are amply available, cheap, and its easy to employ in the area of adsorption to purify contaminated water, could be deemed safe ecologically (Cao et al. 2014).

Furthermore, studies reveal that chemical or physical modification of AW adsorbent improves its adsorption capacity (Dovi et al. 2021a; Kani et al. 2021; Xu et al. 2012; Sowmya and Meenakshi 2014). A classic instance is the cetyltrimethylammonium bromide (CTAB) functionalized walnut shell, which enhanced Congo red uptake substantially owing to the binding ability or ionic reaction between the functionalized sorbents and the anionic dye molecules, while there was also binding capacity towards bisphenol A from solution (Dovi et al. 2021b). Several methods for cross-linking agricultural waste have been extensively researched over the last decade. Orlando et al. (2002a, b) produced a weak anion exchanger by cross-linking sugarcane bagasse and rice hull with epichlorohydrin and dimethylamine in the presence of N,N-dimethylformamide (DMF) and a pyridine catalyst (EDM method, secondary amine). Furthermore, Wang et al. (2010) used the ETM technique, a modification of the EDM method, which involves substituting the secondary amine with a tertiary amine, to modify sugarcane bagasse and rice hull using epichlorohydrin, ethylenediamine, and triethylamine in the presence of DMF to produce a strong anion exchanger.

Herein, a cheap and effective adsorbent, amine functionalized walnut shells (ACWNS), based on walnut shell, was successfully synthesized by grafting and cross-linking diethylenetriamine (DETA) and triethylamine (TEA) with epichlorohydrin (ECH) and DMF following the ETM method for the uptake of phosphate and nitrate. In this research, ACWNS was used for the first time to remove phosphate and nitrate and to study the influence of different factors (concentration, pH, dosage, temperature) on the adsorption efficiency, as well as the kinetics, which help to understand the rate mechanism that underpins the uptake phenomena; the adsorption isotherm, which helps to appreciate the relationships between the adsorbent and adsorbate molecules when they reach equilibrium; and the thermodynamic properties.

Materials and methods

Materials

WNS was acquired from a market close to Zhengzhou University. Potassium hydrogen phosphate (KH2PO4), ECH, DMF, sodium hydroxide (NaOH), hydrochloric acid (HCl), sodium sulfate (Na2SO4), sodium chloride (NaCl), potassium nitrate (KNO3), and DETA were acquired from Aladdin Reagent Co., Ltd., and TEA was acquired from Merck. Analytical graded chemicals were used.

Preparation of ACWNS

The walnut shell was prepared as described in our previous work (Dovi et al. 2021b). The preparation of ACWNS was slightly modified according to Xu et al. (2012). Brifely, 2.0 g of WNS was weighed in a 250-mL round-bottom flask with 10 mL of ECH and 12 mL of DMF. The mixture was then heated in an oil bath at 85 °C with continuous stirring for 1 h. 3.5 mL of DETA was then added to the mixture and stirred continuously for another 1 h at 85 °C. This was followed by 10 mL of TEA at 85 °C for 3 h with continuous stirring for the grafting procedure to occur. Lastly, the end product was rinsed with deionized water to get rid of any residues until its pH became neutral, then dried for 12 h at 80 °C, grinded and filtered with 40–60 mesh to attain the size of particles desired, then stored to be used later. Finally, ACWNS were obtained and strored. Synthesis process is depicted in Fig. 1.

Fig. 1
figure 1

Synthesis process of ACWNS

Characterization techniques and instruments

The existence of functional groups on ACWNS and WNS was determined from 4000 to 500 cm−1 using Fourier transform infrared (FTIR-Nicolet iS50, American). The crystalline structure of the adsorbents was studied by powder X-ray diffraction (XRD, PANalytical, Netherlands) while the Brunauer–Emmett–Teller technique (BET, ASAP2420-4MP, American) was employed to determine the pore volume, specific surface area, and average pore diameter. X-ray photoelectron spectroscopy (XPS, Escalab 250xi, England) was performed to establish the alteration and the uptake process. The scanning electron microscopy (SEM, Hitachi Su8020, Japan) was used to confirm the surface formation of WNS and ACWNS. The absorbance and equilibrium concentration of phosphate (PO43−) and nitrate (NO3) were quantified on a UV–Vis spectrophotometer (Persee TU-1900, China) at 700 and 220 nm, respectively. The pH point of zero charge (pHzpc) of WNS and ACWNS were conducted to determine the surface charge of the adsorbent at solution pH using the procedure prescribed by Meili et al. (2019) and Calvete et al. (2009).

Batch adsorption experiments

The removal experiment was conducted using a single-component method. Preliminary experiments revealed that the optimum adsorbent dose was 1.0 g L−1. So 0.010 g ACWNS and 10 mL of adsorbate were placed in a 50mL conical flask and agitated at 130 rpm and pH 5. The adsorption kinetics was studied at 30 mg L−1 as the initial concentration of PO43− and NO3 at 303 K, while uptake equilibrium experiments were performed at different PO43− and NO3 concentrations (10–100 mg L−1) at 293, 303, and 313 K and the experimental time of 1 h was adequate to bring the reaction to equilibrium. The samples were consequently centrifuged at 5000 rpm for 5 min and the clear solution was taken. For the adsorption work in binary systems, 1.0 g L−1 ACWNS was placed in a 50mL flask containing a solution mixture of initial concentrations of PO43− and NO3 at 1:1 ratio. The method and analysis for the binary system was the same as illustrated above, and the experimental time was 1 h. All the works were carried out three times and their means were put to data analysis. PO43− concentration was determined at 700 nm using a UV–Vis spectrophotometer (via Mo-Tb anti-spectrophotometry) while NO3 concentration was directly measured at 220 nm using a UV–Vis spectrophotometer (Editorial Committee 2002). The adsorption study experiments were carried out in triplicate and the obtained average data were recorded. The errors were less than 5%.

The removal efficiency and amount of PO43− or NO3 adsorbed on a unit weight of adsorbent (qe or qt, mg g−1) were calculated from Eqs. 1 and 2.

$$P=\frac{\left(C_0-C_e\right)}{C_0}\times100\%$$
(1)
$$q=\frac{V(C_0-C)}m$$
(2)

Other expressions in this study are listed as follows.

$$q_e=\frac{q_mK_LC_e}{1+K_LC_e}$$
(3)
$$q_e=K_FC_e^{1n}$$
(4)
$$q_e=A+B\;\ln\;C_e$$
(5)
$$q_t=q_e(1-e^{-k_1t})$$
(6)
$$q_t=\frac{k_2q_e^2t}{1+k_2q_et}$$
(7)
$$qt=A+Blnt$$
(8)
$$q_t=K_{id}t^{1/2}+C$$
(9)
$$K_c=C_{ad}/C_e$$
(10)
$$\Delta Go=-RT\;\ln K_c$$
(11)
$$\Delta G^o=\Delta H^o-T\Delta S^o$$
(12)

where C0 means the initial adsrobate concentration (mg L−1); C or Ce, V, and m represent the concentration of the adsorbate at any time t or equilibrium (mg L−1), the volume of adsorbate solution (L) and mass of adsorbent (g), respectively; qm is the maximum adsorption quantity (mg g−1); KL is the adsorption constant (L mg−1); qe or q is the equilibrium adsorption capacity (mg g−1); KF is the adsorption quantity constant; 1/n is the adsorption intensity constant; A and B are the Temkin constants; Kid is the intra-particle diffusion (IPD) rate constant (g mg−1 min−1/2); C is the constant for IPD (mg g−1) that shows the thickness of the boundary layer, i.e., the bigger the value of C, the greater the boundary layer effect; Cad (mg L−1) is the concentration of adsorbate adsorbed onto ACWNS; Kc (L mg−1) is the distribution coefficient obtained from the lowest experimental PO43− and NO3 concentrations; T (K) is the absolute temperature in Kelvin; R (8.314 J mol−1 K−1) is the ideal gas constant; ΔH° is enthalpy change; ΔS° is degree of randomness; and ΔG° is Gibbs free energy.

Application to the treatment of real water samples

To evaluate the practical prospects of ACWNS, a real environmental sample was analyzed. Water samples from a lake on Zhengzhou University campus and tap water were sampled for the analysis. Varied concentrations (5, 10, and 20 mg L−1) of both PO43− and NO3 were placed in the real samples (lake and tap water) separately. The study was performed by placing 10 mg of ACWNS into 10 mL of samples of the lake and tap water with various concentrations of PO43− and NO3 and mixtures shaken at 303 K for 1 h in an orbital shaker. This study was conducted in a single-component system.

Reusability studies of ACWNS

To estimate the regeneration capability of ACWNS towards PO43− and NO3 adsorption, desorption, and regeneration, experiments were performed in batch mode. Initially, 10 mg of ACWNS was separately placed in a 50-mL flask containing 10 mL of 30 mg L−1 PO43− and NO3 solution at 303 K. The mixture was shaken at 130 rpm for 1 h in an orbital shaker. Consequently, the spent ACWNS was desorbed separately using 10 mL of 0.1 mol L−1 NaOH, 0.1 mol L−1 NaOH-NaCl, and 0.1 mol L−1 HCl as an elution solution. Furthermore, the reuse ability of ACWNS was verified by conducting reusability studies at the same uptake conditions in three successive cycles. The regeneration outcome was achieved as the ratio of values of qe before and qe after regeneration.

Results and discussion

Characterization of adsorbent (ACWNS)

Scanning electron microscopy analysis

The SEM of WNS and ACWNS are described in Fig. 2a, b. The surface structure of ACWNS is relatively diverse compared to WNS. The decrease in the particle size and irregular surface of ACWNS may be credited to the quaternization of WNS. The unevenness and pores available on the surface of ACWNS might have functioned as the active sites in the adsorption of phosphate and nitrate.

Fig. 2
figure 2

SEM images of a pristine WNS and b ACWNS. c FTIR spectra of WNS, ACWNS, ACWNS-PO43−, and ACWNS-NO3, and d XRD patterns of ACWNS and WNS

Fourier transform infrared analysis

The FTIR spectra of WNS, ACWNS, ACWNS-PO43−, and ACWNS-NO3 are illustrated in Fig. 2c. In the FTIR spectrum of WNS, ACWNS, ACWNS-PO43−, and ACWNS-NO3, the band spanning from 3400 to 3500 cm−1 was due to –OH/–NH stretching vibrations depicting hydrogen bonds which may be due to compounds like carboxylic acids and alcohols as in cellulose, lignin, and pectin. Hence, it divulges the presence of –OH groups on the adsorbent’s surface (Foroughi-Dahr et al. 2015). Also, the absorption peaks observed around 2900 cm−1 on the adsorbents could be credited to the presence of CH2 groups. The new peak which appeared around 1330 cm−1 on ACWNS matched up to C–N bending vibrations that pointed to the existence of amine groups (Ren et al. 2016). The wave number around 1740 cm−1 (WNS) and 1739 cm−1 (ACWNS) represents C = O stretching vibrations and that at 1246 cm−1 ascribed to the C–O stretching vibration showing the existence of carboxyl groups on the WNS. The FTIR analysis of ACWNS-PO43− reveals that peaks ranging from 1050 to 1646 cm−1 were improved owing to the uptake of PO43−, corresponding to the –P–O and –O–P–O groups. It showed that the phosphate group was successfully adsorbed onto the ACWNS (Wang et al. 2018). The nitrate characteristic peak around 1383 cm−1 in ACWNS-NO3 confirmed the adsorption of nitrate by ACWNS (Xu et al. 2013). FTIR analysis established the existence of functional groups and demonstrated that ACWNS could adsorb nutrients from aqueous medium.

X-ray diffraction analysis

The XRD analysis of WNS and ACWNS is exhibited in Fig. 2d. XRD peaks of WNS around 2θ = 17.5°, 22.5°, and 35° signify the presence of a highly organized crystal cellulose structure (Ayala and Fernández 2019). The same peak on ACWNS was observed but with a slight shift to 21.88°. Again, the XRD peaks around 2θ = 17.5° and 35° disappeared, confirming the successful modification. However, the results showed that the modification had no effect on the structure and crystal nature of the WNS.

Brunauer–Emmett–Teller analysis

The BET surface area was estimated to be 0.230 and 0.369 m2 g−1 for WNS and ACWNS, respectively. Total pore volume of WNS increased from 0.000893 to 0.003012 cm3 g−1 (ACWNS) after modification. This shows that the modification process significantly enhances the surface area of pristine WNS. The polymerization seems to enlarge the surface area and also increased the average pore width of the adsorbent from 17.8 (WNS) to 32.7 nm (ACWNS), indicating a mesoporous structure. The enhanced specific surface area of ACWNS and its mesoporous structure provided sufficient reaction sites for the direct contact with both phosphate and nitrate to enhance their adsorption capacity. Figure 3a depicts the graph obtained from the adsorption and desorption of N2 gas on the surface of ACWNS.

Fig. 3
figure 3

Plot of N2 adsorption/desorption isotherm of ACWNS (a). Point of zero charge of WNS and ACWNS (b). Influence of pH on adsorption of PO43− (c) and NO3 (d)

Point of zero charge

The pH value at which the adsorbet’s surface is neutral is known as the point of zero charge. It depicts the state of the adsorbent's surface when the overall charge on it is zero (Zhao et al. 2019). It verifies how easily a material can uptake potential injurious ions. Therefore, it is indispensable to assess pHzpc of WNS and ACWNS. The outcome is presented in Fig. 3b. It is observed from Fig. 3b that the pHzpc of WNS and ACWNS were 6.4 and 6.0 respectively. Below these values, the charge on the surface is positive, while above those values, the charge is negative. Hence, it was anticipated that the removal would occur at pH lower than 6.4 and 6.0, since phosphate and nitrate are anionic species. However, ACWNS is a novel adsorbent that efficiently adsorbed both nutrients (phosphate and nitrate) over a broad array of pH (3–10) as exhibited in Fig. 3c, d. Hence, the pH of the solutions was not altered but was used as prepared for the adsorption experiments.

Adsorption studies

Influence of pH on adsorption capacity

In the adsorption process, the degree of ionization, the adsorbent’s surface charge, and the speciation of adsorbates can greatly be affected by the pH of the solution (Naiya et al. 2009). Hence, the adsorption was studied at different pH (2–12) to arrive at the most favorable pH for the uptake process. The influence of pH on the uptake of PO43− and NO3 is shown in Fig. 3c, d. The ACWNS capacilities for PO43− and NO3 were improved when the pH was increased from 2.0 to 3.0 and remained significantly constant (up to pH 10.0 and 9.0 for PO43− and NO3, respectively) and then reduced significantly as pH increased further from 10.0 to 12.0. The best uptake occurred between pH 3 and 10 for PO43− and 3 to 9 for NO3 ions. The results also indicated that in a highly acidic medium, removal of NO3 was slightly enhanced compared to the uptake of PO43− as exhibited in Fig. 3c, d, which is similar to studies conducted by Qiao et al. (2019). These occurrences can be better elucidated by protonation and competing ion effects. The ionization constants (pKa) for PO43− in H2PO4, HPO42−, and PO43− forms based on the pH of the solution were pK1 = 2.2, pK2 = 7.2, and pK3 = 12.4 respectively (Waktole et al. 2019). As reported, within this pH range of 3–10, phosphates are likely to exist in H2PO4 and HPO42− which are strongly attracted to the positively charged adsorbent, with this attraction decreasing with an increase in solution pH (Waktole et al. 2019). In a highly acidic medium, PO43− becomes protonated, forming H3PO4 which limits its adsorption. Again, the presence of a high concentration of H+ ions competes for the uptake of H2PO4 against a highly positive charged adsorbent surface, resulting in the formation of H3PO4 molecules. However, adsorption of NO3 was not affected by low pH as HNO3 is a strong electrolyte (Wang et al. 2018). Meanwhile, at pH greater than 10, a drastic decrease in the uptake of PO43− and NO3 was observed, which could be ascribed to excessive OH ions competing with both PO43− and NO3 for the binding sites on the adsorbent’s surface. Based on the results of the adsorption assay, the amine cross-linked walnut shell was shown to be most promising for use as an adsorbent to uptake PO43− and NO3 across a broad pH range of 3.0–10.0 and 3.0–9.0, respectively, which is considerably better than other reported cross-linked agricultural by-products (Xu et al. 2011; Kalaruban et al. 2016). Consequently, changing pH values of polluted solutions in a real sample would not be required. However, pH 5 was used for the work. The pH values after the uptake of pollutants were also determined. For both anions, the results show that the equilibrium pH values were almost constant at the pH range of 4.0–8.0. Similar results also accounted for a similar pH change when modified tea waste was used for PO43− removal (Qiao et al. 2019). This buffer effect could have resulted from the changing effect of nutrient species, PO43− (i.e., H3PO4, H2PO4, HPO42−, and PO43−), present in an aqueous solution of varied pH values and as adsorption occurs act as buffers during the entire process (Qiao et al. 2019).

Effect of adsorbent dose

Generally, the mass of adsorbent used is relative to the amount of binding site available for nutrient adsorption (PO43− and NO3). As seen in Fig. 4a, b, the percentage reduction of PO43− and NO3 increased as the adsorbent mass increased from 0.5 to 3.0 g L−1. At higher doses, this dose dependence may be attributed to increased surface area and a larger number of binding sites (Qiao et al. 2019; Banu and Meenakshi 2017; Pan et al. 2014). At an optimum dose of 1.0 g L−1, the uptake of PO43− was almost twice as that of NO3 with removal percentage of 78% for PO43− and 47% for NO3, which was in agreement with work reported by Wang et al. (2018). However, ACWNS exhibited an excellent removal of nutrients as the dose increased. Conversely, the qe values showed a reverse trend with the rise of dose, signifying that binding groups available on ACWNS were underexploited at a higher dose, that occurs as a consequence of the solution-adsorbent surface solute concentration gradient (Zhang et al. 2011). In contrast, at a dose of 1.0 g L−1 WNS showed very low removal ability with reference to ACWNS (Fig. 4a, b); hence, ACWNS was adopted and used for the remaining experiments.

Fig. 4
figure 4

Influence of adsorbent dose on adsorption of PO43− (a) and NO3 (b). Influence of salt concentration on PO43− (c) and NO3 (d) adsorption by ACWNS (C0 = 30 mg L−1, T = 303 K, t = 1 h)

Effect of salinity

To estimate the feasibility of the prepared ACWNS for industrial application, it is imperative to evaluate the effect of salt ions on the uptake procedure to ascertain the expediency of ACWNS. In this work, the effects of NaCl and Na2SO4 on the uptake of PO43− and NO3 were examined at the same experimental conditions and the obtained results are shown in Fig. 4c, d. The adsorption potential of ACWNS declined as the salt concentration was raised from 0.01 to 0.2 mol L−1, as seen in Fig. 4c. This development might be assigned to the competing effect between PO43− and salt ions (Cl and SO42−) for the active groups present on the adsorbent, hence inhibiting PO43− uptake, which suggests that the mechanism of adsorption could be electrostatic interaction. In contrast, for the nitrate removal as illustrated in Fig. 4d, the adsorption quantity of ACWNS was significantly increased in the presence of both Cl and SO42−. The increase was noticed to be greater than 40% of its initial uptake at a higher concentration of the salts. This suggests that other forces like hydrogen bonding interaction may be linked to the uptake of NO3 onto ACWNS besides the ionic force of attraction (Zhao et al. 2017). Again, this observation could be credited to the capability of these anions to lessen the boundary effect between the adsorbent and the nitrate molecules, thus leading to an enhanced interaction and accessibility to active sites (Hu and Han 2019). Furthermore, the effect of sulfate on nitrate adsorption was greater than Cl ions. Since the sulfate ion (SO42−) contributes more to ionic strength and has a higher negative charge than Cl, it has a more significant impact on NO3 adsorption (Wang et al. 2011).

Effect of equilibrium concentration and fitting of isotherm models

The adsorptions of PO43− and NO3 onto ACWNS at varied adsorbate concentrations are presented in Fig. 5a, b. The qe values become bigger as the adsorbate equilibrium concentration Ce increases. However, the uptake capacity for both PO43− and NO3 decreased with increasing temperature, which suggests an exothermic reaction. The qe values obtained were 58.5, 53.2, and 39.1 mg g−1 for PO43− at 293, 303, and 313 K and 30.2, 22.5, and 18.0 mg g−1 for NO3 at 293, 303, and 313 K, respectively. To comprehend better the adsorption phenomenon, it is important to investigate the adsorption experimental parameters. Adsorption isotherm basically is an expression that helps to establish the interactions between the adsorbent and adsorbate molecules at equilibrium (Cao et al. 2014) along with information about the adsorbent’s surface characteristics, adsorption affinity, and adsorption mechanism (Leah et al. 2018). In this study, Langmuir (Eq. 3) (Langmuir 1916), Freundlich (Eq. 4) (Aharoni and Ungarish 1977), and Temkin (Eq. 5) (Foo and Hameed 2010) were used to depict removal phenomenon. The Langmuir isotherm depicts homogeneous and monolayer adsorption onto a uniform surface. On the contrary, the Temkin isotherm model relates to the energy state resulting from material and nutrient reaction (Zhang et al. 2014).

Fig. 5
figure 5

Adsorption isotherms and fitted curves of PO43− (a) and NO3 (b). Contact time and kinetic modeling of PO43− (c) and NO3 (d) adsorption onto ACWNS

The parameters of Langmuir, Freundlich, and Temkin isotherm models were obtained by evaluating the experimental data based on nonlinear regression analysis. The results and the fitted curves are shown in Table 1 and Fig. 5a, b, respectively. The data presented in Table 1 indicated that uptake of phosphate onto ACWNS was well fitted by the Freundlich isotherm models. Thus, the adsorption of phosphate onto ACWNS suggests multilayer heterogeneous removal of phosphate (Velazquez-jimenez et al. 2018). Moreover, from Table 1, the Freundlich equation presented the highest R2 values and lowest SSE values compared to both the Langmuir and Temkin equations. Additionally, the fitted curves stemming from the Freundlich model were also very near to the experimental data relative to both Langmuir and Temkin models. Again, the acquired values of 1/n (0.1 < 1/n < 1) signified favorable removal of phosphate at all temperatures studied (Zhou et al. 2015). Conversely, for the adsorption of nitrate, the Langmuir equation depicts higher R2 and lower SSE values compared to the Freundlich and Temkin equations as shown in Table 1. Additionally, the Langmuir fitted curves were close to the experimental results relative to Freundlich and Temkin curves (Fig. 5a, b). As a result, the Langmuir model was considered appropriate for describing nitrate adsorption onto the surface of ACWNS, as it illustrates monolayer adsorption. Also from Table 1, the values of KL were lower than 1 suggesting that the bonding forces were strong and that the uptake was favorable (Aryee et al. 2021a). The maximum adsorption capacity (qm) values for PO43- and NO3- were estimated using the Langmuir model, and the values of qm for PO43- and NO3- were matched up with other reported adsorbents in previous works as illustrated in Table 2. The amine modified WNS (ACWNS) exhibited a higher performance at a dosage of 10 g L−1 than other adsorbent for removal of PO43- and NO3- (Fan and Zhang 2018; Wang et al. 2018). This outcome signified that ACWNS has immense potential to uptake PO43− and NO3 from contaminated water.

Table 1 Parameters of adsorption isotherms for PO43− and NO3 adsorbed onto ACWNS at varied temperatures
Table 2 Comparison of maximum adsorption capacities for uptake of PO43− and NO3 using different adsorbents

Adsorption kinetic and fitting models

In general, kinetic experiments were performed to further grasp the rate mechanism underlying the uptake phenomenon. The relationship between adsorption quantity of PO43− and NO3 onto ACWNS and the contact time at various temperatures (293, 303, and 313 K) are shown in Fig. 5c, d respectively. The kinetic trend can be illustrated in three steps. In the initial step, the sharp slope represented a fast reaction rate. During the second step, the reaction rate began to slow down in which the uptake processes were almost completed. The reaction rate in the third stage further slowed down until the equilibrium was attained for both anions. These occurrences could be explained by the fact that more active sites are available on ACWNS, as well as the fact that the high concentration gradient of the contaminants (PO43− and NO3) decreased over time until equilibrium was reached. Furthermore, as shown in Table 3, the qe values increased at the lowest temperature for both phosphate and nitrate. This study demonstrated that adsorption was an exothermic process (Zhang et al. 2014). The rate-determining phase and mechanism for absorption of PO43− and NO3 onto ACWNS were evaluated using pseudo-first-order, pseudo-second-order, and Elovich adsorption kinetic models. The pseudo-first-order equation is given in Eq. 7 (Ho et al. 2000); Eq. 8 illustrates pseudo-second-order (Ho and Mckay 1999) while Eq. 9 expresses Elovich equation (Chien and Clayton 1980).

Table 3 Parameters of kinetic models for PO43− and NO3 adsorption onto ACWNS

The calculated coefficient (R2) and errors (SSE) can be used to determine a model’s adequacy. From Table 3, the pseudo-second-order model depicted the best fit under the same experimental conditions (R2 = 0.993, SSE = 1.60 to 3.09) for phosphate and (R2 = 0.988–0.993, SSE = 1.37 to 2.21) for nitrate and the acquired qe values were near to experimental results. This predicted that the rate-limiting step could be chemisorption or ion exchange (Mpatani et al. 2021). Nonetheless, the R2 values derived from pseudo-first-order and Elovich kinetic models were quite high (Table 3). This depicts that the uptake of both PO43− and NO3 could also be predicted by pseudo-first-order and Elovich kinetic models, showing the complexity of these adsorption processes. Since the Elovich model could predict ion exchange, it reveals that PO43− and NO3 uptake behavior on ACWNS could not suggest chemisorption only but also ion exchange reactions (Zhang et al. 2012; Li et al. 2019). The ion exchange mechanism occurs as follows:

  1. (1)

    \(\mathrm R-\mathrm N^+({\mathrm{CH}}_2{\mathrm{CH}}_3{)_3\;}\mathrm{Cl}^-+{\mathrm{PO}}_4^{3-}\rightarrow\mathrm R-\mathrm N^+\;({\mathrm{CH}}_2{\mathrm{CH}}_3)\;{\mathrm{PO}}_4^{3-}+\mathrm{Cl}^-\) 

  2. (2)

    \(\mathrm R-\mathrm N^+=({\mathrm{CH}}_2{\mathrm{CH}}_3{)_3\;}\mathrm{Cl}^-+\mathrm{NO}_3^-\rightarrow\mathrm R-\mathrm N^+\;({\mathrm{CH}}_2{\mathrm{CH}}_3{)_3\;}\mathrm{NO}_3^-+\mathrm{Cl}^-\) 

The intra-particle diffusion (IPD) equation was used to describe the kinetic effects of PO43− and NO3 adsorption onto ACWNS. Equation 10 illustrates the IPD model (Weber et al. 1963). Figure 6 shows a graph of qt versus t1/2 for PO43− and NO3 adsorption. A graph of qt against t1/2 as seen in Fig. 6a and 6b, indicates that the adsorption mechanism had more than two stages. Conversely, IPD is the rate-controlling phase if the line moves through the origin. The adsorption mechanism went through three phases. External surface adsorption was the first step, driven by boundary layer diffusion; the second stage was IPD, followed by final equilibrium adsorption (Aryee et al. 2021a; Pan et al. 2017). The second or third phase, which represented the adsorption stage, was linear and constant, with IPD dominanting (Pan et al. 2017; Aryee et al. 2021b). The values of C were not equal zero. This means that surface adsorption and IPD may be expected to regulate the adsorption mechanism in both cases (Aryee et al. 2020). Consequently, it indicates that external mass transfer followed by IPD mass transfer could regulate PO43− and NO3 adsorption onto ACWNS. Table 3 shows that Kt1 is larger than Kt2, C1 is lower than C2, and the R2 value in the first adsorption stage is higher than the R2 value in the second process in both situations. As a result, IPD could be able to forecast the kinetic mechanism at different stages (Pan et al. 2017).

Fig. 6
figure 6

Intra-particle diffusion plot for PO43− (a) and NO3 (b) adsorption onto ACWNS

Adsorption of PO4 3− and NO3 in binary systems

The uptake in a binary method was conducted and the results obtained are presented in Fig. 7. Noticeably, an inconsequential decrease in the uptake of phosphate (from 21.2 to 15.2 mg g−1; reduction of 14.4%) and nitrate (from 15.2 to 12.1 mg g−1; reduction of 10.4%) onto ACWNS in the binary solution system was witnessed. This may be attributed to the presence of a variety of active sites on ACWNS that exhibit a degree of anion specificity. However, slight decrease in their adsorption could be due to competition for the adsorbent active sites (Waktole et al. 2019). The outcomes infer that ACWNS to some extent exhibited higher affinity towards the adsorption of both ions. Therefore, ACWNS presents itself as a prospective adsorbent for the uptake of PO43− and NO3 from wastewater in a binary system simultaneously prior to its release into aquatic systems.

Fig. 7
figure 7

Adsorption capacity of ACWNS for PO43− and NO3 in single and binary systems (1:1 initial concentration, 30 mg L−1, T = 303 K, t = 1 h, dose = 1.0 mg L−1)

Application to the treatment of real water samples

From this study, it was established that the initial level of PO43− in the tap and lake water was 0.09 and 0.108 mg L−1, while NO3 levels in the tap and lake water were 1.04 and 2.47 mg L−1 respectively, which are lower than the permissible limits reported by World Health Organization (2011). The adsorption efficacy of ACWNS for PO43− and NO3 adsorption was found to be greater than 90% in all environmental media in the sorption experiments. From this data, it was evident that ACWNS exhibited great prospects as an adsorbent for the practical remediation processes. Table 4 presents the analysis for the recovery of PO43− and NO3 from the real water samples. It is interesting to observe that the level of phosphate is less than 0.1 mg L−1 for PO43− while the level of NO3 is less than 5 mg L−1, which is below the limited level. In another word, the adsorbent can be applied to remove phosphate and nitrate from mixtures.

Table 4 Recovery of PO43− and NO3 from the real water samples

Reusability studies

To test the usability of the exhausted adsorbent, adsorption–desorption studies were undertaken. This process helps to establish the economical, efficient practicability of the prepared adsorbent (ACWNS) with regard to adsorption (Aryee et al. 2022; Bhatti et al. 2020; Kani et al. 2021; Zhou et al. 2015). Again, the process might help to comprehend chemical reactions associated with the uptake of the pollutants. This study was done with 0.1 mol L−1 NaOH, 0.1 mol L−1 HCl, and 0.1 mol L−1 NaOH-NaCl as an eluting agent for desorbing both phosphate-loaded and nitrate-loaded adsorbents.

The results of this study showed that 0.1 mol L−1 NaOH-NaCl solution had the highest desorption efficiency for both PO43− and NO3 (NaOH-NaCl was 94%, NaOH was 88%, and HCl was 70% for PO43−; and NaOH-NaCl was 89%, NaOH was 82%, and HCl was 67% for NO3). The desorption efficiency remains fairly constant at about 94% for PO43− and 89, 78, and 73% for NO3. The removal effectiveness of ACWNS was not influenced greatly by the desorption process as the regeneration performance of ACWNS towards PO43− was 90, 87, and 82% and 87, 83, and 77% for NO3 after three successive cycles. As exhibited in Fig. 3c, d, the uptake capacity of ACWNS was observed to be very low in an alkaline medium, indicating that the occurrence of excess OH and Cl in solution disrupts the interactions that occur between the adsorbate and the binding sites on ACWNS resulting in a higher desorption rate of both phosphate and nitrate. Furthermore, there is no in favor of both adsorbate adsorption at lower solution pH. This could be elucidated based on the principle of ion exchange between the negative ions in the solution and the nutrients (PO43− and NO3) on the surface of ACWNS (Gu et al. 2019). This state causes adsorbates to be released into solution as well as the creation of many active sites for further adsorption phases. The end usage of the adsorbent is critical, since improper disposal will result in environmental degradation, which has a knock-on impact on the whole ecosystem. It is necessary to dispose of this adsorbent in the soil, which has a number of advantages. ACWNS’s mineral composition (i.e., N, C, and O) has been shown to foster soil and plant growth, thus aiding in environmental management and biodiversity.

Thermodynamic studies

To further grasp the effect of temperature on the absorption process of PO43− and NO3 onto ACWNS, thermodynamic parameters such as Gibbs free energy (ΔG°) (Eq. 11), enthalpy change (ΔH°) (Eq. 12), and entropy change (ΔS°) (Eq. 12) were used (Aksu 2002). The changes in Gibbs free energy (∆G°) values obtained that were negative for PO43− and NO3 removal at diverse temperatures verified the spontaneity of the adsorption mechanism (Ghorai et al. 2013) as seen in Table 5. As temperature increased, the absolute values of ∆G° decreased, implying that adsorption of contaminants onto ACWNS was more beneficial at lower temperatures. Phosphate uptake has a lower ΔG° than nitrate, which is consistent with studies reported by Wang et al. (2018), indicating that PO43− is easier to be removed. Moreover, the negative values of ΔH° for both PO43− (− 9.46 kJ mol−1) and NO3 (− 17.8 kJ mol−1) illustrate an exothermic uptake process. Therefore, high temperatures do not promote their adsorption. The lower values of ΔH° (Kumar et al. 2014) confirm the involvement of physisorption associated with electrostatic interactions in PO43− and NO3 adsorption. Furthermore, the entropy of the aqueous interface during the uptake process increased, depicting a positive ΔS° value (Han et al. 2009).

Table 5 Thermodynamic parameters for phosphate and nitrate adsorption on ACWNS

Adsorption mechanisms

To further understand the reaction mechanism involved in the adsorption of nutrients onto ACWNS, the XPS technique was employed. The analysis revealed the elemental composition of WNS, ACWNS before and after the uptake of the PO43− and NO3. Figure 8a–d illustrates the XPS wide spectrum results. It was seen from Fig. 8a that the elements C and O were present in the adsorbent before modification, which signifies that they are inherent in agricultural-based adsorbent. The emergence of N 1 s on the adsorbent as shown in Fig. 8b confirmed successful modification, and the appearance of P 2p confirms the adsorption of phosphate ions onto ACWNS (Fig. 8d). A narrow scan of the N 1 s spectrum of ACWNS showed two peaks at 398.5 eV and 401.3 eV which might be attributed to C–N and quaternary nitrogen respectively (Luo et al. 2019). After the uptake of nitrate, a bond linked to quaternary nitrogen at 401.3 eV shifted slightly and a new peak emerged which could be credited to N–O at 404.01 eV. The nitrogen composition was found to have increased from 12.97 to 14.45%, affirming the adsorption of nitrate onto ACWNS. Again, the resolution of the O 1 s spectrum of ACWNS before (Fig. 8g) and after (Fig. 8h) adsorption of nitrate gave four peaks. The binding energies of the peaks resulting from ACWNS are 532.12 eV for C–O–C, 531.18 eV for C = O, 530.53 eV for C–O–H, and 533.07 eV for –O–H (Li and Bai 2005). There were no significant alterations in the binding positions of the O 1 s peaks after adsorption (Fig. 8h). However, the oxygen content on ACWNS increased marginally from 18.15 to 24%. This could be assigned to the uptake of nitrate ions. Furthermore, after the uptake of phosphate onto ACWNS, the N 1 s spectrum showed two peaks at 397.96 eV emanating from C–N/N–H and 400.73 eV match up to quaternary nitrogen (Fig. 8i) and the analysis also revealed a reduction in the nitrogen content from 12.97 to 9.85% showing its involvement in the adsorption process. Aditionally, O 1 s spectrum peaks after the uptake of phosphate showed five peaks corresponding to –OH at 533.56 eV, C–O–C at 532.65 eV, C = O at 531.63 eV, C–O–H at 530.70 eV, and 529.46 eV attributable to O = C–OH/O–P. After the adsorption, oxygen content increased from 18.15 to 25%, which could be credited to the adsorption process. Figure 8k shows the P 2p spectrum of ACWNS-PO43− confirming the adsorption of phosphate with total phosphorus content of 1.44%.

Fig. 8
figure 8figure 8

XPS spectrum of WNS (a), ACWNS (b), ACWNS-NO3 (c), and ACWNS-PO43− (d). High-resolution spectrum of N 1 s of ACWNS e before and f after NO3 adsorption. O 1 s spectrum of ACWNS g before and h after NO3 adsorption. N 1 s spectrum of ACWNS i after adsorption of PO43−. j O 1 s spectrum of ACWNS-PO43−. k P 2p spectrum of ACWNS-PO43−

Conclusion

In this study, walnut shell is functionalized (ACWNS) through grafting quaternary amine groups via cross-link reaction and utilized as an adsorbent for effective uptake of phosphate and nitrate from aqueous media in a single-component and binary system (Fig. 9). The efficiency of ACWNS was considerably influenced by pH, concentration, dosage, time, and temperature. The surface characteristics of the adsorbent were assessed using analytical techniques which confirmed its involvement in the uptake of the nutrients (PO43− and NO3). The results also showed that ACWNS had an enhanced uptake capacity for phosphate than nitrate, which could be linked to a bigger atomic number and greater valence for phosphate. The phosphate and nitrate adsorption process was spontaneous and exothermic. Pseudo-second-order kinetic model better fit the adsorption of all nutrients, while the Freundlich and Langmuir equations best fit the adsorption of phosphate and nitrate, respectively. Moreover, the results obtained from isotherm, kinetic, and thermodynamic studies revealed that both chemical and physical processes occasioned the uptake process which explained the complex nature of PO43− and NO3 uptake onto ACWNS. Further studies in a binary system confirmed that the prepared adsorbent exhibited a higher affinity towards the adsorption of both ions and could serve as a plausible material for the removal of both ions simultaneously from aqueous media. Again, the efficiency of ACWNS was affirmed when applied to the practical remediation of wastewater. This study presents a simplistic method for the construction of a new adsorbent which is highly effective, inexpensive, eco-friendly, reusable, and most promising for use to uptake PO43− and NO3 across a wide pH range, which makes it advantageous for not altering the pH of contaminated solutions in a real sample before treatment. Therefore, ACWNS has a huge prospect of being used as a valuable adsorbent to be applied practically to treat wastewater containing phosphate and nitrate prior to its release into the aquatic system to always keep their level below the threshold limit.

Fig. 9
figure 9

Proposed schematic mechanism of PO43− and NO3 adsorption onto ACWNS