Introduction

The world population is continuously increasing without any substantial increase in cultivable land area and water resources (Elliott et al. 2014). It is of utmost requirement in the present scenario to develop sustainable and eco-friendly solutions for cultivation and agricultural product and by-product processing to meet the growing demands (Hilbert and Galligani 2014). Environmental concerns demand judicious and thoughtful recovery or reuse of generated industrial wastes. These issues are addressed by innovative techniques of valorization of not only by-products but also the wastes. This is evident from the paradigm shift in wastewater treatment technologies where the focus is on the recovery of resources while minimizing the energy consumption along with proper remediation of effluents (Jung et al. 2012). Recovery of value-added compounds from industrial wastes will have a significant impact on the economy of the process and eventually enhancing the revenue of companies (Rosello-Soto et al. 2015).

Most of the coffee production (over 90%) happens in developing countries, and it is consumed in developed countries (Ponte 2002). The coffee industry represents one of the major agro-industries, contributing significantly to the Gross Domestic Product of Latin American countries (Brazil and Colombia), South East Asian countries (Vietnam and Indonesia) and many African Countries (Ethiopia and Uganda). To meet its growing demand, the cultivation and production of processed coffee are on the rise and it has doubled over the last decade (Mussatto et al. 2011). Coffee is the second largest traded commodity worldwide after petroleum, and it has been associated with the generation of large quantities of harmful residues having serious environmental impacts (Mussatto et al. 2011). According to the reports of International Coffee Organization (ICO), coffee is grown in around 70 countries, and in the crop year 2016, the total production was 1.51 million of 60 kg bags, with Brazil being the leading producer with 55,000 of 60 kg bags (ICO 2019).

Globally over ten million tons of solid residue, along with an enormous amount of wastewater is released from coffee-based agro-industries (Echeverria and Nuti 2017). After processing, 1 kg of green coffee bean produces about 0.33–0.45 kg of instant coffee having 3% moisture, and in this process, around 550–670 g of solid residue (coffee pulp, coffee husk, and silver skin) is generated (Fan et al. 2003). Water is used in abundance in the processing of coffee beans, and this generates a large volume of coffee wastewater. Since coffee requires a huge amount of water for its processing, most of the coffee processing plants are located in the vicinity of the water bodies (Dadi et al. 2018). These processing plants consume water from these nearby water bodies and dump the wastewater directly into the environment due to lack of stringent environmental policies. 1–15 l of freshwater is utilized for processing of 1 kg of coffee beans, and this results in 1.00E+06–3.10 × 10E+6 m3 of coffee processing wastewater annually (Rattan et al. 2015). Coffee processing by wet method produces a significant quantity of wastewater (20–45 kg per kg of coffee beans processed) (Dias et al. 2014), which needs to be treated systematically before disposal. In 2016, according to the reports of the IOC organization, 16.6 billion liters of wastewater were generated (ICO 2019). Coffee processing wastewater has a high organic load, agrochemicals like pesticides and fertilizers and has a high pH, pungent odor and color and high chemical oxygen demand (COD) and biological oxygen demand (BOD) (Kulandaivelu and Bhat 2012). The variation of the components present in the coffee processing wastewater is mainly due to the different processing practices, the variation of maturation of coffee beans and the difference in the geographic location of cultivation (Pires et al. 2017).

The current review makes an attempt to deliver a technical synopsis of the current coffee production technologies, threats associated with the wastewater, remediation methodologies in use, the scope for the valorization of wastewater and the future prospects indicating the direction in which research must be carried out. The review aims to give a possible plan of action that can be carried out with the present technologies to make coffee processing more sustainable and eco-friendly while maintaining its capacity to meet the market demand. Although the authors make schemes for beneficial treatment as general as possible, the sheer lack of research in this field, in terms of pilot-scale testing and novel treatment methods, makes it difficult to draw a general conclusion with which can be directly utilized by policymakers. However, this challenge provided the major opportunity, to give, for the first time a sense of direction of future research that would drive scientific community in solving this problem with treatment of coffee processing wastewater.

Methodology

This review is done after extensive literature survey on coffee processing wastewater treatment studies. It has to be noted that the wastewater generated while making coffee beverage or while preparing coffee products at consumer end, although sometime mistakably denoted as coffee processing wastewater, has not been considered for this review. This is mainly done because each of the wastewater has different challenges in terms of technology and socioeconomic challenge. While coffee processing wastewater is generated in mostly developing countries requiring more critical techniques to counter expense and seasonal variation of wastewater, the other coffee wastewater does not face these challenges. Only relevant and recent studies have been considered while drafting this review. Few key steps that were followed are

  1. 1.

    Searching peer-review journal articles and book chapters on scientific databases.

  2. 2.

    Searching non-peer reviewed database (government reports, ICO reports)

  3. 3.

    Critical evaluation of key findings and selection of recent works for bibliographic citations.

  4. 4.

    Proposing new treatment schemes based on available studies on coffee processing wastewater and judiciously extrapolating findings from studies on other wastewater.

The databases searched include and not limited to: Google scholar and web of science.

Coffee processing wastewater: generation and properties

The two major varieties of coffee produced for consumption is Coffee Arabica and Coffee Robusta. Robusta growing in the lower elevation, a high yielding plant producing over 1 kg of green coffee annually per plant, is used for production of lower quality beans mainly used as instant coffee. Arabica, a low yielding plant (0.5–0.8 kg annually per plant), grows at higher elevation, produces superior quality beans used for specialty coffee. The latter is the major commodity of trade and accounts for 75% of the coffee traded globally (Chanakya and Alwis 2004). Processing coffee beans consumes 15,000 l of fresh water for processing 1 ton of coffee beans and most of the water consumed is dumped into the main water bodies nearby with very little or no recycling of wastewater. Coffee beans are plucked and are dried after sorting according to green or overripe variety since the quality of the seeds ultimately determines the final quality of the processed coffee (Murthy and Naidu 2011). Coffee beans are processed either via the dry method or the wet method, and among the two, wet method produces coffee of superior quality (Torres et al. 2016). The dry method of processing is mainly used for the Robusta variety of coffee and is much simpler than the wet method which is used for the Arabica. In the dry processes, the coffee seeds are sun-dried, and mechanical hulling then removes most of the dried husks along with most of the silver skin (Esquivel and Jiménez 2012). The wet method compared to the dry method consumes a huge amount of water and in turn, generates effluent which is very rich in various organic. This method generates coffee which is of higher quality, and moreover, it has the advantage of lesser area requirement for drying of beans (Aguiar et al. 2016a, b). Discharge of this effluent in the surrounding water bodies can be very harmful to the environment as it has a low pH (between 3 and 5) and high organic load. The volume of wastewater varies with time and the processing technique. The value is usually high in peak harvesting season. In the wet process, the berries are dumped into the water where the unripe ones (containing contamination—ochratoxin) float on top and are removed with screens (Batista et al. 2009). The wet process also contains a fermentation step which helps in removing the remaining mucilage attached to the bean. This fermentation provides the coffee with a high-quality aroma (Gonzalez-Rios et al. 2007). The separated beans are then roasted under high heat to give its aroma, texture and color (Fujioka and Shibamoto 2008). A detailed schematic of the steps involved in coffee processing is given in Fig. 1. The two major steps where wastewater is generated are the pulping process and the washing step after the fermentation processes, and these two wastewater streams collectively constituted the coffee processing wastewater (Garde et al 2017). Effluent generated from both the pulping and post-fermentation washing showed similar composition (Chanakya and Alwis 2004).

Fig. 1
figure 1

(adopted from Rattan et al. 2015; Echeverria and Nuti 2017)

Flow diagram showing coffee processing steps and the by-products produced during various steps. The key steps that produce most of the effluent and solid waste have been indicated.

This wastewater contains a high amount of organic load and has low pH due to the pulp and mucilage that it contains from the pulping process and the fermentation process. The COD in the wastewater ranges between 9000 and 15,000 mg mL−1, while the pH ranges around 5. The phosphorus, ammonia, and nitrogen ranges around 50 mg L−1 (Rattan et al. 2015). Apart from these, the raw coffee processing wastewater contains a good amount of total dissolved solute (TDS) and total suspended solute (TSS) which gives it its cloudy color. A detailed composition of the coffee processing wastewater as reported by various studies are given in Table 1. It has been indicated in studies that the effect of coffee processing wastewater on the environment is severe (Haddis and Devi 2008). The various health effects that were identified associated with coffee processing wastewater, as discussed by Haddis and Devi (2008), are skin irritation, nausea, breathing difficulties among many others. The study conducted over the Jimma Zone region of Ethiopia suggested that among the people living and consuming water of the water body in the downstream region of the coffee processing plant, 89% and 85% had the feeling of spinning effect (feeling drunk) and eye irritation, respectively (Haddis and Devi 2008). This was one of the literature that stressed the difficulties humans face due to pollution of coffee processing wastewater. There are more studies that indicated similar effects in various organisms, and we have tabulated (Table 2) the toxicity assay conducted on various organisms (including humans) in different literature to show the harmful effect of rice mill wastewater. Other effects of dumping effluents with a high organic load into the nearby water bodies are eutrophication (Scherer et al. 2017) which causes algal bloom cause shortage of oxygen for aquatic life (Lima et al. 2017). There must be technologies that would look into alleviate the problems faced by the dumping of coffee processing wastewater into nearby water bodies by treating the wastewater in an effective and efficient way such that they comply with the discharge limits set by the authority as listed in Table 3 (CPCB 1998).

Table 1 Characteristics of coffee mill wastewater as reported in various literature
Table 2 Toxicity assay studies showing an adverse effect of coffee processing wastewater on different organisms
Table 3 Discharge standard as recommended by the Central Pollution Control Board (CPCB), India

Coffee wastewater treatment

Literature reviews indicate various treatment methods for the treatment of agricultural wastewater (Kumar et al. 2016b). These include physicochemical processes like adsorption (De Gisi et al. 2016), advanced oxidation (Miklos et al. 2018), and biological processes (Bollmaan et al. 2016) like the use of up-flow anaerobic sludge blanket (UASB) reactor (Lu et al. 2015). While recent research work is being carried out on membrane technologies which provide better treatment opportunities, traditional approaches are more widely used for its simplicity and awareness. Figure 2 summarizes a general treatment scheme for wastewater treatment. This study mainly focuses on the more challenging secondary treatment method and also touches on tertiary treatments. However, after extensive literature survey, it was understood that all of the various secondary and tertiary treatment methods were not studied. We have highlighted the ones that have been studied, and we have analyzed those studies in our work.

Fig. 2
figure 2

Schematic of a conventional wastewater treatment system. This review mainly focuses on the more challenging secondary and tertiary treatment methods

Physicochemical treatment

Flocculation and coagulation

Flocculation and coagulation is the technique in which a chemical is used to form colloid of the pollutants in wastewater and make them either settle down or float on top (Hargreaves et al. 2018). This helps in easy removal of the contaminant. Flocculation is one of the most commonly used techniques in industrial wastewater treatment (Nair and Ahammed 2015). A schematic of coagulation and flocculation unit which is typically used as the first line of treatment process is given in Fig. 3. A treatment process should always be evaluated for its economic viability (Kumar et al. 2017a). For a newly proposed wastewater remediation technology, an economic evaluation involves usually the cost for removal of a certain amount of COD or BOD (Kumar et al. 2017a). If the new technology needs complete new establishment, it is seldom rejected by the authorities or policymakers. This should motivate researchers to establish new technology which requires very little or no investment of capital. Recently, keeping in mind these factors, Garde et al. (2017) proposed coagulation using Moringa oleifera seed extract as a coagulant to treat coffee processing wastewater as it promises a local and affordable technology. The technique saw the removal of TSS (8–54%) and total COD (1–25%). Although the removal is not at par with the scientific state of the art technology (Haaz et al. 2019), it has a huge advantage of not generating sludge as alum does, which require further treatment (Ndabigengesere and Narasiah 1998). Etiégni et al. (2011) studied electrocoagulation to treat coffee processing wastewater and achieved COD and BOD5 removal between 82.6% and 91.1%, 78.1% and 88%, respectively. The study showed that the effective reduction of power consumption is about 57% when electrocoagulation was combined with leachate from wood ash and coffee husk ash.

Fig. 3
figure 3

(Adopted from Teh et al. 2016; Mahmudabadi et al. 2018)

Schematic of coagulation and flocculation, which is the most common treatment process is widely used for coffee processing wastewater.

Advance oxidation process

The advanced oxidation process uses chemical oxidation or high-energy from ultraviolet (UV) radiation to completely mineralize toxic organic pollutants without generating any secondary by-products (Akpotu et al. 2019). Since chemical oxidation has very high COD degradation capability and the process is very fast, it was studied by other researchers. Teresa et al. (2007) in their work have coupled flocculation with advanced oxidation to achieve significant COD reduction from 67% (currently at the factory that supplied raw coffee processing wastewater, by using only flocculation and coagulation carried out by commercially available flocculant Ecofloc 6260 and coagulant, T-1) to approximately 85% when it was coupled with advanced oxidation processes in combination with (UV) with H2O2 or O3. It was concluded that the maximum COD removal of 87% was achieved when all three agents for advanced oxidation were used together. It can be debated about the necessity of further COD removal using all three oxidizing against the extra cost incurred while achieving this extra reduction. It was reported that oxidation using UV/H2O2/O3 requires a pH reduction from the natural pH of 4.5 of wastewater to pH 2.0 for best results, and the process took 2 h for maximum reported removal. Thus cost and complication incurred during pH change would also be a big hindrance to commercial acceptance of such process (Kumar et al. 2017c). Peralta et al. (2015) used rasing rings made of Al–Fe-pillared bentonite extrudates for catalytic oxidation of phenol present in the coffee processing wastewater. The performance of the new catalyst was tested in a semi-batch basket type reactor. After 96 h of operation, it achieved a 62.5% total phenol conversion. Even after eight test cycles of phenol oxidation, no iron leached out from the extrudate. This study also pointed out the low conversion of phenol in real coffee wastewater compared to synthetic phenol solution. This is mainly because of the complexity of the actual wastewater and indicates the need for testing every new technique with real wastewater (Kumar et al. 2017b). Another study by Novita (2016) uses instant coffee to simulate real coffee wastewater. Although the study shows a promising result, there might be some variation when the same process is applied to real wastewater due to the complexities involved. Thus, it is very important to test new technology in a pilot-scale with extremes of varying operating conditions to understand how robust the system is. Chagas et al. (2015) studied peroxide oxidation of phenolic compounds (Caffeic acid) in real coffee wastewater using chitosan beads prepared in which glutaraldehyde was used as a cross-linking agent to immobilize soya hull peroxide. The beads showed 50% caffeine oxidation potential even after four cycles of use under optimum condition of pH 6, in the temperature range of 40–60 °C, H202 dosage of 3 mmol L−1 and reaction time of 30 min. It was observed that the immobilized beads showed better phenolic acid removal because of both oxidation and adsorption onto the beads. Although the technique does fairly well in terms of the required reaction time, yet it is potential as a commercial process is unknown due to lack of economic evaluation and the complexity of preparing these chitosan beads on a commercial scale.

Fenton process was evaluated as a potential treatment technique for coffee processing wastewater by Kuma et al. (2012) where ferrous sulfate heptahydrate (FeSO4·7H2O) was used as a source of iron. It was observed that 0.2 g Fe2+ with 1.5 g H2O2, which accounts for 17% of the theoretical value, gives maximum COD removal of 84.93% at pH of 6.4, 25 rpm, and 60 min of reaction. The study demonstrates that a good reduction of COD achieved at conditions that are below the theoretical values. Under the mentioned operating condition, the removal efficiency of other contaminants as nitrate-nitrogen, phosphorus, ammonia nitrogen, and nitrate nitrogen is found to be 57.5%, 80%, and 90.75%, respectively. The results of this work show that this process can be potentially be used for coffee processing wastewater treatment. Schematic of the mechanism of the typical advanced oxidation process for coffee processing wastewater has been presented in Fig. 4.

Fig. 4
figure 4

(Adopted from Hartmann et al. 2010; Jiménez et al. 2019)

Schematic of ozone and Fenton treatment—the common advanced oxidation process used for the treatment of coffee processing wastewater.

Villanueva-Rodríguez et al. (2014) used Electrochemical Advanced Oxidation Process (EAOP) to reduce the organic load from coffee processing wastewater. The study compared four processes using boron-doped diamond electrodes—electro–Fenton, anodic oxidation, anodic oxidation with electrogenerated H2O2 and photo-electro–Fenton process. The processes were compared to the traditional technique and showed better color removal (89–93%) and total organic removal (73–84%) compared to very low values in Fenton (58 and 4.8%) and photo-Fenton processes (61 and 7%). The performance of the H202-anodic oxidation process was the best, while the electro-Fenton process was not so promising. A proper economic analysis was carried out and acceptable levels of Fe2+ (0.3 mmol L−1) and energy (0.082–0.098 kW h g−1 TOC) were required by the EAOP processes even after 4 h of operation suggesting the potential of using these techniques commercially for coffee wastewater treatment. The major problems associated with chemical processes are the cost of chemicals required for the treatment and the waste management of sludge generated (Kestioğlu et al. 2005). Electrooxidation is another common technique for agricultural wastewater treatment where charge assisted coagulation (electrocoagulation) is combined with charge assisted oxidation (electrooxidation) in the same cell to make the process more energy-efficient. Can et al. (2019) study the electrooxidation process for coffee processing wastewater treatment. They found that using boron-doped diamond cathodes gave best performance of 95% TOC and 97% COD removal. Although the removal efficiency is impressive, the high cost associated with the electrodes might hinder the application of such a technology in developing countries. However, there are studies (Ibarra-Taquez et al. 2017) which used low-cost electrodes (aluminum and graphite) to achieve 72% and 89% TOC and COD removal, respectively. This result again shows the importance of the electrode used and the electrodes needed for better performance are usually very expensive.

Adsorption

The aspect of sludge generation can be countered using adsorption, but the major problem associated with using adsorption for wastewater treatment is the high cost of commercially available adsorbents (Corwin and Summers 2010). However, the solution to this problem is well known and many researchers have used agro-based waste for the preparation of low-cost adsorbent using various plant wastes—water hyacinth (Kumar et al. 2017c), industrial waste—hog fuel ash (Bandyopadhyay and Choudhury 2018), animal-derived polysaccharide (Thirugnanasambandham et al. 2013) or even nanoengineered adsorbents (Song et al. 2017). Adsorption technique is more adaptable for large-scale operation due to high efficiency, simplicity (Dawood and Sen 2012) and ability to change quickly according to the condition of the effluent to be treated and ease of operation (Song et al. 2016). Devi et al. (2008) took this approach for the treatment of coffee wastewater where the avocado peel was carbonized for 12 h at 600 °C with H2SO4 as activating agent. Under optimum operating condition (pH 7, 70 min reaction time, 4 g per 100 ml activated carbon dose and agitation speed of 600 rpm) activated carbon prepared from avocado manifested COD and BOD reduction of 98.20% and 99.18%, respectively, while reduction using commercial activated carbon was 99.02% and 99.35% for COD and BOD. Applicability of the process for commercial use can be only considered if the process is evaluated for economic viability (Bilal et al. 2013) and a process to regenerate the spent adsorbent is proposed (O’Connell et al. 2008). It is also essential that an adsorbent is studied for its regeneration capabilities. However economical the generation of a bio adsorbent is, its full potential is only tested when it is used over and over in cycle through a process of adsorption and desorption. Thus, it is very essential to do desorption studies while reporting new adsorption in the literature.

Biological treatment processes

Although chemical processes are able to degrade much of the organic load at a reasonably faster rate yet the sludge generated in such processes is of concern (Yang et al. 2015). The solution to this is the biological treatment that breaks down the organic loads of the wastewater into fundamental constituents forms a sludge which does not contain any chemicals like those used for chemical oxidation (Borake and Choi 2014). This makes it possible for the generated sludge to be used as fertilizer (Cartes et al. 2018).

Wetlands

Wetlands offer a very simple and effective biological treatment solution in terms of cost-effectiveness and ease of operation (Terada. 2019). They employ aquatic plants, microorganisms, and crude filter beds to treat wastewater. Rossmann et al. (2013) studied the influence of aeration and vegetation while removing the organic load from coffee processing wastewater in wetlands. For the study, four combinations of aerated or non-aerated and rye-grass cultivated or uncultivated of wetlands were selected. It was concluded that cultivation and aeration did not play any role in the removal of organic matter but aeration prior to addition of effluent into the system resulted in the conversion of COD to BOD initiating faster organic removal. Aeration also played a role in the removal of other contaminants in the wastewater. Lowest average TSS, BOD and COD removal were 73%, 84% and 87%, respectively, for the cultivated non-aerated wetland. These figures demonstrate the potential of using this technique for coffee processing wastewater treatment.

Bioreactors

Bioreactors employ a much-controlled environment and usually only one type of microorganism. Fia et al. (2012) treated coffee processing wastewater in anaerobic fixed bed reactors and achieved COD removal of around 82%. Various types of support (polyurethane foams, blast furnace cinders and crushed stones) were used, and of them, the foam was found to be the most effective. A hydraulic reaction time (HRT) of 1.06 days was allowed under the organic loading rate (OLR) of 4.41 kg m−3 day−1. It was stipulated that the maximum removal of COD in foam was mostly due to the porosity which helped biomass to grow. This study indicates the importance of porosity in biomass growth which results in better contaminant removal from wastewater.

Selvamurugan et al. (2009) made an up-flow anaerobic hybrid reactor for the treatment of coffee processing wastewater which gave a dual advantage of both suspended and attached systems. Best performance of 61.0%, 66.0%, and 58.0% for COD, BOD and TSS removal was achieved at HRT of 18 h with OLR of 9.55 kg m−3 day−1. Dinsdale et al. (1997a) compared mesophilic and thermophilic bacteria at 35 °C and 55 °C, respectively, in a UASB reactor over 100 days for digestion of instant coffee wastewater which was collected from a Nestle instant coffee factory in the UK. Both the reactors operated at OLR of 10 kg COD m3 day−1 (24 h HRT), but the COD reduction of thermophilic was a bit lower (70%) compared to mesophilic (78%). Recently, Puebla et al. (2013) studied the performance of UASB reactor for the treatment of the same wastewater in a mesophilic temperature-controlled (37 ± 1 °C) single-stage condition for various HRT and OLR. The best performance of 77.2% COD removal was obtained at OLR of 3.6 kg COD m−3 day−1.

Although all the biological treatment methods show excellent potential, the major concern is that most studies were not evaluated for economic viability (Garrido-Baserba et al. 2018). Biological treatment is usually used as a secondary treatment coupled with a primary physicochemical treatment process; hence, it is necessary to do an economic evaluation of the integrated system and not just the biological degradation (Ioannou-Ttofa et al. 2017). While these techniques solve the problem of sludge with high chemical content (Bouju et al. 2016), the time required for these processes is of major concern (Grandclément et al. 2017). The only possible solution to this problem is to optimize the time required for the treatment process and sludge generation by making a combination process of biological and chemical process (Thill et al. 2016) because a coffee production is a seasonal event and this generates a huge amount of wastewater in a short period of time which demands treatment at a fast rate (Mozia et al. 2016). Future research must be carried out to design a treatment procedure which integrates best of present biological and physicochemical treatment processes while there should always be an attempt to make novel techniques like membranes which would meet the demand of economic viability, fast and easier management of coffee processing wastewater (Johir et al. 2016).

A summary of all different treatment processes reported in the literature has been listed in Table 4 with details of their removal efficiency and the removal conditions. The authors feel it is very important for research to focus on treatment of huge volume of wastewater whose volume varies seasonally. It is also important to note that the cost of such treatment scheme should be as low as possible. A study conducted (Marsolek et al. 2012) has shown that even though one of their treatment system designs failed to bring down contaminant level below discharge limit, the community in Nicaragua selected that because of a much lower capital cost compared to others. Thus, we can understand how important it is to design system that would cost less, because a community during implementation of new technology would tend to accept the one which is less expensive and requires less of new skills to operate or build, even at the expense of performance.

Table 4 Summary of various treatment methods studied for the treatment of coffee processing wastewater

Coffee processing wastewater as an energy source: potential and limitations

With the growing global demand for and improper distribution of energy resources, utilizing waste to generate energy has is of utmost importance in the present scenario (Shareefdeen et al. 2015). The two most common techniques currently deployed to utilize coffee processing wastewater are hydrogen production from wastewater (Pavlas and Touš. 2009) and biomethane production (Tucker 2014).

Bio-hydrogen from coffee processing wastewater

Currently, the hydrogen-producing source is natural gas, petroleum, coal gasification and a little proportion of it is prepared from the electrolysis of water (Dincer and Acar. 2015). The US department of energy estimates that by 2025, bio-hydrogen will be estimated 8–10% of the total energy market (Abraham 2002). It is thus very evident that the hunt for resources to generate bio-hydrogen is on and although any material with organic contents can be used as a source, wastewater has an advantage as handling wastewater is easier (although critical) and it has a high organic load. With varying reactor design of bio-hydrogen production unit, it has been observed that most of them work in the range of substrate concentration of 0.25–160 g COD L−1, temperature 23–60 °C, HRT 0.5–72 h and pH between 4 and 8 (Lin et al. 2012). Optimum temperature and pH of the bio-hydrogen production processes are usually around 35 °C and 5.5 (Shi et al. 2010). Although temperature, pH, HRT, organic load, yield are the major governing parameters, the choice of microbe becomes very critical while designing the process. The key factors include the efficiency of the microbe used along with its stability over a varied temperature, pH and organic load (Gadhe et al. 2013). The most promising microbes are the culture of Clostridium—Clostridium butyricum, Clostridium acetobutylicum, Clostridium acetobutyricum in converting an organic load of the wastewater into acetate, butyrate, hydrogen, carbon dioxide and organic solvents (Chong et al. 2009).

Coffee processing wastewater, having comparable properties to the effluents that have been explored providing promising results, should be further investigated for its potential for being a bio-hydrogen generator. Promising results have been shown by Jung et al. who worked extensively on fermentation of coffee wastewater to generate hydrogen (Jung et al. 2010, 2012). Jung et al. (2010) compared the potential of continuous hydrogen production using complete stirred tank reactor (CSTR) and UASB and found that the performance of the later was better due to higher concentration of biomass in the blanket zone which has an insufficient substrate for the lactic acid bacteria to survive. The major bacteria in UASB reactor were Clostridium sp and the following reactions were suggested to explain the production of bio-hydrogen in the reactor (Jung et al. 2010).

$${\text{C}}_{6} {\text{H}}_{12} {\text{O}}_{6} + 2{\text{H}}_{2} {\text{O}} \to {\text{CH}}_{3} {\text{COO}}^{ - } + 2{\text{CO}}_{2} + 4{\text{H}}_{2}$$
(1)
$${\text{C}}_{6} {\text{H}}_{12} {\text{O}}_{6} \to {\text{C}}_{4} {\text{H}}_{7} {\text{O}}_{2}^{ - } + 2{\text{CO}}_{2} + 2{\text{H}}_{2}$$
(2)
$$3 {\text{C}}_{6} {\text{H}}_{12} {\text{O}}_{6} \to 2{\text{C}}_{6} {\text{H}}_{11} {\text{O}}_{2}^{ - } + 6{\text{CO}}_{2} + 4{\text{H}}_{2} + 2{\text{H}}_{2} {\text{O}}$$
(3)

Out of the above three reactions, the caproate producing equation (Eq. 3) might be the bio-hydrogen producing step with a theoretical yield of (in UASB reactor) 1.33 mol H2 per mol glucose (Jung et al. 2010). The partial pressure of the reaction chamber was found to be lower than that of CO2 and this is evident from the Stoichiometry of the reaction given in Eq. 3. After getting sufficient evidence that the UASB reactor has better performance than CSTR, Jung et al. (2012) went on to construct a two-stage USAB reactor for bio-hydrogen production from coffee processing wastewater. This two-stage reactor resolved the issue of the long startup time of UASB reactor and using thermophilic bacteria at 55 °C. It got an H2 yield of 2.57 mol H2 per mol hexose added and a stable production rate of 4.24 l H2 L−1 h−1 with an HRT of 6 h (Jung et al. 2012). The overall process had a biomass conversion of 88.2% (having 15.2% H2) along with a COD removal of 98%, not only making it an effective bio-hydrogen production technique but also a system of wastewater treatment.

The major advantage of using hydrogen as a fuel is its eco-friendly behavior due to the absence of sulfur, carbon and nitrogen, eliminating the possibility of sulfur oxides and nitrogen oxides formed during its combustion. Hydrogen also has a high calorific value which interests many of its use as a fuel for many applications. Despite these advantages, any bio-based energy supply faces several criticisms. These processes being slower requires a lot of retention time manifesting in larger tank volumes which takes up a lot of land spaces. One can debate whether the land on which biohydrogen plant is installed, used for forest cover, would result in a greater reduction of carbon footprint. Socioeconomic concerns have also been raised on issues of whether this land could be used for food production. The regions where such bio-hydrogen production plants can potentially thrive are all in developing regions where it is very usual that the moral question of the need for fuel over food is raised. Other major concern for bio-hydrogen production is its storage. 2 g of hydrogen, at standard pressure and temperature, occupies approximately 22.4 l while having a calorific value of 13 J gm−1, while conventional fuels have a larger energy density thus making it comparatively difficult in transportation and storage, not only for space but for its explosive nature. This problem might be overcome by storing hydrogen in some compound form like ammonia and later dissociating it into hydrogen and nitrogen during use. Gas hydrates might also be another option for safe and compact storage of hydrogen.

Biogas and methane production from coffee wastewater

Coffee is grown usually grown and processed in developing countries where there is a considerable shortage of electricity and power. The wastewater generated from the processing of coffee can act as a source to generate biogas, a mixture of CH4 and CO2 and trace of H2 (Lu et al. 2016). There have been few studies showing the possibilities of CH4 production from coffee wastewater.

One of the first few studies includes the work of Dinsdale et al. (1997a) where they compared the CH4 production in the thermophilic and mesophilic reactor at 55 °C and 35 °C, respectively. Their study suggested CH4 yield of 0.29 and 0.2732 m3 per kg COD removed for mesophilic and thermophilic reactors, respectively, and these values were less than the theoretical value of 0.35 m3 per kg COD removed. In their later work, Dinsdale et al. (1997b) use UASB reactor for thermophilic and mesophilic digestion of coffee processing wastewater. The produced biogas contained by volume 71–79% CH4 and 73–75% CH4 in case of two stages thermophilic and mesophilic system. Lower CH4 concentration (59–64%) was seen in single stage UASB reactor. CH4 yield was 0.3 m3 and 0.3–0.32 m3 per kg COD removed for thermophilic and mesophilic reactor, respectively, under optimum condition. Both the results were very close to the theoretical yield. Both the studies suggested mesophilic reactor and this kind of reactor is also economical considering no heat is required as they operate to close to 35 °C.

In recent times, Selvamurugan et al. (2010) in their work have developed an integrated treatment method for the wastewater through methanation with aeration and wetland plant treatment. Using an up-flow anaerobic hybrid reactor, they achieved a biogas production of 2.62 L per day (having 60.7% CH4) with a hydraulic retention time of 18 h. Improvement of quality of robusta coffee bean is achieved by minimization of water use in the wet processing. This practice although increases the organic load in the generated wastewater, but makes it suitable for its use for anaerobic processing (Novita 2016). Jung et al. (2012) studied mesophilic UASB reactor at 35 °C for the potential of biogas generation and achieved a maximum yield of 325 mL CH4 per gm of COD removed with 88.2% biogas conversion with biogas containing 73% CH4. In most of the studies, the major drawback was the long startup time of the UASB reactor which was overcome by a unique way by Jung et al. (2012). They followed an operation strategy of using a complete stirred tank reactor (CSTR) for 8 days to prepare the seed which was later transferred to the UASB reactor.

The theoretical biogas production potential of wastewater is related to the amount of discharge and the COD removed in the process. It is given by (Tchobanoglous et al. 2003)

$$Q_{m} = Q \times \left( {{\text{ST}}_{0} - {\text{ST}}_{e} } \right) \times M = Q \times E \times M \times {\text{ST}}_{0}$$
(4)

where Qm is the quantity of CH4 produced per unit time; Q is the flow rate of the incoming effluent; ST0 is the total COD in the incoming (untreated) effluent; STe is the total outgoing (treated) effluent COD; E is an efficiency factor (dimensionless, varying between 0 and 1) and M is the volume of methane (CH4) produced per unit of COD. Beyene et al. (2014) in their work estimated that coffee processing wastewater has a yield of 0.4 m3 CH4 per kg COD for anaerobic digestion in the temperature range 30–40 °C. The study also suggested that by anaerobic digestion of the wastewater, under optimum condition, the carbon conversion efficiencies were somewhere between 75–85%. In their system, after 50 days of retention time, a maximum possible extraction of 10 million kJ per day (Beyene et al. 2014). This study also suggested the sludge generated from the digester can also be used as fertilizer. It was reported that the accessible NH4-N in the anaerobic digester is 25% more compared to untreated liquid waste (Beyene et al. 2014). Droste and Gher (1997) state that a typical anaerobic digester yields 0.08 g VSS (volatile suspended solid) per gram of COD and at a decay coefficient of 0.03 g VSS d−1 within a temperature range of 30–40 °C. This makes it possible for coffee processing wastewater to be a reliable source of fertilizer.

The commercial success of biogas generation from coffee processing wastewater was also reported. Tucker (2014) reports The Energy from Coffee Wastewater project, which began in 2010, where 8, 10 and 1 coffee wastewater treatment plant was installed in Nicaragua, Honduras and Guatemala, respectively. At one of the pilot plants at Nicaragua, 200,000 kW power was generated from biogas generated from coffee wastewater and savings of $ 40,000 were made annually (Tucker 2014). Although there has been commercial success, research must be undertaken to determine the best operating condition for methane production while more pilot plant testing should be undertaken to use coffee processing wastewater to its maximum potential (having yield closer to the theoretical value) to solve the energy problem in the developing parts of the world where coffee processing usually takes place.

Electricity using microbial fuel cell from coffee processing wastewater

Microbial fuel cells (MFC) is one promising technique for energy generation from wastewater that should be explored at the coffee processing sites. The simplest MFC deploys a proton exchange membrane diving the whole cell into two chambers where the electron acceptor is separated from the microbes that oxidize the organic to generate electrons through anaerobic oxidation of organic matter producing CO2 as a by-product. The electrons generated are passed to the respiratory enzymes found on the inside of the inner cell membrane, and this process must be mediated artificially by the high humic acid concentration of neutral red or anthraquinone—2,6-disulfonate (Liu et al. 2004). However, studies have detected several microbes—Shewanella putrefaciens (Kim et al. 1999), Geobacter sulfurreducens (Pham et al. 2003), Geobacter metallireducens (Bond et al. 2002) and Rhodoferax ferrireducens (Choudhuri and Lovely. 2003), which do not require any media in the MFC to generate electricity. The generated protons move to the cathode via the proton exchange membrane where it combines with oxygen to form water. The general equation governing the electricity generation in MFC is given as follows (Du et al. 2007).

Anodic reaction:

$${\text{CH}}_{3} {\text{COO}}^{ - } + 2{\text{H}}_{2} {\text{O}} \to 2{\text{CO}}_{2} + 7{\text{H}}^{ + } + 8e^{ - } { }$$
(5)

Cathodic reaction:

$${\text{O}}_{2} + 4e^{ - } + 4{\text{H}}^{ + } \to 2{\text{H}}_{2} {\text{O}}$$
(6)

The operation of a typical MFC is shown in Fig. 5. Although coffee processing wastewater has not been studied much for its potential for electricity generation in MFCs, its characteristics are similar to other wastewaters that have been utilized in MFC. Nam et al. (2010) studied the generation of electricity using coffee processing wastewater in a continuous operating single-chamber MFC with granulated carbon as anode and achieved a power density of 1884 mW m−3. With the increase in organic loading, this went up to a maximum of 2981 mW m−3.

Fig. 5
figure 5

(Adopted from Breheny et al. 2019)

Representation of a possible way of using coke oven wastewater to generate electricity.

Although an eco-friendly process, MFC is not used commercially extensively due to its low energy of several thousand mW m−3. There have also been debates about the net carbon footprint of the process as MFC releases CO2 from the anode and takes up atmospheric oxygen. Although the net carbon footprint of the process is not negative, still the process is literally a zero-carbon emission system as the CO2 released into the atmosphere originally was drawn from the atmosphere via photosynthesis (Du et al. 2007). Another advantage of the process is that the system uses wastewater as a raw source of organic load and lowers down the organic load to such a limit that the wastewater attains disposable limits.

To make MFCs more commercially applicable, there are several areas where there must be positive technology development. The very first step to make the process more sustainable is by developing better and cheaper proton exchange membrane. Efforts should be put into modifying bacterial culture through recombinant DNA technology such that new modified strains can sustain fluctuation within the MFC and show higher electron production capability without the requirement of any mediators. Studies can also be carried out to see the potential of a mixed culture of bacterium which forms a synergic relationship with each other to provide better performance. In terms of electrodes, research must be done to manufacture electrodes that are resistance to fouling. Although due to the low microbial conversion of organic load, MFC can never realistically compete with chemical fuel cells, but MFCs should be consider for their potential of using wastewater as raw material and in turn laying a possibility of efficient wastewater treatment with positive economic impact.

Future prospects

In the midst of the global climate crisis and growing legislative stronghold on pollution and carbon emission and the possibility of a hefty carbon tax, the future of coffee processing industry depends on how well the industry can transform itself into a carbon–neutral self-sustaining operational unit. To achieve this, the industry must look for values in the waste that it generates—starting from wastewater to other solid wastes it generates. The need of the hour demands more than just efficient ways to treat the wastewater, rather find ways to generate value-added products from it. It is an integrated process that encompasses wastewater treatment along with its valorization will show the path into the future for these industries. The possibility of using coffee processing wastewater as a raw material for energy production (bio-hydrogen and methane) has already been explored by many researchers (Beyene et al. 2014). While some research takes into consideration on increasing the productivity of energy extraction using coffee processing wastewater as raw material, other studies (Etiégni et al. 2011) focus only on efficient treatment of wastewater generated so that they can be discharged with nutrition loads well within the limit set by the local legislature. A combination of both where operating parameters of both the processes are optimized would be more futuristic and would address the bigger problem of self-sustainability. Keeping this in mind, the authors propose a scheme of action pertaining to the wastewater generated by the coffee processing industry that might enlighten future research on ways to make a coffee processing industry self-sufficient (Fig. 6). The idea is to first treat the coffee processing wastewater using solid waste generated by the coffee processing or using spend coffee beans (Jutakridsada et al. 2016) so that the COD value of the wastewater comes down so that it can be easily used in the microbial fuel cell for hydrogen production. The hydrogen with a caloric value 150 kJ g−1 (highest among all fuels) can be readily used for heating up the coffee roasting oven in the plant. This scheme shows the possibility of making a sustainable coffee processing plant in the future. After incurring initial implementation costs, a production unit would, in turn, save money in the long term by not using energy from outside sources and possibly at some point produce surplus energy so that it can be sold in the market. Concept of waste to waste treatment have been implemented on the scheme by using solid wastes generated in the coffee processing process or the spent coffee grounds (Cherdchoo et al. 2019), and coffee husk (Murthy et al. 2019) can be used as an adsorbent to treat the coffee processing wastewater after slight chemical activation. These changes can be implemented with investigative studies on such integrated schemes. However, it is important to note that this scheme has been proposed after reviewing the very limited literature available on abatement of coffee processing wastewater. Thus much of the generalization has been made based on limited data available to us and some of the ideas have been extrapolated from lessons learned from other wastewater treatment (Kumar et al. 2016a). It is also important to note that such a treatment scheme is accessed for Life Cycle Assessment (LCA). An LCA analysis would give the exact value in terms of years after this proposed scheme would achieve breakeven for the initial capital investment (Rocha et al. 2014).

Fig. 6
figure 6

Proposed scheme which converts coffee production into not only a green industry with zero discharge and energy-neutral but in the long run would make the wastewater treatment revenue-generating process

Other futuristic valorization technologies involve complex metabolic molecular engineering to produce microorganisms (bacteria and algae) that break down lignin present in the wastewater into glucose so that they can be utilized to make a variety of valuable products including bioethanol (Ravindran and Jaiswal. 2016). Other techniques that involve the use of photo-catalysis by Cu/TiO2 to directly breakdown organic matter in the coffee pulp can be extended to coffee processing wastewater with slight modification (Carro et al. 2014). It is thus evident that coffee processing wastewater can be used in a variety of different ways to generate not only biogas, hydrogen and electricity, but technologies that have proven applications in other organic wastes can also be extended for its application for valorization and subsequent treatment of coffee processing wastewater.

While we invest capital in developing waste to energy technologies to make the coffee processing more sustainable and waste to waste treatment process to provide wastewater treatment solutions from within the same industry, it is also essential to find measures to make the coffee processing industry water neutral. To do this, attempts can be made to use membrane system to recover clean water from the effluent and feed it back to the system. Since we have not many studies in this regards, technologies that have been suggested for effective treatment of coffee product processing wastewater can also be tried out for the treatment of coffee processing wastewater because of the similar nature of the effluent in terms of constituents (however, the quantity may vary). Wisniewski et al. (2018) used nanofiltration (NF) and reverse osmosis (RO) membrane in vibratory module. The vibration reduced the obvious problem of membrane fouling and increased flux up to 4.6 times and 1.6 times in NF and RO membrane. The steady-state flux was 150 l m−2 h−1 and 45 l m−2 h−1 for NF and RO membrane (under 2400 kPa transmembrane pressure), while the membranes maintained rejection of both turbidity and COD. Thus learning from other wastewater treatment and extrapolating it to the coffee processing industry may hold a key to solve many problems.

Conclusion

Treating wastewater is very challenging due to its complex constituents which interact differently with various adsorbents and biological systems, and these interactions vary with varying physicochemical parameters. For agricultural wastewater, the challenge doubles as the wastewater’s constituent vary with season and with variation of geographic location. Further, the aim of having a wastewater treatment system simple and efficient as well as economical makes designing of new strategies very difficult. To deal with these, the concept of waste-to-wealth and waste-to-waste treatment is very crucial. With the demands presented, a treatment process can only survive if it provides any cost-beneficial output in terms of energy or value-added product. The main aim of this literature review was to provide pathways to integrate wastewater treatment with energy generation so as to drive new researches in the future where a holistic treatment scheme would be given importance. An example scheme of the process has been presented which intends to make the coffee processing industry sustainable with energy and water neutral at its core. Since coffee processing units are mostly located in the developing countries, it has been also taken into account to make such scheme not only more economical but profit-making in the long run. As these conclusions are put forward from the challenges present and existing technological solutions to these, a huge role is to be played by policymakers to make new laws that make it feasible for these coffee mills to accept new technology to mitigate their net effect on the environment. To make such changes long-lasting, a basic scheme of funding by the corporates who benefits from these coffee mills has to be set up. While funds would drive the technological changes toward water–energy-neutral coffee mills, a part of these should also be diverted toward fundamental research on new effluent remediation methods with treatment of coffee processing wastewater as its goal. Along with these changes, stringent discharge limitation with occasional testing of effluent by a third party would keep check of impacts that the industry has on the environment. The authors believe that for a technology to be implemented at ground level, policymaking and awareness are very critical and often plays more important role than inventing the technology itself.