Comparative Study on Adsorption of Crystal Violet and Chromium (VI) by Activated Carbon Derived from Spent Coffee Grounds

: In the context of the circular economy, used coffee grounds were transformed into pow-dered activated carbon by chemical activation using potassium hydroxide. Its characterisation was conducted in comparison with that of a commercial activated carbon by scanning electron microscopy (SEM) coupled with energy dispersive X-ray microanalysis (EDX), X-ray diffraction (XRD), Fourier transform infrared spectroscopy (FTIR), Boehm titration, and point zero charge (pH PZC ) and by determination of the methylene blue number (MBN) and the iodine number (IN). Performance of the prepared activated carbon was tested in the adsorption of the cationic dye crystal violet (CV) and hexavalent chromium. Batch adsorption tests were carried out and the effects of operating parameters were studied. The results collected on the adsorption kinetics show that the adsorption followed pseudo-second order kinetics and that the Langmuir isotherm best ﬁts the equilibrium data for crystal violet and hexavalent chromium. The thermodynamic study showed that the adsorption of both adsorbates is spontaneous and exothermic and leads to a decrease in disorder at the solid–liquid interfaces. These results indicate that this activated carbon can be used as an alternative adsorbent to remove cationic dyes and heavy metals from aqueous solutions.


Introduction
Many industries, such as leather tanning, paint making, battery manufacturing industries, and others, generate liquid waste that is usually contaminated with toxic substances such as synthetic dyes and heavy metals [1][2][3].The accumulation of these contaminants in living tissues throughout the food chain poses a serious health problem [4,5].Several studies have highlighted the direct and indirect toxic effects of dyes and heavy metals, which can lead to a wide range of health problems, such as renal failure, diarrhoea, lung cancer, liver damage, and asthma [6][7][8].For these reasons, it is essential that effluents containing these pollutants are treated before they are released into the environment.
In recent decades, various conventional physical-chemical methods have been used to remove heavy metals and dyes from industrial waste, including filtration, coagulation and flocculation, chemical oxidation with chlorine, ozone and hydrogen peroxide, and advanced oxidation processes (AOPs).However, of these many different wastewater treatment processes, only a few are commonly used by the industrial sector due to economic and technological reasons.Nevertheless, adsorption is often cited as the process of choice for the removal of many types of pollutants due to its cost effectiveness, flexibility of application, and simplicity of design [2,9,10].Despite its remarkable performance, adsorption based on commercial activated carbon is expensive, as this carbon is produced from relatively expensive precursors [11][12][13][14].Therefore, the use of inexpensive and abundant materials, such as agro-industrial waste, has emerged in recent years as one of the most viable options for establishing waste management strategies [15].The literature indicates that there have been numerous attempts to synthesise low-cost activated carbons from agro-industrial wastes such as orange peel [16], almond leaves [17], potato peel [18], water lily [19], oil palm empty fruit bunch [20], coffee husk [21], spent coffee grounds [22], and tea waste [23].
Coffee is the most important food commodity in the world and is second only to crude oil among all raw materials [24][25][26].Spent coffee grounds (SCGs) are the residue of the coffee brewing process using hot water (~80 • C); for each ton of green coffee about 650 kg of SCGs are generated [27].Currently, the main amount of waste coffee grounds follows the linear economy model and ends up in a landfill.The shift to the circular economy model proposes its exploitation in the production of energy and high value added materials [28].As it is lignocellulosic in nature and rich in carbon, it would be highly desirable to use this waste as an alternative raw material to make activated carbon.
Crystal violet dye is widely used as a cotton and silk dye in the textile industry.It is also used in the manufacture of paints and printing inks [29,30].Crystal violet is carcinogenic and has been classified as a recalcitrant molecule since it is poorly metabolised by microbes, is not biodegradable, and can persist in a variety of environments [31].On the other hand, Cr (VI) is the highest priority toxic pollutant according to the US Environmental Protection Agency [32].It is commonly used in the manufacture of pigments, in the treatment of metal surfaces, and in the chemical industry as an oxidising agent [33].
Some research has been undertaken for the valorisation of spent coffee grounds into activated carbon and for the fixation of dyes [22,[34][35][36][37] and heavy metals [38][39][40].However, studies in this area are recent and, according to our understanding, there are no studies associated with the removal of CV and Cr (VI) from water using KOH-activated SCGs as an adsorbent.
In view of the above, the objectives of the present study are to produce an activated carbon from spent coffee grounds and to evaluate its adsorption capacity of CV and hexavalent chromium Cr (VI).The influence of operating parameters, such as adsorbent dose (C ads ), pH, contact time, and temperature, was studied.The modelling of equilibriums and adsorption kinetics as well as the thermodynamic parameters were evaluated and discussed.In addition, the adsorption capacity of the prepared activated carbon was compared with that of recently reported adsorbents of similar class.

Preparation of Adsorbent
SCGs used in this study were collected from a coffee shop in the city of Meknes (Morocco).The raw material was washed several times with hot distilled water (60 • C) to remove impurities and then dried at 105 • C in an oven for 24 h.The preparation of the activated carbon was carried out by pyrolysis in two stages.This choice of process was based on studies on the optimisation of factors influencing the preparation of activated carbon from lignocellulosic waste [41][42][43].The SCGs were first carbonised in a vertical tube furnace (Figure 1).The temperature of the furnace was increased at a rate of 10 • C/min to 400 • C and then maintained at this temperature for one hour and a free descent to ambient temperature under a continuous flow of nitrogen gas throughout the pyrolysis of 50 mL/min.After the first carbonisation step, the resulting biochar was contacted with the activating agent (potassium hydroxide KOH) in a weight proportion of 1/3 (biochar/KOH).The KOH crystals were dissolved with distilled water.The mixture was stirred for 5 h and then heated in an oven at a temperature of 110 • C until the water evaporated.The resulting product was placed in the previous reactor and heated under a nitrogen flow of 50 mL/min at a heating rate of 10 • C/min to the activation temperature of 450 • C, where it was left for one hour and then cooled to room temperature.
char/KOH).The KOH crystals were dissolved with distilled water.The mixture was stirred for 5 h and then heated in an oven at a temperature of 110 °C until the water evaporated.The resulting product was placed in the previous reactor and heated under a nitrogen flow of 50 mL/min at a heating rate of 10 °C/min to the activation temperature of 450 °C, where it was left for one hour and then cooled to room temperature.
After the activation process, the steps of washing with distilled water and then with 0.1 M HCl solution to remove excess KOH and the soluble ash fraction and drying the material in an oven at 105 °C for 12 h were carried out.The final activated carbon was ground and sieved to retain a particle size <100 μm and stored in clean dry glass vials.In the following, the prepared activated carbon will be referred to as ACSCGs and a powdered commercial vegetable carbon (referred to in the following as CAC) will be used for comparison.

Characterisation of Adsorbent
Surface morphology and activated carbon composition were analysed by scanning electron microscopy (SEM) coupled with energy dispersive X-ray microanalysis (EDX), using a JEOL JSM-IT500HR scanning electron microscope.
The porous structure of both carbons was characterised by exploiting the adsorption of iodine and methylene blue.The iodine number (IN) is a fast test that gives an indication of the micropore content [44].This determination is based on ASTM D4607-94 [45,46].This method is based on a three-point isotherm.A standard iodine solution is treated with three different masses of adsorbent.The experiment consisted of washing the sample beforehand with 5.0 mL of 5 wt% HCl.Then, this sample was introduced into 50.0mL of 0.05 mol/L iodine solution and the mixture was stirred vigorously for 30 s.The resulting After the activation process, the steps of washing with distilled water and then with 0.1 M HCl solution to remove excess KOH and the soluble ash fraction and drying the material in an oven at 105 • C for 12 h were carried out.The final activated carbon was ground and sieved to retain a particle size < 100 µm and stored in clean dry glass vials.In the following, the prepared activated carbon will be referred to as ACSCGs and a powdered commercial vegetable carbon (referred to in the following as CAC) will be used for comparison.

Characterisation of Adsorbent
Surface morphology and activated carbon composition were analysed by scanning electron microscopy (SEM) coupled with energy dispersive X-ray microanalysis (EDX), using a JEOL JSM-IT500HR scanning electron microscope.
The porous structure of both carbons was characterised by exploiting the adsorption of iodine and methylene blue.The iodine number (IN) is a fast test that gives an indication of the micropore content [44].This determination is based on ASTM D4607-94 [45,46].This method is based on a three-point isotherm.A standard iodine solution is treated with three different masses of adsorbent.The experiment consisted of washing the sample beforehand with 5.0 mL of 5 wt% HCl.Then, this sample was introduced into 50.0mL of 0.05 mol/L iodine solution and the mixture was stirred vigorously for 30 s.The resulting solution was filtered and 25.0 mL of the filtrate was titrated with 0.05 mol/L sodium thiosulphate, using starch as a colour indicator.The iodine value was the value of the adsorbed amount when the residual concentration was 0.01 mol/L.The IN was calculated by the following Equation (1): where C 1 is the initial concentration of the I 2 solution (in mol/L); C 2 is the concentration of Na 2 S 2 O 3 (in mol/L); V is volume of Na 2 S 2 O 3 at the equivalence (in mL); V F is the volume of filtrate dosed (in mL); M is the molar mass of I 2 (in g/mol); V 1 is the adsorption volume (in mL); V HCl is the volume of HCl (in mL); m is mass of adsorbent used (in g).
The methylene blue number (MBN) was used to evaluate the mesoporosity and macroporosity of an adsorbent, based on the European Chemical Industry Council (CEFIC) standard [46].The MBN is defined as the maximum amount of methylene blue adsorbed on 1 g of adsorbent.In this test, 100 mg of ACSCGs was brought into contact with 100 mL of a methylene blue solution at different concentrations (0-1000 mg/L) and at room temperature.The remaining concentration after 24 h was determined by UV-Vis spectroscopy at 660 nm.The MBN was determined using the Langmuir model.
The characterisation of the chemical functional groups present on the surface was carried out by Fourier transform infrared spectroscopy (FTIR), using an infrared spectrometer (Shimadzu.JASCO 4100).The samples were analysed as very well-dried pellets, prepared by diluting 4 mg of the sample in 96 mg of KBr.The spectra were recorded from 4000 to 400 cm −1 , with a resolution of 4 cm −1 and 16 scans per sample.
The quantification of the acidic and basic surface functions was performed using the Boehm method [47,48].Samples of the adsorbent (0.5 g) were brought into contact with 50 mL of different basic solutions (NaHCO 3 , Na 2 CO 3 , NaOH), of concentration 0.1 mol/L, with an acidic solution (HCl) of the same concentration, respectively.The excess of base or acid after 48 h of stirring was titrated back on 20 mL of filtrate by means of an HCl or NaOH solution of concentration 0.1 mol/L.
The point zero charge (pH PZC ) was determined by the salt addition technique [49].In a series of beakers containing 40 mL of NaCl solution (0.1 mol/L) each, a mass of 0.2 g of sample was added.The pH was adjusted by a solution of HCl (0.1 mol/L) or NaOH (0.1 mol/L) to values noted as pH i , between 2 and 12.The pH f values were measured after 24 h of stirring at 200 rpm.The pH PZC was obtained from the plot of ∆pH (= pH f − pH i ) versus pH i at ∆pH = 0.

Preparation of Adsorbate Solutions
Crystal violet powder of chemical formula C 25 H 30 Cl of very high purity (Sigma Aldrich; p.a. ≥ 98%; molecular weight 407.98 g/mol) and analytical grade potassium dichromate K 2 Cr 2 O 7 (Sigma Aldrich; p.a. ≥ 99.0%; molecular weight 294.19 g/mol) were used to prepare a stock solution (1 g/L) by dissolving an accurately weighed mass in distilled water.Experimental solutions of different concentrations were obtained by dilution.

Batch Adsorption Experiments
The adsorption tests, for the two pollutants studied, were carried out in batch mode in 50 mL beakers.The effect of different parameters on the adsorption was studied.The experimental conditions of the different experiments are shown in Table 1.A precisely weighed mass of adsorbent was introduced into a volume of adsorbate solution of concentration C 0 .The initial pH of the solutions was adjusted using solutions of HCl (0.1 mol/L) and NaOH (0.1 mol/L).The reaction mixtures were stirred, using a multi-station magnetic stirrer (9 stations), for a specified time.At the end of each experiment the solution was separated from the adsorbent by centrifugation at 3000 rpm for 20 min.The residual concentration C t of the adsorbate was determined by UV-Visible spectroscopy (Shimadzu UV-1240) using previously plotted calibration curves.The amount adsorbed per gram of adsorbent q t (mg/g) and the removal rate R t (%) were determined by the following Equations ( 2) and (3): where V is the volume of the solution (L) and m is the mass of the adsorbent (g).

Adsorption Modelling 2.5.1. Adsorption Kinetics
Adsorption kinetics is one of the key factors that must be understood prior to the application of any adsorbent material.It is an important consideration in understanding the adsorption process as it provides information on the rate of adsorption, the performance of the adsorbent used, and the mass transfer mechanisms.The adsorption kinetics of CV and Cr (VI) on ACSCGs was studied using three models, namely the pseudo-first order (PFO) model in Equation (4) [50], the pseudo-second order (PSO) in Equation ( 5) [51], and intraparticle diffusion [52] as given by Equation (6): q t = q 2 e k 2 t 1 + q e k 2 t (5) where q e is the estimated equilibrium adsorption quantity in (mg/g); k 1 is the adsorption rate constant of PFO in (min −1 ); k 2 is the adsorption rate constant of PSO in (g/mg•min); k d is the intraparticle diffusion rate constant; C i is the thickness of the boundary layer in (mg/g).The pseudo term is added to differentiate between the equations for solution concentrations and adsorption capacities.

Adsorption Isotherm
Adsorption isotherms use concentration-dependent data to describe the distribution of the adsorbate between the solid and liquid phases at equilibrium.The adsorption isotherm can give useful information about the adsorbate, the adsorbent, and the adsorption process.
Adsorption isotherms were studied using the Langmuir Equation (7) [53], the Freundlich Equation ( 9) [54], and the Temkin Equation (10) [55] isotherm models: where K L is the equilibrium adsorption constant or Langmuir constant (L/mg); q e is the quantity adsorbed at equilibrium per gram of adsorbent (mg/g); C e is the concentration of the adsorbate in the liquid phase at equilibrium (mg/l); q m is the maximum adsorption capacity for a monolayer (mg/g).
A dimensionless constant commonly known as the separation factor (R L ) can be represented as follows (Equation ( 8)) [56]: where C 0 is the initial concentration of the adsorbate in (mg/L) and K L is the Langmuir constant in (mg/g).This separation factor is used to indicate the nature of the adsorption, which can be either linear (R L = 1), irreversible (R L = 0), unfavourable (R L > 1), or favourable (0 < R L < 1).
where K F is the Freundlich constant characterising the adsorption capacity of the solid in (mg/g) (L/mg) 1/n ; 1/n is the intensity of adsorption or surface heterogeneity, indicating the relative energy distribution and heterogeneity of the adsorption sites.When 1/n is between 0 and 1 (0 < 1/n <1), adsorption is favourable.When 1/n is greater than 1, adsorption is unfavourable.It is irreversible when 1/n = 1.The irreversibility of the isotherm can be attributed to the fact that the concentration must extremely decrease to a low value before desorption of the adsorbate molecules from the surface [57].
where A is the equilibrium binding constant of the Temkin isotherm (L/mg); b is Temkin isotherm constant; R is the universal gas constant (8.314J/mol/K); T is the absolute temperature (K).

Model Validation
In order to evaluate the performance and validity of the kinetic and isothermal models, two error functions were used: The coefficient of determination (R 2 ) (Equation ( 11)) [58]: The non-linear chi-square (χ 2 ) test (Equation ( 12)).A small value of χ 2 indicates a better fit [59].
q e. exp − q e.cal 2 q e.cal (12) where q e.cal and q e.exp are the calculated and experimental adsorption capacities, respectively (mg/g).

Thermodynamic Study
The thermodynamic study is crucial to predict the spontaneity nature (physisorption or chemisorption), reversibility, and energetic nature (exothermic or endothermic) of the adsorption process.The determination of the main thermodynamic parameters was carried out by studying the effect of temperature on the adsorption.The temperature of the solutions during the adsorption experiments was controlled using a thermostatic bath.
The activation energy was determined by the following Arrhenius Equation ( 13) [60]: where K is the rate constant of the kinetic model; A is the pre-exponential factor.The values of ∆H • and standard entropy ∆S • for the adsorption process were determined from the slope and intercept of the plot of lnK d versus 1/T (van't Hoff curve) using the following van't Hoff Equation ( 14) [61]: The standard free energy (∆G • ) at equilibrium was calculated by the Gibbs-Helmholtz Equation ( 15) [62]: where E a is the activation energy (kJ/mol); R is the perfect gas constant (8.314J/mol K); T is the temperature of the solution (K); K d is the distribution coefficient K d = q e /C e ; ∆H • is the standard enthalpy in (KJ/mol); ∆S • is the standard entropy (KJ/mol K); ∆G • is the standard free energy (J/mol)

X-ray Diffraction (DRX)
The crystalline structure of ACSCGs-activated carbon and CAC was characterised by DRX analysis.The diffractograms are shown in Figure 2. In general, the XRD spectra of the different samples are amorphous; nevertheless, we observe a weak crystallinity in the range from 20 to 50 • for the two activated carbons.We note that the spectra show the same appearance and present the same diffraction peaks.On the other hand, we observe after activation of the SCGs the appearance of new peaks at 29.6 • and at 43.3 • , the displacement of the main peak from 19.6 • to 24.3 • , and the decrease of its intensity.This is attributed to the structural modifications resulting from the activation, indicating the formation of a non-uniform lattice strain in the activated carbon [63,64] and showing that the activation process was well undertaken.The peaks at 29.6 • and at 43.3 • are attributed to the (002) and (100) reflections of graphite, respectively [65,66].

Scanning Electron Microscopy SEM/EDS
The SEM analysis aims to illustrate the porosity created by the chemical activation.Figure 3 shows the SEM images of the ACSCGs at different magnifications.Numerous pores were developed on the surface of the activated carbon.This shows that potassium hydroxide (KOH) is effective in creating new pores and developing those naturally existing in the spent coffee grounds, leading to an activated carbon with a large surface area and a porous structure.

Scanning Electron Microscopy SEM/EDS
The SEM analysis aims to illustrate the porosity created by the chemical activation.Figure 3 shows the SEM images of the ACSCGs at different magnifications.Numerous pores were developed on the surface of the activated carbon.This shows that potassium hydroxide (KOH) is effective in creating new pores and developing those naturally existing in the spent coffee grounds, leading to an activated carbon with a large surface area and a porous structure.

Scanning Electron Microscopy SEM/EDS
The SEM analysis aims to illustrate the porosity created by the chemical activation.Figure 3 shows the SEM images of the ACSCGs at different magnifications.Numerous pores were developed on the surface of the activated carbon.This shows that potassium hydroxide (KOH) is effective in creating new pores and developing those naturally existing in the spent coffee grounds, leading to an activated carbon with a large surface area and a porous structure.Activation by KOH can be interpreted by the following two reactions [67].
Appl.Sci.2023, 13, 985 9 of 25 KOH is transformed initially into potassium oxide and steam; the latter diffuses into the carbon structure to react with the carbon atoms, generating CO and H 2 and a solid with a highly developed pore structure.According to Yang et al. [68], the activation process reorganises the carbon structure, producing a more ordered structural skeleton.Pore development occurs in four stages: (i) opening of initially inaccessible pores, (ii) creation of new pores, (iii) enlargement of existing pores, and (iv) fusion of existing pores due to the rupture of the wall between them.The observed pores (µm range) act as channels for the microporous network.
The results obtained by energy dispersive X-ray microanalysis (EDS) of ACSCGs confirm the presence of carbon-rich compounds, as well as the presence of heteroatoms such as Mg, O, P, S, and Ca, as shown in Table 2.The absence of K shows that the washing process used at the end of the preparation process is efficient.The effect of pH on the adsorption can be described on the basis of the point zero charge (pH PZC ).The pH PZC is the point where the net charge of the adsorbent surface is zero.The pH PZC value allows to identify an increase of acidity or basicity after activation treatments.The results of the pH PZC measurement for ACSCGs obtained by the salt addition method are presented in the graph in Figure 4.The ACSCGs has a pH PZC value of 8.2, which shows that this carbon has a slightly basic nature.A relatively similar value was obtained in the study of Zubrik et al., for activated carbon from corncobs activated with KOH [43].Activated carbon is an amphoteric material, whose surface charge depends on the pH of the solution.As an example, the ACSCGs sample exhibited a pH PZC of 8.2, which will give its surface a negative charge for solutions of pH above 8.2 and a positive charge for solutions of pH below 8.2.

Surface Function Analysis by Fourier Transform Infrared Spectrometry (FTIR)
The FTIR spectra of ACSCGs, SCGs, and CAC are shown in Figure 5. From these spectra it was possible to identify the functional groups present in the synthesised activated carbon and to compare the spectrum of the coffee grounds with that of its activated carbon.The spectra of the two activated carbons are identical, which confirms that the activation process has taken place.The following functional groups are observed, based on reference spectra [69-71]: • A band at 3440 cm −1 due to the stretching vibration of OH functional groups, corresponding to carboxylic acids, alcohols, and water molecules in the sample; its intensity decreased after activation.

•
Two bands at 2930 cm −1 and 2852 cm −1 , attributed to the C-H stretching vibration of aliphatic groups and aromatic hydrocarbons, are clear in the SCGs spectra but show a lower intensity for ACSCGs, indicating a decrease in the amount of aliphatic compounds due to carbonisation.

•
A band at 1745 cm −1 is consistent with the presence of carbonyl groups (C=O) in aldehydes, ketones, carboxylic acids, and esters.This band disappears after activation with KOH base.

•
The absorption peak at 1644 cm −1 represents C=C stretching vibrations, indicating the presence of alkenes and aromatic rings.
• Two bands around 1386 and 1465 cm −1 attributed to aliphatic C-H deformation, which disappeared after activation.

•
The bands in the spectral region between 1400 and 1000 cm −1 with maxima at 1246, 1170, and 1030 cm −1 are commonly attributed to C-O stretching in acid, alcohol, phenol, ether, and ester groups.The intensities of these bands become weak after activation.
Appl.Sci.2023, 13, x FOR PEER REVIEW 10 of 26 The FTIR spectra of ACSCGs, SCGs, and CAC are shown in Figure 5. From these spectra it was possible to identify the functional groups present in the synthesised activated carbon and to compare the spectrum of the coffee grounds with that of its activated carbon.The spectra of the two activated carbons are identical, which confirms that the activation process has taken place.The following functional groups are observed, based on reference spectra [69-71]: • A band at 3440 cm −1 due to the stretching vibration of OH functional groups, corresponding to carboxylic acids, alcohols, and water molecules in the sample; its intensity decreased after activation.

•
Two bands at 2930 cm −1 and 2852 cm −1 , attributed to the C-H stretching vibration of aliphatic groups and aromatic hydrocarbons, are clear in the SCGs spectra but show a lower intensity for ACSCGs, indicating a decrease in the amount of aliphatic compounds due to carbonisation.

•
A band at 1745 cm −1 is consistent with the presence of carbonyl groups (C = O) in aldehydes, ketones, carboxylic acids, and esters.This band disappears after activation with KOH base.

•
The absorption peak at 1644 cm −1 represents C = C stretching vibrations, indicating the presence of alkenes and aromatic rings.

•
Two bands around 1386 and 1465 cm −1 attributed to aliphatic C-H deformation, which disappeared after activation.

•
The bands in the spectral region between 1400 and 1000 cm −1 with maxima at 1246, 1170, and 1030 cm −1 are commonly attributed to C-O stretching in acid, alcohol, phenol, ether, and ester groups.The intensities of these bands become weak after activation.These results indicate that activation with KOH leads to a decrease in the concentration of oxygen-containing functional groups on the surface of the activated carbon.

Surface Function Analysis by Boehm's Method
The results of the Boehm titration method reported in Table 3 indicate that the synthesised activated carbon has a slightly basic character.These results are confirmed by the pHPZC value obtained.The treatment with KOH considerably increases the amount of basic groups and decreases the amount of acidic groups, which is in line with the previous findings from FTIR analysis that show the decrease in band intensities of oxygenated These results indicate that activation with KOH leads to a decrease in the concentration of oxygen-containing functional groups on the surface of the activated carbon.

Surface Function Analysis by Boehm's Method
The results of the Boehm titration method reported in Table 3 indicate that the synthesised activated carbon has a slightly basic character.These results are confirmed by the pH PZC value obtained.The treatment with KOH considerably increases the amount of basic groups and decreases the amount of acidic groups, which is in line with the previous findings from FTIR analysis that show the decrease in band intensities of oxygenated groups with an acidic character.The same results were reported by Bamba et al. [42], who studied the activation of coconut shells by KOH. Figure 6 shows the Langmuir isotherms for the two activated carbons.The evaluation of the different results obtained indicates that the activation with KOH presented a high adsorption capacity of methylene blue (645.5 mg/g), slightly lower than that of the CAC (734.9 mg/g).These results corroborate those obtained by Gao et al. [72], who found that activation of carbon with alkaline salts favours the appearance of mesopores.Thus, the high adsorption of methylene blue can be justified by its basic character, which has a greater affinity for basic carbon than for acidic carbon, as shown by Faria et al. [73].Similarly, Qian et al. [74] confirmed that the acidic surface functions significantly decrease the electron density on the base layer of the carbon, which limits the adsorption of basic dye.The purpose of the iodine number is to characterise the microporosity of an activated carbon and to measure its degree of activation.Its typical value is between 500 and 1200 mg/g [75].A higher value indicates a higher degree of activation.Figure 7 summarises the three-point isotherms of the two activated carbons obtained by using activated carbon masses of 450, 500, and 550 mg.The value of the IN of the ACSCGs of 981.9 mg/g is close

Characterisation by Iodine Adsorption (IN)
The purpose of the iodine number is to characterise the microporosity of an activated carbon and to measure its degree of activation.Its typical value is between 500 and 1200 mg/g [75].A higher value indicates a higher degree of activation.Figure 7 summarises the three-point isotherms of the two activated carbons obtained by using activated carbon masses of 450, 500, and 550 mg.The value of the IN of the ACSCGs of 981.9 mg/g is close to that of CAC, which is 996.4 mg/g, which indicates that the activation has developed good microporosity and that the prepared activated carbon is of good quality [76].On the other hand, this value is comparable to that reported by Evwierhoma et al., for KOH activated bean husk (951.75 mg/g) [77].

Effect of Solution pH
In the adsorption process, the pH of the solution controls the surface charge of the adsorbent and the degree of ionisation of the adsorbate.The influence of pH on the adsorption of CV dye and Cr (VI) was carried out in the pH range of 2.0 to 12.0 for CV and 2.0 to 10.0 for Cr (VI), keeping the other parameters constant.Figure 8 shows that the removal rate of CV dye increased gradually from 2 to 12 and then decreased with increasing solution pH, while that of Cr (VI) increased more rapidly with increasing solution pH from 2 to 6 and then decreased due to deprotonation of functional groups on the CAC surface.The maximum retention of CV and Cr (VI) was found at pH 9 and pH 6, respectively.These pH values were chosen as the optimum pH for the subsequent adsorption experiments.
This behaviour can be illustrated based on the point zero charge of ACSCGs, which was found to be equal to 8.2.The surface of the adsorbent became more and more negative as the pH increased and, consequently, the electrostatic attraction forces between the CV cations and the ACSCGs surface became more and more important.The decrease in removal above pH 10 can be interpreted by the competition between the dye cations and the Na + cations from NaOH.In this context, Anirudhan et al. [78] indicated that Na + ions surround the adsorption sites, which weakens the electrostatic attraction forces between the adsorbent and the adsorbate.On the other hand, the adsorption of dye cations at low pH can be explained by the existence of dispersive π-π interactions between the delocalised π electrons on the surface of basic activated carbons and the free electrons of the Furthermore, the iodine and methylene blue index values suggest the presence of micro-and mesopores, which suggests that the prepared activated carbon has the capacity to adsorb molecules of different sizes.

Effect of Solution pH
In the adsorption process, the pH of the solution controls the surface charge of the adsorbent and the degree of ionisation of the adsorbate.The influence of pH on the adsorption of CV dye and Cr (VI) was carried out in the pH range of 2.0 to 12.0 for CV and 2.0 to 10.0 for Cr (VI), keeping the other parameters constant.Figure 8 shows that the removal rate of CV dye increased gradually from 2 to 12 and then decreased with increasing solution pH, while that of Cr (VI) increased more rapidly with increasing solution pH from 2 to 6 and then decreased due to deprotonation of functional groups on the CAC surface.The maximum retention of CV and Cr (VI) was found at pH 9 and pH 6, respectively.These pH values were chosen as the optimum pH for the subsequent adsorption experiments.
charge density on the carbon surface due to the progressive deprotonation of the surface sites.Moreover, this optimal adsorption around neutral pH is economically favourable as it does not require another neutralisation step of the solutions at the end of the process.Similar results have also been reported by Nizam et al., who studied the adsorption of methylene blue on activated carbon prepared from two biomasses [79], and by Yang et al. in their studies on the removal of Cr (VI) ions on activated carbon prepared from longan seeds [80].

Effect of Adsorbent Dose
The study of the effect of the adsorbent dose is essential in the adsorption process in order to determine the most cost-effective amount to be used and to effectively remove the pollutants without wasting the adsorbent.The results obtained from experiments with different doses of ACSCGs are shown in Figure 9.The percentage removal increased with an increasing dose of ACSCGs from 0.01 to 0.1 g/100 mL for CV and from 0.01 to 0.15 g/100 mL for Cr (VI), which then remained constant beyond these ranges.This initial rapid increase could be attributed to the increase in the number of adsorption sites by increasing the dose of the adsorbent.Insufficient or excessive dosing of the adsorbent would result in low removal efficiency or high cost; therefore, 0.1 g/100 mL and 0.15 g/100 mL of ACSCGs were chosen as the optimal doses for the retention of CV and Cr (VI), respectively.In this context, El Nemr et al. [81] studied the removal of Cr (VI) by adsorption on a microporous nano-activated carbon derived from orange peel.They showed that 3 g/L is the optimal dose of the adsorbent for a solution of C0 = 300 mg/L.In another study, Jabar et al. [82] tested the efficiency of activated cocoa leaves' biochar in the adsorption of CV.The experimental results showed that the optimal dose is 0.4 g/L and that above this dose CV dye-uptake and percentage CV dye removed decreased.This behaviour can be illustrated based on the point zero charge of ACSCGs, which was found to be equal to 8.2.The surface of the adsorbent became more and more negative as the pH increased and, consequently, the electrostatic attraction forces between the CV cations and the ACSCGs surface became more and more important.The decrease in removal above pH 10 can be interpreted by the competition between the dye cations and the Na + cations from NaOH.In this context, Anirudhan et al. [78] indicated that Na + ions surround the adsorption sites, which weakens the electrostatic attraction forces between the adsorbent and the adsorbate.On the other hand, the adsorption of dye cations at low pH can be explained by the existence of dispersive π-π interactions between the delocalised π electrons on the surface of basic activated carbons and the free electrons of the aromatic rings of the dye [73].
For Cr (VI) adsorption in the pH range studied, ACSCGs was protonated and the two predominant forms of Cr (VI) were the hydrogen chromate ion HCrO 4 − (at pH between 1.0 and 6.0) and the chromate ion (pH above 6.0).As the pH of the aqueous solution increased, the predominant ions (HCrO 4 − ) were transformed into the chromate ions CrO 4 2− .The CrO 4 2− ion has two negative charges, which leads to an increase in electrostatic attraction and, consequently, an increase in the adsorption capacity of Cr (VI) is observed.Furthermore, the decrease in removal at higher pH is related to the increase in negative charge density on the carbon surface due to the progressive deprotonation of the surface sites.Moreover, this optimal adsorption around neutral pH is economically favourable as it does not require another neutralisation step of the solutions at the end of the process.Similar results have also been reported by Nizam et al., who studied the adsorption of methylene blue on activated carbon prepared from two biomasses [79], and by Yang et al. in their studies on the removal of Cr (VI) ions on activated carbon prepared from longan seeds [80].

Effect of Adsorbent Dose
The study of the effect of the adsorbent dose is essential in the adsorption process in order to determine the most cost-effective amount to be used and to effectively remove the pollutants without wasting the adsorbent.The results obtained from experiments with different doses of ACSCGs are shown in Figure 9.The percentage removal increased with an increasing dose of ACSCGs from 0.01 to 0.1 g/100 mL for CV and from 0.01 to 0.15 g/100 mL for Cr (VI), which then remained constant beyond these ranges.This initial rapid increase could be attributed to the increase in the number of adsorption sites by increasing the dose of the adsorbent.Insufficient or excessive dosing of the adsorbent would result in low removal efficiency or high cost; therefore, 0.1 g/100 mL and 0.15 g/100 mL of ACSCGs were chosen as the optimal doses for the retention of CV and Cr (VI), respectively.In this context, El Nemr et al. [81] studied the removal of Cr (VI) by adsorption on a microporous nano-activated carbon derived from orange peel.They showed that 3 g/L is the optimal dose of the adsorbent for a solution of C0 = 300 mg/L.In another study, Jabar et al. [82] tested the efficiency of activated cocoa leaves' biochar in the adsorption of CV.The experimental results showed that the optimal dose is 0.4 g/L and that above this dose CV dye-uptake and percentage CV dye removed decreased.

Effect of Contact Time and Temperature
Time is also a crucial factor in designing an appropriate treatment process.The effect of contact time at different temperatures on the adsorption of CV and Cr (VI) is shown in Figure 10.It is clear from the figure that for all temperatures studied the adsorbed amount increased rapidly during the first minutes, then gradually slowed down, and finally became constant after an equilibrium time of 45 min and 80 min for CV and Cr (VI), respectively.After equilibrium, the adsorption was insignificant as a function of contact time under the conditions employed.Therefore, these two times were selected for further studies.

Effect of Contact Time and Temperature
Time is also a crucial factor in designing an appropriate treatment process.The effect of contact time at different temperatures on the adsorption of CV and Cr (VI) is shown in Figure 10.It is clear from the figure that for all temperatures studied the adsorbed amount increased rapidly during the first minutes, then gradually slowed down, and finally became constant after an equilibrium time of 45 min and 80 min for CV and Cr (VI), respectively.After equilibrium, the adsorption was insignificant as a function of contact time under the conditions employed.Therefore, these two times were selected for further studies.The rapid adsorption at the beginning is due to a large concentration gradient between the solution and the adsorbate concentration on the solid surface, as well as the large number of important vacant adsorption active sites.The slow increase in the later stage is attributed to the low number of free sites.Regarding the effect of temperature, the decrease in the adsorbed amount of both pollutants with increasing temperature indicates that the adsorption is exothermic and is therefore more favourable at low temperatures.This shows that increasing the temperature leads to a decrease in the binding forces between the adsorbent and the adsorbate.These observations are consistent with those of Jabar et al. [82], concerning adsorption of crystal violet dye using biochar from cocoa leaves, and those of Anuj et al. [83], concerning the adsorption of Cr (VI) on activated carbon from aloe vera leaf powder waste.

Adsorption Kinetics
The experimental kinetic data at different temperatures and the theoretical curves of the two models are shown in Figure 11; the parameters associated with these models are reported in Table 4. Visually, the PSO model is the most adequate to describe the experimental adsorption data of the two studied pollutants.This is confirmed by the high R 2 values and the low χ 2 compared with those of the PSO model.Moreover, the theoretical qe.cal values of the two adsorbates are very close to the experimental qe.exp values.The works of Streit et al. [84] and Ghorbani et al. [85] support these results.They studied, respectively, the adsorption of CV and Cr (VI) on activated carbons synthesised from lignocellulosic waste.These authors found that the PSO model describes the adsorption process well.The rapid adsorption at the beginning is due to a large concentration gradient between the solution and the adsorbate concentration on the solid surface, as well as the large number of important vacant adsorption active sites.The slow increase in the later stage is attributed to the low number of free sites.Regarding the effect of temperature, the decrease in the adsorbed amount of both pollutants with increasing temperature indicates that the adsorption is exothermic and is therefore more favourable at low temperatures.This shows that increasing the temperature leads to a decrease in the binding forces between the adsorbent and the adsorbate.These observations are consistent with those of Jabar et al. [82], concerning adsorption of crystal violet dye using biochar from cocoa leaves, and those of Anuj et al. [83], concerning the adsorption of Cr (VI) on activated carbon from aloe vera leaf powder waste.

Adsorption Kinetics
The experimental kinetic data at different temperatures and the theoretical curves of the two models are shown in Figure 11; the parameters associated with these models are reported in Table 4. Visually, the PSO model is the most adequate to describe the experimental adsorption data of the two studied pollutants.This is confirmed by the high R 2 values and the low χ 2 compared with those of the PSO model.Moreover, the theoretical q e.cal values of the two adsorbates are very close to the experimental q e.exp values.The works of Streit et al. [84] and Ghorbani et al. [85] support these results.They studied, respectively, the adsorption of CV and Cr (VI) on activated carbons synthesised from lignocellulosic waste.These authors found that the PSO model describes the adsorption process well.In order to obtain information on the different stages of the diffusion mechanism of the two adsorbates from the solution to the active sites of the activated carbon, the intraparticle diffusion model, described by the Weber and Morris equation (Equation ( 6)), was applied to analyse the experimental data.Figure 12 shows the curves of the intraparticle model for the two pollutants.Table 5 shows the values of the intraparticle rate constant kdi, the boundary layer thickness Ci, and R 2 for the four temperatures.Figure 12 shows that the intraparticle model curves for both pollutants are composed of three segments whatever the temperature studied, indicating the intervention of three steps in the adsorption process.The linear segments do not pass through the origin, indicating that  In order to obtain information on the different stages of the diffusion mechanism of the two adsorbates from the solution to the active sites of the activated carbon, the intraparticle diffusion model, described by the Weber and Morris equation (Equation ( 6)), was applied to analyse the experimental data.Figure 12 shows the curves of the intraparticle model for the two pollutants.Table 5 shows the values of the intraparticle rate constant k di , the boundary layer thickness C i , and R 2 for the four temperatures.Figure 12 shows that the intraparticle model curves for both pollutants are composed of three segments whatever the temperature studied, indicating the intervention of three steps in the adsorption process.
The linear segments do not pass through the origin, indicating that intraparticle diffusion is not the only rate-controlling step during the diffusion of CV and Cr (VI) from the solution to the pores of the activated carbon [86].The first stage, the fastest, represents the adsorption of CV and Cr (VI) on the external surface of the carbon.The second stage corresponds to the progressive adsorption of the two adsorbates, where intraparticle diffusion limits the adsorption phenomenon.The third stage indicates the final equilibrium state, where intraparticle diffusion starts to slow down due to low residual adsorbate concentrations in the solutions.

Adsorption Isotherms
The adsorption isotherm is essential to describe how the adsorbate interacts with the adsorbent and to reliably predict the adsorption parameters in order to quantitatively compare the behaviour of adsorbents under various experimental conditions.
To simulate the adsorption isotherms in this study, three commonly used models-the Freundlich model, the Langmuir model, and the Temkin model-were chosen to explain the interaction between the activated carbon and the two pollutants.The adsorption isotherms of CV and Cr (VI) from aqueous solutions on ACSCGs at 303 K are shown in Figure 13 and the parameters of these models are summarised in Table 6.Table 6 shows that the Langmuir model best describes the experimental data, with a high R 2 and a low χ 2 , compared with the values of the Freundlich and Temkin models, implying a monolayer adsorption without interactions and on homogeneous sites, where each molecule has a constant enthalpy and activation energy of adsorption.

Adsorption Isotherms
The adsorption isotherm is essential to describe how the adsorbate interacts with the adsorbent and to reliably predict the adsorption parameters in order to quantitatively compare the behaviour of adsorbents under various experimental conditions.
To simulate the adsorption isotherms in this study, three commonly used modelsthe Freundlich model, the Langmuir model, and the Temkin model-were chosen to explain the interaction between the activated carbon and the two pollutants.The adsorption isotherms of CV and Cr (VI) from aqueous solutions on ACSCGs at 303 K are shown in Figure 13 and the parameters of these models are summarised in Table 6.Table 6 shows that the Langmuir model best describes the experimental data, with a high R 2 and a low χ 2 , compared with the values of the Freundlich and Temkin models, implying a monolayer adsorption without interactions and on homogeneous sites, where each molecule has a constant enthalpy and activation energy of adsorption.In addition, the affinity between the carbon and the two adsorbates can be predicted by calculating the Langmuir separation factor (R L ).Adsorption is more favourable as the value of R L is close to 0. Figure 14 shows the R L versus C 0 curves in the concentration range studied.The figure shows that the RL values for CV and Cr (VI) are between 0 and 1.It can be concluded that the adsorption process is more favourable at higher concentrations.In addition, the affinity between the carbon and the two adsorbates can be predicted by calculating the Langmuir separation factor (RL). Adsorption is more favourable as the value of RL is close to 0. Figure 14 shows the RL versus C0 curves in the concentration range studied.The figure shows that the RL values for CV and Cr (VI) are between 0 and 1.It can be concluded that the adsorption process is more favourable at higher concentrations.

Adsorption Thermodynamic
The changes in Gibbs free energy (∆G°), enthalpy (∆H°), and entropy (∆S°) for CV and Cr (VI) adsorption process were evaluated using van't Hoff curves (Figure 15).The calculated values of ∆G°, ∆H° and ∆S° for CV and Cr (VI) adsorption are collected in Table 7.The negative values of ∆G° for both pollutants indicate that the adsorption process is spontaneous and feasible, without the need for an external energy source.Furthermore, the increase in the value of ∆G° with increasing temperature implies that adsorption is easier at lower temperatures.The negative values of ∆H° for CV and Cr (VI) confirm that the adsorption process of both pollutants is exothermic, which is already indicated by the decrease of the adsorbed amount with increasing temperature.This can be explained by the weakening of the adsorption forces between the active sites of the carbon and the adsorbed species by the increase in temperature.The negative values of ∆S° revealed that the adsorption of CV and Cr (VI) leads to a decrease of disorder at the solid-liquid interfaces.On the other hand, the value of the activation energy (Ea) of the adsorption of the

Adsorption Thermodynamic
The changes in Gibbs free energy (∆G • ), enthalpy (∆H • ), and entropy (∆S • ) for CV and Cr (VI) adsorption process were evaluated using van't Hoff curves (Figure 15).The calculated values of ∆G • , ∆H • and ∆S • for CV and Cr (VI) adsorption are collected in Table 7.The negative values of ∆G • for both pollutants indicate that the adsorption process is spontaneous and feasible, without the need for an external energy source.Furthermore, the increase in the value of ∆G • with increasing temperature implies that adsorption is easier at lower temperatures.The negative values of ∆H • for CV and Cr (VI) confirm that the adsorption process of both pollutants is exothermic, which is already indicated by the decrease of the adsorbed amount with increasing temperature.This can be explained by the weakening of the adsorption forces between the active sites of the carbon and the adsorbed species by the increase in temperature.The negative values of ∆S • revealed that the adsorption of CV and Cr (VI) leads to a decrease of disorder at the solid-liquid interfaces.On the other hand, the value of the activation energy (E a ) of the adsorption of the two pollutants, estimated by the Arrhenius equation (Equation ( 13)), shows that the removal of the two pollutants on the activated carbon is physical in nature.A similar thermodynamic behaviour was also observed by

Comparison of Activated Carbon from Coffee Grounds with Other Adsorbents
The comparison of the adsorption capacity of CV and Cr (VI) on ACSCGs with that of other activated carbons reported in the literature is presented in Table 8.It can be seen from Table 8 that activated carbon prepared by activation of spent coffee grounds has a high adsorption capacity compared with other activated carbons.This may be mainly due to the initial carbon content, the activation process, as well as the basic morphology of the raw material.In addition, it can be observed that ACSCGs has a great advantage for adsorption at a pH around neutral.Therefore, ACSCGs can be considered as an effective adsorbent for the removal of Cr (VI) and CV from aqueous solutions.The comparison of the adsorption capacity of CV and Cr (VI) on ACSCGs with that of other activated carbons reported in the literature is presented in Table 8.It can be seen from Table 8 that activated carbon prepared by activation of spent coffee grounds has a high adsorption capacity compared with other activated carbons.This may be mainly due to the initial carbon content, the activation process, as well as the basic morphology of the raw material.In addition, it can be observed that ACSCGs has a great advantage for adsorption at a pH around neutral.Therefore, ACSCGs can be considered as an effective adsorbent for the removal of Cr (VI) and CV from aqueous solutions.

Conclusions
Activated carbon spent coffee grounds synthesised by chemical activation with KOH was tested in this study to assess its ability to remove CV and Cr (VI) from aqueous solutions.The study of the effects of operating parameters showed that 0.1 g/100 mL of ACSCGs removes 95% of the CV from a solution of initial concentration 100 mg/L at pH 9, and 0.15 g/100 mL of ACSCGs removes 95% of Cr (VI) from the same solution at pH 6.The equilibrium adsorption data can be well described for both pollutants by the Langmuir isotherm and the kinetic data are well-fitted by the pseudo-second order model.In addition, the analysis of the data by the intraparticle diffusion model showed that the process takes place in three steps and that intraparticle diffusion is not the only step that limits the adsorption of the two contaminants.The negative values of Gibbs free energy (∆G • ), enthalpy (∆H • ), and entropy (∆S • ) for both pollutants indicate that the adsorption process is spontaneous and exothermic, and leads to a decrease in disorder at the solid-liquid interfaces.Therefore, the synthesized activated carbon can be effectively used in various adsorption applications such as adsorption of cationic dyes and heavy metals from industrial waste.

Figure 1 .
Figure 1.Reactor and furnace used to produce activated carbon.

Figure 1 .
Figure 1.Reactor and furnace used to produce activated carbon.
Appl.Sci.2023, 13, x FOR PEER REVIEW 12 of 26 greater affinity for basic carbon than for acidic carbon, as shown by Faria et al.[73].Similarly, Qian et al.[74] confirmed that the acidic surface functions significantly decrease the electron density on the base layer of the carbon, which limits the adsorption of basic dye.

Figure 6 .
Figure 6.Adsorption isotherm of methylene blue on ACSCGs and on CAC.

26 Figure 7 .
Figure 7. Adsorption isotherm of iodine on the two activated carbons.

Figure 7 .
Figure 7. Adsorption isotherm of iodine on the two activated carbons.

Figure 8 .
Figure 8. pH effect on the adsorption of Cr (VI) and CV by ACSCGs.

Figure 8 .
Figure 8. pH effect on the adsorption of Cr (VI) and CV by ACSCGs.

Figure 9 .
Figure 9.Effect of adsorbent dose on Cr (VI) and CV removal.

Figure 9 .
Figure 9.Effect of adsorbent dose on Cr (VI) and CV removal.

Figure 10 .
Figure 10.Effect of time and temperature on the adsorption of CV and Cr (VI) on ACSCGs.

Figure 10 .
Figure 10.Effect of time and temperature on the adsorption of CV and Cr (VI) on ACSCGs.

Figure 11 .
Figure 11.Plots of the PPO and PSO models at different temperatures.

Figure 11 .
Figure 11.Plots of the PPO and PSO models at different temperatures.

Figure 14 .
Figure 14.Separation factor for the adsorption of Cr (VI) and CV on ACSCGs.

Figure 14 .
Figure 14.Separation factor for the adsorption of Cr (VI) and CV on ACSCGs.
Foroutan et al., for the adsorption of CV on activated carbon prepared by lemon wood [87], and by Yunusa et al., in their work on the adsorption of Cr (VI) on activated carbon from date seeds [88].

Figure 15 .Table 7 .
Figure 15.Evolution of ln (K d ) as a function of 1/T.

Table 1 .
Experimental conditions of the different adsorption experiments.
3.1.3.Determination of pH of the Point of Zero Charge (pH PZC )

Table 3 .
Surface functions of SCGs and ACSCGs.

Table 4 .
Adsorption rate constants of PFO and PSO.

Table 4 .
Adsorption rate constants of PFO and PSO.

Table 5 .
Constants of the intraparticle diffusion model.

Table 6 .
Adsorption isotherm constants for CV and Cr (VI) at 30 °C.

Table 6 .
Adsorption isotherm constants for CV and Cr (VI) at 30 • C.

Table 7 .
Thermodynamic parameters of Cr (VI) and CV adsorption on ACSCGs.

Table 8 .
Comparison of ACSCGs's adsorption capacity with other activated carbons.

Table 8 .
Comparison of ACSCGs's adsorption capacity with other activated carbons.