Biodiesel and activated carbon from arabica spent coffee grounds

This study aims to analyze the potential and characteristics of biodiesel and activated carbon from spent coffee grounds (SCG).• Biodiesel was obtained by extracting oil from SCG using Soxhlet extraction method with n-hexane solvent with an oil yield of 18.14% w/w of dry SCG. Furthermore, the coffee oil was esterified and transesterified to produce biodiesel with 57.32 % yield of coffee oil and higher heating value of 36.69 MJ/kg, density (15°C) of 0.89 g/mL, kinematic viscosity (40°C) of 7.67 mm2/s, acid number of 1.19 mg KOH/g oil.• The residue in form of grounds after oil extraction process was turned into activated carbon using two step activation process. Carbonization process was carried out at 500, 600, 700, and 800°C for 30 minutes and then chemically activated using potassium hydroxide (KOH) at 750°C for 2 hours. As the comparison, activated carbon was also made from SCG without oil extraction process. This study shows that the adsorption capacity of activated carbon made from SCG with oil extraction was better than without oil extraction. The best adsorption of activated carbon was obtained from SCG with oil extraction and carbonized at 700°C with iodine value of 1,224.59 mg/g and methylene blue value of 153.08 mg/g.


Introduction
Oil depletion is an ongoing problem and a way out must be sought by finding sources of fuel from renewable sources, such as biofuels in the form of biodiesel or bioethanol. Biodiesel can be produced from vegetable oil through squeezing or extraction process such as palm oil, coconut oil, and jatropha oil. On the other hand, bioethanol can be derived from materials containing sugar and starch such as sugarcane molasses, corn, palm sugar, sago, and cassava [1] . However, the United Nations (UN) noted an increase in Table 1 Oil yield from Soxhlet extraction using hexane as solvent reported in other studies.

Study
Dry spent coffee grounds to solvent ratio, m/v Extraction time (h) Oil yield on dry spent coffee grounds weight basis, m/m (%) Abdullah and Bullent Koc [15] 1 : 15 8 13 Al-Hamamre et al. [14] 1 : 4.2 0.25 -0.5 11.2 -15.28 Ahangari and Sargolzaei [16] 1 : 15 6 16.7 Caetano et al. [13] 1 : 20 2.5 -9.5 16 Couto et al. [17] --18.3 Deligiannis et al. [18] --10 -15 Efthymiopoulos et al. [10] 1 : 4.44 -1 : 8.88 1 -2 12.55 -15.69 Haile [19] -4-8 15.6 Kondamudi et al. [20] 1 : 3 1 13.4 Table 2 Composition of spent coffee grounds oil and other plant oils reported in other study. the number of hunger figures from 2015. Until 2018 there were more than 821 million people in the world who suffer from hunger, food insecurity and malnutrition [2] . Seeing this problem, currently there is a second generation of biofuels, namely fuels made from non-food materials, waste or by-products from these foodstuffs, such as straw, bagasse, husks, palm empty bunches, and spent coffee grounds. Coffee was the second largest commodity traded in world trade after crude oil that makes the availability of spent coffee grounds (SCG) abundant. Indonesia as the 4 th largest coffee producing country in the world with total production of 565.08 thousand tons and consumption of 288 thousand tons in 2018/2019 makes the availability of spent coffee grounds abundant [3] . The amount of fat contained in coffee ranges from 7-17 % depending on the type of coffee, arabica coffee has oil content of 15% and 10% for robusta coffee [4] . In spent coffee grounds, the oil content ranged from 15 -21.5% depending on the extraction method used [5] . This result is quite significant when compared to biodiesel raw materials in general, such as rapeseed oil (37 -50%), palm oil (20%), and soybean oil (20%) [6] . Besides being used to produce biodiesel, spent coffee grounds also have ≥ 50% carbon content so they have good potential to be used as activated carbon [7] .
Drying process plays a very important role in oil extraction. Decreasing the water content will increase the effectiveness of the solvent [8] . High water content will inhibit / interfere the penetration of the solvent and the oil diffusion process because the solvent used for oil extraction is not soluble in water [9] . However, very low water content will also decrease the amount of oil that can be extracted due to the reduced solubility of phosphatides in the absence of water [ 10 , 11 ]. The thickness of the sample to be dried also has a large effect on the drying rate. The time required for the drying process was directly proportional to the thickness of the sample and inversely proportional to the heating temperature [ 10 , 12 ].
Oil extraction process from spent coffee grounds can be done using various types of solvents, both polar solvents such as acetone, isopropanol, ethanol, methanol, and non-polar solvents such as n-pentane, hexane, toluene, n-octane, n-heptane, and chloroform [ 13 , 14 ]. Table 1 shows the oil yield using Soxhlet extraction method when hexane is used as the solvent from other studies.
Main composition of spent coffee grounds oil is palmitic acid and linoleic acid, followed by oleic acid and stearic acid. Some researchers reported a small composition of lauric acid, myristic acid, linolenic acid and arachidic acid. Table 2 shows the composition of spent coffee grounds oil and other plant oils obtained by previous researchers. The composition of the oil will affect the quality and properties of the oil produced. Oil obtained from the extraction process cannot be directly used as biodiesel, this oil needs to go through an esterification and transesterification process to convert it into FAME (Fatty Acid Methyl Ester). The final result of FAME is highly influenced by the quality and composition of the extracted oil. Oils with FFA level greater than 0.5% by weight need to go through a pretreatment stage to reduce FFA levels [28] . The esterification process can be used as a pretreatment stage which aims to convert free fatty acids into esters using alcohol and an acid catalyst [29] . FFA levels above 0.5% are reported to affect the product produced in the transesterification process. FFA levels above 5% will result in ester conversion below 90% [30] . Lowering FFA levels from 3.6% to 0.5% will increase the yield of biodiesel from 73% to 87% [31] . The ability of esterification and transesterification is strongly influenced by the type of alcohol used, the longer carbon chain of the alcohol used, the lower the esterification and transesterification performance. The transesterification performance obtained from various types of alcohol in sequence is methanol > ethanol > 2propanol > 2-butanol > 2-hexanol > 2-octanol > 1-decanol. This is due to the difference in polarity, the polarity of the alcohol decreases as the number of carbon contained in the alcohol chain increases [32] .
Esterification and transesterification processes require the presence of a catalyst. The acid catalysts that can be used in the esterification process are H 2 SO 4 , HCl, dan H 3 PO 4 which are the most common acid homogeneous catalysts used in the esterification process. This catalyst is insensitive to FFA and H 2 O, but capable for catalyzing the esterification process of FFA. This homogeneous acid catalyst is corrosive to metallic materials and cannot be reused [33] . NaOH, KOH, and CH 3 ONa are homogeneous alkaline catalysts that are generally used in the biodiesel transesterification process because they have a fast reaction in short time [34] . However, this catalyst is sensitive to fatty acids and H 2 O in oil so that hydrolysis and saponification reactions can occur [35] . Spent coffee grounds biodiesel produced by previous researchers was summarized in Table 3 .
Activated carbon can be made from various kinds of raw materials, generally divided into two, namely from fossil raw materials (coal and petroleum residue), and from biomass-based carbon (wood, coconut shell, and agricultural residues) [37] . Spent coffee grounds was one of the lignocellulosic residues that are produced in large quantities throughout the world because coffee is the second largest trading commodity in the world after crude oil makes this waste easily found and widely available. There are two methods of carbon activation, one-step activation and two-step activation process.

Material
Spent coffee grounds used in this study are arabica spent coffee grounds from espresso machine obtained from Starbucks café located in Paris Van Java, Bandung, Indonesia. Potassium hydroxide, hydrochloric acid, potassium iodide, potassium iodate, sodium carbonate, sodium thiosulfate pentahydrate, starch soluble, and methylene blue were analytical grade from Merck. Phosphoric acid, n-hexane, sodium hydroxide, methanol, sulfuric acid, and aquadest were technical grade. Iodine used in this study was laboratory grade.

Drying
The drying process was carried out by using 5 kg of spent coffee grounds which divided into 5 containers or trays, each tray contains 10 mm thickness of SCG and dried at 105 ± 5°C. Every 30 minutes a weight measurement was carried out for the five trays and rotation of the trays is done in order to obtain even drying results. The drying process was stopped after there was no decrease in mass in the five tray. The principle of this process was to calculate the mass loss on heating. To determine the moisture content contained in the spent coffee grounds before and after the drying process, it was validated using a volumetric Karl Fischer titrator.

Oil production
The process of extracting oil from the dried spent coffee grounds was carried out using Soxhlet extractor and n-hexane as solvent, extraction was carried out in 5 cycles. This was done because after the 5 th cycle, the amount of oil produced was very small ( ≤ 0.03 g). From this process, a mixture of n-hexane and coffee oil will be collected and separated by using rotary evaporator to get coffee oil and n-hexane that can be reused for next extraction.

Biodiesel production
The process of making biodiesel from coffee oil begins with the degumming process. The degumming process was carried out using phosphoric acid (H 3 PO 4 ) then sodium hydroxide (NaOH) solvent and heated at 70°C for 1 hour. After the degumming process was complete, the mass, acid number, and saponification value of the oil were measured. If the oil acid number greater than 5 mg-KOH/g, it is necessary to do the esterification process because the levels of free fatty acids (FFA) are still high. The esterification process was carried out by mixing oil with methanol and sulfuric acid (H 2 SO 4 ) as acid catalyst and heated for 1 hour at 60°C. The amount of methanol and sulfuric acid used based on formula below. After the esterification process, the oil was washed with distilled water and the acid number of the oil was measured. If the acid number is > 5 mg-KOH/g, then the esterification process must be repeated. If the acid number is below 5 mg-KOH / g, then the mass and saponification value of oil were measured for further use in the transesterification process. The transesterification process was carried out by mixing the oil after esterification / oil with an acid number < 5 mg-KOH/g with methanol and potassium hydroxide (KOH) catalyst. This mixture was heated at 60°C for 1 hour and transesterified oil then washed with distilled water. The amount of methanol and potassium hydroxide used based on formula below. = molar masss of methanol (g/mol) = density of methanol (g/cm 3 ) = volume of potassium hydroxide used (mL) = volume oil (mL)

Oil and biodiesel composition analysis
The types and levels of composition from the compounds contained in coffee oil was analyzed using Gas Chromatography and Mass Spectrometer (GC-MS). This study use Agilent 8890 with autosampler as gas chromatography instrument and Agilent 59778 as mass spectrometer instrument, Agilent HP-5MS column (capillary column : 30 m x 0.25 mm i.d. x 0.25 μm), and helium gas. Oven temperature 60°C, 15°C/m to 175°C, 2°C/m to 240°C, 10 minutes. Detector temperature of 230°C, and injector temperature of 250°C.

Carbonization
Spent coffee grounds after the oil extraction and without oil extraction are processed into activated carbon to determine the effect of oil extraction on the quality of the activated carbon produced. The process of making activated carbon begins with the carbonization process carried out at temperature of 500, 600, 700, and 800°C at a rate of 10°C/min. after this temperature was attained, the reaction was held for 30 minutes and then it was cooled to ambient temperature. This process was carried out under inert condition by injecting nitrogen gas at 1 L/min.

Activation process
Carbon from previous step (carbonization) was activated using KOH solution with concentration of 50%-mass as activating agent. The impregnation ratio was 1:4 m/m and impregnation was held for 2 hours. After impregnation, this mixture was dried at 105 ± 5°C for 6 hours and then heated in muffle furnace at 750°C at a rate of 10°C/min in inert condition. The heating process was held for 2 hours and then cooled to room temperature. Activated carbon obtained then washed using HCl 0.1M solution and rinsed with distilled water until neutral pH.

Drying
The drying process was carried out 3 times with the same amount of spent coffee grounds. Fig. 1 shows the drying profile of spent coffee grounds.
By using Karl Fischer titrator, it was found that the moisture content of the spent coffee grounds before drying was 61.59% and after drying was 2.65%. This result was relevant because the water content was reduced by 58.94% compared to drying process above that shows the amount of substance that evaporates from drying was 59.34%.

Oil extraction
Oil extraction was carried out using Soxhlet extractor and n-hexane as solvent. Mass of dried spent coffee ground used on oil extraction was 100 g and 750 mL of solvent was used. This process was repeated for 19 times and averaged, oil extraction process takes 89.79 minutes to complete with oil yield of 18.14% by mass of dried spent coffee grounds and 74.23% of solvent recovery.

Fatty acid profile
After going through the esterification process, the composition of spent coffee grounds oil was measured using a GC-MS. Fig. 2 shows the fatty acids profile. The majority or the fatty acids contained in the oil was palmitic acid and linoleic acid with 33.82% and 32.98% respectively. Followed with 11.76% of oleic acid, 11.24% of stearic acid, 3.94% of arachidic acid, and 0.53% of lauric acid. Spent coffee grounds oil produced contain 49.53% of saturated fatty acid, 44.74% of unsaturated fatty acid, and 5.73% others.

Properties of biodiesel
The properties of biodiesel produced from this research can be seen in the Table 4 along with the test methods and limitations according to Indonesian biodiesel standards (SNI 7182:2015). There are several properties of biodiesel that do not meet the Indonesian biodiesel standard (SNI 7182: 2015), such as kinematic viscosity, acid number, and oxidation stability. The viscosity of biodiesel was strongly influenced by the methyl ester content, the higher the levels of palmitic acid and stearic acid will increase the viscosity of the oil [ 38 , 39 ]. The acid level in this study can still be lowered again by doing the esterification process for the second time so   that the acid level of the oil before entering the transesterification process was already low. The low oxidation stability of coffee grounds biodiesel was because SCG have gone through various heating processes in the presence of oxygen, such as the roasting process which is generally carried out at a temperature of 180 -240°C, the process of brewing coffee with hot water at high pressure (espresso), the drying process at temperature 105°C, oil extraction process at a temperature of 70 -75°C. This will greatly affect the oxidation stability of the oil in the coffee grounds. The conversion ratio from coffee oil to biodiesel was 57.32%, namely 45.39 grams of biodiesel produced from 79.18 grams of coffee oil.

Carbonization and activation process
Both SCG with oil extraction and without oil extraction was carbonized at 500, 600, 700, and 800°C for 30 minutes. Sample A_500 means SCG with oil extraction carbonized at 500°C, and B_600 means SGC without oil extraction carbonized at 600°C. Carbon produced from carbonization process both from A and B type SCG was activated with chemical activation using KOH and heated at 750°C for 2 hours. Table 5 shows the yield from carbonization and activation process.

Properties of activated carbon
The properties of activated carbon produced from this research can be seen in Table 6 along with the test methods and limitation according to Indonesian activated carbon standard, namely SNI 06-3730-1995. The properties of activated carbon measured was moisture content, ash content, volatile matter content, carbon content, iodine number, and methylene blue number. The variation   of carbonization temperature and the type of sample used did not really affect the moisture content of activated carbon. The ash content of activated carbon made from sample A was lower when compared to sample B. In addition, the higher carbonization temperature, the higher ash content, this was consistent with the statement of previous study [37] . The volatile matter content will increase by increasing carbonization temperature. The volatile matter content of sample B was higher than sample A. Carbon content will decreased by increasing the carbonization temperature both for sample A and sample B. In Table 6 , it can be seen that sample A has a better iodine number than sample B for the same carbonization temperature. The best iodine adsorption was obtained in sample A_700 with a value of 1,224.6 mg/g, and for sample B the best iodine adsorption was obtained in sample B_800 with a value of 966.0 mg/g. Similar results with the adsorption of iodine were also shown for the adsorption of activated carbon against methylene blue. Sample A has a better adsorption ability of methylene blue than sample B. The best adsorption of methylene blue was obtained by sample A_600 with a value of 157.7 mg/g and for sample B the best absorption of methylene blue was obtained by sample B_700 with a value of 141.4 mg/g. Table 6 also shows the yield of activated carbon produced from dried spent coffee grounds. Table 7 shows the comparison of activated produced from this study against other researchers. The pore structure of the resulting activated carbon can be seen using SEM (Scanning Electron Microscopy). Fig. 3 shows the SEM characterization for sample A_700 and Fig. 4 shows the SEM characterization for sample B_800. From the SEM results, it can be seen that sample A_700 has a tighter pore structure so that it has a larger surface area when compared to sample B_800. The larger the surface area of activated carbon, the contact area between the activated carbon and the substance to be adsorbed will also increase, this will lead to better adsorption ability of iodine and methylene blue.

Conclusion
Biodiesel produced from spent coffee grounds still does not fully meet the Indonesia biodiesel standards (SNI 7182:2015) because the values of kinematic viscosity, acid content, and oxidation stability are still outside the standard limits. The process of extracting oil from coffee grounds affects the quality and quantity of activated carbon produced where by extracting the oil will increase the adsorption of activated carbon against iodine and methylene blue, reduce ash and volatile matter content thus increase carbon content from activated carbon. By increasing the carbonization temperature from 500°C to 800°C causes an increase in the ash and volatile matter content, and a decrease in carbon content. The moisture content was not significantly affected by the increase in carbonization temperature. Activated carbon that meets the quality requirements of Indonesian activated carbon (SNI 06 -3730 -1995) was activated carbon made from coffee grounds by oil-extracted and non oil-extracted at carbonization temperatures of 600, 700, and 800°C. The best quality of activated carbon from adsorption ability was obtained from coffee grounds that have been oilextracted and the carbonization process at 700°C for iodine absorption of 1224.59 mg/g, and carbonization at 600°C for methylene blue adsorption of 157.68 mg/g.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Data availability
Data will be made available on request.