Introduction

Growth and production of commodities and food in modern society involve large-scale industrial and agricultural activities. In addition to the desired products, these activities also produce large quantities of waste that can cause serious environmental problems if it is not properly managed. Coffee is a popular product that is processed on a large scale. The annual consumption of coffee worldwide reached 10.1 million metric tons in 2022 (USDA 2023), and approximately 90% of this ended up as coffee biomass waste.

Anaerobic digestion is one of the most cost-effective processes to treat animal manure and food waste. Previous studies have shown that food waste shows potential as a substrate for anaerobic digestion because of its high contents of biomass and nutrients (Lane 1983; Luz et al. 2017). However, anaerobic digestion also produces an effluent called anaerobic digestate. This digestate is generally rich in nutrients (Mucha et al. 2019), such as nitrogen, phosphorous, and organic matter. The simplest method for treatment of digestate is direct discharge onto local agricultural lands (Möller and Müller 2012; Walsh et al. 2012), but this method has a limited processing capacity and potential ecological risks.

In recent years, the production of microalgal biomass using digestate has attracted attention as a potential strategy for resource recycling of digestate. Anaerobic digestates, such as thin stillage digestate, have been used to provide nutrients in microalgae cultivation (Sayedin et al. 2020). Liquid digestates, such as poultry liquid digestate (Rajagopal et al. 2021) and maize silage liquid digestate (Kisielewska et al. 2022), have been applied for production of microalgae and biomass. Although these methods show potential for economical wastewater treatment and high-value microalgal biomass production, other issues restrict the application of this method. The high turbidity of the digestate is particularly problematic.

High turbidity in digestate hinders the permeation of light into the medium and is a major issue for the use of digestate in microalgae cultivation (Monlau et al. 2015). The turbidity in digestate is caused by insoluble suspended solids (SS) and soluble, colored organic compounds (Wang et al. 2010), such as microbial byproducts, and humic acid-like and fulvic acid-like substances. Membrane filtration (Bchir et al. 2011), centrifugation (Franchino et al. 2013), and precipitation (Chen et al. 2012) have been applied to remove turbidity, mainly in the form of insoluble SS, from digestate. Liquid digestate without SS has higher light permeation. However, the liquid digestate remains dark because of the soluble, colored organic compounds.

Electrochemical oxidation (EO) has been widely applied for the decolorization of wastewater containing methyl orange (Wang et al. 2020) and malachite green (El-Ghenymy et al. 2015). The EO process can decompose complex refractory contaminations into small biodegradable molecules and greatly improve the biodegradability of wastewater (Krzemińska et al. 2015). In decolorization by EO, electrochemically generated hypochlorite has been used from chloride ions in solution (Martínez-Huitle et al. 2015). This production of hypochlorite by the electrochemical reaction reduces the concentration of ammonium nitrogen (NH4-N), which is a nutrient source for algae. For example, when liquid digestate from the anaerobic digestion of dairy manure was treated by EO with a dimensionally stable anode (DSA) based on mixed oxides of RuO2 + IrO2, the NH4-N concentration decreased because of electro-generated hypochlorite (Ihara et al. 2006).

The selection of an appropriate anode material is important for the EO process. As an electrode, boron-doped diamond (BDD) provides a high overpotential for oxygen production and a wide potential window. Because of these properties, rather than generating and using hypochlorite, BDD anodes generate ·OH and use it to oxidize organic compounds (Panizza and Cerisola 2005). The EO process using a BDD anode (EO-BDD) has been applied to decolorization of dark solutions, such as those colored with melanoidins (Liakos et al. 2017) and the synthetic azo dye Ponceau 4R (Thiam et al. 2016). In these applications, ·OH is likely the primary active species instead of hypochlorite.

The objective of this study was to evaluate the decolorization of anaerobic digestate from spent coffee grounds (SCG) using a BDD anode for EO. The decolorization performance and NH4-N concentration in the anaerobic digestate were investigated. This study compared the SCG digestate with cow manure (CM) digestate to evaluate the effect of the substrate on anaerobic digestion. The effects of the anodic material, initial Fe2+ concentration, and current on the EO process were also investigated. To evaluate the performance, the color removal rate, absorbance decay, chemical oxygen demand (COD) removal, and changes in the NH4-N concentration were analyzed.

Materials and methods

Chemicals

The catalyst (FeSO4·7H2O, guaranteed grade reagent) was purchased from FUJIFILM Wako Pure Chemical Corporation (Osaka, Japan) and used in the experiments at 0.1, 0.2, 0.4, 0.8 mM. Solutions were prepared with deionized water, which was produced by a Direct-Q 3UV system.

Digestate

Two types of digestates were used in this study. The CM digestate was obtained from a small-scale anaerobic digester fed with dairy CM at a dairy farm in Kansai, Japan. The SCG digestate was collected from a laboratory-scale anaerobic reactor fed with simulated coffee waste. The simulated coffee waste was prepared from coffee powder (Golden Special Coffee, UCC, Japan). First, the coffee powder was fully dissolved in 100 mL of distilled water at 70 °C to prepare a coffee solution. Then, the coffee solution was filtered through coffee filter paper (20 μm) to obtain filtered coffee waste as a substrate. The inoculum for anaerobic digestion of the simulated coffee waste was obtained from a biogas plant at a food processing facility in Kansai, Japan. The characteristics of the SCG digestate are shown in Table 1.

Table 1 Characteristics of the SCG digestate

Apparatus and experimental procedures

Each digestion reactor had a working volume of 700 mL and a total volume of 1000 mL. After the inoculum was added to the reactor, the reactor was placed in an incubator at 37 °C for 72 h before addition of the substrate. The inoculum and substrate were mixed in the reactor by manual shaking. Anaerobic digestion was performed with 30% headspace under a N2 atmosphere, and the vials were sealed with a butyl cap and plastic thread. The biogas is collected in a composite aluminum bag throughout the anaerobic digestion process.

After anaerobic digestion, the digestate was obtained by filtering the reaction mixture through a mesh filter and remaining the filtrate. The digestate then was centrifuged twice (4347 × g, 15 min) to separate the SS and solution. Liquid digestate was obtained by membrane filtration (0.2 μm, MICRODYN, Germany) of the solution.

For EO, the liquid digestate was diluted two-fold. The anode for the EO was BDD (Sumitomo Electric Industries), platinum-doped titanium mesh sheet (Ti/Pt, Tanaka Kikinzoku Kogyo Co., Ltd), or IrO2 doped titanium mesh (Ti/IrO2, Tanaka Kikinzoku Kogyo Co., Ltd), and the cathode was BDD (Sumitomo Electric Industries). The EO experiments were carried out in a 500 mL flask reactor with 400 mL of solution. A water bath was used to maintain the temperature of the solutions at 35 °C. The reaction mixtures were stirred with a magnetic stirrer at 800 rpm and under constant current conditions at 0.6, 0.9, 1.2, 1.5, or 2.0 A (KX-100L DC power supply, Takasago Electric). The inter-electrode gap was 0.5 cm and the immersed area of each electrode was 35 cm2. The flow diagram of the experimental procedure is shown in Fig. 1.

Fig. 1
figure 1

Flow diagram of the experimental procedure

Analytical methods

The absorbance values of the solutions were measured by ultraviolet–visible spectrophotometry (U-5100, HITACHI, Japan). A calibration curve for the platinum-cobalt (Pt–Co) color scale against the absorbance was constructed using color standard solutions with Pt–Co values of 100 and 1000 (Cardoso et al. 2016; Sathishkumar et al. 2017). The color removal was calculated from the absorbance measured at 475 nm and the calibrated Pt–Co value as follows:

$$\text{\%Color removal }= \frac{{C}_{0}- C}{{C}_{0}}*100$$
(1)

where C0 and C denoted the Pt–Co value and that at time t during the EO, respectively.

All parameters were analyzed according to the Standard Method for Examination of Water and Wastewater (APHA 2017). The COD and the concentration of PO43− were measured using a spectrometer (DR3900, HACH, USA). To determine the contents of NH4+, Na+, K+, Cl, NO2, and PO43−, the raw SCG digestate was analyzed by ion chromatography (IC-8100, TOSOH, Japan). The total nitrogen (TN) and total organic carbon (TOC) were measured by a TN and TOC analyzer (TNM-L, TOC-L, Shimadzu, Japan). The color density was analyzed according to the American Dye Manufactures Institute method (APHA Method 2120 F 2017). A target was established as the absorbance at 475 nm of a clear and colorless solution with a Pt–Co value of 200.

Results and discussion

Electrochemical oxidation of CM digestate and SCG digestate

The CM and SCG digestates were treated by EO using a Ti/Pt anode and BDD cathode with a current of 1.5 A. Both digestates had a similar initial absorbance at 475 nm. Figure 2 shows the change in the absorbance and color removal for the different digestates. The dashed line shows the target value for the absorbance at 475 nm of a clear and transparent solution with a Pt–Co value of 200. The color of the CM digestate changed rapidly and the solution became colorless and nearly clear after 720 min with an absorbance value close to the target (Fig. 2a). The color removal rate was 97.6% (Fig. 2b). For the SCG digestate, the absorbance at 475 nm decreased to reach the target value at 810 min (Fig. 2a), and the color removal rate was 97.8% (Fig. 2b). The higher color removal rate of the CM digestate compared with that of the SCG digestate could be attributed to the following. First, a high concentration of chlorine in the CM digestate might enhance the EO process via indirect oxidation. Second, the substrate for SCG digestion was roasted coffee beans, which meant that the SCG digestate contained caramel and melanoidin in addition to humus-like and fulvic acid-like colored matter (Monlau et al. 2015). Caramel is a complex mixture that contains high and low molecular weight compounds (Tomasik 2003), and is rich in auxochromes and chromophores that contain carbon–carbon covalent bonds, amino groups, and ketone groups. Melanoidins are high molecular weight compounds with a dark brown color (Moreira et al. 2012). The contents of caramel and melanoidin in the SCG digestate would increase its decolorization time compared with the CM digestate.

Fig. 2
figure 2

a Absorbance values and b color removal rates over time for the electrochemical decolorization of SCG and CM digestates with a Ti/Pt anode

Effect of the anode material on decolorization of the SCG digestate

The anode properties are important for efficient EO. The anode affects the rate of an electrochemical reaction, including the generation of oxidants, and consequently affects the oxidation of colorants (Martínez-Huitle et al. 2015).

Figure 3 shows the effect of the anode material on the absorbance of the SCG digestate. The dashed line shows the target value for the absorbance at 475 nm of a clear and transparent solution with a Pt–Co value of 200. The decolorization with the BDD anode was much more rapid than with the Ti/Pt or Ti/IrO2 anode. With the BDD anode, the target color (Pt–Co value of 200) and 98.7% color removal were reached at 270 min. By contrast, with the Ti/Pt anode, it took 720 min for the decolorization to reach the target and the color removal was only 97.5%. With the Ti/IrO2 anode, the decolorization took even longer (1020 min) and the color removal rate was lower (97.1%). These results were attributed to the nature of the inactive BDD anode, which has a wide electrochemical window and produces large quantities of ·OH radicals and other active species on its surface. According to previous research (Fernandes et al. 2015), the generated·OH is weakly physisorbed on the BDD anode and facilitates the oxidation of organic compounds. By contrast, ·OH is strongly chemisorbed on the active anodes of Ti/IrO2 and Ti/Pt, and the oxidation of organic compounds with these anodes is inferior to that of BDD (Mandal et al. 2017). Furthermore, the concentration of chlorine in the SCG digestate was low, which resulted in weak indirect oxidation by the Ti/Pt and Ti/IrO2 anodes. The comparison of the three anodes showed that the anode material greatly affected color removal in EO and that the BDD anode was best for decolorization.

Fig. 3
figure 3

Effect of anode material (BDD, Ti/Pt, or Ti/IrO2) on the decolorization (absorbance and color removal) of SCG digestate

Effect of the ferrous ion concentration on degradation of the SCG digestate

Fenton’s reagent, which contains Fe2+ and H2O2, can generate hydroxyl radicals by Fenton’s reaction. Therefore, the Fe2+ concentration in EO is important for the generation of hydroxyl radicals. In this study, the effect of Fe2+ concentration (0–0.8 mM) was investigated using SCG digestate solutions with the same initial absorbance at 475 nm and EO at 1.5 A.

Figure 4 shows the change in absorbance for the SCG digestate. The dashed line shows the target value for the absorbance at 475 nm of a clear and transparent solution with a Pt–Co value of 200. Up to 100 min, the decolorization increased with increases in the Fe2+ concentration. Up to 270 min, the change in color removal was not greatly associated with an increase in initial Fe2+ concentration (Fig. 4 and Table 2). The effect on the absorbance could be attributed to the fact that Fenton’s reaction produced a larger amount of ·OH as the Fe2+ concentration increased. However, an excess of Fe2+ might have adverse effects on oxidation because some·OH would be consumed as shown in reaction (2) (Sirés et al. 2014).

Fig. 4
figure 4

Effect of the Fe2+ concentration on the absorbance for the SCG digestate treated with a BDD anode and BDD cathode

Table 2 Effects of added Fe2+ on the color removal rate and chemical oxygen demand (COD) removal for SCG digestate treated with a BDD anode (270 min)
$${{\text{Fe}}}^{2+}+ \bullet \mathrm{OH }\to {{\text{Fe}}}^{3+}+ {{\text{OH}}}^{-}$$
(2)

Colored complexes of Fe3+ and Fe2+ (Thiam et al. 2015) might be produced as by-products of the EO, and these complexes will affect the absorbance at 475 nm and the Pt–Co value.

Changes in the concentration of Fe2+ also affected the COD removal. Up to 270 min, the COD removal increased with increases in the Fe2+ concentration (Table 2). COD removal rates of 84.2, 85.5, 87.1, and 89.2% were obtained with 0.1, 0.2, 0.4, and 0.8 mM Fe2+, respectively. The improvement in COD removal up to 270 min with increases in the initial Fe2+ concentration contrasted with the results for color removal, where improvements were only observed up to 100 min (Fig. 4 and Table 2). This difference in the results is consistent with the effect of Fe2+ on the formation of colored complexes (Ertugay and Acar 2017).

Effect of the current on decolorization of the SCG digestate

The current is a key parameter that affects generation of hydrogen peroxide via cathodic oxygen reduction and generation of physisorbed·OH on the BDD anode surface (Ou et al. 2020). The effect of the current (0.6–2.0 A) on the decolorization of SCG digestate by the EO process was investigated.

The relationship between the absorbance decay and electric charge for the EO process is shown in Fig. 5. With a current of 1.5 A, the absorbance decreased faster than with a current of 0.6, 0.9, 1.2, or 2.0 A (Fig. 5a). The above results were validated by a pseudo-first-order kinetic analysis of the SCG digestate decolorization (Fig. 5b). The pseudo-first-order reaction was applied to model the electrochemical decolorization process (Eq. 3) (Garcia-Segura et al. 2011; Thiam et al. 2015) as follows:

$$A={A}_{0} \bullet {e}^{-kC}$$
(3)

where A0 and A are the absorbance at 475 nm with the initial electric charge and a given electric charge C, respectively. The k was determined as the slope of the linear regression line between the absorbance and electric charge. The kinetics analysis is shown in Fig. 5b. A positive relationship was established between the current (0.6–1.5 A) and absorbance decay. With a current of 2.0 A, the absorbance decay was the slowest. The results in Fig. 5a and b could be explained by an increase in competitive electrode reactions, including side reactions and parasitic reactions. Moreover, a higher current would enhance oxygen evolution at the anode and hydrogen evolution at the cathode (Nidheesh and Gandhimathi 2012).

Fig. 5
figure 5

Effect of the current on a the absorbance and b the relative absorbance for decolorization of the SCG digestate

Changes in the nutrients in the SCG digestate during the EO process

Ammonium and phosphate in digestate can be used in microalgae cultivation (Sayedin et al. 2020; Pulgarin et al. 2021). In the present study, changes in the NH4-N, COD, and color during membrane filtration pre-treatment and EO were investigated.

Membrane filtration reduced the NH4-N by 27.4%, the COD by 42.1%, and the Pt–Co value by 32% (Fig. 6). The reduction in NH4-N was attributed to the pore size of membrane used for filtration. The high COD removal by the membrane indicated that some organic compounds in the digestate were in the form of suspended particles (> 1.2 μm) (Akhiar et al. 2017) and other macromolecular substances that were larger than the pore size of the membrane (0.2 μm). These organic particles would be retained on the membrane, and this would also trap any ammonium ions that were absorbed on the particles. Most of the reduction in the Pt–Co color value was attributed to SS, which were removed by the membrane.

Fig. 6
figure 6

Changes in the color (Pt–Co value), NH4-N concentration and chemical oxygen demand (COD) in three digestates

Figure 7 shows the changes in NH4-N and COD removal during EO with BDD and Ti/Pt anodes. In each case, the absorbance of the treated solution at 475 nm reached the target (Pt–Co value of 200). The NH4-N concentration decreased by 12.6% with the BDD anode and 22.7% with the Ti/Pt anode (Fig. 7a). For the COD, the BDD and Ti/Pt anodes showed large differences (Fig. 7b). With the Ti/Pt anode, the COD concentration was reduced by 49.6% from 2200 to 1110 mg/L. The decrease obtained with the BDD anode was 84.1%, and the COD concentration at the end of the decolorization process was only 350 mg/L. The higher removal of COD by the BDD anode could be explained by the fact that the BDD anode is inactive, whereas the Ti/Pt anode is not classed as inactive. The BDD anode has a much higher potential for oxygen evolution (2.2–2.6 V) than the Ti/Pt anode (1.7–1.9 V). Consequently, it shows higher chemical reactivity for COD oxidation (Moradi et al. 2020).

Fig. 7
figure 7

a NH4-N concentration and b COD removal during electrochemical decolorization (Pt–Co value of 200 at 475 nm) of SCG digestate

The results showed that the EO with the BDD anode did not degrade NH4-N (Fig. 7a). It could be inferred that the minimal degradation of NH4-N was mainly because of the low concentration of hypochlorite with this anode (Chiang et al. 1995; Bagastyo et al. 2021). Ammonium is mainly degraded by oxidation with electrochemically generated hypochlorite according to reactions 410 (Chiang et al. 1995; Clifford White 1999).

$$\mathrm{Anodic reaction }{Cl}^{-} \to {Cl}_{2}+ {2e}^{-}$$
(4)
$${\mathrm{Bulk reactions }Cl}_{2}+ {H}_{2}O \to HOCl+ {H}^{+}+ {Cl}^{-}$$
(5)
$${NH}_{4}^{+}+HOCl \to {NH}_{2}Cl+ {H}_{2}O+ {H}^{+}$$
(6)
$${NH}_{2}Cl+HOCl \to {NHCl}_{2}+ {H}_{2}O$$
(7)
$${NHCl}_{2}+{H}_{2}O \to NOH+ {2H}^{+}+ {2Cl}^{-}$$
(8)
$${NH}_{2}Cl+NOH \to {N}_{2}+HOCl+{H}^{+}+{Cl}^{-}$$
(9)
$$2{NH}_{4}^{+}+3\mathrm{HOCl }\to {N}_{2}+3{H}_{2}O+5{H}^{+}+3{Cl}^{-}$$
(10)

Both the concentration of chlorine ions in the digestate and the properties of the anode affect the generation of hypochlorite in an electrochemical process. In this study, the concentration of Cl in SCG raw digestate was 792.5 ± 40.3 mg/L (Table 1). This decreased to 631.3 ± 19.6 mg/L in the liquid digestate, and then to 311. 5 ± 14.2 mg/L in the diluted digestate used for EO (two-fold dilution). Because of this low Cl concentration in the digestate and the fact that the BDD anode does not generate hypochlorite, degradation of ammonium ions was minimal during the EO. With the Ti/Pt anode, ammonium degradation was slightly higher than with the BDD anode because the Ti/Pt anode generated hypochlorite.

In summary, treatment of the SCG digestate by membrane filtration and EO gave a light-permeable medium with a Pt–Co value of less than 200. The resulting liquid was almost colorless and transparent (Fig. 8). The concentrations of NH4-N and PO4-P after the EO process were 520 ± 60 and 62 ± 14 mg/L, respectively. These concentrations are sufficient for microalgae cultivation (Morales-Amaral et al. 2015; Lu et al. 2022).

Fig. 8
figure 8

Electrochemically oxidized liquid digestate with a Pt–Co value of 200

Conclusion

The EO process using a BDD anode promoted decolorization of liquid digestate from SCG and retained nutrients, especially NH4-N. The electrochemically oxidized liquid digestate had a Pt-Co value of less than 200 and adequate NH4-N and PO4-P concentrations for use as a medium for cultivation of algae. The anode material affected the electrochemical decolorization of liquid digestate and the decolorization performance was in the order of Ti/IrO2 < Ti/Pt < BDD. Increasing the initial Fe2+ concentration enhanced the Fenton reaction and COD removal. A higher current enhanced the electrochemical decolorization process and side reactions. The EO process removed 84.1% of the COD and retained most of the NH4-N.