From Coffee to Biodiesel—Deep Eutectic Solvents for Feedstock and Biodiesel Purification

Over three billion cups of coffee are consumed daily, making waste coffee grounds readily available throughout the world. Containing approximately 10–15 wt% of oil, they have great potential for biodiesel production. The goal of this work was to produce high quality biodiesel from waste coffee grounds. One fresh and four different types of waste coffee grounds were collected. Oil was extracted by the Soxhlet method with n-hexane and then purified via extractive deacidification with a potassium carbonate-based deep eutectic solvent. Biodiesels were synthesized by means of alkali catalyzed transesterification at different catalyst:methanol:oil mass ratios and reaction times. Impurities present in crude biodiesels were extracted with a choline chloride-based deep eutectic solvent. All batch extraction experiments were performed at room conditions in a small scale extractor. Optimal conditions for synthesis and purification were defined in order to assure high quality of the produced biodiesel. Additionally, continuous column extraction with the choline chloride-based solvent was tested as a purification method for crude biodiesel. Stabilization time and optimal biodiesel to solvent mass ratio were determined. The potassium carbonate-based solvent efficiently reduced the total acid number of the feedstock (deacidification efficiency ranged from 86.18 to 94.15%), while the one based on choline chloride removed free glycerol and glycerides from crude biodiesels. After continuous purification, the purified biodiesel was of excellent quality with glycerol and glyceride contents below the EN 14214 limit.


Introduction
A Scopus search on the term "waste coffee grounds" (WCGs) uncovers an interesting trend. Since 2000, research interest has grown significantly, with 490 papers published on the topic, over half of them in the last four years and the trend is expected to continue in 2020. Papers have explore coffee and WCG chemical composition [1], availability and environmental implications [2], and their possible uses and processes required [3]. Being the second most traded commodity, coffee is present in every corner of the world. It is of vital importance to 25 million families growing it and over 70 countries exporting it to the world, retailers, roasters, and their employees in the supply chain as well as to millions of people who start their day with a cup of coffee [4]. With coffee being so widely consumed, waste coffee grounds make a readily available material for further utilization.
After brewing, waste coffee grounds contain on average 10-15 wt% of oil, depending on the type of coffee and the processing it went through [5]. Apart from lipids, WCGs also contain polysaccharides, proteins, nitrogenous non-protein compounds, minerals, and phenolic compounds. Nitrogenous compounds such as free amino acids, peptides, and alkaloids enable some interesting

Extraction of Oil from Waste Coffee Grounds
Waste coffee grounds were collected from three different coffee bars that sold different types of coffee. Additional samples of waste and fresh coffee grounds were of household origin. Prior to oil extraction, waste coffee grounds were dried at 105 • C in an atmospheric dryer. The Soxhlet method with n-hexane as the solvent was used for the extraction of oil from waste and fresh coffee grounds. Dry coffee grounds were weighed into a thimble and placed in the Soxhlet extractor. Oil was extracted with 1000 mL of n-hexane per 100 g of coffee under reflux for 2 h. After extraction, n-hexane was removed by means of vacuum evaporation and stored for future use. Oil samples were taken in order to determine total acid number. Total acid number was determined titrimetrically, according to the standard method ISO 660:2009.

Preparation of Deep Eutectic Solvents
Before the preparation of deep eutectic solvents, hydrogen bond donors and hydrogen bond acceptors were vacuum dried in order to remove residual water. Hydrogen bond acceptors (choline chloride and potassium carbonate) and a hydrogen bond donor (ethylene glycol) were directly weighed in a round bottom flask and placed on a rotary vacuum evaporator equipped with a vacuum pump until a clear homogeneous liquid was obtained. Two DESs were prepared: (1) potassium carbonate:ethylene glycol, 1:10 molar ratio (DES1-used for extractive deacidification) and (2) choline chloride:ethylene glycol, 1.0:2.5 molar ratio (DES2-used for purification of biodiesel).

Deacidification of Waste Coffee Grounds Oil
Two methods were tested for lowering the concentration of FFA in the extracted oils: esterification with H 2 SO 4 and extractive deacidification with DES1. Esterification was conducted for 2 h in a jacketed vessel (500 rpm) equipped with thermostat set at 60 • C and mass ratio of H 2 SO 4 , methanol, and oil equal to 1:40:100. Extraction experiments were performed in a batch extractor equipped with a temperature controlled magnetic stirrer (500 rpm) at 25 • C and mass ratio of DES1 and oil equal to 0.1:1 for 1 h. After deacidification, two-phase systems obtained after both methods were separated in the separating funnel. Deacidified oil was used for transesterification.

Biodiesel Synthesis and Purification
In the initial set of experiments, biodiesels were synthesized by the alkali-catalyzed transesterification of three different types of waste coffee ground oil (WCGO) with methanol at the mass ratio of catalyst, methanol and oil equal to 1:40:100. Sodium methoxide (BD1, BD2, BD3) or potassium methoxide (BD4) solution was prepared by dissolving 1 g of catalyst in 40 g of methanol and added to 100 g of WCGO heated at 60 • C and intensively mixed (500 rpm) for an hour in a vessel equipped with a temperature controlled magnetic stirrer. Reaction duration ranged from 30 to 90 min. The heterogeneous mixture was separated by centrifugation. Glycerol and glycerides from crude biodiesels were removed by means of liquid-liquid extraction with DES2 under the following process conditions: mass ratio of DES2 and oil = 1:1, T = 25 • C, n = 500 rpm, t = 30, 60, and 90 min. Additionally, the influence of the mass ratio of the catalyst ([0.1, 0.5, 1]:40:100), methanol, and oil (0.5: [30,40,50]:100) on the conversion of WCGO to biodiesel as well as the influence of the mass ratio of DES2 and biodiesel on the biodiesel composition were both tested. Finally, biodiesel was continuously purified using a Karr column. The column had 11 perforated plates spaced every 4 cm with a 22% plate free flow area and a plate diameter of 0.043 m. Total height of the column was 0.75 m, active height was 0.43 m, its diameter was 0.05 m, and it was equipped with two peristaltic pumps and two phase separators. Biodiesel was introduced at the bottom of the column and the DES was introduced near the top. Samples were taken from the separator every 5 min and analyzed.

Coffee Ground Oil and Biodiesel Characterization
Analytical methods used for characterization of all samples were Fourier transform infrared spectroscopy (FTIR), proton nuclear magnetic resonance spectroscopy ( 1 H NMR), and gas chromatography (GC). FTIR spectra were recorded using a Bruker Vertex 70 spectrometer in FTIR ATR (attenuated total reflection) mode with a range of 4000-400 cm −1 (MIR). 1 H NMR spectra were recorded in deuterated chloroform with tetramethylsilane (TMS) as the internal standard on a Bruker Avance 300 Neo spectrometer. 1 H NMR was used to quantify the content of total fatty acid methyl esters (FAME). Integration values of the methyl ester signal at 3.66 ppm (AMe) and of glyceridic signal in triglycerides at 2.30 ppm (ACH2) were used for calculations. The equation used to quantify the yield of transesterification was: Composition of FAME (Shimadzu GC-2014) as well as glycerol and glycerides (GC, Scion 436-GC) were determined by GC analysis.
Biodiesel samples were further analyzed at an accredited Central Testing Laboratory of INA-Industrija nafte d.d., Zagreb, Croatia.

Deacidification of Waste and Fresh Coffee Ground Oils
Wet waste coffee grounds were collected from three coffee bars and one household and dried until all water was removed. After extraction of oil from the different types of waste and one sample of freshly milled coffee grounds, the quantity of extracted oil and TAN of all oils were determined and presented in Table 2. The quantity of oil ranged from 11.28 to 14.85% in dried WCGOs and 16.22% in fresh coffee ground oil (FCGO), which was in concordance with the previously published data [23]. Slightly lower concentrations of oil in WCGOs can be attributed to the low extraction of lipids during preparation of the coffee beverage [38]. Since the TAN of all extracted oils was higher than 2 mg KOH/g oil, the concentration of FFA needed to be reduced. The concentration of FFA in all samples was significantly lower than that reported in the literature [23] due to the different types of coffee [5,39]. Campos, Vega, R. et al. reported in their review that the acid value of oils extracted in a laboratory usually ranges from 4 to 10 mg KOH/g oil. For instance, based on the results by Chokchai Mueanmas et al., oil extracted from WCGO of a mixture of grounds from Arabica and Robusta coffee beans contained 16.5% of FFAs, which corresponded to an acid value of 32.84 mg KOH/g of oil. The first employed method for lowering the concentration of FFAs was a commonly used method, esterification with H 2 SO 4 . This method successfully reduced TAN, however, it was not cost-effective since the reaction was conducted for two hours at elevated temperature. After one hour, TAN was reduced to 2.69 mg KOH/g oil. On the other hand, only 30 min at room temperature were sufficient to achieve TANs lower than 1 mg KOH/g oil by means of extractive deacidification with DES based on potassium carbonate. Extraction efficiency ranged from 86.18 to 94.15%. Deacidification by means of esterification with  [23]. Esterification efficiency obtained in this article fell within the range that can be found in the literature. Since sulfuric acid is a strong acid and the reaction is conducted under unfavorable conditions (increased temperature and longer reaction duration) when compared to deep eutectic solvents (green solvent) and mild extraction conditions (30 min, room temperature). The initial acid number of the used extracted oils ranged from 3.76 to 5.9 mg KOH/g oil. Different extraction efficiencies probably result from different compositions of the extracted oils. It was expected that the increase in the initial concentration of FFA will result in a higher extraction efficiency due to the higher driving force for mass transfer. Since the WCGOs are of different origin, and consequently different chemical composition, obviously some other components participated in mass transfer and effected the solubility of FFA in DES or the rate of mass transfer. The FTIR spectra of WCGO2 are shown in Figure 1. Some characteristic peaks can be observed: peaks between 3000 and 2800 cm −1 correspond to the aliphatic CH 2 group; peaks at 2360.22 and 2341.17 cm −1 belong to CO 2 ; the peak at 1743.62 cm −1 is attributed to the ester carbonyl groups of triglycerides. A weak shoulder at around 1710 cm −1 corresponds to the stretching vibration of the free fatty acid carbonyl group and the reduction of that peak (shown in the enlarged portion of the spectra, to the right) indicates that free fatty acids were extracted successfully. The absence of a peak at around 1570 cm −1 means that neutralization did not occur and that the reduction of free fatty acids is indeed due to extraction [40]. The peak at 1377.26 cm −1 corresponds to the glycerol group O-CH 2 of mono-, di-, and triglycerides [41]. from different compositions of the extracted oils. It was expected that the increase in the initial concentration of FFA will result in a higher extraction efficiency due to the higher driving force for mass transfer. Since the WCGOs are of different origin, and consequently different chemical composition, obviously some other components participated in mass transfer and effected the solubility of FFA in DES or the rate of mass transfer. The FTIR spectra of WCGO2 are shown in Figure 1. Some characteristic peaks can be observed: peaks between 3000 and 2800 cm −1 correspond to the aliphatic CH2 group; peaks at 2360.22 and 2341.17 cm −1 belong to CO2; the peak at 1743.62 cm −1 is attributed to the ester carbonyl groups of triglycerides. A weak shoulder at around 1710 cm −1 corresponds to the stretching vibration of the free fatty acid carbonyl group and the reduction of that peak (shown in the enlarged portion of the spectra, to the right) indicates that free fatty acids were extracted successfully. The absence of a peak at around 1570 cm −1 means that neutralization did not occur and that the reduction of free fatty acids is indeed due to extraction [40]. The peak at 1377.26 cm −1 corresponds to the glycerol group O-CH2 of mono-, di-, and triglycerides [41].

Selection of Optimal Process Conditions
In the first set of experiments, purified WCGOs of different origins were used for biodiesel synthesis. BD1 was synthesized from WCGO1 and BD2 from WCGO2, while BD3 and BD4 were produced from WCGO3. Reaction conditions were: mass ratio catalyst:methanol:oil = 1.0:40:100;

Selection of Optimal Process Conditions
In the first set of experiments, purified WCGOs of different origins were used for biodiesel synthesis. BD1 was synthesized from WCGO1 and BD2 from WCGO2, while BD3 and BD4 were produced from WCGO3. Reaction conditions were: mass ratio catalyst:methanol:oil = 1.0:40:100; synthesis time, 60 min; extraction time, 60 min. 1 H NMR spectra of synthesized crude biodiesels (BD1, BD2, BD2, and BD4) are given in Figure 2. Aside from the signal characteristic for methyl ester at 3.66 ppm, the hydroxyl group signal from glycerol and methanol at around 3.44 ppm could also be observed. The signals characteristic for kahweol (5.87, 5.91, 6.19, and 6.29 ppm) were found on all spectra [42]. This means that kahweol was also extracted with n-hexane from the waste coffee grounds. Signals in the range from 3.80 to 4.35 ppm are attributed to unreacted mono-, di-, and triglycerides.   Crude biodiesels were then purified by means of liquid-liquid extraction with DES based on choline chloride. Distributions of FAME in crude and purified biodiesels are given in Table 3. Based on the obtained results, it can be concluded that the type of coffee, deacidification method, and catalyst used for transesterification influenced the quality of the produced biodiesel. The concentration of FAME in the crude and purified biodiesels increased in the following order: BD2 < BD1 < BD3 < BD4. It was obvious that not only the concentration of FFAs in oil influenced the quality of biodiesel. The lowest quality biodiesel (lowest concentration of FAME) was obtained from deacidified WCGO2, which had the lowest acid number. The most abundant FAME in all crude biodiesels was linoleic acid methyl ester (from 33.85 to 43.1%), followed by palmitic acid methyl ester (from 26.31 to 33.6%), oleic acid methyl ester (from 6.49 to 8.9%), and stearic acid methyl ester (from 5.56 to 6.80%). According to the published data reviewed by R. Campos-Vega, waste coffee grounds oils consist mostly of linoleic, palmitic, oleic, and stearic fatty acids. FAME profiles depend on the method and/or conditions of oil extraction, purification method, reaction conditions, and origin. In this study, oils were obtained by the same extraction method (Soxhlet extraction with n-hexane). The purification method did not significantly modify the composition of FAME. All biodiesels were produced at the same reaction conditions, so based on the results presented in this work, coffee origin plays a major role. Biodiesels BD3 and BD4 were of the same origin and the few FAME that were detected in other biodiesels were not detected in biodiesels obtained from WCGO3. It is possible that the concentration of those FAME (C8:0 up to C12:0, C16:1, C22:0, C22:6, C23:0) were below the detectable limit. In general, concentrations of different types of FAME in WCGO biodiesels were as Crude biodiesels were then purified by means of liquid-liquid extraction with DES based on choline chloride. Distributions of FAME in crude and purified biodiesels are given in Table 3. Based on the obtained results, it can be concluded that the type of coffee, deacidification method, and catalyst used for transesterification influenced the quality of the produced biodiesel. The concentration of FAME in the crude and purified biodiesels increased in the following order: BD2 < BD1 < BD3 < BD4. It was obvious that not only the concentration of FFAs in oil influenced the quality of biodiesel. The lowest quality biodiesel (lowest concentration of FAME) was obtained from deacidified WCGO2, which had the lowest acid number. The most abundant FAME in all crude biodiesels was linoleic acid methyl ester (from 33.85 to 43.1%), followed by palmitic acid methyl ester (from 26.31 to 33.6%), oleic acid methyl ester (from 6.49 to 8.9%), and stearic acid methyl ester (from 5.56 to 6.80%). According to the published data reviewed by R. Campos-Vega, waste coffee grounds oils consist mostly of linoleic, palmitic, oleic, and stearic fatty acids. FAME profiles depend on the method and/or conditions of oil extraction, purification method, reaction conditions, and origin. In this study, oils were obtained by the same extraction method (Soxhlet extraction with n-hexane). The purification method did not significantly modify the composition of FAME. All biodiesels were produced at the same reaction conditions, so based on the results presented in this work, coffee origin plays a major role. Biodiesels BD3 and BD4 were of the same origin and the few FAME that were detected in other biodiesels were not detected in biodiesels obtained from WCGO3. It is possible that the concentration of those FAME (C8:0 up to C12:0, C16:1, C22:0, C22:6, C23:0) were below the detectable limit. In general, concentrations of different types of FAME in WCGO biodiesels were as follows: polyunsaturated FAME > monounsaturated FAME > saturated FAME. The increase in FAME concentration up to 4.2% after purification could be observed for lower quality biodiesels (BD1 and BD2). In contrast, the composition of purified biodiesel did not change significantly for higher quality biodiesels (BD3 and BD4). When KOH was used as the catalyst, the total FAME content in crude BD4 (97.3%) was higher than in crude biodiesel BD3 (96.4%), therefore, it can be concluded that KOH is a more effective catalyst than NaOH. The presence of other components in extracted oil and FFA profiles influenced the conversion of triglycerides to FAME, in other words, the quality of biodiesel [13,39]. A concentration increase of FAME for biodiesels BD1 and BD2 can be attributed to the removal of glycerol and glycerides during the extraction step. In order to confirm this, the concentrations of glycerol and glycerides in crude and purified biodiesels (BD1) were measured and are presented in Figure 3. Bearing in mind that the concentration of free glycerol, mono-, di-, and triglycerides was reduced from 1.287 to 0.775%, it is obvious that some other substances (excess catalyst, methanol, or some biocompounds characteristic for coffee oil) were extracted from crude biodiesel. Additional measurements of caffeine in crude and purified biodiesel confirmed that caffeine also participated in mass transfer. Concentration of caffeine was reduced from 0.46 to 0.40%.  1 H NMR spectra of deacidified oil (WCGO1), crude and purified biodiesel (BD1) are presented in Figure 4. Signals that corresponded to aliphatic protons in the region between 0 and 3 ppm were visible in the 1 H NMR spectra of oil and biodiesels. Crude and purified biodiesel spectra contained a signal at 3.66 ppm corresponding to the methyl ester group, while the deacidified oil spectrum contains signals in the region between 4.10 and 4.35 ppm and 5.25 ppm, corresponding to glycerides. The intensity of the signal that corresponded to the hydroxyl group was significantly reduced, so it can be concluded that the selected DES is suitable for the extraction of glycerol as well as methanol from crude biodiesel.
The FTIR spectra shown in Figure 5 are characteristic for biodiesel samples with an ester group peak at 1741.65 cm −1 , -CH3 group peak at 1436.61 cm −1 , and O-CH3 group peak at 1196.90 cm −1 . In the spectrum of unpurified biodiesel, a wide -OH peak between 3000 and 3600 cm −1 indicated the presence of alcohols, namely glycerol and methanol, and the peak at 1028.74 cm −1 corresponded to the C-O stretching of methanol; both of these peaks are significantly reduced in the spectrum of purified biodiesel [43].
Since preliminary results with WCGO3 indicate that using KOH instead of NaOH did not significantly influence the FAME content in biodiesel, for the WCGO that produced the lowest quality biodiesel (WCGO2), the influence of mass ratio catalyst (NaOH):methanol:oil and extraction time with DES2 was investigated. FAME distributions in crude and purified biodiesels are presented in Table 4. The highest concentration of FAME was obtained for a mass ratio NaOH:methanol:WCGO2   . Signals that corresponded to aliphatic protons in the region between 0 and 3 ppm were visible in the 1 H NMR spectra of oil and biodiesels. Crude and purified biodiesel spectra contained a signal at 3.66 ppm corresponding to the methyl ester group, while the deacidified oil spectrum contains signals in the region between 4.10 and 4.35 ppm and 5.25 ppm, corresponding to glycerides. The intensity of the signal that corresponded to the hydroxyl group was significantly reduced, so it can be concluded that the selected DES is suitable for the extraction of glycerol as well as methanol from crude biodiesel.
Separations 2020, 7, x FOR PEER REVIEW 9 of 20 equal to 0.5:40:100 when the biodiesel yield was 78.60%. A higher amount of catalyst did not enhance the reaction and the biodiesel yield was reduced. It is possible that a small amount of esters undergo the saponification reaction due to the presence of excess catalyst. However, all biodiesels contained a higher amount of FAME after extraction. Increasing the duration of the purification step from 30 to 90 min did not significantly influence the total FAME amount, therefore, the extraction time was set to 60 min for the other experiments.  The FTIR spectra shown in Figure 5 are characteristic for biodiesel samples with an ester group peak at 1741.65 cm −1 , -CH 3 group peak at 1436.61 cm −1 , and O-CH 3 group peak at 1196.90 cm −1 . In the spectrum of unpurified biodiesel, a wide -OH peak between 3000 and 3600 cm −1 indicated the Separations 2020, 7, 22 9 of 18 presence of alcohols, namely glycerol and methanol, and the peak at 1028.74 cm −1 corresponded to the C-O stretching of methanol; both of these peaks are significantly reduced in the spectrum of purified biodiesel [43]. Normalised absorbance Figure 5. FTIR spectra of BD2 before and after extraction with DES2. Figure 5. FTIR spectra of BD2 before and after extraction with DES2.
Since preliminary results with WCGO3 indicate that using KOH instead of NaOH did not significantly influence the FAME content in biodiesel, for the WCGO that produced the lowest quality biodiesel (WCGO2), the influence of mass ratio catalyst (NaOH):methanol:oil and extraction time with DES2 was investigated. FAME distributions in crude and purified biodiesels are presented in Table 4. The highest concentration of FAME was obtained for a mass ratio NaOH:methanol:WCGO2 equal to 0.5:40:100 when the biodiesel yield was 78.60%. A higher amount of catalyst did not enhance the reaction and the biodiesel yield was reduced. It is possible that a small amount of esters undergo the saponification reaction due to the presence of excess catalyst. However, all biodiesels contained a higher amount of FAME after extraction. Increasing the duration of the purification step from 30 to 90 min did not significantly influence the total FAME amount, therefore, the extraction time was set to 60 min for the other experiments.
The influence of reaction time on the conversion of the same WCGO2 to biodiesel and the purification time on the composition of biodiesel is presented in Table 5. For the investigated feedstock, the influence of reaction time on the conversion of oil to biodiesel could be neglected. Generally speaking, the influence of extraction duration on extraction efficiency could also be neglected since the total FAME content changed for a maximum of 1.69% with increasing extraction time from 30 to 90 min. These conclusions were derived from the high capacity of deep eutectic solvents for different types of solutes and it can be assumed that equilibrium is reached after a short extraction period. In some cases, a slight decrease in FAME concentration can be observed, most probably due to the dissolution of some esters in DES.
Since better results were obtained with KOH as the catalyst, the influence of mass ratio of catalyst, methanol, and WCGO3 (catalyst: KOH, synthesis time, 60 min; extraction time, 60 min) on the FAME concentration of purified biodiesels was investigated. Based on the obtained results given in Table 6, it can be concluded that the mass ratio of catalyst, methanol, and WCGO3 did not influence the biodiesel yield significantly for the given range of reaction conditions. For all biodiesels, the concentration of FAME satisfied the biodiesel quality standard (>96.5% FAME) after the purification step. The highest concentration of FAME (98.0%) was obtained when 0.5 g of KOH and 40 and 50 g of methanol were used for transesterification of 100 g of oil.  Finally, biodiesel was produced from fresh and waste coffee grounds (household coffee) of the same type of coffee, and the FAME concentrations in the purified biodiesels are given in Table 7 (KOH:methanol:oil = 0.5:40:100; synthesis time, 60 min; extraction time, 60 min). Total FAME content was the same for fresh and waste coffee grounds. However, the concentration of glycerides and glycerol was different. Crude biodiesel produced from fresh coffee grounds contains more free glycerol and diglycerides and significantly less triglycerides than crude biodiesel produced from waste coffee grounds ( Figure 6). Coffee contains different types of lipids (triglycerides, esters of diterpene alcohols and fatty acids, diterpene alcohols, esters of sterols and fatty acids, sterols, tocopherols, phosphatides and tryptamine derivatives) [1]. During beverage preparation, water soluble lipids, like diterpens, are partially extracted, so it can be expected that the content of glycerides is different. Chlorogenic acids, a class of water soluble esters, and related compounds are the main phenolic compounds in green and roasted coffee [44] as well as in waste coffee grounds [45]. Phenolic compounds present in WCGO and FCGO can also be extracted during the extraction of oil with n-hexane [46]. It was also reported that phenolic compounds are soluble in deep eutectic solvents and therefore these compounds can be extracted from biodiesel during the purification step [47,48]. Häkkinen and Abbott reported that different types of carbohydrates were soluble in choline chloride-based DESs. Some other compounds present in SCG, like terpenoids, can also be extracted with n-hexane [49]. Figure 7 shows that the 1 H NMR spectra of fresh and waste coffee grounds oil differed mostly in the intensity of signals that correspond to caffeine at: 3.39, 3.57, 3.98, and 7.55 ppm [42].  Based on the obtained results, it is obvious that the origin of the coffee influences the quality of the synthesized biodiesel. This means that the optimal reaction conditions have to be determined experimentally for each type of coffee. However, some general conclusions can be drawn. The best mass ratio of catalyst:methanol:oil is 0.5:40:100. Too low a mass of the catalyst may not be enough for a high yield of biodiesel, while excess catalyst can induce saponification of FAME. Too low a mass of methanol may not be enough for the high conversion of oil to biodiesel. If the reaction is conducted with a high excess of methanol, the concentration of residual methanol in biodiesel can be too high, which can lower the flashpoint of biodiesel. Reaction time can be set to 60 min in order to ensure the maximum possible yield of biodiesel, and the extraction time can be set to 60 min to be sure that Based on the obtained results, it is obvious that the origin of the coffee influences the quality of the synthesized biodiesel. This means that the optimal reaction conditions have to be determined experimentally for each type of coffee. However, some general conclusions can be drawn. The best mass ratio of catalyst:methanol:oil is 0.5:40:100. Too low a mass of the catalyst may not be enough for a high yield of biodiesel, while excess catalyst can induce saponification of FAME. Too low a mass of methanol may not be enough for the high conversion of oil to biodiesel. If the reaction is conducted with a high excess of methanol, the concentration of residual methanol in biodiesel can be too high, which can lower the flashpoint of biodiesel. Reaction time can be set to 60 min in order to ensure the maximum possible yield of biodiesel, and the extraction time can be set to 60 min to be sure that Based on the obtained results, it is obvious that the origin of the coffee influences the quality of the synthesized biodiesel. This means that the optimal reaction conditions have to be determined experimentally for each type of coffee. However, some general conclusions can be drawn. The best mass ratio of catalyst:methanol:oil is 0.5:40:100. Too low a mass of the catalyst may not be enough for a high yield of biodiesel, while excess catalyst can induce saponification of FAME. Too low a mass of methanol may not be enough for the high conversion of oil to biodiesel. If the reaction is conducted with a high excess of methanol, the concentration of residual methanol in biodiesel can be too high, which can lower the flashpoint of biodiesel. Reaction time can be set to 60 min in order to ensure the maximum possible yield of biodiesel, and the extraction time can be set to 60 min to be sure that equilibrium (for transfer of glycerol, methanol and catalyst from crude biodiesel to DES) is achieved. Finally, since a higher conversion of oil to biodiesel was achieved with KOH as well as a better solubility of KOH in methanol, KOH was selected as the better catalyst.

Purification of Crude Biodiesel in Continuous Column Extractor
Following the batch extraction experiments, the possibility of purification of crude biodiesel by countercurrent column extraction was investigated. Biodiesel was synthesized from WCGO3 under optimal process conditions determined based on batch experiments (KOH:methanol:oil = 0.5:40:100; synthesis time, 60 min). Stable column operating conditions (constant active height of the column: distance between upper and lower phase separation limits) were accomplished at a pulsation rate equal to 36 pul/min and mass ratio of solvent to biodiesel 1.4. Under the specified conditions, the time needed for the column to achieve the stationary condition was experimentally determined by collecting samples of purified biodiesel every 5 min, followed by the measurements of 1 H NMR spectra. Obtained results are given in Figure 8. It can be seen that the intensity of the signals characteristic for the hydroxyl group at 2.86 and 3.44 ppm decreased over time. Based on the total FAME content (Figure 9), it was concluded that the stationary conditions were achieved after 15 min. Equation (1) was used to calculate the total FAME content [50].
Separations 2020, 7, x FOR PEER REVIEW 16 of 20 equilibrium (for transfer of glycerol, methanol and catalyst from crude biodiesel to DES) is achieved. Finally, since a higher conversion of oil to biodiesel was achieved with KOH as well as a better solubility of KOH in methanol, KOH was selected as the better catalyst.

Purification of Crude Biodiesel in Continuous Column Extractor
Following the batch extraction experiments, the possibility of purification of crude biodiesel by countercurrent column extraction was investigated. Biodiesel was synthesized from WCGO3 under optimal process conditions determined based on batch experiments (KOH:methanol:oil = 0.5:40:100; synthesis time, 60 min). Stable column operating conditions (constant active height of the column: distance between upper and lower phase separation limits) were accomplished at a pulsation rate equal to 36 pul/min and mass ratio of solvent to biodiesel 1.4. Under the specified conditions, the time needed for the column to achieve the stationary condition was experimentally determined by collecting samples of purified biodiesel every 5 min, followed by the measurements of 1 H NMR spectra. Obtained results are given in Figure 8. It can be seen that the intensity of the signals characteristic for the hydroxyl group at 2.86 and 3.44 ppm decreased over time. Based on the total FAME content (Figure 9), it was concluded that the stationary conditions were achieved after 15 min. Equation (1) was used to calculate the total FAME content [50].   The obtained results are presented in Figure 9. It can be seen that the initial FAME content was slightly reduced from 98.82 to 96.72%, which indicates the possible low solubility of FAME in the selected DES. Since FAME content did not decrease below the EN 14214 limit, the solvent can be used for the purification of crude biodiesel. The measured characteristic properties of purified biodiesel are presented in Table 8. The purified biodiesel synthesized from WCGO3 fulfills the standard specification (EN 14214) for biodiesel in terms of density, kinematic viscosity, ester content, TAN, iodide number, and linoleic acid methyl ester as well as glycerol and glyceride content. The obtained results are presented in Figure 9. It can be seen that the initial FAME content was slightly reduced from 98.82 to 96.72%, which indicates the possible low solubility of FAME in the selected DES. Since FAME content did not decrease below the EN 14214 limit, the solvent can be used for the purification of crude biodiesel. The measured characteristic properties of purified biodiesel are presented in Table 8. The purified biodiesel synthesized from WCGO3 fulfills the standard specification (EN 14214) for biodiesel in terms of density, kinematic viscosity, ester content, TAN, iodide number, and linoleic acid methyl ester as well as glycerol and glyceride content. Table 8. Specification of biodiesel after column extraction.

Property
Unit Biodiesel Standard Method