1 Introduction

In the past two decades, emerging organic contaminants such as pharmaceutical products have grabbed great attention. The widespread distribution of these harmful compounds enable their entry into the aquatic environment through diverse wastewater streams, encompassing sources such as hospital effluents and effluents from wastewater treatment plants. Pharmaceutical products including antibiotics, anti-inflammatories, tranquilizers, anticonvulsants, analgesics, and antihypertensives have bioaccumulation potential and long-term persistence in the environment [1]. In recent years, addressing the issue of the presence of these compounds’ residues at trace levels in aquatic bodies (e.g. groundwater, surface water, and wastewater treatment plants) has become a significant concern [2]. Diclofenac potassium suppresses cyclooxygenase (COX) in a non-selective reversible and competitive manner preventing arachidonic acid from being transformed into a prostaglandin precursor. As a result, the production of prostaglandin which is implicated in pain, inflammation, and fever is inhibited [3]. Excessive consumption of this substance can result in significant adverse effects on the gastrointestinal tract, potentially increasing the risk of renal failure in humans. Significantly, DCF (Diclofenac) was confirmed to be a cause of aquatic ecotoxicity if the concentrations exceeding 2.20 µg L-1. The resulting impacts comprise cardiovascular damage, thyroid neoplasms, hepatoxicity, and nephrotoxicity. The environmental pollution stemming from DCF has emerged as a prominent concern, leading to its inclusion on the monitoring list of the European Union. Consequently, the imperative to develop advanced and efficient technologies for mitigating DCF pollution in water [4, 5].

The occurrence of diclofenac potassium (DCF-p) in water bodies reflects the overuse due to low cost, availability, and limitations in regulatory reinforcement. The removal percentage of diclofenac by wastewater processes is ~ 21–40%, which is quite alarming [6]. An additional issue is associated with the presence of DCF in water sources and its potential to induce the activation of antibiotic-resistance genes, leading to the emergence of antibiotic-resistant bacteria commonly known as superbugs. In this context, diclofenac potassium and sodium and their residues are often found in the water bodies and wastewater samples and, in addition, studies indicate their biomagnification in food chain which resulted in contamination and harmful effect on the flora and fauna. According to one research, diclofenac concentrations in urban wastewater can reach up to 7.1 ugL-1 [7].

Although the detrimental effects of DCF on human and environment are well-known, its occurrence in water bodies and the inadequate regulation of its removal from wastewater remain significant concerns. Conventional techniques such as photocatalytic degradation, biodegradation, electrochemical-advanced oxidation processes (AOPs), bio-filtration, membrane separation, and adsorption used for water and wastewater remediation have certain problems for complete elimination of DCF-p, such as expensiveness, sensitivity and production of secondary by-products. However, the mean concentration (0.003µL-1-836µgL-1) was found to be relatively high. Moreover, the generation of complex and toxic intermediate by-products requires more attention [8, 9].

In recent years, researchers have focused on the utilization of modified adsorbents that are not only cost-effective but also highly efficient and selective for the removal of targeted pollutant  [10, 11]. Consequently, numerous materials, particularly those derived from agricultural waste, have been extensively examined as potential adsorbents. However, an essential factor in selecting the most appropriate material is its environmentally friendly behavior, non-toxicity, and biodegradability [12, 13]. Green adsorbents contain a lot of natural macromolecules that are lignin, cellulose, pectin, and polysaccharides, which have been exploited for different treatment options. Among them, cellulose is found to be a naturally occurring, common, and inexpensive material that is found in huge quantities in agricultural biomass [14]. It is a branched polysaccharide molecule comprised of glucose which is connected through glycosidic bonds. The abundant hydroxyl groups available on the surface of cellulose contribute to its inherent hydrophilicity, which restricts its usage in polymeric matrices. However, the significant number of hydroxyl groups also makes cellulose a distinct substrate that can be easily modified on the surface, thereby expanding its potential for advanced applications. By strong acid and alkali pretreatment, these glycosidic bonds can be hydrolyzed by certain enzymes to extract cellulose. These chemical modifications can enhance the specific surface area and provide excellent mechanical strength and dispersibility.

Green cellulosic adsorbents which are by-products of agricultural waste processing for making secondary products contribute to the generation of solid waste products resulting in the need for big dumping spaces. Therefore, the scientific community has highlighted these biomass waste materials as “low-cost adsorbents” to increase their life cycle and utility [15, 16]. Wheat straw is one of the most abundant wastes produced from wheat grains in the world, contributing approximately 529 million tons annually, with Pakistan being its largest producer, with 38.25 million tons of wheat straw after India and China (2016–2017), respectively [14]. The residue produced from wheat processing is partially used in animal fodders and burning as a fuel; however, large quantities are still dumped in open and closed landfills. Wheat straw, containing 40% cellulosic content is a promising adsorbent precursor for eliminating water pollutants [17]. However, researchers are interested in investigating the modified cellulose adsorbents by using simple chemical monomers, limiting the synthesis cost even more. These strategies encompass carboxylation, grafting co-polymerization and sulfonation [18]. Grafting copolymerization of cellulose with specific monomers enables the quick and effective adsorption of compounds through electrostatic interactions and hydrogen bonding. These modified cellulose adsorbents possess favorable characteristics such as affordability, low density, substantial specific surface area (ranging from 108 to 539 m2 g− 1), highly porous, degradability, and compatibility with biological systems. However, despite their advantageous properties, modified cellulose adsorbents face certain limitations that hinder their practical application in wastewater systems. These limitations include issues such as agglomeration, challenging separation, and the potential risk of secondary pollution [19]. Modified cellulose adsorbents have been utilized to remove numerous pharmaceutical pollutants, including ciprofloxacin, endocrine disruptors, and diclofenac sodium, however, previous researchers have investigated the potential of cellulose adsorbent for diclofenac sodium [9], but comprehensive studies have not been conducted on the removal of diclofenac potassium by chemically modified adsorbents and this emphasizes the novelty of the current work.

In the present study, an efficient adsorbent based on grafted cellulose was prepared from an agricultural by-product (wheat straw) for the removal of diclofenac potassium. The effect of the initial concentration of DCF-p, pH, contact time and raw and modified adsorbent doses, were analyzed to optimize the operating conditions in a batch experiment. Finally, the adsorption mechanism of DCF-p onto surfaces of adsorbents was elucidated through studies conducted using kinetic models and adsorption experiments.

2 Materials and methods

2.1 Isolation of cellulose from wheat straws

Wheat straws were collected from District Haripur, Khyber Pakhtunkhwa, Pakistan. The collected samples were rinsed with deionized water, dried for 48 h and stored in cotton bags for further experiments.

2.2 Acid and alkaline hydrolysis

25 g of raw material (oven dried wheat straw) was added into a round bottom flask (500 mL) with 10% of HCl solution. The contents were heated with 10% HCl solution under reflux for continuous 3 h with the help of hot plate and round bottom spiral flask condenser. The sample was neutralized after being rinsed with distilled water. For alkaline hydrolysis, 25 g of the sample that was previously acid hydrolyzed was added into round bottom flask with the liquor ratio of 1:5. The prepared solution was heated with 10% NaOH solution under reflux for continuous 3 h with the help of hot plate and round bottom spiral flask condenser. The samples were thoroughly cleaned with deionized water until the adsorbent is neutralized. The wet sample was placed at low temperature to prevent degradation of modified cellulose. In alkaline hydrolysis, NaOH combines with any free –COOH or acidic –OH that are present in the pre hydrolyzed wheat straw [20].

2.3 Bleaching of cellulose isolated from wheat straw

Pretreated wheat straw sample (100 g) were treated with glacial acetic acid (5 mL), 0.5 mL H2O2 hydrogen peroxide and 10 mg sodium chlorate in a 500 mL flask. The water bath was used to heat in a water bath for 3 to 5 h, after that it was neutralized with distilled water. The material obtained after bleaching was a raw cellulose [20].

2.4 Chemical modification of cellulose

Cellulose derivatives can be produced from bleached wheat straw by chemical modifications which are used for ion-exchange capability. For example, graft copolymerization of bleached wheat straw with aniline (C6H5NH2) using Fe2+/H2O2 initiator produce grafted copolymers. Graft copolymerization of cellulose is a process in which synthetic polymer and cellulose are combined to produce a material with the best properties of both. Grafting was carried out by steeping 10 g of cellulose in aniline (C6H5NH2) solution for 15 min and then added 3 mL dissolved H2O2, 2.5 g Fe2(SO4)3, 2 mL acetic acid in 500 mL deionized water and placed the at 40 ⁰C for 2.5 h in water bath. The sample underwent filtration, subsequently rinsed with deionized water, air-dried, followed by second washing, and finally air dried. Following the completion of the grafting process, copolymerization grafted cellulose was placed in 250 mL conical flask with anhydrous toluene in water bath at 60 ˚C for 4 h to dissolve the homopolymer. The grafted wheat straw cellulose was then washed with deionized water [21]. The reaction scheme of chemical modification is shown in Fig. 1.

Fig. 1
figure 1

Chemical modification of cellulose fiber with aniline monomer to produce aniline grafted cellulose

2.5 Characterization of raw and chemically modified cellulose

Wheat straw-derived cellulose, both bleached and grafted samples, were investigated before adsorption to determine their surface morphology by using scanning electron microscopy (SEM). The functional groups of raw and chemically modified cellulose were characterized with the help of Fourier transform infrared (FTIR) spectroscopy [22].

2.6 Batch adsorption experiments

For batch studies, 1.5 g of adsorbent dose of raw and modified cellulose was added in 50 mg L− 1 solution of diclofenac potassium in 100 mL conical flasks placed in a shaking incubator under the set conditions of pH 7, for 120 min at 35 ˚C and shaken at 220 rpm. Following shaking the sample was filtered and filtrate was collected. The concentration of diclofenac potassium in the filtrate was determined the absorbance measured using an UV-Vis spectrophotometer at 276 nm (BK-UV1000). The removal percentage (% R) and adsorption capacity qmax (mg g− 1) were calculated by using Eqs. (1) and (2) respectively.

$$\:\text{q}\text{e}\:=\frac{\text{V}\left(\text{C}\text{o}-\text{C}\text{e}\right)}{\text{W}}\:$$
(1)
$$\:\text{\%}\text{R}=\frac{\left(Co-Ce\right)}{Co}\times\:100$$
(2)

Where “qe” is the adsorption capacity at equilibrium, “V” is volume (L), “W” is weight of adsorbent (g), “Co and Ce” are concentration of analyte at initial stage and equilibrium respectively and (%R) is percent removal efficiency.

2.7 Adsorption mechanism studies

2.7.1 Adsorption kinetics studies

Kinetic studies were conducted for both raw and modified cellulose using 0.5 g of adsorbents for 20, 40, 60 and 80 mg L− 1 of DCF-p (pollutant dose). The adsorption was carried out for 20, 40, 60 and 80 min at pH 7. The experimental data obtained was computed by Pseudo 1st order, pseudo 2nd order, and intra-particle diffusion models.

The equation for the pseudo-first order is given below.

$$\:\text{ln}(qe-qt)=lnqe-k1t\:$$
(3)
$$\:\frac{t}{{q}_{t}}=\frac{1}{{K}_{2}{q}^{2}e}+\frac{t}{qe}\:\:\:$$
(4)

The amount of diclofenac potassium adsorbed (mg g− 1) at equilibrium and specific time are represented by qe and qt respectively, while k1 and k2 are rate constant of pseudo-1st order and pseudo-2nd order respectively. By plotting ln (qe- qt) vs. t, and t vs. t/qt the values of constants were determined from the slop and intercept for both pseudo-1st order and pseudo-2nd equations. Similarly, Eq. (6) represents intra-particle diffusion model.

$$\:{q}_{t=}\:{K}_{p}{t}^{0.5}$$
(5)

Where qt (mg g− 1) is the absorbed amount of diclofenac potassium onto the adsorbents at time t, Ki (mg g− 1 min0.5) is the IPD constant and C is the intercept. The intercept’s values are used to calculate the boundary layer effect [23].

2.7.2 Adsorption isotherm studies

Raw cellulose (0.5 g) and modified cellulose (0.5 g) were separately added to 20, 40, 60 and 80 mg L− 1 of DCF-p (pollutant dose) at pH 7 and the maximum adsorption capacities were determined. The experimental data was computed by Freundlich and Langmuir isotherm models and the linear form of these models are shown in Eq. (7) and Eq. (8) respectively.

$$\:\text{ln}q=\:\text{l}\text{n}\text{K}\frac{1}{n}Ce$$
(6)
$$\:\frac{Ce}{q}=\frac{1}{qmax}K+\:\frac{Ce}{qmax}$$
(7)

where Ce (mg L− 1) is the concentration of analyte at equilibrium, the amount of adsorbent adsorbed at equilibrium is denoted by qe (mg g− 1 ), qmax (mg g− 1 ) is the adsorption capacity, and KL is the Langmuir equilibrium constant (L mg − 1 ) while KF is the Freundlich equilibrium constant (mg g− 1), respectively which are dimensionless.

3 Results and discussion

3.1 Characterization of cellulose

3.1.1 SEM analysis

The SEM images of raw and chemically modified cellulose are shown in Fig. 2. A and B respectively. The SEM image in Fig. 2A shows that raw cellulose derived from wheat straw has fibers like structure and free fibers can be seen clearly. After chemical modifications i.e., functionalization with monomers, the fibers of the cellulose look more denser and rearranged owing to the grafting co-polymerization of aniline (Fig. 2B). The grafting of aniline made a thin polymer layer over each fiber and the fibers looks more denser than the fibers of raw cellulose. Similar changes in the surface morphology of cellulosic materials have been observed by other researchers [10, 11].

Fig. 2
figure 2

SEM images of raw cellulose (A) and aniline-modified cellulose (B) extracted from what straw

3.1.2 FTIR spectroscopy

FTIR spectroscopy was employed to analyze the chemical characteristics of the surface of both the raw and modified cellulose adsorbents, both before and after adsorption. The FTIR spectrum before and after DCF-p adsorption for both adsorbents (raw and modified) are shown in Fig. 3 (A) where, and (B). Raw cellulose showed a broader peak before adsorption and were found at 914, 1088, 1141, 1181 and 2161 cm− 1 with strong C-F stretching fluoro compounds, C-O secondary alcohol, tertiary alcohol and aliphatic ether, ester. 2161 cm− 1 corresponded to S-C ≡ N thiocyanate group on adsorbents surface. The adsorption of DCF-p (Fig. 3 (A)) onto raw cellulose associated with C-F, C-O and C-N functional groups peak which shifted from 914 to 924 cm− 1, 1088 to 1096 cm− 1, 1141 to 1150 cm− 1, 1181 to 1190 cm− 1 and 2161 to 2174 cm− 1.

Fig. 3
figure 3

FTIR spectrum of raw cellulose (A), and aniline-modified cellulose (B) before and after the adsorption of DCF-p

As a result of DCF-p adsorption, new peaks were observed in the 1508 to 403 cm− 1 range, indicating the presence of these frequencies in the contaminant spectrum [24]. These findings suggest that the adsorbent material had effectively trapped the contaminant. Figure 3 (B) explained the functional group before and after adsorption onto modified cellulose adsorbents and they were identified at 913, 1134, 1181, 2162 and 2987 cm − 1. The cellulosic C-H vinyl group’s plane bend was shown at 913 cm− 1; 1134 and 1181 cm− 1 which were ascribed to the stretching of the C-O aliphatic ether, ester and tertiary alcohol. While the peak at 2162 cm − 1 represents the stretching of C-N, and 2987 cm− 1 showed C-H, N-H alkane and amine salt stretching group [25].

The adsorption of DCF-p onto modified cellulose associated with C-H, C-O, C-N and N-H functional groups. The peaks shifted from 913 to 921 cm− 1, 1134 to 1144 cm− 1, 1181 to 1196 cm− 1, 2162 to 2174 cm− 1 and 2987 to 2993 cm− 1 [26]. After detailed comparison, the –OH bending vibration of alcoholic group shifted from 1134 to 1181 cm− 1, this small shift might be due to the presence of carboxyl group (-COO) of DCF-p which may be responsible for donating electron. It was also inferred that it may also support the hydrogen bonding between modified cellulose adsorbent and DCF-p [27]. An obvious peak shift and strength was found in the region from 2162 to 2174 cm− 1 and 2987 to 2993 cm− 1, which indicates benzene rings. This indicates the π-π interaction between aromatic alkane and amine salt groups of DCF and modified cellulose adsorbent that strengthen the adsorption process.

3.2 Effect of initial concentration on DCF-potassium removal

The initial concentrations of DCF-p varied from 20, 50, 100, 150, 200, and 250 mg L− 1 while the solution pH, adsorbent dosage and contact time constant were 7, 0.5 g L− 1 and 120 min respectively. The removal efficiency (%) DCF-p at different concentrations for both raw and modified cellulose are presented in Fig. 4 (A). At lower concentration 20 mg L− 1, maximum removal efficiency of 80.6% and 98.8% were obtained for raw and chemically modified cellulose respectively. By increasing the analyte concentration up to 100 mg L− 1, the adsorption efficiencies of raw and modified cellulose adsorbents decreased to 75.33% and 90.39% respectively. Similarly, by further increasing the concentration of DCF-p to 200 and 250 mg L− 1, the removal efficiencies of raw and modified cellulose adsorbents decreased to 65.90% and 80.69% respectively. The removal efficiency of raw and chemically modified cellulose was higher at low concentration because there were small number of DCF-p molecules at lower concentration which were easily picked up by the adsorbents. The results in Fig. 4(A) show that as the concentration increases the removal efficiency decreases for both raw and chemically modified cellulose because the available active sites have been occupied by the analyte molecules. The minimum removal efficiencies of 60.78% and 73.57% were obtained at 250 mg L− 1 for raw and chemically modified celluloses. The results show that the adsorbents can remove DCF-p from concentrated solution (250 mg L− 1) with satisfactory efficiencies owing to their porous nature and the presence of various functional groups (chemically modified cellulose). Similar trend was reported by other researchers as reported in the literature [28, 29].

3.3 Effect of pH on diclofenac potassium removal

The effect of pH on DCF-p removal by raw and chemically modified cellulose was checked by taking DCF-p solution (20 mg L− 1) in six conical flasks and the pH was adjusted to 2,4,6,8,10, 12 using 1MHCl and 1 M NaoH solutions. Other parameters such as adsorbent dose (1.5 g/L) and time (90 min) were kept constant. The results in Fig. 4(B) show that at low pH (2) the removal efficiency of raw and chemically modified cellulose was 60.94% and 72.94% respectively. By increasing the solution pH to 4, the removal efficiency of raw and chemically modified cellulose was increased to 70.82% and 85.28% respectively. The maximum removal efficiency of 79.60% and 97.08% were obtained at pH 7 for raw and chemically modified cellulose respectively. By further increasing the pH of solution to 8, 10 and 12, the removal efficiency of raw and chemically modified cellulose decreased. Minimum removal efficiency of 58.92% and 70.39% were obtained at pH 12 for raw and chemically modified cellulose respectively. As the diclofenac potassium precipitates at pH lower than its pKa of 4.15, therefore, the removal effeciency is lower at pH below 6 [30]. Similarly, at pH above 8, the removal efficiency of DCF-p is low because of the formation of large number of hydroxyl ions in the solution which compete with the adsorbate molecules and saturate the surface of adsorbent. This finding supports the idea that the surface charge of the adsorbent material is sensitive to changes in pH [31,32,33].

3.4 Effect of time on the removal of DCF-p

The effect of adsorption time on the removal of DCF-p is shown in Fig. 4(C). The adsorption of DCF-p onto raw and chemically modified cellulose was carried out for 30, 60, 90, 120 and 150 and 180 min while other parameters were kept constant such as pH 7, adsorbent mass 1.5 g L− 1, and concentration of adsorbate 20 mg L− 1. Figure 4 (C) shows that the removal efficiency of DCF-p on both raw and chemically modified cellulose increases with an increase in adoption time 30 min until the establishment of an equilibrium at 90 min. The availability of surface area and functional binding sites on the adsorbent surface transferred the DCF-p to the surface of adsorbent quickly initially [34]. Increasing adsorption time beyond 90 min brings no significant change in removal efficiency of DCF-p because of the saturation of adsorbent sites by the adsorbate molecules. The maximum removal efficiency of DCF-p on raw and chemically modified cellulose was obtained at 90 min, indicating that 90 min is the optimum adsorption time for DCF-p adsorption onto raw and chemically modified cellulose. Other researchers have also reported similar findings in DCF-p uptake [35].

3.5 Effect of adsorbent dose

Figure 4(D) presents the impact of different doses of raw and chemically modified cellulose on DCF-p removal. The effect of adsorbent dose on DCF-p was checked by conducting experiments in which different quantity of adsorbents (raw and chemically modified cellulose) ranging from 0.5 to 4 gL− 1 while other parameters were kept constant. The results in Fig. 4(D) show that at lower dose i.e., 0.5 gL− 1, the removal efficiencies of raw and chemically modified cellulose for DCF-p were 52.94 and 72.86% respectively. Increasing the adsorbent dose to 1.5 gL− 1 increased the removal efficiencies to 77.64 and 97.73% for raw and chemically modified cellulose respectively. There was no significant change in the removal efficiencies when the adsorbent dose was further increased to 4 gL− 1 as shown in Fig. 4(D). The removal efficiency increased by increasing adsorbent dose because at the initial stage the amount of adsorbent was not enough to pick the adsorbate molecules as there were a smaller number of active sites or functional groups available for the uptake of adsorbate molecules. Adding more adsorbent to the solution leads to the substantial number of functional sites for the uptake of DCF-p and therefore the removal efficiency increased when the adsorbent dose was raised to 1.5 gL− 1. There was no further increase in the removal efficiency by increasing the adsorbent dose beyond 1.5 gL− 1 because the available adsorbate molecules were already picked up by the adsorbent and there were no more adsorbate molecules to be picked up by the adsorbent. Therefore, a horizontal line can be seen in the graph of removal efficiency vs. adsorbent dose when the adsorbent mass was increased from 1.5 gL− 1 to 4 gL− 1. Similar trend was reported by other researchers in the literature [36, 37].

Fig. 4
figure 4

Effect of concentration (A), pH (B), contact time (C) and adsorbent dose (D) on removal of Diclofenac potassium (DCF-p) by raw cellulose and chemically modified cellulose extracted from wheat straw

3.6 Adsorption kinetics

Kinetic studies were carried out to ascertain adsorption capacity as a function of time and the rate at which the system achieves equilibrium [38]. Figure 5 (A) and (B) illustrate the adsorption kinetics of diclofenac potassium on both raw and aniline-modified cellulose respectively. It was noticed that adsorption rate of the contaminant was quick in the initial minutes due to high availability of active sites, reaching adsorption capacity of 1.16 mg g− 1 in 80 min. Once available pores were occupied over time, equilibrium was attained and the adsorption curve plateaus and displays simultaneous absorption and desorption [11, 39]. The equilibrium was established at 120 and 100 min with a qe of 1.96 and 2.89 mg g− 1 for of raw and modified adsorbent respectively at optimal conditions. In order to elucidate the adsorption mechanism in light of the experimental data, two pseudo-first order and pseudo-second order kinetic models were utilized. Table 1 displays the results of key kinetic parameters obtained in the current study.

Various parameters such as rate constant, equilibrium adsorption capacity and R2 values for pseudo 1st order, pseudo 2nd order and intraparticle diffusion models are for raw cellulose and chemically modified cellulose are summarized in Table 1 (A) and 1 (B) respectively. The results show that the average R2 values of pseudo-first order model was pseudo-second order model show the strongest correlation coefficients R2 of 0.8905 and 0.9892 and 0.9977 for raw and chemically modified cellulose. The modified cellulose adsorbent’s adsorption rate (K2) was found to be larger (7.6359 mg g-1 min-1) than raw cellulose adsorbent’s (0.0124 mg g− 1 min− 1) according to the pseudo second order model. This could be explained by the fact that, under similar experimental conditions, more contact time would be needed for raw than modified adsorbent particles at the same concentration of DCF-p adsorption. Raw adsorbent particles have a lower rate of dispersal in the aqueous medium than modified adsorbent, which can result in weak adsorption. Notably, the pseudo-second-order model was discovered to be the best exact fit for the diclofenac adsorption processes in certain earlier investigations. Adsorption kinetics also reflected that grafting of aniline monomer provided more accessible sites for binding for modified cellulose adsorbent relative to raw cellulose adsorbent [40].

Fig. 5
figure 5

Pseudo1st order plot for the adsorption of diclofenac potassium (DCF-p) by raw cellulose (A) and chemically modified cellulose (B)

Fig. 6
figure 6

Pseudo 2nd order plot for the adsorption of diclofenac potassium (DCF-p) by (A) raw cellulose (B) chemically modified cellulose

As illustrated in Fig. 6 (A) and (B), the adsorption mechanism for raw and modified cellulose adsorbents might be related to the following explanation: initially, the adsorption was rapid during the first 20 to 40 min and attained absorption equilibrium at 60 min. The second-order rate equation showed that the adsorption was chemisorption in nature. To analyze the influence of adsorption on the mechanism of mass transfer and diffusion resistance, the experimental data was subjected to the intraparticle diffusion model [41]. However, it is observed that the only limiting step is the adsorption rate and control of the boundary layer in a multi-stage process. This indicates that there may be various steps involved in intraparticle diffusion, such as mass transport, film diffusion, intraparticle diffusion, and surface reaction. In the present study, the diffusion mechanism of DCF-p onto both raw and modified wheat straw cellulose was examined using intra-particle diffusion models. The intra-particle diffusion process involves the movement of DCF-p ions from the solution into the solid phase. The intra-particle diffusion rate constants for raw and modified cellulose adsorbents are listed in Table 1 (A) and (B).

The rate constants value was of IPD model was high for modified cellulose (0.0228 (mg g− 1 min− 1)) and raw cellulose adsorbent (0.0267 (mg g− 1 min− 1)), which was consistent with previous studies It can be seen in Fig. 6 (B), the intra-particle diffusion of DCF-p ions onto the surfaces of both adsorbents observed only one stage which includes rapid dispersion of DCF-p molecules onto the external boundary layer which immediately blocked the active sites inside of the adsorbents. The R2 values (Table 1 (A) and (B)) for both adsorbents indicate a decreased rate of adsorption. As the higher concentration of DCF-p (80 mgL− 1) was adsorbed on the outer surfaces, available active sites were exhausted, and leading to a low adsorption into the interior micro pores of both adsorbents. As demonstrated in Fig. 7(A) and (B), the intra-particle diffusion rate rises steadily when the DCF-p ion concentration is higher. The presence of a boundary layer effect on the surface of both raw and modified cellulose suggests that the chemical adsorption of DCF p is the rate-limiting step.

Fig. 7
figure 7

Intra particle diffusion plot for the adsorption of Diclofenac potassium (DCF-p) by (A) Raw cellulose absorbent (B) Modified cellulose adsorbent

Table 1 Adsorption kinetics constant and regression square values of DCF-p onto raw and chemically modified cellulose

3.7 Adsorption isotherms

Table 2 illustrates the parameters of the Langmuir, Freundlich isotherms, which are significant in understanding the surface properties, attraction of contaminants involved in the adsorption mechanisms [42]. According to the Freundlich isotherm, the adsorption happened. in a multilayer mode onto the surface of the absorbent containing abundant active sites for adsorption. number of adsorption sites. It further explained that adsorption took place onto the micropores and macropores resulting in chemical bonding. Additionally, it has been investigated that the adsorbent with random and porous structure has heterogeneous adsorption sites [43]. A study that employed peach kernel activated carbons to remove diclofenac showed similar results to the current study, with values between 0.560 and 0.635, indicating that the surface was highly heterogeneous. The equilibrium constant (KF) indicates that a higher KF value corresponds to a stronger attraction between the adsorbent and the adsorbate [44].

Table 2 Parameters of the adsorption isotherms of DCF-p onto raw and modified cellulose

The Freundlich isotherm assumed that DCF-p ions were adsorbed on heterogeneous surfaces of both raw and modified cellulosic materials, and that the amount of adsorption rises with concentration. The R2 values for both adsorbents (0.97) exhibited that the adsorption of diclofenac potassium ions takes place on heterogeneous surface with multilayer diffusion. As demonstrated in Fig. 8 (A) that “1/n” values demonstrated the efficacy of both raw and modified adsorbents (0.48 and 0.28), as well as the heterogeneity and high affinity of their surfaces for DCF-p ions [42]. According to the Langmuir adsorption isotherm model, both raw and modified cellulose adsorption by monolayer adsorption on predetermined homogeneous surfaces with a finite number of adsorption sites (Fig. 8B). The linear regression of the raw and grafted experimental data yielded the isotherm constants. R2 = 0.74 and 0.64, respectively, indicate that the Langmuir models for the raw and adjusted sample data are not well fitted. The features of the raw and modified Langmuir isotherms can be described by the dimensionless equilibrium parameter (RL). The isotherm constants and regression analysis show that there is not a perfect agreement between the Langmuir isotherm model and the adsorption data. the RL values’ respective values of 0.021699 and 0.006241. Additionally, it shows that the adsorption data is well-fitted by the Langmuir isotherm model, that the adsorption of DCF-p onto modified cellulose was successful, and that the RL values are less than 1 [29]. In the current study, the experimental data of DCF-p adsorption onto both adsorbents fit well with Freundlich isotherm model (Fig. 8A).

Fig. 8
figure 8

Freundlich isotherm plot (A) and Langmuir isotherm plot (B) for the adsorption of Diclofenac potassium (DCF-p) onto raw cellulose and chemically modified cellulose extracted from wheat straw

3.8 Comparison of current adsorbent with the previous adsorbents for the removal of DCF-P

The removal efficiency of the current adsorbent for DCF-P removal is better than previously reported adsorbents for the removal of DC-P from water or wastewater samples. Araujo et al. [36], used modified seed hulls obtained from moringa for the removal of DCF-p from aqueous medium. However, these treatments resulted in a lower adsorption capacity of 8.06 mg g − 1 and a longer equilibrium time of 1080 min. Another study [37], used fruits waste and activated carbon as adsorbents to remove DCF at a higher concentration of 400 mg L − 1 with adsorption capacities of 6.45 and 4.94 mg g − 1, respectively, and an equilibrium time of 180 min. In comparison, the present study achieved a much higher adsorption capacity for both raw and modified adsorbents at a very low concentration of the pollutant, and in a shorter equilibrium time. Similarly, Ref [38] reported the use of biosorbents to remove diclofenac at a slower adsorption rate of 0.0036 min − 1 from wastewater. These findings do highlight the high potential of modified adsorbents as low-cost options for diclofenac potassium removal [22].

3.9 Adsorption mechanisms

Various types of interactions such as electrostatic interactions, hydrogen bonds, and π-π interactions are expected between aniline grafted cellulose and diclofenac potassium as shown in Fig. 9. The most prominent interaction may be π-π interactions owing to the presence of aromatic rings in aniline grafted cellulose and diclofenac potassium. The H-bonding and electrostatic interactions also exits owing to the presence of positive and negative charges on aniline grafted cellulose and diclofenac potassium. As the aromatic rings, H-bonding and electrostatic interaction are more prominent at neutral pH conditions therefore the removal efficiency of adsorbent is higher at pH 7. The possible mechanisms in the adsorption of pharmaceutical compounds. At lower pH there are a lot of H + ions in the medium which interact with DCF-p as well as adsorbent and thus decreased the adsorbate-adsorbent interaction, therefore the removal efficiency is lower at low pH. Similarly, at high pH the hydroxyl ions interrupt this interaction between DCF-p and adsorbent and thus the removal efficiency decreases. The highest removal efficiency at neutral pH is a plus point for an adsorbent that could be used under neutral conditions and do not need any harsh conditions of low or high pH.

Fig. 9
figure 9

Interaction mechanism of aniline grafted cellulose with diclofenac potassium

4 Conclusion

This study demonstrated that cellulose isolated from what straw could be used as effective adsorbent for the removal of diclofenac potassium from aqueous solution. Cellulose pulp/fibers were isolated from wheat straw (an agricultural by-product) by acid hydrolysis, alkaline hydrolysis and bleaching and functionalized with aniline monomer to prepare aniline grafted cellulose. The adsorption capacities and removal efficiencies of both unmodified cellulose and aniline grafted cellulose for the removal of DCF-p from an aqueous solution were compared and it was found that the aniline grafted cellulose exhibited exceptional adsorption capacity and high removal efficiency. The high adsorption capacity and removal efficiency of aniline grafted cellulose may be owing to the presence of aromatic ring and amine groups on the surface of aniline grafted cellulose. Therefore, the adsorption capacity and removal efficiency of aniline grafted cellulose is higher than unmodified cellulose extracted from wheat straw. By plotting the experimental data on various isotherm models revealed that the adsorption of DCF-p follows Freundlich isotherm model, and the adsorption is chemical adsorption. The aniline grafted cellulose may interact with DCF-p by hydrogen bonding and π-π interaction owing to the presence of aromatic ring in aniline grafted cellulose. The developed adsorbent will be utilized for the removal of other pharmaceuticals and organic pollutants from water in the near future.