Study of Inﬂuential Parameters of the Caffeine Extraction from Spent Coffee Grounds: From Brewing Coffee Method to the Waste Treatment Conditions

: This article aims to study the interest of spent coffee grounds (SCG) valorization through caffeine recovery. In an original way, this study takes into account all the parameters such as (i) the brewing coffee methods (household, coffee shops, etc.); (ii) the storage conditions, in particular the drying step; (iii) the solid/liquid extraction parameters such as the nature of solvent, the temperature, the extraction time and the solid/liquid ratio; and (iv) the liquid/liquid puriﬁcation parameters such as the nature, the volume and the pH of extraction medium. Results have shown that spent coffee grounds from coffee-shops obtained by percolation contain a higher amount of caffeine than spent coffee grounds from households obtained from spent pods or ﬁlters. A drying treatment is not required when extraction is performed under one week after the spent coffee grounds collection with 96.4% of not degraded caffeine. Solid/liquid extraction performed with 25 mL.g − 1 SCG of hydroalcoholic solvent (water/EtOH, v / v 60/40) at 60 ◦ C during 15 min have given a caffeine yield up to 4.67 mg.g − 1 SCG . When using ethyl acetate, 93.4% of the caffeine has been selectively recovered by liquid/liquid extraction. Finally, the extraction of caffeine for the valorization of spent coffee grounds is a promising and easy way, which ﬁts with an already important and well established market.


Introduction
Coffee is one of the most being traded commodity with an annual world production over 10 million tons in 2019 [1]. The path to produce a coffee beverage is long and leads to the generation of several by-products such as coffee husk, pulp, silverskin and spent coffee grounds (SCG). Coffee grounds represent the most valuable and available coffee by-product produced by soluble coffees industries, domestic houses, restaurants and coffee shops. Besides, it has been calculated that 650 kg of spent coffee grounds are generated from one ton of green coffee beans turned into coffee beverage [2].
Caffeine can be incorporated in daily life products such as sodas and energy drinks [23], painkillers [24] or slimming creams [25]. Nowadays, coffee decaffeination is the most important known process to recover caffeine [26,27]. Extracted caffeine is the same as synthetic Caffeine can be incorporated in daily life products such as sodas and energy drinks [23], painkillers [24] or slimming creams [25]. Nowadays, coffee decaffeination is the most important known process to recover caffeine [26,27]. Extracted caffeine is the same as synthetic caffeine, expect that its economic value is higher due to its naturalness. However, caffeine from spent coffee grounds is rarely purified from raw extracts of bioactive molecules [18].
Hence, the aim of this work is to propose a full investigation of parameters of caffeine production from spent coffee grounds such as: (i) the brewing method in relation with the origin of spent coffee grounds (household, restaurants/coffee shops), (ii) the storage conditions with the influence of a drying step, (iii) the first step of solid/liquid extraction to recover caffeine from spent coffee grounds (nature of the solvent, extraction temperature and time, solid/liquid ratio) and (iv) the second step of liquid/liquid extraction to selectively recover caffeine (nature and volume of the solvent, pH).

Chemicals and Reagents
Pure standard of caffeine, ethanol (96% purity, not denatured), acetic acid (99.5% purity) and dichloromethane were obtained from ACROS ORGANICS. Acetonitrile, ethyl acetate, n-heptane and sodium hydroxide were supplied by Fisher Chemical. Chlorhydric acid (37% w) was obtained from Roth. All solvents and reagents were of analytical grade and used as received.

Plant Material
Spent coffee grounds and roasted coffee beans used in this study have been obtained from a local bakery (R1) and from two restaurants (R2, R3). The bakery and restaurants prepare coffee beverage using the brewing method called percolation using professional high-pressure coffeemakers. The roasted coffee beans are from the same provider for each restaurant and are composed of a blend of 80% of Arabica and 20% of Robusta coffee. Individuals obtain spent coffee grounds through different ways: by percolation with household capsule coffeemakers (C1, C2), by percolation with mocha coffeemaker (M1) and by filtration with filter coffeemakers (F1). The amount of water required to brew the coffee was different for the household capsule coffeemakers C1, C2 (13 mL/gcoffee), household filtration coffeemaker F1 (18 mL/gcoffee), mocha coffeemaker M1 (unknown ratio) and restaurants R1, R2, R3 (unknown ratio). The residence time of water inside coffee were unknown in all cases.

Storage of Spent Coffee Grounds (SCG)
The spent coffee grounds from the bakery (R1) were used for the study of storage and solid/liquid extraction. A full week was required for the bakery to fill up a 25 L plastic bucket with spent coffee grounds that was then closed. The naturally wet (59.25% water w/w) spent coffee grounds were then stored at standard pressure and temperature in a close plastic bucket. Dry spent coffee grounds were obtained after 24 h in a 50 °C oven (12.50% water w/w). Hence, the aim of this work is to propose a full investigation of parameters of caffeine production from spent coffee grounds such as: (i) the brewing method in relation with the origin of spent coffee grounds (household, restaurants/coffee shops), (ii) the storage conditions with the influence of a drying step, (iii) the first step of solid/liquid extraction to recover caffeine from spent coffee grounds (nature of the solvent, extraction temperature and time, solid/liquid ratio) and (iv) the second step of liquid/liquid extraction to selectively recover caffeine (nature and volume of the solvent, pH).

Chemicals and Reagents
Pure standard of caffeine, ethanol (96% purity, not denatured), acetic acid (99.5% purity) and dichloromethane were obtained from ACROS ORGANICS. Acetonitrile, ethyl acetate, n-heptane and sodium hydroxide were supplied by Fisher Chemical. Chlorhydric acid (37% w) was obtained from Roth. All solvents and reagents were of analytical grade and used as received.

Plant Material
Spent coffee grounds and roasted coffee beans used in this study have been obtained from a local bakery (R1) and from two restaurants (R2, R3). The bakery and restaurants prepare coffee beverage using the brewing method called percolation using professional high-pressure coffeemakers. The roasted coffee beans are from the same provider for each restaurant and are composed of a blend of 80% of Arabica and 20% of Robusta coffee. Individuals obtain spent coffee grounds through different ways: by percolation with household capsule coffeemakers (C1, C2), by percolation with mocha coffeemaker (M1) and by filtration with filter coffeemakers (F1). The amount of water required to brew the coffee was different for the household capsule coffeemakers C1, C2 (13 mL/g coffee ), household filtration coffeemaker F1 (18 mL/g coffee ), mocha coffeemaker M1 (unknown ratio) and restaurants R1, R2, R3 (unknown ratio). The residence time of water inside coffee were unknown in all cases.

Storage of Spent Coffee Grounds (SCG)
The spent coffee grounds from the bakery (R1) were used for the study of storage and solid/liquid extraction. A full week was required for the bakery to fill up a 25 L plastic bucket with spent coffee grounds that was then closed. The naturally wet (59.25% water w/w) spent coffee grounds were then stored at standard pressure and temperature in a close plastic bucket. Dry spent coffee grounds were obtained after 24 h in a 50 • C oven (12.50% water w/w).

Solid/Liquid Extraction-General Protocol
Extractions with dichloromethane, ethyl acetate or a solution at 0, 20, 40, 60, 80 or 100% of EtOH in water (v/v) were performed. A total of 1.43, 2, 3.33 or 5 g of dry spent coffee grounds were mixed up with 50 mL of the studied solution in a round bottom flask magnetically stirred maintained at 20, 40, 60 or 80 • C in a water bath for 5, 10 or 15 min. The obtained extracts were filtered on a Buchner funnel equipped with a cellulose filter and rinsed with 10 mL of solvent. The resulting liquid extracts were then filtrated with a syringe filter (0.22 µm, polyethersulfone (PES) membrane) before HPLC analysis.

Liquid/Liquid Extraction-General Protocol
The previous aqueous spent coffee grounds extracts were acidified with 0.5 mL of a 10% HCl until pH = 2, basified by adding 1 mL of a 2 N NaOH until pH = 14 or remained neutral at pH = 7. Liquid/liquid extractions were performed under magnetic stirring to treat the extract obtained in solid/liquid extraction with 60 mL (6 × 10 mL) or 180 mL (6 × 30 mL) of dichloromethane, ethyl acetate, ethyl ether or n-heptane. Then, the mixture was decanted for 15 min in a separating funnel. The organic phases were evaporated and the obtained dried extracts were dissolved in 50 mL of water for HPLC analysis.

HPLC-UV Analysis
HPLC analysis was achieved with a Perkin Elmer (Series 200) system equipped with an automated sampler. A reverse phase column (Surf C18 TriF 100A 3 µm 33 × 4.6 mm ImChem) was used at 25 • C. The sample injection was 5 µL. The chromatographic separation was performed using an isocratic elution with a mixture of 0.1% (w) of acetic acid in water (solvent A) and acetonitrile (solvent B). A constant flow of solvent of 0.4 mL.min −1 with A/B ratio of 90/10 (v/v) during 30 min was applied. Detection was accomplished with a UV/Visible diode at a wavelength of 273 nm [28].

Statistical Analysis
Analyses were performed in duplicate. Experiments described in Section 3.3 were performed in duplicate. Linear regression was tested on the results in Section 3.2 to observe caffeine degradation during storage of wet spent coffee grounds ( Figure 4). Student tests (t-test) were performed with the results in Section 3.3 to evaluate the significant difference on caffeine extraction with various %EtOH in hydroalcoholic solvent ( Figure 6), temperature (Figure 7), time ( Figure 8) and solid/liquid ratio ( Figure 9). Linear regressions were tested on the results in Section 3.4 to observe the liquid/liquid extraction of caffeine with different organic solvent ( Figure 10) and volume ( Figure 11). Student tests (t-test) were performed in Section 3.4 to evaluate the significant difference on selectivity ( Figure 13) and yield ( Figure 14) with various pH when liquid/liquid extraction of caffeine. Kruskal-Wallis tests were carried out on the results of Section 3.2 to evaluate the significance of the influence of %EtOH in hydroalcoholic solvent, temperature, time and solid/liquid ratio when solid/liquid extraction of caffeine (Table 1). Statistical analyses were performed with the software R (4.0.3 version).

Influence of Brewing Methods
The influence of the brewing methods on the caffeine content has been studied by comparing the caffeine content of roasted coffee beans (RCB, initial state) and of spent coffee grounds (after brewing) of different origin of roasted coffee beans and location of preparation ( Figure 2). Restaurants (R1, R2, R3) have the same RCB provider and prepare coffee through percolation using professional high-pressure coffeemakers. Two different household capsule coffeemakers (C1, C2) and a mocha coffeemaker (M1) lead to coffee preparation by percolation at lower pressures. Last, filter coffeemakers (F1) only involved filtration method.
Spent coffee grounds from restaurant are richer in caffeine with 2.8-4.0 mg.g −1 SCG ; 21.5-30.8% remaining caffeine compared to the one of domestic house filtration with 0.7 mg.g −1 SCG ; 5.6% remaining caffeine. Spent coffee grounds obtained by domestic percolation through capsule espresso (C1, C2) have also revealed low concentrations of caffeine 0.5-1.1 mg.g −1 SCG ; 2.7-9.3% of remaining caffeine. Spent coffee grounds from Spent coffee grounds from restaurant are richer in caffeine with 2.8-4.0 mg.g −1 SCG; 21.5-30.8% remaining caffeine compared to the one of domestic house filtration with 0.7 mg.g −1 SCG; 5.6% remaining caffeine. Spent coffee grounds obtained by domestic percolation through capsule espresso (C1, C2) have also revealed low concentrations of caffeine 0.5-1.1 mg.g −1 SCG; 2.7-9.3% of remaining caffeine. Spent coffee grounds from mocha apparatus (M1) exhibited a concentration of caffeine of 2.1 mg.g −1 SCG; 16.4% remaining caffeine.
These preliminary results are in agreement with those of the literature, reporting that coffee beverage obtained from filtration is richer in caffeine than the coffee beverage obtained from percolation, due to longer time and bigger volume of extraction. In this work several minutes and 120 mL for filtration are compared to 30 s and 30 mL for percolation [29,30]. Thus, a selective collection of spent coffee grounds in restaurants is the most suitable for caffeine recovery [31]. This collection strategy was implemented in 2020 by the start-up "Kaffee Bueno" in Denmark that collects spent coffee grounds for free from restaurants, hotels and offices consuming over 300 kg of coffee per month [32]. Vakalis et al. have reported that household capsules of spent coffee grounds are the most difficult to valorize due to their high moisture level and the additional issues generated by plastic from the capsule. [33]

Influence of Spent Coffee Grounds Storage
The influence of spent coffee grounds storage has been investigated using visual observations and measurement of caffeine content in spent coffee stored during four weeks (Figures 3 and 4).  These preliminary results are in agreement with those of the literature, reporting that coffee beverage obtained from filtration is richer in caffeine than the coffee beverage obtained from percolation, due to longer time and bigger volume of extraction. In this work several minutes and 120 mL for filtration are compared to 30 s and 30 mL for percolation [29,30]. Thus, a selective collection of spent coffee grounds in restaurants is the most suitable for caffeine recovery [31]. This collection strategy was implemented in 2020 by the start-up "Kaffee Bueno" in Denmark that collects spent coffee grounds for free from restaurants, hotels and offices consuming over 300 kg of coffee per month [32]. Vakalis et al. have reported that household capsules of spent coffee grounds are the most difficult to valorize due to their high moisture level and the additional issues generated by plastic from the capsule [33].

Influence of Spent Coffee Grounds Storage
The influence of spent coffee grounds storage has been investigated using visual observations and measurement of caffeine content in spent coffee stored during four weeks (Figures 3 and 4). Spent coffee grounds from restaurant are richer in caffeine with 2.8-4.0 mg.g −1 SCG 21.5-30.8% remaining caffeine compared to the one of domestic house filtration with 0. mg.g −1 SCG; 5.6% remaining caffeine. Spent coffee grounds obtained by domestic percola tion through capsule espresso (C1, C2) have also revealed low concentrations of caffein 0.5-1.1 mg.g −1 SCG; 2.7-9.3% of remaining caffeine. Spent coffee grounds from mocha appa ratus (M1) exhibited a concentration of caffeine of 2.1 mg.g −1 SCG; 16.4% remaining caffeine These preliminary results are in agreement with those of the literature, reporting tha coffee beverage obtained from filtration is richer in caffeine than the coffee beverage ob tained from percolation, due to longer time and bigger volume of extraction. In this wor several minutes and 120 mL for filtration are compared to 30 s and 30 mL for percolatio [29,30]. Thus, a selective collection of spent coffee grounds in restaurants is the most suit able for caffeine recovery [31]. This collection strategy was implemented in 2020 by th start-up "Kaffee Bueno" in Denmark that collects spent coffee grounds for free from res taurants, hotels and offices consuming over 300 kg of coffee per month [32]. Vakalis et a have reported that household capsules of spent coffee grounds are the most difficult t valorize due to their high moisture level and the additional issues generated by plasti from the capsule. [33]

Influence of Spent Coffee Grounds Storage
The influence of spent coffee grounds storage has been investigated using visual ob servations and measurement of caffeine content in spent coffee stored during four week (Figures 3 and 4).  Visual observations showed white moss that appeared at the surface of the sample revealing the growth of fungi. In the inside of raw material, wet spent coffee grounds have started to agglomerate into small balls filled with green fungus.
Experimental measurements have shown that more than 30% of caffeine in wet spent coffee grounds are degraded after 28 days when no degradation has been observed for dry spent coffee grounds. For wet spent coffee grounds, this slight decrease already appears after a week with 96.4% of not degraded caffeine. However, most significant degradation was observed after four weeks with 69.3% of remaining caffeine, in addition to a strong white moss development. Finally, the linear regression model suggests that degradation would keep going over 28 days for wet spent coffee grounds.
Batista et al. have identified Aspergillus genusas as one of filamentous fungi that develop naturally on coffee beans [34]. The mechanism of the degradation of caffeine by Aspergillus strains has been described by Gummadi et al. as successive demethylation of caffeine into 1,3-dimethylxanthine, theophylline, into 3-methylxanthine, then, into xanthine ( Figure 5) [35]. Hence, main differences explaining those results between dry and wet spent coffee grounds can be related to the presence of water in the raw material, which is thus responsible for fungal development.

Solid/Liquid Extraction Optimization
The solid-liquid extraction process includes three stages: (i) permeation of the solvent through the matrix, (ii) solubilization of the solute and iii) diffusion of the solute through the solvent [36]. Pinelo et al. have put forth the hypothesis that the limited stage in solidliquid extraction is the diffusion of the dissolved solute (step iii). The diffusion of the solute is governed by the Fick laws [37]. Fick's first law considers that the flux of the gradient of solute concentration goes from regions of high concentration to regions of low concentration with a magnitude that is proportional to the concentration gradient (Equation (1)).
Equation (1) Visual observations showed white moss that appeared at the surface of the sample revealing the growth of fungi. In the inside of raw material, wet spent coffee grounds have started to agglomerate into small balls filled with green fungus.
Experimental measurements have shown that more than 30% of caffeine in wet spent coffee grounds are degraded after 28 days when no degradation has been observed for dry spent coffee grounds. For wet spent coffee grounds, this slight decrease already appears after a week with 96.4% of not degraded caffeine. However, most significant degradation was observed after four weeks with 69.3% of remaining caffeine, in addition to a strong white moss development. Finally, the linear regression model suggests that degradation would keep going over 28 days for wet spent coffee grounds.
Batista et al. have identified Aspergillus genusas as one of filamentous fungi that develop naturally on coffee beans [34]. The mechanism of the degradation of caffeine by Aspergillus strains has been described by Gummadi et al. as successive demethylation of caffeine into 1,3-dimethylxanthine, theophylline, into 3-methylxanthine, then, into xanthine ( Figure 5) [35]. Hence, main differences explaining those results between dry and wet spent coffee grounds can be related to the presence of water in the raw material, which is thus responsible for fungal development. Visual observations showed white moss that appeared at the surface of the sample revealing the growth of fungi. In the inside of raw material, wet spent coffee grounds have started to agglomerate into small balls filled with green fungus.
Experimental measurements have shown that more than 30% of caffeine in wet spent coffee grounds are degraded after 28 days when no degradation has been observed for dry spent coffee grounds. For wet spent coffee grounds, this slight decrease already appears after a week with 96.4% of not degraded caffeine. However, most significant degradation was observed after four weeks with 69.3% of remaining caffeine, in addition to a strong white moss development. Finally, the linear regression model suggests that degradation would keep going over 28 days for wet spent coffee grounds.
Batista et al. have identified Aspergillus genusas as one of filamentous fungi that develop naturally on coffee beans [34]. The mechanism of the degradation of caffeine by Aspergillus strains has been described by Gummadi et al. as successive demethylation of caffeine into 1,3-dimethylxanthine, theophylline, into 3-methylxanthine, then, into xanthine ( Figure 5) [35]. Hence, main differences explaining those results between dry and wet spent coffee grounds can be related to the presence of water in the raw material, which is thus responsible for fungal development.

Solid/Liquid Extraction Optimization
The solid-liquid extraction process includes three stages: (i) permeation of the solvent through the matrix, (ii) solubilization of the solute and iii) diffusion of the solute through the solvent [36]. Pinelo et al. have put forth the hypothesis that the limited stage in solidliquid extraction is the diffusion of the dissolved solute (step iii). The diffusion of the solute is governed by the Fick laws [37]. Fick's first law considers that the flux of the gradient of solute concentration goes from regions of high concentration to regions of low concentration with a magnitude that is proportional to the concentration gradient (Equation (1)).

Solid/Liquid Extraction Optimization
The solid-liquid extraction process includes three stages: (i) permeation of the solvent through the matrix, (ii) solubilization of the solute and (iii) diffusion of the solute through the solvent [36]. Pinelo et al. have put forth the hypothesis that the limited stage in solid-liquid extraction is the diffusion of the dissolved solute (step iii). The diffusion of the solute is governed by the Fick laws [37]. Fick's first law considers that the flux of the gradient of solute concentration goes from regions of high concentration to regions of low concentration with a magnitude that is proportional to the concentration gradient (Equation (1)).

Equation (1): Fick first law
where J is the diffusion flux expressed as amount of substance per unit area per time, D is the diffusion coefficient or diffusivity expressed as area per unit time, ϕ is the concentration expressed as amount of substance per unit volume and x is the position expressed as the dimension of length. Hence, several parameters of solid-liquid extraction such as the nature of the solvent, temperature, time of extraction and solid/liquid ratio (w/v) or particle size can significantly affect the different stages of caffeine extraction and have been investigated. Only particle size has not been studied since spent coffee grounds is already a powder that does not need to be ground.
temperature, time of extraction and solid/liquid ratio (w/v) or particle size can significantly affect the different stages of caffeine extraction and have been investigated. Only particle size has not been studied since spent coffee grounds is already a powder that does not need to be ground.
As a further comparison, Santana and Macedo have determined extraction with H2O/EtOH of 50/50 (w/w) as optimum conditions for caffeine recovery from guarana [38]. This is in accordance with the fundamental study of the caffeine solubility in hydroalcoholic solutions by Bustamante et al. reporting a higher caffeine solubility in H2O/EtOH with a 40/60 ratio (v/v) between 5 and 40 °C [39].
Zosel has patented a caffeine extraction system with supercritical CO2 at temperatures between 40 and 80 °C, and pressures between 120 and 180 atm; 5 to 30 h were required to quantitatively extract the caffeine [40]. Todd and Baroutian have reported a comparative techno-economic analysis of the extraction of bioactive grape marc using supercritical CO2 vs. organic solvent extraction [41]. The costs of manufacture (COM) have been reported as 87.0 NZ$/ton for organic solvents and 123.40 NZ$/ton for supercritical CO2; these results show that supercritical CO2 is a more expensive process [41]. The decaffeination using supercritical CO2 is efficient, highly selective and eco-responsible for coffee bean without removing flavor. Unfortunately, the additional cost can seem questionable when it comes to treating waste. Indeed, the residue after extraction is presently without market value.  Zosel has patented a caffeine extraction system with supercritical CO 2 at temperatures between 40 and 80 • C, and pressures between 120 and 180 atm; 5 to 30 h were required to quantitatively extract the caffeine [40]. Todd and Baroutian have reported a comparative techno-economic analysis of the extraction of bioactive grape marc using supercritical CO 2 vs. organic solvent extraction [41]. The costs of manufacture (COM) have been reported as 87.0 NZ$/ton for organic solvents and 123.40 NZ$/ton for supercritical CO 2 ; these results show that supercritical CO 2 is a more expensive process [41]. The decaffeination using supercritical CO 2 is efficient, highly selective and eco-responsible for coffee bean without removing flavor. Unfortunately, the additional cost can seem questionable when it comes to treating waste. Indeed, the residue after extraction is presently without market value.
The extracted caffeine for dichloromethane (1.7 mg.g −1 SCG ) and ethyl acetate (0.5 mg.g −1 SCG ) are worse than optimized hydroalcoholic solution (4.32 mg.g −1 SCG ). This is surprising since Shalmashi et al. have reported that caffeine solubility was higher in dichloromethane and chloroform compared to water, ethyl acetate, ethanol, carbon tetrachloride, methanol and acetone [42]. However, according to Sondheimer et al., caffeine occurs in coffee as chlorogenic acid-caffeine complex where it is hardly extractible with chloroform [43]. Hence, a polar solvent such as water-based solvent is strongly recommended for effective extraction of caffeine from coffee matrices in short time. In addition, Bustamante et al. have highlighted that caffeine display several functional groups with different hydrogen bonding abilities, explaining the affinity for water-based solvent [39]. Hence, we can make the hypothesis that ethanol can decrease the polarity of water, while keeping strong hydrogen bonding interactions between water and caffeine. The Student test does not show that an increase of the EtOH content in the hydroalcoholic solvent from 20% to 40% increases caffeine extraction efficiency (p < 0.05). Therefore, extractions could be performed with 20% EtOH to minimize the proportion of organic solvent. In our case, the following experiments were performed with hydroalcoholic solvent with 40% ethanol.
Clean Technol. 2021, 3, FOR PEER REVIEW 7 The extracted caffeine for dichloromethane (1.7 mg.g −1 SCG) and ethyl acetate (0.5 mg.g −1 SCG) are worse than optimized hydroalcoholic solution (4.32 mg.g −1 SCG). This is surprising since Shalmashi et al. have reported that caffeine solubility was higher in dichloromethane and chloroform compared to water, ethyl acetate, ethanol, carbon tetrachloride, methanol and acetone [42]. However, according to Sondheimer et al., caffeine occurs in coffee as chlorogenic acid-caffeine complex where it is hardly extractible with chloroform [43]. Hence, a polar solvent such as water-based solvent is strongly recommended for effective extraction of caffeine from coffee matrices in short time. In addition, Bustamante et al. have highlighted that caffeine display several functional groups with different hydrogen bonding abilities, explaining the affinity for water-based solvent [39]. Hence, we can make the hypothesis that ethanol can decrease the polarity of water, while keeping strong hydrogen bonding interactions between water and caffeine. The Student test does not show that an increase of the EtOH content in the hydroalcoholic solvent from 20% to 40% increases caffeine extraction efficiency (p < 0.05). Therefore, extractions could be performed with 20% EtOH to minimize the proportion of organic solvent. In our case, the following experiments were performed with hydroalcoholic solvent with 40% ethanol.

Influence of the Extraction Temperature
Temperature influence between ambient temperature (20 °C) and temperature close to ethanol boiling point (80 °C) was investigated on caffeine extraction (Figure 7). A slight increase (+11%) was observed between 20 °C (4.23 mg.g −1 SCG) and 60-80 °C (4.67-4.76 mg.g −1 SCG). Linares et al. have found that a temperature between 40 and 70 °C did not affect the equilibrium concentration and extraction yield of yerba mate after 60 min of extraction [44]. Hence, the temperature influenced the kinetic parameters since the pseudo first order kinetic constant (kobs) and effective diffusion coefficient (Dleaf) were higher at 70 °C with kobs = 3.155 × 10 3 s −1 , Dleaf = 9469 × 10 11 m 2 .s −1 compared to 40 °C extraction with kobs = 2.030 × 10 3 s −1 , Dleaf = 6092 × 10 11 m 2 .s −1 . The experiments that were performed (Figure 7) showed similar trends with an incomplete extraction at 20 °C compared to 60-80 °C. In addition, caffeine is a very stable molecule even at high temperature, as reported by Shalmashi et al. [45]. The Student test does not show that an increase of the temperature from 60 °C to 80 °C increase caffeine extraction efficiency (p < 0.05). Therefore, extractions were performed at 60 °C to reduce energy consumption.  Linares et al. have found that a temperature between 40 and 70 • C did not affect the equilibrium concentration and extraction yield of yerba mate after 60 min of extraction [44]. Hence, the temperature influenced the kinetic parameters since the pseudo first order kinetic constant (k obs ) and effective diffusion coefficient (D leaf ) were higher at 70 • C with k obs = 3.155 × 10 3 s −1 , D leaf = 9469 × 10 11 m 2 .s −1 compared to 40 • C extraction with k obs = 2.030 × 10 3 s −1 , D leaf = 6092 × 10 11 m 2 .s −1 . The experiments that were performed (Figure 7) showed similar trends with an incomplete extraction at 20 • C compared to 60-80 • C. In addition, caffeine is a very stable molecule even at high temperature, as reported by Shalmashi et al. [45]. The Student test does not show that an increase of the temperature from 60 • C to 80 • C increase caffeine extraction efficiency (p < 0.05). Therefore, extractions were performed at 60 • C to reduce energy consumption.

Influence of the Extraction Time
The time of extraction influence was investigated on caffeine extraction, but similar results were observed from 5 to 15 min of extraction ( Figure 8).

Influence of the Extraction Time
The time of extraction influence was investigated on caffeine extraction, but similar results were observed from 5 to 15 min of extraction ( Figure 8). Lee et al. observed similar trends for black tea extraction with water at 25 °C. The fast caffeine extraction might be due to an easy accessibility of spent coffee grounds that is enhanced by the powder shape of spent coffee grounds due to the grinding step, like the rolling step for black tea preparation [46]. The Student test did not show that times of extraction of 5, 10 or 15 min lead to significant extraction efficiency increase (p < 0.05). Therefore, extraction was performed in 5 min to reduce energy consumption. However, solid/liquid ratio experiments were performed in 15 min to more easily evaluate their influence.

Influence of the Solid/Liquid Ratio
The solid/liquid ratio (5-35 mL.g −1 ) of caffeine extraction was studied ( Figure 9). The major difference was observed between 5 mL.g −1 (2.35 mg.g −1 SCG) and 15 mL.g −1 (3.23 mg.g −1 SCG). The Student test does not show that a variation of the solid/liquid ratio from 15 to 25 mL.g −1 significantly increase caffeine extraction (p < 0.05). The experiments could be therefore performed with a 15 mL.g −1 ratio in order to reduce solvent consumption. Lee et al. observed similar trends for black tea extraction with water at 25 • C. The fast caffeine extraction might be due to an easy accessibility of spent coffee grounds that is enhanced by the powder shape of spent coffee grounds due to the grinding step, like the rolling step for black tea preparation [46]. The Student test did not show that times of extraction of 5, 10 or 15 min lead to significant extraction efficiency increase (p < 0.05). Therefore, extraction was performed in 5 min to reduce energy consumption. However, solid/liquid ratio experiments were performed in 15 min to more easily evaluate their influence.

Influence of the Solid/Liquid Ratio
The solid/liquid ratio (5-35 mL.g −1 ) of caffeine extraction was studied (Figure 9). The major difference was observed between 5 mL.g −1 (2.35 mg.g −1 SCG ) and 15 mL.g −1 (3.23 mg.g −1 SCG ). The Student test does not show that a variation of the solid/liquid ratio from 15 to 25 mL.g −1 significantly increase caffeine extraction (p < 0.05). The experiments could be therefore performed with a 15 mL.g −1 ratio in order to reduce solvent consumption.

Influence of the Extraction Time
The time of extraction influence was investigated on caffeine extraction, but similar results were observed from 5 to 15 min of extraction (Figure 8). Lee et al. observed similar trends for black tea extraction with water at 25 °C. The fast caffeine extraction might be due to an easy accessibility of spent coffee grounds that is enhanced by the powder shape of spent coffee grounds due to the grinding step, like the rolling step for black tea preparation [46]. The Student test did not show that times of extraction of 5, 10 or 15 min lead to significant extraction efficiency increase (p < 0.05). Therefore, extraction was performed in 5 min to reduce energy consumption. However, solid/liquid ratio experiments were performed in 15 min to more easily evaluate their influence.

Influence of the Solid/Liquid Ratio
The solid/liquid ratio (5-35 mL.g −1 ) of caffeine extraction was studied ( Figure 9). The major difference was observed between 5 mL.g −1 (2.35 mg.g −1 SCG) and 15 mL.g −1 (3.23 mg.g −1 SCG). The Student test does not show that a variation of the solid/liquid ratio from 15 to 25 mL.g −1 significantly increase caffeine extraction (p < 0.05). The experiments could be therefore performed with a 15 mL.g −1 ratio in order to reduce solvent consumption. Ho Row et al. investigated the influence of solid/liquid ratio from 5 to 60 mL.g −1 in decaffeination of coffee bean waste with EtOH/H 2 O 50/50 (v/v) at 80 • C during 60 min [47]. They reported an increase of the decaffeination with bigger volume of extraction. More precisely, up to 78%, 92% and 98% of caffeine were extracted with 5, 10 and 20 mL per gram, respectively. According to the authors, when the amount of solvent increases, the chance of bioactive components coming into contact with the solvent goes up, leading to higher leaching out rates. In addition, the bad diffusion of solutes cannot be compensated by strong agitation since Silva et al. have observed weak influence of stirring (0-400 rpm) on the yield of extraction [48].
Kruskal-Wallis comparative analysis of the influence of the different factors is summarized in Table 1. The results show, with a probability superior to 99.9%, that solvent and temperature significantly influence caffeine extraction in the range of values that has been studied.

Purification of Caffeine by Liquid/Liquid Extraction
The solid/liquid extract is rich in caffeine and impurities such as polyphenols, melanoidins and other polar molecules. To purify caffeine, a liquid/liquid extraction step is required. Instead of hydroalcoholic extracts, water extracts have been used for this study to simplify the liquid/liquid extraction. Hence, the following results can be extrapolated to hydroalcoholic extracts that can be evaporated and solubilized into water. This part will focus on the optimization of liquid/liquid extraction such as nature and volume of organic solvent and pH of aqueous phase.

Influence of Different Organic Solvents for Liquid/Liquid Extraction of Caffeine
The choice of the organic solvent is the most important parameter in a liquid/liquid extraction [49]. It should be immiscible with the aqueous phase and the solutes need a higher affinity for the solvent of extraction to be recovered. It is measured as K, the coefficient distribution/partition, provided in Equation (2).
K solvent = Solute concentration in organic phase (extraction solvent) Solute concentration in aqueous/hydroalcoholic phase (original solution) Since the distribution coefficient is a ratio, unless K is very large, a single extraction is not enough to extract all the solute. A multiple extraction is recommended, that is, in different steps, at equilibrium, the solute has the same partition/distribution coefficient K. Then, to perform liquid/liquid extraction in appropriate conditions, the volume of extraction has been split into six small extractions of 10 mL instead of a unique extraction of 60 mL.
Among the organic solvents with immiscibility for water, dichloromethane, ethyl acetate, diethyl ether and n-heptane have been tested (Figure 10). Diethyl ether and nheptane are not reported in Figure 10 since no caffeine was recovered in these solvents. Interestingly, Table 2 shows that dichloromethane or ethyl acetate have the dipolar moment and the Hildebrand function the closest of those of caffeine, and are the solvents the most appropriate here for the transfer of caffeine.
Equation ( Mohammed et al. have performed liquid/liquid extraction of caffeine with dichloromethane, since it is the most widely used solvent for decaffeination. Their experience allowed recovering 98 to 99% of caffeine [54]. The efficiency of dichloromethane compared to ethyl acetate is supported by the experimental measurements of mole fraction solubility of caffeine in dichloromethane that is 10 times higher than the one in ethyl acetate [42]. However, due to green chemistry concerns it is more suitable to use an eco-compatible solvent such as ethyl acetate. In addition, ethyl acetate extraction curve follows a linear regression model. This suggests that caffeine extraction has not yet reach a plateau for the maximum ethyl acetate volume that was used in the present study.  After six cycles, 80% of caffeine transferred (Equation (3)) in dichloromethane instead of 57% in ethyl acetate.
Equation ( Mohammed et al. have performed liquid/liquid extraction of caffeine with dichloromethane, since it is the most widely used solvent for decaffeination. Their experience allowed recovering 98 to 99% of caffeine [54]. The efficiency of dichloromethane compared to ethyl acetate is supported by the experimental measurements of mole fraction solubility of caffeine in dichloromethane that is 10 times higher than the one in ethyl acetate [42]. However, due to green chemistry concerns it is more suitable to use an eco-compatible solvent such as ethyl acetate. In addition, ethyl acetate extraction curve follows a linear regression model. This suggests that caffeine extraction has not yet reach a plateau for the maximum ethyl acetate volume that was used in the present study.

Influence of the Volume of Extraction Solvent
The influence of the volume of ethyl acetate with 6 × 30 mL compared to 6 × 10 mL to treat 60 mL of aqueous extract has been reported during liquid/liquid extraction ( Figure 11). The curve of the yield has shown quite linear increases even up to 6 × 30 mL of ethyl acetate. Better results with 6 × 30 mL have reached 93.4% of extraction yield. By increasing the volume, solvent of extraction is not saturated in solute, thus, coefficient distribution is increased in favor of the solvent of extraction. Results with 6 × 30 mL of ethyl acetate are competitive with those obtained with 6 × 10 mL of dichloromethane.

Influence of the Volume of Extraction Solvent
The influence of the volume of ethyl acetate with 6 × 30 mL compared to 6 × 10 mL to treat 60 mL of aqueous extract has been reported during liquid/liquid extraction ( Figure  11). The curve of the yield has shown quite linear increases even up to 6 × 30 mL of ethyl acetate. Better results with 6 × 30 mL have reached 93.4% of extraction yield. By increasing the volume, solvent of extraction is not saturated in solute, thus, coefficient distribution is increased in favor of the solvent of extraction. Results with 6 × 30 mL of ethyl acetate are competitive with those obtained with 6 × 10 mL of dichloromethane. Figure 11. Evolution of the yield of caffeine transferred (%w) from aqueous extract (60 mL) into 6 × 10 mL () or 6 × 30 mL ethyl acetate (♦) during liquid/liquid extraction at room temperature.

Influence of Aqueous Extract pH
The influence of the pH of the solution is an important parameter that can affect both, yield and selectivity of the liquid/liquid extraction of caffeine. The affinity of caffeine for the aqueous or organic phase is strongly related to the different pKa of caffeine and pH of the aqueous phase. Charged molecules have better affinity to aqueous phase through hydrogen bonds. The selectivity can be observed indirectly through the area ratio of caffeine in chromatograms (Equation (4)).
The influence of pH on the selectivity and yield has been illustrated through the analysis of chromatograms (Figure 12), the area ratio of caffeine ( Figure 13) and yields of extractions ( Figure 14). Ethyl Acetate (6x30 mL) Figure 11. Evolution of the yield of caffeine transferred (%w) from aqueous extract (60 mL) into 6 × 10 mL ( ) or 6 × 30 mL ethyl acetate ( ) during liquid/liquid extraction at room temperature.

Influence of Aqueous Extract pH
The influence of the pH of the solution is an important parameter that can affect both, yield and selectivity of the liquid/liquid extraction of caffeine. The affinity of caffeine for the aqueous or organic phase is strongly related to the different pKa of caffeine and pH of the aqueous phase. Charged molecules have better affinity to aqueous phase through hydrogen bonds. The selectivity can be observed indirectly through the area ratio of caffeine in chromatograms (Equation (4)).
Equation ( The influence of pH on the selectivity and yield has been illustrated through the analysis of chromatograms (Figure 12), the area ratio of caffeine ( Figure 13) and yields of extractions ( Figure 14).
The observation of chromatograms after liquid/liquid extraction was reported. Ethyl acetate was yellow colored after liquid/liquid extractions performed at pH = 2 and 7 and colorless at pH of 14. At pH = 2 and pH = 7, the chromatograms contain several peaks with moderate to high intensity in addition of caffeine ( Figure 12). By contrast, at pH = 14, chromatogram contains only the peak of caffeine peak ( Figure 12). This results in an area ratio of caffeine described in Equation (4) that is higher at pH = 14 than at pHs = 2 and 7, indirectly indicating a higher purity ( Figure 13). In accordance with those observations, Student tests show significant differences between the values of the area ratio of caffeine (Equation (4)) at different pH (p < 0.05). On the other hand, Student tests do not show significant difference on the yield of caffeine transferred in ethyl acetate as a function of pH (p < 0.05). To conclude, statistical analyses of the pH influence unequivocally suggest that pH exclusively affects the selectivity of the liquid/liquid extraction of caffeine.     The observation of chromatograms after liquid/liquid extraction was reported. Ethyl acetate was yellow colored after liquid/liquid extractions performed at pH = 2 and 7 and colorless at pH of 14. At pH = 2 and pH = 7, the chromatograms contain several peaks with moderate to high intensity in addition of caffeine ( Figure 12). By contrast, at pH = 14, chromatogram contains only the peak of caffeine peak ( Figure 12). This results in an area ratio of caffeine described in Equation (4) that is higher at pH = 14 than at pHs = 2 and 7, indirectly indicating a higher purity ( Figure 13). In accordance with those observations, Student tests show significant differences between the values of the area ratio of caffeine (Equation (4)) at different pH (p < 0.05). On the other hand, Student tests do not show significant difference on the yield of caffeine transferred in ethyl acetate as a function of pH (p < 0.05). To conclude, statistical analyses of the pH influence unequivocally suggest that pH exclusively affects the selectivity of the liquid/liquid extraction of caffeine.
Polyphenols like chlorogenic acids are the main impurities in aqueous extract, thus, potentially transferred in ethyl acetate [55,56]. Gazzani et al. have reported that chlorogenic acids from green coffee beans were more efficiently extracted in ethyl acetate at acidic pH [57]. This might due to the lack of affinity of protonated form of chlorogenic acids since their pKa are pKa1 = 3.50, pKa2 = 8.42 and pKa3 = 11.00 [58]. For our experimental results, at pH = 2 and 7, the -OH function of chlorogenic acids stayed in a totally or partially protonated form, which resulted in lower affinity for aqueous phase and higher transfer in ethyl acetate. At pH = 14, all the -OH functions of chlorogenic acids were deprotonated into -O -, which favored hydrogen bonds with aqueous phase, resulting in none transfer of chlorogenic acids in ethyl acetate.
Caffeine has low interaction with aqueous phase at pH = 2, 7 and 14 since caffeine pKa are pKa1 = 0.6-0.7 and pKa2 = 14 ( Figure 15) [59][60][61]. This results in a similar yield of caffeine transferred at all the studied pH ( Figure 14). No experiment has been carried out with pH < 0.7 and pH ≥ 14 to confirm that caffeine cation or anion has more affinity for water. Polyphenols like chlorogenic acids are the main impurities in aqueous extract, thus, potentially transferred in ethyl acetate [55,56]. Gazzani et al. have reported that chlorogenic acids from green coffee beans were more efficiently extracted in ethyl acetate at acidic pH [57]. This might due to the lack of affinity of protonated form of chlorogenic acids since their pKa are pKa 1 = 3.50, pKa 2 = 8.42 and pKa 3 = 11.00 [58]. For our experimental results, at pH = 2 and 7, the -OH function of chlorogenic acids stayed in a totally or partially protonated form, which resulted in lower affinity for aqueous phase and higher transfer in ethyl acetate. At pH = 14, all the -OH functions of chlorogenic acids were deprotonated into -O − , which favored hydrogen bonds with aqueous phase, resulting in none transfer of chlorogenic acids in ethyl acetate.
Caffeine has low interaction with aqueous phase at pH = 2, 7 and 14 since caffeine pKa are pKa 1 = 0.6-0.7 and pKa 2 = 14 ( Figure 15) [59][60][61]. This results in a similar yield of caffeine transferred at all the studied pH ( Figure 14). Figure 14. Influence of the pH on the yield of liquid/liquid extraction of aqueous extract (60 mL) treated with ethyl acetate (60 mL) at room temperature. All the values are not significantly different (p < 0.05) according to the Student test (t-test).
The observation of chromatograms after liquid/liquid extraction was reported. Ethyl acetate was yellow colored after liquid/liquid extractions performed at pH = 2 and 7 and colorless at pH of 14. At pH = 2 and pH = 7, the chromatograms contain several peaks with moderate to high intensity in addition of caffeine ( Figure 12). By contrast, at pH = 14, chromatogram contains only the peak of caffeine peak ( Figure 12). This results in an area ratio of caffeine described in Equation (4) that is higher at pH = 14 than at pHs = 2 and 7, indirectly indicating a higher purity ( Figure 13). In accordance with those observations, Student tests show significant differences between the values of the area ratio of caffeine (Equation (4)) at different pH (p < 0.05). On the other hand, Student tests do not show significant difference on the yield of caffeine transferred in ethyl acetate as a function of pH (p < 0.05). To conclude, statistical analyses of the pH influence unequivocally suggest that pH exclusively affects the selectivity of the liquid/liquid extraction of caffeine.
Polyphenols like chlorogenic acids are the main impurities in aqueous extract, thus, potentially transferred in ethyl acetate [55,56]. Gazzani et al. have reported that chlorogenic acids from green coffee beans were more efficiently extracted in ethyl acetate at acidic pH [57]. This might due to the lack of affinity of protonated form of chlorogenic acids since their pKa are pKa1 = 3.50, pKa2 = 8.42 and pKa3 = 11.00 [58]. For our experimental results, at pH = 2 and 7, the -OH function of chlorogenic acids stayed in a totally or partially protonated form, which resulted in lower affinity for aqueous phase and higher transfer in ethyl acetate. At pH = 14, all the -OH functions of chlorogenic acids were deprotonated into -O -, which favored hydrogen bonds with aqueous phase, resulting in none transfer of chlorogenic acids in ethyl acetate.
Caffeine has low interaction with aqueous phase at pH = 2, 7 and 14 since caffeine pKa are pKa1 = 0.6-0.7 and pKa2 = 14 ( Figure 15) [59][60][61]. This results in a similar yield of caffeine transferred at all the studied pH ( Figure 14). No experiment has been carried out with pH < 0.7 and pH ≥ 14 to confirm that caffeine cation or anion has more affinity for water. No experiment has been carried out with pH < 0.7 and pH ≥ 14 to confirm that caffeine cation or anion has more affinity for water.

Conclusions
The present study promotes the valorization of the most popular food waste, spent coffee grounds, into caffeine molecule, presenting a well-established market for applications in agrifood, cosmetic, nutraceutic or pharmaceutic industries. This paper proposes a complete investigation and optimization for the production of caffeine from spent coffee grounds, including all key steps such as collection, storage, solid/liquid extraction and purification by liquid/liquid extraction.
Investigation of collection has shown that spent coffee grounds from restaurants are richer in caffeine with 30% remaining caffeine. Studies on storage have reported that drying is an unnecessary step when spent coffee grounds extractions are performed below one week of storage because degradation of caffeine is lower than 4%. Investigation of solid/liquid extraction indicates that extraction of 2 g with 50 mL hydroalcoholic solvent 40% EtOH and 25 mL.g −1 solid/liquid ratio at 60 • C during 5 min are the optimized conditions. Investigation of caffeine purification by liquid/liquid extraction illustrates that extraction of 60 mL of aqueous phase at pH = 12-14 with 6 × 30 mL of green solvent like ethyl acetate is efficient to recover 93.4% of purified caffeine.
In accordance with circular economy and the need to 100% waste valorization, further studies will be carry out to perform (i) the valorization of decaffeinated extract that is rich in polyphenols [18,62] and (ii) the valorization of solid coffee residue after hydroalcoholic extractions that is a rich lignocellulose and lipid material [4,5].