Activated Carbon Prepared from Waste Coffee Grounds: Characterization and Adsorption Properties of Dyes

Spent coffee grounds (SCGs) have great potential as a useful, value-added biological material. In this context, activated carbon (AC) was prepared from SCGs by an activation process using H3PO4 at 600 °C in the air and used as an adsorbent for the azo dye AO7, a model molecule for dye colorants found in textile industry effluents. X-ray diffraction, SEM and BET revealed that the AC was predominantly amorphous, consisting of a powder of 20–100 µm particles with mesopores averaging 5.5 nm in pore size. Adsorption kinetics followed a pseudo-second-order law, while the Langmuir model best fitted the experimental isotherm data (maximum capacity of 119.5 mg AO7 per AC g). The thermodynamic parameters revealed that adsorption was endothermic and spontaneous. All the characterizations indicated that adsorption occurred by physisorption via mainly π–π interactions. The best experimental removal efficiency optimized by means of a Box–Behnken design and response surface methodology was 98% for an initial AO7 concentration of 20 mg·L−1 at pH 7.5 with a dose of 0.285 g·L−1 of AC and a contact time of 40 min. These results clearly show that activated carbon prepared from SCGs can be a useful material for efficiently removing organic matter from aqueous solutions.


Introduction
Water is an essential resource which integrity is often compromised by the discharge of industrial waste containing harmful substances into natural environments [1].A striking example of this challenge is the treatment of contaminated industrial wastewater, particularly from the textile industry, one of the biggest water consumers [2].This industry generates a large volume of waste loaded with dyes and chemicals, posing a threat to human health and the environment [3].It is responsible for the largest amount of wastewater compared to other industries, at over 56% [4,5].Recent estimates have indicated an annual consumption of more than 10,000 tons of over 100,000 commercial dyes [6][7][8][9].Approximately 10-15% of the dye is lost during the dyeing process, and around 20% of the lost dye ends up in wastewater [10,11], with a concentration of up to 1 mg•L −1 [12,13].Synthetic dyes, especially azo dyes, are of particular concern because of their carcinogenic, mutagenic and teratogenic properties, as well as the high chemical and biological oxygen demand required for their degradation [14,15].Acid Orange 7 (AO7), an azo dye widely used as a model molecule, exemplifies these challenges.Despite its water solubility and stability, AO7 can cause methemoglobinemia upon human exposure, resulting in symptoms such as cyanosis and weakness [15][16][17].
Azo dyes, characterized by an azo chromophore group (-N=N-) and an electronreceiving sulfonate group (-SO 3 − ), are difficult to degrade by conventional processing methods [18][19][20].In fact, textile dyes are not easily biodegradable, requiring the development of specific microbial strains and immobilized enzymes [21].Another approach to decontaminating water polluted by textile dyes is the use of physicochemical techniques, including electrochemical oxidation [22], coagulation-flocculation [23], filtration [24,25] and photodegradation [26].However, these methods often have drawbacks, such as high costs and the production of toxic by-products.Adsorption appears to be a promising alternative approach due to its cost-effectiveness and its ability to remove contaminants without introducing additional toxicity.A number of different approaches have been developed [27][28][29].Activated carbon (AC) is emerging as an adsorbent of choice, especially when derived from natural biopolymers or waste products, offering a sustainable and cost-effective solution for water purification [8].The production of AC from inexpensive feedstocks available in large quantities makes it possible to envisage an easily scalable adsorption process [30].In this work, spent coffee grounds (SCGs) were chosen as a precursor to produce AC [31,32].
Coffee is one of the world's most popular beverages.Every year, more than five million tons of coffee are produced worldwide (International Coffee Organization, London, UK, 2022).Generally, SCGs are disposed of by composting, incineration or landfill.It has been reported that these methods can have a negative impact on the environment, releasing contaminating residues of tannin, caffeine and polyphenols [33].Other ways of valorizing SCGs have been proposed, such as converting them into biofuel, biodiesel, bioethanol or biomaterials [34] and producing biochar and AC [35][36][37].These routes can help reinforce the circular economy approach by enabling continuous processes that reduce the accumulation of waste by transforming it into useful, value-added materials while promoting more environmentally friendly models [38,39].
This study examined the removal of AO7, as a model molecule for azo dye used in textile industry, by adsorption onto AC produced from SCGs.The physicochemical properties of the AC produced were investigated using techniques such as TGA-DTG, XRD, FT-IR and SEM.With a view toward optimizing the process, studies including adsorption kinetics and isotherms, as well as thermodynamic characteristics, were carried out to understand how certain experimental parameters such as the dye concentration/adsorbent quantity ratio and contact time can affect the adsorption operation.A statistical analysis was then applied to assess the weight of each of the experimental parameters.The response surface methodology (RSM) model was used to analyze the interactions among the parameters studied in order to gain a better insight into their combined effects.This method has the advantage of evaluating several parameters at once, which reduces the number of experiments required and saves time compared to the traditional method of examining one factor at a time [40,41].In addition, the efficiency of experimental systems can be effectively evaluated and process variability minimized.

Chemicals
The SCGs used in the present study were collected from local coffee shops and served as a low-cost precursor for AC.Phosphoric acid (H 3 PO 4 , 50%) was used as a chemical activating agent in the preparation of AC.The azo dye AO7 (analytical grade ≥ 85%), which characteristics are given in Table 1, was supplied by Sigma-Aldrich (St. Louis, MO, USA).All aqueous solutions were prepared with deionized water and pH-adjusted with sodium hydroxide (NaOH, 0.2 M) and hydrochloric acid (HCl, 0.2 M).

Activated Carbon Preparation
Two batches of SCG-based AC were prepared according to the following procedure, adapted from [42].Typically, SCGs (30 g) were washed with deionized water, then dried in an oven at 60 °C.The resulting dried SCGs were immersed in a 50% solution of H3PO4

Activated Carbon Preparation
Two batches of SCG-based AC were prepared according to the following procedure, adapted from [42].Typically, SCGs (30 g) were washed with deionized water, then dried in an oven at 60 • C. The resulting dried SCGs were immersed in a 50% solution of H 3 PO 4 in a weight ratio of 1:3 (SCG:H 3 PO 4 ) and stirred at 80 • C for 3 h.Slow pyrolysis was then carried out at 600 • C for 2 h in a muffle furnace in the air.The resulting AC was washed with deionized water to a neutral pH and then finally dried in an electric oven at 105 • C for 24 h.

Characterization of AC
The produced AC was characterized using FTIR (Spectrum 100, Perkin Elmer, Waltham, MA, USA) and SEM (Quanta-250, Thermo Fisher Scientific, Waltham, MA, USA) at an accelerating voltage of 20 kV to identify the surface functional groups and morphologies, respectively.The specific surface area, total pore volume and pore diameter were measured using the Brunauer, Emmett and Teller (BET) method (ASAP 2020, Micromeritics, Norcross, GA, USA).The crystalline structure was determined by X-ray diffraction (XRD 6000, Shimadzu, Kyoto, Japan) using Cu Kα1 (λ = 1.5046Å) with an X-ray source through the 2θ range from 4 • to 80 • .Thermogravimetric analysis (TGA; Labsys evo1150, Setaram, Caluire-et-Cuire, France) was carried out to determine the thermal stability.
The zero charge point is the pH at which the AC surface becomes neutral.This value (pH PZC ) was determined using the following procedure: 50 mL of NaCl solution (0.01 M) with pH values ranging from 1 to 10 was prepared by adding NaOH solution (0.2 M) and HCl solution (0.2 M), then 100 mg of AC was added to each solution and left to stir for 48 h at room temperature.The final pH after 48 h was recorded to calculate the pH change.The pH PZC point was identified at the intersection of the curve (final pH-initial pH) and the straight line (final pH = initial pH) using a graphical representation of the data.

Batch Adsorption Studies
A stock solution was prepared at 0.1 g•L −1 from AO7 as purchased.The concentrations required for the adsorption experiments were obtained by dilution with deionized water.The desired amount of AC, depending on the experimental conditions chosen, was added to the 100 mL dye solution under magnetic stirring (500 rpm) at room temperature (about 25 • C).The pH was 7.5 and remained unchanged during the adsorption experiments.Once the adsorption process was complete, the solution mixture was passed through a 0.45 µm syringe filter.The filtrate obtained was then analyzed using a UV-Visible spectrophotometer at a wavelength of 483 nm to determine the percentage of dye removal according to the calibration curve.The dye adsorption capacity and removal efficiency of the adsorbent were quantified using Equations ( 1) and (2), respectively.
where q t (mg•g −1 ) is the adsorption capacity at time t, R the AO7 dye removal efficiency, C 0 the initial dye concentration, C t (mg•L −1 ) the dye concentration at time t, V (mL) the solution volume and M (g), the mass of the AC adsorbent.

Adsorption Kinetics
The kinetics of the adsorption process were evaluated by varying the contact time between AO7 and AC.The experiment was carried out in a 200 mL suspension with a dye concentration of 30 mg•L −1 and 0.6 g AC.The concentration of dye in the solution was determined every 10 min until equilibrium was reached, when its value remained constant.The data were then fitted to pseudo-first-order and pseudo-second-order models (equations presented in Table 2).

Kinetic Model Equation
Pseudo-first-order log(q e − q t ) = logq e − K f •t 2303 (3) Pseudo-second-order where q t and q e (mg•g −1 ) are the adsorption capacity at time t and equilibrium, respectively, and K f and K s are the pseudo-first-order (min −1 ) and pseudo-second-order (g (mg•min) −1 ) adsorption rate constants, respectively.

Adsorption Isotherms
Adsorption isotherm models can be used to highlight the interactions of AO7 molecules with adsorption sites on the AC surface.This experiment examined the correlation between the amount of dye adsorbed at equilibrium and the amount of sorbent used.For this study, the dye concentrations ranged from 10 to 90 mg•L −1 , while the AC quantity and contact time were kept constant and equal to 0.3 g•L −1 and 60 min, respectively.Data adequacy and characterization of the adsorbent surfaces as heterogeneous or homogeneous were assessed using Langmuir and Freundlich isotherm models (linearized equations presented in Table 3).

Isotherm Model Equation
Langmuir Freundlich where q max and q e (mg•g −1 ) are the maximum monolayer adsorption capacity of the adsorbent and at equilibrium in Equations ( 5) and ( 6), respectively, C e (mg•L −1 ) the equilibrium value of the initial concentration, K L the Langmuir constant (mg•L −1 ) and K F the Freundlich constant.

Adsorption Thermodynamics
Equilibrium adsorption isotherms were performed at three different temperatures (298, 321 and 339 K) to determine the thermodynamic parameters, such as enthalpy, entropy and Gibbs free energy, using Equations ( 7)- (9) presented in Table 4.

Thermodynamic Parameters Equation
Gibbs free energy where K c (dimensionless) is the equilibrium constant; K L (L•mg −1 ) the Langmuir constant; 55.51 the number of moles of pure water per liter (mol•L −1 ); Mw (g•mol −1 ) the molecular weight of the dye; T ( • K) is the absolute temperature; R the ideal gas constant (8.314J•mol −1 •K −1 ); and ∆G • (kJ•mol −1 ) is the Gibbs free energy change, ∆H • (kJ•mol −1 ) the enthalpy change and ∆S • (J•mol −1 •K −1 ) the entropy change.

Optimization of AO7 Removal by AC Adsorption
A Box-Benken quadratic three-factor response RSM model was developed to determine the impact of three independent variables on AO7 dye removal: contact time (X 1 ), initial dye concentration (X 2 ) and adsorbent dose (X 3 ).This approach made it possible to optimize the response variable (Y) as a function of the input variables while reducing the amount of experimental work required for the adsorption studies.Design-Expert v12 software (Stat-Ease, Minneapolis, MI, USA) was applied to analyze the data using the RSM approach.In this study, the box in which the selected parameters were varied was 10-60 min for the contact time, 10-90 mg•L −1 for the initial dye concentration and 0.1-0.4g•L −1 for the adsorbent dose.Fifteen experiments were designed to optimize the combination of input variables, with AO7 dye removal efficiency (%) used as the output response.To assess the model fit, analysis of variance (ANOVA) was used.The results derived from the experimental design, structured in three levels, were fitted using a model designed to capture the desired response.A classical polynomial regression equation was used to express the predicted response (Y): where the X i is the input factors that can influence the response Y, n the number of variables, a 0 the constant intercept, a i the linear and a ii the quadratic coefficient (with (i = 1, 2. . .n) and a ij (i = 1, 2. . .n − 1; j = 2, . . .n) the interaction coefficient between two input factors.The regression and RSM models were used to investigate the highest projected dye removal.

Results and Discussion
Two batches of AC were prepared.Very similar results were obtained in terms of material characterization and adsorption properties.

Chemical Group Analysis
The raw SCG mixture and the AC produced were compared using the FTIR technique to highlight the change in characteristic functional groups during activation (Figure 1a,b).The following band assignments were made based on the data found in the literature [43][44][45]: • As expected, AC showed stronger absorption than the starting SCG material around 1600 cm −1 corresponding to the C=C vibrations in aromatic rings due to pyrolysis.On the other hand, the broad band around 1200 cm −1 was attributed to P=O and P-O-C vibrations associated with H3PO4 activation.Comparison of the AC spectra before and after dye adsorption (Figure 1b,c) revealed only slight changes due to a strong overlap of their respective characteristic bands.However, an increase in absorption in the 1500-1550 cm −1 range linked to the vibrations of azo groups (-N=N-) was observed, confirming the AO7 adsorption.

Structural Characterization
The X-ray diffraction was used to study the existence of crystalline structures and the amorphous nature within the AC matrix (Figure 2).The powder spectrum obtained revealed two diffraction peaks at about 2θ = 24 and 44°, as is usually observed for AC prepared from different sources, indicating that the activation process was successful [42,[46][47][48].The peaks observed are generally associated with the (002) and (100) reflection planes of graphite.However, as can be seen, the diffraction peaks are quite broad, suggesting that the structure of the prepared AC consisted of small crystalline phases dispersed in large disordered zones.
The amorphous structure of adsorbent is expected to create a favorable microenvironment for the adsorption of molecules in large quantities with a stronger bond.In contrast, crystalline structures have uniform shapes, making the adsorption ability difficult.The AC prepared from SCGs in this work presented a structure suitable for having good adsorption capability.• The presence in the SCG spectrum (Figure 1a) of a broad transmission band between 3200 and 3600 cm −1 was attributed to the O-H stretching vibrations in cellulose, hemicellulose and lignin molecules.This band almost disappeared in the AC spectrum (Figure 1b) due to dehydration caused by the combination of H 3 PO 4 and heat action.• The sharp bands at 2800-3000 cm −1 can be assigned to stretch vibrations of the C-H bond in the saturated hydrocarbons.These strong absorptions in the SCG spectrum have been assumed due to the presence of components other than cellulose, hemicellulose and lignin molecules [44].These bands disappeared in the AC spectrum, probably indicating their decomposition during pyrolysis.• The bands between 1650 and 1750 cm −1 characteristic of carbonyl groups in the SCG spectrum revealed the presence of lignin and the strong absorption observed in the 1000-1200 cm −1 region linked to C-O stretching vibrations of cellulose, hemicellulose and lignin.• As expected, AC showed stronger absorption than the starting SCG material around 1600 cm −1 corresponding to the C=C vibrations in aromatic rings due to pyrolysis.On the other hand, the broad band around 1200 cm −1 was attributed to P=O and P-O-C vibrations associated with H 3 PO 4 activation.
Comparison of the AC spectra before and after dye adsorption (Figure 1b,c) revealed only slight changes due to a strong overlap of their respective characteristic bands.However, an increase in absorption in the 1500-1550 cm −1 range linked to the vibrations of azo groups (-N=N-) was observed, confirming the AO7 adsorption.

Structural Characterization
The X-ray diffraction was used to study the existence of crystalline structures and the amorphous nature within the AC matrix (Figure 2).The powder spectrum obtained revealed two diffraction peaks at about 2θ = 24 and 44 • , as is usually observed for AC prepared from different sources, indicating that the activation process was successful [42,[46][47][48].The peaks observed are generally associated with the (002) and (100) reflection planes of graphite.However, as can be seen, the diffraction peaks are quite broad, suggesting that the structure of the prepared AC consisted of small crystalline phases dispersed in large disordered zones.

Morphological Analysis
SEM analysis provided useful information on the shape, size and structure of the AC powder particles (Figure 3).The irregular-shaped particles showed a polydisperse size distribution with dimensions ranging mainly from about 20 to 100 µm.In addition, SEM images enabled us to characterize the porous structure generated during the acid activation and pyrolysis processes.The outer surface of the particles had a macroporous morphology with cavity smaller than 20 µm.The enlargement in Figure 3 shows that interconnection by smaller pores in the cavities ensures the penetration and transfer of lowmolecular-weight molecules from the surface to the inner microporosity of the adsorbent.The amorphous structure of adsorbent is expected to create a favorable microenvironment for the adsorption of molecules in large quantities with a stronger bond.In contrast, crystalline structures have uniform shapes, making the adsorption ability difficult.The AC prepared from SCGs in this work presented a structure suitable for having good adsorption capability.

Morphological Analysis
SEM analysis provided useful information on the shape, size and structure of the AC powder particles (Figure 3).The irregular-shaped particles showed a polydisperse size distribution with dimensions ranging mainly from about 20 to 100 µm.In addition, SEM images enabled us to characterize the porous structure generated during the acid activation and pyrolysis processes.The outer surface of the particles had a macroporous morphology with cavity smaller than 20 µm.The enlargement in Figure 3 shows that interconnection by smaller pores in the cavities ensures the penetration and transfer of low-molecular-weight molecules from the surface to the inner microporosity of the adsorbent.

Textural Properties
Activated carbons are porous substances with a wide variety of pores ranging from macropores (>50 nm) to mesopores (2-50 nm) and occasionally a small number of micropores (<2 nm), depending on the activation process [29].Gas adsorption-in particular, nitrogen adsorption at 77 K-is a commonly used method for studying the characteristics of porous activated carbons.Figure 4a,b show the hysteresis of the adsorption isotherm and the pore distribution deduced for the AC sample, respectively.The material mainly exhibited a mesoporous structure according to IUPAC standards (Figure 4a; Type IV isotherm) [49], with a surface area and pore volume at 295 K of 29.38 m 2 •g and 0.067 cm 3 •g, respectively (Table 5).These values are easily explained by the reduction in the surface area and total volume of AC pores due to pyrolysis, which leads to pore collapse in composite materials [50].However, given the small molecular size of the dyes, and of AO7 in particular (Table 1), the mean pore size (D m ) of 5.5 nm appears large enough to allow internal mass transfer of these compounds within the AC porous structure.

Morphological Analysis
SEM analysis provided useful information on the shape, size and structure of the AC powder particles (Figure 3).The irregular-shaped particles showed a polydisperse size distribution with dimensions ranging mainly from about 20 to 100 µm.In addition, SEM images enabled us to characterize the porous structure generated during the acid activation and pyrolysis processes.The outer surface of the particles had a macroporous morphology with cavity smaller than 20 µm.The enlargement in Figure 3 shows that interconnection by smaller pores in the cavities ensures the penetration and transfer of lowmolecular-weight molecules from the surface to the inner microporosity of the adsorbent.Activated carbons are porous substances with a wide variety of pores ranging from macropores (>50 nm) to mesopores (2-50 nm) and occasionally a small number of m cropores (<2 nm), depending on the activation process [29].Gas adsorption-in particula nitrogen adsorption at 77 K-is a commonly used method for studying the characteristic of porous activated carbons.Figure 4a,b show the hysteresis of the adsorption isotherm and the pore distribution deduced for the AC sample, respectively.The material mainl exhibited a mesoporous structure according to IUPAC standards (Figure 4a; Type IV iso therm) [49], with a surface area and pore volume at 295 K of 29.38 m 2 •g and 0.067 cm 3 •g respectively (Table 5).These values are easily explained by the reduction in the surfac area and total volume of AC pores due to pyrolysis, which leads to pore collapse in com posite materials [50].However, given the small molecular size of the dyes, and of AO7 i particular (Table 1), the mean pore size (Dm) of 5.5 nm appears large enough to allow in ternal mass transfer of these compounds within the AC porous structure.

Thermal Stability
Figure 5 shows the variation in AC weight between 50 and 1100 °C using TGA.Th thermogram obtained displays that a significant mass loss, equivalent to about 20%, oc curred from 50 °C to 150 °C.It mainly corresponded to the removal of moisture (DTG peak at 100 °C) and, possibly, of volatile compounds that accumulated within the porou structure of the material during its storage [51].This result is indicative of the excellen adsorption properties of AC prepared in this work.Then, the curve shows a plateau up t 450 °C with no significant mass loss, revealing high thermal resistance and possible appl AC (from SCG) 29.38 0.067 5.5

Thermal Stability
Figure 5 shows the variation in AC weight between 50 and 1100 • C using TGA.The thermogram obtained displays that a significant mass loss, equivalent to about 20%, occurred from 50 • C to 150 • C. It mainly corresponded to the removal of moisture (DTG peak at 100 • C) and, possibly, of volatile compounds that accumulated within the porous structure of the material during its storage [51].This result is indicative of the excellent adsorption properties of AC prepared in this work.Then, the curve shows a plateau up to 450 • C with no significant mass loss, revealing high thermal resistance and possible applications in this temperature range.After this second region, a gradual weight loss of about 30% is observed from 450 • C to 1100 • C.This mass decrease is due to decomposition of the oxygenated functions and partial degradation of the carbon skeleton [52,53].

pH Determination of Zero Charge Point
The surface charge of an adsorbent as a function of pH is an important parameter for the adsorption process, as it depends on the chemical groups present on the surface.Figure 6 presents the shift in pH AC suspension compared to the corresponding blank solutions.The intersection of curves at pH 2.4 indicates when the net AC surface charge becomes neutral at this value (pHPZC).This implies that, for pH above this, the number of negatively charged surface functions is higher than that of positively charged functions, mainly due to deprotonation of the carboxylic and phenolic groups [53].

pH Determination of Zero Charge Point
The surface charge of an adsorbent as a function of pH is an important parameter for the adsorption process, as it depends on the chemical groups present on the surface.Figure 6 presents the shift in pH AC suspension compared to the corresponding blank solutions.The intersection of curves at pH 2.4 indicates when the net AC surface charge becomes neutral at this value (pH PZC ).This implies that, for pH above this, the number of negatively charged surface functions is higher than that of positively charged functions, mainly due to deprotonation of the carboxylic and phenolic groups [53].

pH Determination of Zero Charge Point
The surface charge of an adsorbent as a function of pH is an important parameter for the adsorption process, as it depends on the chemical groups present on the surface.Figure 6 presents the shift in pH AC suspension compared to the corresponding blank solutions.The intersection of curves at pH 2.4 indicates when the net AC surface charge becomes neutral at this value (pHPZC).This implies that, for pH above this, the number of negatively charged surface functions is higher than that of positively charged functions, mainly due to deprotonation of the carboxylic and phenolic groups [53].

Adsorption Kinetics
Adsorption kinetics and analysis of the quantity adsorbed at equilibrium are the two key parameters for understanding and optimizing the adsorption process.The rate of removal of the AO7 dye from solution by AC was studied in order to establish the kinetic laws of adsorption.These experimental data were modeled in Figure 7 using two theoretical approaches: the pseudo-first-order (PFO) model and the pseudo-second-order (PSO) model (Table 2).
Materials 2024, 17, x FOR PEER REVIEW 10 of 22 laws of adsorption.These experimental data were modeled in Figure 7 using two theoretical approaches: the pseudo-first-order (PFO) model and the pseudo-second-order (PSO) model (Table 2).The best fitting for each of the two Equations ( 3) and (4) were obtained using the coefficients listed in Table 6.It was found that experimental data fitted the PSO model (Figure 7b) much better than the PFO model (Figure 7a).The quantities of dye adsorbed on AC (qexp) were almost identical to those calculated (R 2 values close to unity).These results confirm the relevance of the PSO model to describe the adsorption kinetics of the AO7 dye on the AC surface and agree fully with previously reported data for the adsorption of various dyes on activated carbon [29].

Adsorption Isotherms
Isotherm adsorption modeling makes it possible to determine the various equilibrium parameters, understand the degree of affinity and interpret interaction mechanisms between the adsorbent and adsorbate.Numerous models have been developed in the literature, taking into account parameters such as the number of layers of adsorbed molecules, surface heterogeneity and binding energies [29].Langmuir and Freundlich isotherm models are the most frequently used due to their simplicity and consistency.The adsorption mechanism of AO7 by AC was analyzed at three different temperatures using these two models.Figure 8 presents the data non-linearized and the corresponding fitted theoretical curves.The optimized parameter values obtained for Equations ( 5) and ( 6) are listed in Table 7.

Langmuir
Freundlich T (K)  The best fitting for each of the two Equations ( 3) and (4) were obtained using the coefficients listed in Table 6.It was found that experimental data fitted the PSO model (Figure 7b) much better than the PFO model (Figure 7a).The quantities of dye adsorbed on AC (q exp ) were almost identical to those calculated (R 2 values close to unity).These results confirm the relevance of the PSO model to describe the adsorption kinetics of the AO7 dye on the AC surface and agree fully with previously reported data for the adsorption of various dyes on activated carbon [29].Table 6.Kinetic parameters for AO7 adsorption.

Adsorption Isotherms
Isotherm adsorption modeling makes it possible to determine the various equilibrium parameters, understand the degree of affinity and interpret interaction mechanisms between the adsorbent and adsorbate.Numerous models have been developed in the literature, taking into account parameters such as the number of layers of adsorbed molecules, surface heterogeneity and binding energies [29].Langmuir and Freundlich isotherm models are the most frequently used due to their simplicity and consistency.The adsorption mechanism of AO7 by AC was analyzed at three different temperatures using these two models.Figure 8 presents the data non-linearized and the corresponding fitted theoretical curves.The optimized parameter values obtained for Equations ( 5) and ( 6) are listed in Table 7.
The experimental results fit better with the Langmuir model based on homogeneous monolayer sorption (R 2 = 0.9877) than with the Freundlich model based on heterogeneous multilayer sorption at all temperatures.As a result, AO7 molecules are assumed to disperse into monolayers on adsorption sites that are identical in terms of energy and without electrostatic interactions between them [18].The parameter R L is a measure of the separation factor between the adsorbate and adsorbent in a system.A value between 0 and 1 indicates a favorable adsorption process, while R L > 1 represents unfavorable adsorption.When R L = 1, adsorption is linear, and when its value is zero, the adsorption process is irreversible.The separation constant obtained by modeling in Table 7 (R L = 0.178 − 0.223 << 1) suggests a very strong but still reversible adsorption of AO7 by the AC prepared in this work.The experimental results fit better with the Langmuir model based on homogeneo monolayer sorption (R 2 = 0.9877) than with the Freundlich model based on heterogeneo multilayer sorption at all temperatures.As a result, AO7 molecules are assumed to d perse into monolayers on adsorption sites that are identical in terms of energy and witho electrostatic interactions between them [18].The parameter RL is a measure of the separ tion factor between the adsorbate and adsorbent in a system.A value between 0 and indicates a favorable adsorption process, while RL > 1 represents unfavorable adsorptio When RL = 1, adsorption is linear, and when its value is zero, the adsorption process irreversible.The separation constant obtained by modeling in Table 7 (RL = 0.178 − 0.2 << 1) suggests a very strong but still reversible adsorption of AO7 by the AC prepared this work.

Adsorption Thermodynamics
Thermodynamic factors, including standard free energy (ΔG°), enthalpy (ΔH°) an entropy (ΔS°), are the key parameters in understanding the adsorption reaction.It is th possible to gain deeper insight by identifying the spontaneity, heat exchange and degr of disorder of the process.Table 8 presents the values obtained in the temperature ran 298-339 K using Equations ( 7)- (9).
The results led to the following conclusions: The negative ΔG° values indicate that the adsorption process is favorable and spo taneous within the selected temperature range.The ΔG° values become more negati with the increasing temperature, suggesting that the adsorption process is facilitated.Th Table 7. Isotherm modeling parameters for AO7 adsorption.

Adsorption Thermodynamics
Thermodynamic factors, including standard free energy (∆G • ), enthalpy (∆H • ) and entropy (∆S • ), are the key parameters in understanding the adsorption reaction.It is then possible to gain deeper insight by identifying the spontaneity, heat exchange and degree of disorder of the process.Table 8 presents the values obtained in the temperature range 298-339 K using Equations ( 7)- (9).
The results led to the following conclusions: The negative ∆G • values indicate that the adsorption process is favorable and spontaneous within the selected temperature range.The ∆G • values become more negative with the increasing temperature, suggesting that the adsorption process is facilitated.This effect could be due to the widening of the AC pores with the increasing temperature, resulting in an easier diffusion of AO7 molecules and greater accessibility to adsorption sites located within the AC [52,54].
The positive ∆S • value indicates that the AO7 adsorption process is characterized by increased disorder in the interaction between dye molecules and the AC surface.A similar result has been reported for AO7 adsorption on AC from algae [18].Adsorption is generally considered to decrease the number of degrees of freedom by reducing the adsorbate movement, resulting in a negative ∆S • value.The A07 molecule is hydrophobic by nature (Table 1) and is assumed to be solubilized in water as small micellar aggregates.It can therefore be assumed that adsorption of an isolated molecule on the AC interface increases the degree of freedom, which may explain the positive value of ∆S • obtained.
The positive ∆H • value indicates that the dye adsorption process is endothermic in nature.Based on the ∆H • values, it can be deduced that the adsorption is predominantly physisorption through interactions between AO7 molecules and AC active sites such as hydrogen bonds and π-π interactions.This is confirmed by the fact that the ∆H • value is less than 40 kJ•mol −1 [55,56].

Thermodynamic
Parameters T (

Adsorption Mechanism
Previous studies have shown that dye adsorption on activated carbon is influenced by various factors, such as electrostatic attraction, hydrogen bonding, Van der Waals interactions and π-π interactions.Interestingly, adsorption of the anionic dye occurs at pH values higher than the pH PZC of AC, while its surface charge is, on average, negative.Under these operating conditions, the predominant electrical interactions are repulsive, making adsorption unfavorable or limited even if a number of positive charges are present.This means that electrostatic interactions cannot be the main mechanism of AO7 adsorption and suggests the involvement of other types of interactions [18].One possible mechanism is hydrogen bonding, as shown by the analysis of the FTIR spectra (Figure 1).The characteristic peak for hydroxyl groups showed a red shift (move from 3400 cm −1 to 3300 cm −1 ) and broadening after AO7 adsorption, pointing to hydrogen bonding between the hydroxyl groups on the AC surface and AO7.In addition, π-π interactions between the adsorbents and dye molecules seem to play a crucial role in the AO7 adsorption process.This is also supported by the FTIR analysis, which revealed a weakening of the absorption intensity and a broadening of the characteristic C=C peak (1600 cm −1 ) in the AC spectrum after AO7 adsorption (Figure 1), suggesting an interaction between the π-electron system of the AC structure and the aromatic rings of the AO7 dye molecules (Table 1) [55,56].This is in perfect agreement with the endothermic nature of adsorption and the ∆H • value marking a physisorption mechanism and π-π-type interactions, as mentioned above.Figure 9 presents the proposed interaction mechanisms occurring during the AO7 adsorption on AC prepared from SCGs in this work.

Experimental Design and Response Surface Plots of AO7 Removal
Preliminary experiments showed that contact time, dye concentration and adsorbent dose were the key factors to be optimized.Although pH and temperature also had an influence, they were not of primary importance for the adsorption of AO7 on the AC prepared in this work.Therefore, to save time, these two parameters were kept at 7.5 and about 25 • C, while only the first three parameters mentioned were varied.

Experimental Design and Response Surface Plots of AO7 Removal
Preliminary experiments showed that contact time, dye concentration and adsorbent dose were the key factors to be optimized.Although pH and temperature also had an influence, they were not of primary importance for the adsorption of AO7 on the AC prepared in this work.Therefore, to save time, these two parameters were kept at 7.5 and about 25 °C, while only the first three parameters mentioned were varied.

Statistical Analysis of the Derived Response Surface Model
In order to determine the optimum experimental conditions for AO7 removal efficiency by AC (output variable response) and to elucidate the weight of the different input parameters (X1: contact time, X2: dye concentration, and X3: adsorbent dose), batch adsorption experiments were carried out using the Box-Behnken design method as part of the RSM model.A series of 15 experiments was conducted according to a customized design, and the experimental-and model-predicted responses are summarized in Table 9.The last column shows the residual calculated as the difference between the experimental responses and those predicted by the model.Depending on the value of the input factors, the percentage of dye removal varies between 15 and 98%, with residual values well below 4%.

Statistical Analysis of the Derived Response Surface Model
In order to determine the optimum experimental conditions for AO7 removal efficiency by AC (output variable response) and to elucidate the weight of the different input parameters (X 1 : contact time, X 2 : dye concentration, and X 3 : adsorbent dose), batch adsorption experiments were carried out using the Box-Behnken design method as part of the RSM model.A series of 15 experiments was conducted according to a customized design, and the experimental-and model-predicted responses are summarized in Table 9.The last column shows the residual calculated as the difference between the experimental responses and those predicted by the model.Depending on the value of the input factors, the percentage of dye removal varies between 15 and 98%, with residual values well below 4%.
Table 9. Box-Behnken design and comparison of experimental-and model-predicted results for AO7 adsorption using AC.

Factors
Response Y Residual (% Removal) X 1 (min) Table 10 presents the analysis of variance (ANOVA) of the regression parameters of the quadratic response surface models predicted for the percent of dye removal.The F-value of 66.94 and the adjusted regression coefficient above 99% indicate that the model equation is highly significant.Furthermore, there is only a small probability of 0.01% that this F-value is due to noise [52].This analysis also makes it possible to determine the weight of the input parameters and their interactions through the polynomial coefficients of the model (Table 11).It appears from the F-values that X 1 , X 2 , X 3 , X 1 X 3 , X 2 X 3 , X 1 2 and X 3 2 are the most significant terms in the model.In addition, p-values greater than 0.100 indicate that X 1 X 2 and X 2 2 do not significantly contribute to the removal efficiency of AO7.Consequently, the polynomial Equation ( 10) can simply be written as follows: For the purpose of process optimization, Equation (11) of the model shows the extent to which dye removal efficiency is affected by the various input factors considered through their linear and quadratic terms, as well as their mutual interactions.Negative coefficients indicate that the corresponding factors have a negative impact on the removal efficiency [32].The factor (X 2 ) is the most influential parameter: the higher the dye concentration, the lower the removal efficiency (Y).Contact time (X 1 ) and adsorbent dose (X 3 ) have antagonistic effects.
As mentioned above, the regression coefficient R 2 obtained in this study was 0.9918, indicating that the developed customized model accounted for about 99% of the variability observed in the experimental data.In addition, the adjusted regression coefficient R 2 adj was 0.9770, which implies that nearly 98% of the variability, given the number of variables and degrees of freedom, can be explained by the model.Figure 10 compares actual values with predicted model-derived responses for AO7 removal, illustrating the fit between the optimization model and experimental data.The proximity of the data points to the diagonal line in the plot of actual versus predicted values and indicates the suitability of the model developed.This means that the statistical model effectively captures the correlation among the three factors investigated in AO7 removal.It was concluded that the Equation (11) model is highly predictive and appropriate to accurately represent the relationship between the variables considered [40].
optimization model and experimental data.The proximity of the data points to the diagonal line in the plot of actual versus predicted values and indicates the suitability of the model developed.This means that the statistical model effectively captures the correlation among the three factors investigated in AO7 removal.It was concluded that the Equation (11) model is highly predictive and appropriate to accurately represent the relationship between the variables considered [40].2) for AO7 adsorption using AC.

Interaction Effect of Variables on Dye Removal Efficiency of AO7 Dye by AC
The 3D response surface plots and contour graphs for the removal efficiency of AO7 when using AC give a graphical interpretation of the second-order model equation to examine the relationship between the different factors considered in the adsorption process.
1. Dye concentration and adsorbent dosage.Figure 11 illustrates the interaction effects of the dye concentration and adsorbent dose on the removal efficiency at a fixed time of 35 min.This shows that better responses were observed with higher adsorbent masses.This result shows the importance of the factors involving the input parameter X3 in Equation (11).Increasing the amount of AC enhances the availability of active adsorption sites for dye binding, thus promoting the removal process [42].On the other hand, increasing the dye concentration from 10 to 90 mg•L −1 while maintaining the AC dose at 0.250 g•L −1 results in a reduction in removal from 98% to 60%.The high removal efficiency of adsorbates at low concentrations can be attributed to the large number of adsorption sites available.This allows greater accessibility and facilitated adsorption, leading to the removal of a greater proportion of adsorbate from solution.It is important to note that the number of available sites is a major factor in determining the adsorption efficiency Y, showing the antagonistic impact of input parameters X2 and X3 in Equation (11).As the initial concentration of AO7 (X2) increases, the number of available adsorption sites decreases, reducing the efficiency of adsorption removal [57].The 3D response surface plots and contour graphs for the removal efficiency of AO7 when using AC give a graphical interpretation of the second-order model equation to examine the relationship between the different factors considered in the adsorption process.

1.
Dye concentration and adsorbent dosage.Figure 11 illustrates the interaction effects of the dye concentration and adsorbent dose on the removal efficiency at a fixed time of 35 min.This shows that better responses were observed with higher adsorbent masses.This result shows the importance of the factors involving the input parameter X 3 in Equation (11).Increasing the amount of AC enhances the availability of active adsorption sites for dye binding, thus promoting the removal process [42].On the other hand, increasing the dye concentration from 10 to 90 mg•L −1 while maintaining the AC dose at 0.250 g•L −1 results in a reduction in removal from 98% to 60%.The high removal efficiency of adsorbates at low concentrations can be attributed to the large number of adsorption sites available.This allows greater accessibility and facilitated adsorption, leading to the removal of a greater proportion of adsorbate from solution.It is important to note that the number of available sites is a major factor in determining the adsorption efficiency Y, showing the antagonistic impact of input parameters X 2 and X 3 in Equation (11).As the initial concentration of AO7 (X 2 ) increases, the number of available adsorption sites decreases, reducing the efficiency of adsorption removal [57].

2.
Adsorbent dose and contact time.The 3D response surface and contour map, illustrating the interaction effects of the contact time (X 1 ) and adsorbent dose (X 3 ) on dye removal efficiency (Y) at a fixed dye concentration (50 mg•L −1 ), are shown in Figure 12.
It can be seen that, for an AC adsorbent dose of less than 0.250 g•L −1 , the contact time has a negligible effect on AO7 retention, as the available active sites are few in number and rapidly saturated.On the other hand, at a dose higher than 0.250 g•L −1 , AO7 retention increases with the contact time up to 40 min, when retention becomes stable as all active sites are saturated and equilibrium is reached [58].

3.
Contact time and dye concentration.The 3D graph and contour map shown in Figure 13 illustrate the combined influence of dye concentration (X 2 ) and contact time (X 1 ) on the removal efficiency (Y).The experiment was carried out with a constant AC dosage of 0.250 mg•L −1 .The contour map reveals an almost constant removal efficiency, indicating that AO7 adsorption remained relatively unchanged with the varying contact times over the range studied.This lack of significant change in removal with the contact time suggests rapid adsorption kinetics.However, increasing the dye concentration and maintaining a constant contact time leads to local saturation of the most easily accessible active sites.This phenomenon causes the driving force to remain at the same level until the adsorption process reaches equilibrium [59].In general, the interaction of the dye concentration and time of contact has a negative effect on the response variable.with the contact time suggests rapid adsorption kinetics.However, increasing the dye concentration and maintaining a constant contact time leads to local saturation of the most easily accessible active sites.This phenomenon causes the driving force to remain at the same level until the adsorption process reaches equilibrium [59].In general, the interaction of the dye concentration and time of contact has a negative effect on the response variable.

Process Optimization
The optimum conditions in the range studied predicted by the model to ensure maximum AO7 removal were an adsorbent dose of 0.285 g•L −1 , a dye concentration of 20 mg•L −1 and a contact time of 40 min.These conditions were expected to lead to a dye removal efficiency of 98%.An experiment was carried out using these specified parameters.The obtained results showed a discoloration rate of 97.6%, corresponding closely to the value predicted by the model.The agreement between experimental and predicted values confirms the accuracy and reliability of the customized model.Consequently, the model is considered a reliable tool for predicting and monitoring AO7 removal efficiency using AC.
To test the reusability of AC after dye removal, desorption experiments were carried out with 50 wt.%ethanol at room temperature for 2 h.The adsorbent obtained was then recycled four times to remove AO7 (Figure 14).11), respectively).

Process Optimization
The optimum conditions in the range studied predicted by the model to ensure maximum AO7 removal were an adsorbent dose of 0.285 g•L −1 , a dye concentration of 20 mg•L −1 and a contact time of 40 min.These conditions were expected to lead to a dye removal efficiency of 98%.An experiment was carried out using these specified parameters.The obtained results showed a discoloration rate of 97.6%, corresponding closely to the value predicted by the model.The agreement between experimental and predicted values confirms the accuracy and reliability of the customized model.Consequently, the model is considered a reliable tool for predicting and monitoring AO7 removal efficiency using AC.
To test the reusability of AC after dye removal, desorption experiments were carried out with 50 wt.%ethanol at room temperature for 2 h.The adsorbent obtained was then recycled four times to remove AO7 (Figure 14).As can be seen, the results show that AC after regeneration can be reused with a capacity loss of only a few percent for the first three cycles.A more significant drop was observed for the subsequent cycles.This could be due to irreversible adsorption on highaffinity sites.Dye accumulation on the adsorbent surface would partially limit the availa- As can be seen, the results show that AC after regeneration can be reused with a capacity loss of only a few percent for the first three cycles.A more significant drop was observed for the subsequent cycles.This could be due to irreversible adsorption on high-affinity sites.Dye accumulation on the adsorbent surface would partially limit the availability of other adsorption sites.However, given the low cost of this adsorbent, reuse over a small number of cycles should be sufficient for large-scale use.

Comparative Study
Table 12 compares the efficiency of the different adsorbents used to remove AO7 dye from aqueous solution reported in the literature [18,43,58,[60][61][62][63].As shown in this survey, the AC obtained from the SCGs had an excellent affinity for AO7 dye removal (in terms of adsorption capacity and kinetics) and compared favorably with the other low-cost activated carbon and bio-adsorbents.The dose of adsorbent required is comparatively low (0.285 g•L −1 ), and the contact time is equally short (40 min), which may be explained by the high accessibility of adsorption sites despite the low specific surface area (BET) of AC compared to activated carbon produced at higher temperatures.These operating conditions are very attractive and advantageous for a dye removal process using adsorption on activated carbon.Consequently, AC prepared from SCGs according to the procedure described in this work is a promising adsorbent with great potential for the decolorization of wastewater from the textile industry.

Conclusions
A simple and reproducible procedure for preparing activated carbon (AC) from used coffee grounds was successfully developed involving chemical activation with a small amount of H 3 PO 4 at the relatively low temperature of 600 • C, making it an inexpensive material.It was found that the two batches of AC prepared exhibited excellent and similar adsorption properties for AO7 removal from aqueous solutions.A comprehensive adsorption study was conducted, including kinetics, thermodynamics, mechanism and process optimization.
Analysis of surface chemical functions by FTIR and a thermodynamic study revealed that AO7 adsorbs to AC by spontaneous physisorption involving mainly hydrogen bonds and π-π interactions.The modeling of AO7 adsorption by AC showed that experimental kinetic and isotherm data fitted best with the pseudo-second-order model and the Langmuir model, respectively.To optimize AO7 removal by AC, experimental design methodology was applied, allowing the influence of specific parameters such as contact time, dye concentration and adsorbent quantity to be determined.The optimal design model fitted with the experimental data showed a high coefficient of determination (R 2 = 0.9918) and an adjusted R 2 coefficient of 0.9770, indicating that it is a robust predictive model.In addition, the statistical significance was validated by a p-value associated with the model of less than 0.05.The optimal conditions for the nearly complete removal of AO7 (98%) at a concentration of 20 mg•L −1 , predicted by the model and experimentally tested, required a contact time of 40 min and an adsorbent dosage of 0.285 g•L −1 .

Figure 2 .
Figure 2. XRD pattern for the AC prepared from SCGs.

igure 2 .
XRD pattern for the AC prepared from SCGs.

Figure 2 .
Figure 2. XRD pattern for the AC prepared from SCGs.

Figure 6 .
Figure 6.Determination of the point of zero charge pH.

Figure 5 .
Figure 5. TGA and DTG curves of AC prepared from SCGs.

Figure 6 .Figure 6 .
Figure 6.Determination of the point of zero charge pH.3.2.Dye Adsorption Characterization3.2.1.Adsorption KineticsAdsorption kinetics and analysis of the quantity adsorbed at equilibrium are the two key parameters for understanding and optimizing the adsorption process.The rate of re-

Figure 7 .
Figure 7. Kinetic plots and fitted kinetic model curve for AO7 adsorption on AC: (a) pseudo-firstorder kinetic and (b) pseudo-second-order models.

Figure 7 .
Figure 7. Kinetic plots and fitted kinetic model curve for AO7 adsorption on AC: (a) pseudo-first-order kinetic and (b) pseudo-second-order models.

Materials 2024 ,Figure 8 .
Figure 8. Non-linearized data of the AO7 adsorption isotherm on AC at three different temperatur and the corresponding fitted theoretical curves using the Langmuir and Freundlich models.

1 )Figure 8 .
Figure 8. Non-linearized data of the AO7 adsorption isotherm on AC at three different temperatures and the corresponding fitted theoretical curves using the Langmuir and Freundlich models.

Figure 9 .
Figure 9. Proposed adsorption mechanisms of AO7 dye onto the activated carbon (AC).

Figure 9 .
Figure 9. Proposed adsorption mechanisms of AO7 dye onto the activated carbon (AC).

Figure 10 .
Figure 10.The removal efficiency predicted from Equation (11) (Y) versus the actual data (R) from Equation (2) for AO7 adsorption using AC.

Figure 10 .
Figure 10.The removal efficiency predicted from Equation (11) (Y) versus the actual data (R) from Equation (2) for AO7 adsorption using AC.3.4.2.Interaction Effect of Variables on Dye Removal Efficiency of AO7 Dye by AC

Figure 11 . 2 .Figure 11 .
Figure 11.(a) The response surface and (b) the contour map showing the interaction of AO7 concentration and AC dosage (input parameters X2 and X3 in Equation (11), respectively) on dye removal.

Figure 11 . 2 .
Figure 11.(a) The response surface and (b) the contour map showing the interaction of AO7 concentration and AC dosage (input parameters X2 and X3 in Equation (11), respectively) on dye removal.

Figure 12 .
Figure 12.(a) The response surface and (b) the contour map showing the interaction of contact time and AC dosage (input parameters X1 and X3 in Equation (11), respectively) on dye removal.

Figure 12 .
Figure 12.(a) The response surface and (b) the contour map showing the interaction of contact time and AC dosage (input parameters X 1 and X 3 in Equation (11), respectively) on dye removal.

Figure 13 .
Figure 13.(a) The response surface and (b) the contour map showing the interaction of the AO7 concentration and contact time (input parameters X2 and X1 in Equation (11), respectively).

Figure 13 .
Figure 13.(a) The response surface and (b) the contour map showing the interaction of the AO7 concentration and contact time (input parameters X 2 and X 1 in Equation (11), respectively).

Materials 2024 , 22 Figure 14 .
Figure 14.Removal rate of AO7 and recovery efficiency of AC after 5 adsorption/regeneration cycles.

CyclesFigure 14 .
Figure 14.Removal rate of AO7 and recovery efficiency of AC after 5 adsorption/regeneration cycles.

Table 5 .
BET measurements of AC.

Table 5 .
BET measurements of AC.

Table 8 .
Thermodynamic parameters for AO7 adsorption on AC.

Table 9 .
Box-Behnken design and comparison of experimental-and model-predicted results for AO7 adsorption using AC.

Table 10 .
Analysis of variance for the adsorption of AO7 dye by AC.

Table 11 .
Estimated polynomial coefficients for the adsorption of AO7 dye by AC.

Table 12 .
Comparative study of the adsorption of AO7 dye on various bio-sorbents from the literature.