Introduction

In recent years, the rapid growth of the dairy industry has presented significant challenges in dairy wastewater management. High biological putrescible components can be found in dairy effluent. Every liter of processed milk produces between 0.2 and 10 L of waste. Additionally, around 2% of the total dairy production is disposed of in drains (Shete, B & Shinkar 2013). Biochemical Oxygen Demand (BOD) levels in dairy wastewaters usually range from 0.8 to 2.5 kilos per ton of milk. The levels of Chemical Oxygen Demand (COD) are approximately 1.5 times higher than BOD, while the levels of Total Suspended Solids (TSS) range from 100 to 1000 mg/L (Sivakumar & Sekaran, 2015). A significant portion of dairy wastewater primarily comes from cleaning and washing operations in dairy plants. Dairy plants mainly produce milk, cheese, yogurt, and other milk products. Milk whey is a liquid by-product generated in the cheese-making process. The composition of whey consists mainly of proteins, soluble vitamins, lipids, carbohydrates, and minerals. Additionally, around 75% of the solid components of whey are made up of lactose. Many studies have found that dumping milk whey into lakes and rivers causes significant pollution due to the high nitrogen, phosphorus, COD (200–50,000 mg/L), and BOD (100–20,000 mg/L) contents present in that waste (De Jesus et al., 2015). Wastewater of such level of composition is a serious threat to the ecosystem and public health. Therefore, effective treatment methods are essential to mitigate the environmental impact of dairy wastewater discharge (Raghunath et al., 2016). Study indicates that dairy effluents undergo treatment using several kinds of methods, including spreading, biological, and physicochemical procedures. Nevertheless, these approaches suffer from many limitations, such as limited effectiveness, high treatment expenses, and the risk of secondary chemical contamination (Porwal et al., 2015; S. Tchamango et al., 2010). Due to the shortcomings of conventional technologies and the growing environmental guidelines on the discharge of untreated wastewater, environmentally conscious methods were investigated by researchers, and electrocoagulation garnered much interest. This approach has certain advantages over conventional methods, which include less complicated equipment, simpler operation, shorter retention times, minimal or no chemical usage, quick settling of the electrogenerated flocs, and reduced sludge generation (S. Tchamango et al., 2010; S. R. Tchamango et al., 2021).

Among the various physicochemical wastewater treatment techniques, electrocoagulation (EC) technology has emerged as a promising approach for addressing the treatment challenges associated with dairy wastewater (Aitbara et al., 2021; Aiyd Jasim & AlJaberi, 2023; AlJaberi et al., 2022; Reilly et al., 2019). By applying an electrical current to electrodes immersed in the wastewater, EC induces coagulation and flocculation reactions, removing suspended solids, organic compounds, nutrients, and pathogens (Ankoliya et al., 2023). This electrochemical method offers several advantages for dairy wastewater treatment, including its ability to operate over a wide range of pH levels and its potential to reduce or eliminate the need for chemical additives, thereby minimizing sludge generation and environmental impact (AlJaberi, 2022; AlJaberi et al., 2023). EC stands out as a particularly efficient method compared to alternative electrochemical methods. For instance, electrooxidation (EO) offers rapid pollutant degradation but may require additional chemicals and expensive electrode materials (AlJaberi et al., 2023). Electrocoagulation-filtration (ECF) combines EC with filtration processes to enhance pollutant removal efficiency, although it may introduce operational complexity (AlJaberi, 2023). Additionally, electrochemical advanced oxidation processes (EAOPs), such as electro-Fenton and electro-peroxide, effectively remove organic contaminants but may involve higher energy consumption and the generation of potentially harmful by-products (AlJaberi et al., 2023). EC involves the application of an electric current to an electrolytic cell containing metal electrodes, typically aluminum or iron (Krishna B et al. 2022; Noudeh et al., 2023; Varank & Sabuncu, 2015). The process induces electrochemical reactions, resulting in the generation of coagulants that facilitate the removal of contaminants from the wastewater. Several essential electrochemical reactions and equations can describe the EC process (Vidya Vijay et al., 2019).

$$Anode:AI_{\left(s\right)}\rightarrow AI^3+3e^-$$
(1)
$$Cathode:3H_2O+3e^-\rightarrow\frac32H_{2\left(g\right)}+3OH^-$$
(2)
$$AI^3+H_2O\rightarrow AI{\left(OH\right)}_3+3H^+$$
(3)

At the electrodes, the aluminum and hydroxide ions can react to generate the monomeric and polymeric species Al(OH)2+, Al(OH)2+, Al2(OH)24+, Al6(OH)153+, Al7(OH)174+, Al8(OH)204+, Al13(OH)345+, and Al13O4(OH)247+, which are ultimately converted into Al(OH)3 (Graça et al., 2019; Kobya et al., 2003; S. Tchamango et al., 2010; Yilmaz et al., 2007). The surface area of the newly formed Al(OH)3 floc(amorphous) is large, helping to adsorb soluble organic compounds and also helps to confine particles that are colloidal in nature (Vidya Vijay et al., 2019). Thus, electrocoagulation is a promising approach for treating dairy wastewater due to its effectiveness in removing contaminants such as colloidal particles, dissolved organic matter, nutrients, and heavy metals (Boinpally et al., 2023). Optimizing operational parameters like applied voltage, electrolysis time, type of electrode material, and initial concentration of pollutant is crucial for maximizing the efficiency. Among various optimization techniques, efforts have focused on enhancing the electrocoagulation process through experimental investigations and mathematical modeling, employing methods such as response surface methodology (RSM) and the Taguchi method. RSM is commonly employed to identify optimal operating conditions by exploring multiple variables’ interactive effects and minimizing trial-and-error experimentation (Chezeau et al., 2020). By adopting the response surface methodology (RSM), it is possible to identify the critical factors that impact treatment efficiency and construct predictive models to enhance the optimization of process parameters. Optimizing the process parameters can lead to increased energy efficiency, improved operational performance, and the development of cost-effective techniques that dairy industries can widely use (Abdulgader et al., 2020; Djimtoingar et al., 2022). Similarly, the Taguchi method is a statistical quality control technique used in water treatment to optimize process conditions for desired outcomes, such as water purity and efficiency. It involves conducting experiments with different variables and measuring their effects on the process output. Using Taguchi methods, water treatment plants can identify the most significant factors affecting their processes and make informed decisions to improve their operations (Kozik et al., 2019).

In this study, we conducted a comprehensive investigation into the effects of critical operating parameters, such as electrolysis time, applied voltage, and electrode distance, on the removal of pollutants, including BOD, COD, and nitrate in dairy wastewater treatment using electrocoagulation processes. Additionally, comparative studies were conducted on the effectiveness of the response surface methodology (RSM) and the Taguchi method in optimizing these parameters and enhancing treatment efficiency. This study proposes a novel approach to enhance the efficiency of electrocoagulation (EC) for dairy wastewater treatment by optimizing process parameters using RSM and the Taguchi method, alongside utilizing an aluminum electrode configuration. The current study aims to achieve maximum BOD, COD, and nitrate removal compared to traditional methods, addressing pressing environmental concerns and advancing sustainable wastewater treatment practices. Fig. 1

Fig. 1
figure 1

The schematic and laboratory setup of the EC unit

Materials and methodology

The dairy wastewater used in this experiment was taken from the local dairy factory in Dharwad City (Karnataka State) in India (Table 1). Samples were collected in plastic bottles, shipped cold, and kept at 4 °C before use.

Table 1 Characterization of dairy wastewater

Experimental setup

In this study, EC with aluminum electrodes was used for the treatment of dairy wastewater (Fig. 2). Dimensions of the EC cell were 20 cm (L), 20 cm (B), and 30 cm (H), with a maximum capacity of 10 L in total volume. The area of Al electrodes is 20 cm × 15 cm with a thickness of 1 mm. An input power supply of 220 V with a variable output of 0 to 25 V with a maximum current of 5 A was used as a direct current source. The experiment was carried out in batch mode. The connection between the electrodes was a Monopolar Parallel (MP-P) connection. A magnetic stirrer bar was placed inside an electrocoagulation cell to obtain a uniform sample concentration with a speed of 200 rpm (Wang et al., 2021). The experiments were carried out with varying voltages from 5 V, 15 V, and 25 V for the duration of the experiment from 30 m, 60 m, and 90 m. The electrode distance was also varied by 1 cm, 1.5 cm, and 2 cm. To ascertain the efficacy of the treatment, periodic samples were obtained from the reactor during electrocoagulation. After each experiment, the EC unit was rinsed twice with a 50% (v/v) solution of nitric acid for a few minutes, followed by multiple rinses with deionized water. The experiments were all conducted at room temperature.

Fig. 2
figure 2

Graph showing the effects of voltage vs time (a and b) at 1.5-cm interelectrode distance and voltage vs IED (c and d) at 90-min duration for BOD and COD removal

The removal efficiencies (R %) were calculated according to the following equation.

$$\%\;Removal=\frac{C_0-C}{C_0}\times100\\$$
(4)

The values C0 and C represent the pollutant concentrations before and after EC treatment.

Analytical procedure

The efficiency of the electrocoagulation process for Al electrodes was examined by conducting the BOD, COD, and nitrate tests following the reference book “Standard Methods for the Examination of Water and Wastewater” of 24th edition (APHA, 2023).

Data analysis and experiment design using the response surface methodology (RSM)

Response surface methodology (RSM) indeed provides a structured approach to understanding complex processes influenced by multiple factors. By modeling the relationship between input variables (independent variables) and the output (response), RSM helps optimize processes to achieve desirable outcomes (Aydar, 2018; Bayuo et al., 2022). The dependent variables, referred to as responses, are the variables that we seek to optimize. On the other hand, the independent variables are the factors that have an influence on these responses (Lamidi et al., 2023). The RSM evaluates a suitable approximation connection between input and output variables to discover the optimal operating conditions for a system under examination or a region of the factor field that satisfies the operational criteria (Lamidi et al., 2023). The two basic experimental designs utilized in response surface methods are central composite designs (CCD) and Box-Behnken designs (BBD) (Bhattacharya, 2021; Goren et al., 2022). In recent years, optimization studies have also used central composite rotatable design (CCRD) and face central composite design (FCCD) (Alireza et al., 2013). In optimizing electrocoagulation for dairy wastewater treatment, where efficiency and thorough exploratory analysis are paramount, the Box-Behnken Design (BBD) stands out as the preferred choice. Its versatility allows for the simultaneous investigation of multiple factors with relatively few experimental runs, making it efficient in resource utilization. Additionally, BBD is well suited for robustness testing, ensuring the reliability and repeatability of the obtained results. These attributes make BBD an ideal option for exploring and optimizing the complex interplay of parameters in electrocoagulation processes, ultimately leading to enhanced treatment efficiency and performance (Aiyd Jasim & AlJaberi, 2023; Anuf et al., 2022).

The Box-Behnken design (BBD) was used to determine the optimum EC conditions. The overall design included 15 runs, which were carried out at random. The independent variables in this study were voltage, electrolysis time, and interelectrode distance (IED). The responses included BOD, COD, and nitrate removal efficiency. The results were modeled, and then, the optimal points for the operation were determined. The experiments were designed using Design Expert software version 13.0 (Song et al., 2022).

The optimal high and low ranges for voltage (5 V and 25 V), time (30 and 90 min), and IED (1 and 2 cm) were chosen based on certain pretests, as shown in Table 2. The optimum conditions were predicted using the quadratic polynomial equation.

$$Z=\beta_0+\sum_{b=1}^k\beta_bx_b+\sum_{b=1}^k\beta_{bb}x_b^2+{\sum_a^k\sum_{< j=2}^k}\beta_{ab}x_ax_b+e$$
(5)

where Z is the chosen response; β0 is the model intercept coefficient; xa, and xb are variables (a and b have values ranging from 1 to k); βa, βb, and βab are the interaction coefficients of linear, quadratic, and second-order terms; k is the number of independent parameters; and e is the error. ANOVA was used to evaluate the effectiveness of the created model. The statistical significance of the generated model was evaluated using the Fisher F-test, and model terms were evaluated using the confidence level associated with the probability value of 95% (Varank & Sabuncu, 2015).

Table 2 Experimental variables range and levels for the EC process

Taguchi methods

The Taguchi optimization method is widely recognized as a robust and effective approach for designing systems that exhibit high levels of quality. This approach has the advantage of conducting smaller-scale tests that are more cost-effective and show a greater likelihood of reproducibility. Furthermore, it proves to be advantageous when examining the interplay of variables. In contrast to the standard methodology of testing, this strategy significantly decreases the quantity of experimental trials. The technique has been extensively employed in engineering analysis for the purposes of system analysis, parameter design, and tolerance design (Kozik et al., 2019).

The system design process encompasses the utilization of scientific and engineering expertise necessary for the production of the system design process encompasses the utilization of scientific and engineering expertise necessary for producing manufacturing processes. This framework employs parameters design to identify the most favorable configurations and operational values that enhance the performance attributes. Additionally, tolerance design involves identifying and analyzing acceptable deviations within the recommended optimal settings determined by parameter design.

Taguchi’s parameter design methodology involves implementing a series of orthogonal arrays (OA) selected based on the specific research objectives (Ghosh, 2019). Taguchi suggests employing the signal-to-noise (S/N) ratio to evaluate qualities that fall within the nominal-the-better (NB), larger-the-better (LB), and smaller-the-better (SB) objectives (Pervez et al., 2018). The signal-to-noise ratios (S/N ratios) provide each experiment’s mean performance characteristic value. Equations (6)–(7) below depict the three distinct signal-to-noise ratios associated with n experiments.

The NB cases (target value):

$$\mathrm S/{\mathrm N}_{\mathrm{NB}}=-10\log\left[\frac1{\mathrm n}\sum_{\mathrm i=1}^{\mathrm n}\left({\mathrm y}_{\mathrm i}=\mathrm m\right)^2\right]$$
(6)

The LB cases (maximization):

$$S/N_{LB}=-10\log\left[\frac1n\sum_{i=1}^n\frac1{y_i^2}\right]$$
(7)

The smaller-the better cases (minimization):

$$S/N_{SB}=-10\log\left[\frac1n\sum_{i=1}^ny_i^2\right]$$
(8)

where “m” indicates a target value for the number of NB cases. “yi” denotes the data obtained from experiments, while “n” represents the number of experimental runs. Regardless of the specific category of performance characteristics, a higher signal-to-noise ratio (S/N) indicates superior performance characteristics. Hence, the level of process parameters that yields the best signal-to-noise ratio is considered to be the optimal value (Sylajakumari et al., 2018).

The factors and their respective values for the study are presented in Table 3. The experimental runs, conducted using Minitab Statistical Software (Version 21.4.1), were structured using an L9 orthogonal array comprising 9 distinct runs. Utilizing the L9 Taguchi design methodology, operational parameters of the electrocoagulation process were optimized to enhance its efficiency in removing pollutants. To ensure accuracy and reliability, findings from batch experiments were analyzed using a larger signal-to-noise (S/N) ratio. For instance, while a full factorial experimental design would require 27 experiments to evaluate all possible combinations of three factors set to three different levels, employing the Taguchi L9 Orthogonal Array (L9 OA) reduces the number of experiments to 9, significantly saving time and enhancing efficiency in the optimization process (Lee & Yang, 2022). Figs. 2, 3, and 4

Table 3 Factors/variables and values for EC studies at specific levels for Taguchi method
Fig. 3
figure 3

Graph showing the effects of voltage vs time (a) at 1.5-cm interelectrode distance and voltage vs IED (b) at 90-min duration for nitrate removal

Fig. 4
figure 4

The graph describes actual values to predicted values for a BOD, b COD, and c nitrate

Estimation of operational costs for treatment unit

For field operations, determining operational costs involves considering various factors such as construction, maintenance, labor, sludge handling, power consumption, materials, and chemicals. Conversely, laboratory-scale units focus mainly on estimating the expenses related to consumed power, materials, and chemicals [40].

$$\mathrm{Operating}\;\mathrm{cost}={\mathrm\gamma}_{\mathrm{electrodes}}\times{\mathrm Q}_{\mathrm{electrode}}+{\mathrm\gamma}_{\mathrm{power}}\times{\mathrm Q}_{\mathrm{power}}$$
(9)

Here, γelectrodes denotes the cost of electrode material, Qelectrode represents the weight of consumed electrode material(kg of Al /m3), γpower refers to the cost of power, and Qpower indicates the power consumption (AlJaberi, 2022; Hashim et al., 2020).

$${\mathrm Q}_{\mathrm{electrode}}\left(\mathrm{kg}/\mathrm m^3\right)=\frac{\mathrm I\times\mathrm t\times\mathrm M}{\mathrm Z\times\mathrm F\times\mathrm Vol.}$$
(10)

where I is the electrical current (in amperes), t is the treatment time (in seconds), M is the molecular weight of the electrode material (26.98 g/mol for aluminum), Z is the number of electrons in the electrode material (3 for aluminum), F is Faraday’s constant (96,487 C/mol), and Vol. indicates the volume of water (in m3) (Sadik, 2019).

$${\mathrm Q}_{\mathrm {power}}\left(\mathrm {kWh}/\mathrm m^3\right)=\frac{\mathrm I\times\mathrm V\times{\mathrm t}_{\mathrm e}}{\mathrm{Vol.}}$$
(11)

Here, V stands for the potential (in volts), te represents the electrolysis time (in hours), and Vol. indicates the volume of water (in m3) (AlJaberi, 2022; Hashim et al., 2020).

Results and discussion

The results were obtained as per the experimental procedures mentioned above using the electrocoagulation (EC) process. The interaction between three independent variables was studied for dairy wastewater by conducting experiments for responses using both response surface methodology (RSM) and the Taguchi method, as illustrated below. Tables 4, 5, 6 and 7

Table 4 Experimental parameters and experimental and predicted values of the responses to the DWW treatment by the EC process
Table 5 ANOVA results and fit statistics for the quadratic model using RSM
Table 6 The statistical regression equation obtained from the analysis by RSM
Table 7 Experimental variables, levels, and results from L9 experiments

Effect of the applied voltage

Voltage is an important determinant of coagulation efficiency in the EC process, and it can effectively eliminate contaminants from effluents (Bazrafshan et al., 2013). Higher electrocoagulation voltages enhance coagulation rates and improve contaminant removal by forming coagulants such as metal hydroxide flocs, which help remove suspended particles, organic matter, and other pollutants (Alam et al., 2021). The study used Al-Al electrodes at 5 V, 15 V, and 25 V to assess the effects of voltage and the operating time of 30, 60, and 90 min in the EC process. As the voltage increased from 5 to 25 V during electrolysis, (OH)n was observed to be formed, which directly targets flocs growth and charge neutralization during electrolysis (Ansari et al., 2022). The results show that with an increase in applied voltage, the removal efficiency increased from 55.03 to 83.47% for BOD, 57.55 to 84.37% for COD, and 52.8 to 79.28% for nitrate characteristics, as shown in Table 4. The findings of the Taguchi analysis revealed comparable outcomes, wherein the removal effectiveness for BOD, COD, and nitrate exhibited an increase in voltage from 5 to 25 V, as illustrated in Table 8. According to Srivastava et al. (2011), it has been suggested that an increase in the efficiency of aluminum ion generation on the anode leads to a corresponding rise in floc production inside the solution, thus increasing the efficiency of pollutant removal. The examination of the delta ranking approach, as depicted in the aforementioned tables, indicates that voltage substantially influences the reduction of BOD and COD following the implementation of the IED. Furthermore, voltage is crucial in achieving the highest percentage of nitrates removal. The signal-to-noise (S/N) ratios for BOD range from 35.86 to 37.63, for COD range from 36.09 to 37.58, and for nitrate range from 35.72 to 37.38(Table 9, Figs. 5, 6, and 7).

Table 8 Response table for signal-to-noise ratios and means
Table 9 Analysis of variance for responses
Fig. 5
figure 5

Main effects plot for S/N ratios of BOD

Fig. 6
figure 6

Main effects plot for S/N ratios of COD

Fig. 7
figure 7

Main effects plot for S/N ratios of nitrate

Effect of time on EC treatment process

Time is a critical factor in the EC process during dairy wastewater treatment. The efficacy of the EC process depends largely on the length of time it takes for the metal ions to dissolve, leading to the formation of metal hydroxide species at the electrodes (Bote, 2021; Bote & Desta, 2022). According to the results, with an increase in the electrolysis reaction time from 30 to 90 min, the removal efficiency of BOD, COD, and nitrate parameters increases significantly, which may be due to an abundant discharge of coagulation metallic ions, such as Al3+ and H2 gases generated at the anode and cathode to destabilize the colloidal particles in the form of bubbles, in accordance with Faraday’s Law (Biswas & Goel, 2022; Bote & Desta, 2022; Rakhmania et al., 2022). As a result, more flocs are formed, which raises the adsorption strength throughout the electrolysis time, resulting in a rise in the removal efficiency of contaminating pollutants (Bajpai & Katoch, 2020). The graph (Figs. 2, 3, and 4) shows that removal efficiency improved with increasing time. For a fixed voltage of 15 V and an IED of 1.5 cm, the removal rate of BOD increased from 65.5 to 74.68, COD grew from 67.24 to 77.41%, and nitrate increased from 64.09 to 73.22%, as shown in Table 4. When using the Taguchi method, similar conditions were observed for RSM (Biswas & Goel, 2022; Bote & Desta, 2022; Rakhmania et al., 2022). Table 9 presents a comprehensive overview of the removal efficiencies for BOD, COD, and nitrate removal efficiencies based on variations in reaction time. The third level (90 min) exhibited the best removal effectiveness for BOD, COD, and nitrate, respectively. The removal efficiencies for BOD, COD, and nitrate were highest at 74.72%, 76.84%, and 71.23%, respectively. These values were obtained with signal-to-noise (S/N) ratios of 37.36, 37.63, and 37.00 for BOD (Fig. 5), COD (Fig. 6), and nitrate (Fig. 7), respectively.

Effect of electrode distance on the EC treatment process

The electrode spacing significantly affects the efficiency and performance of the electrocoagulation process. As seen in the above 3D Surface counter graph represented in Figs. 3, 4, and 5, there is an increase in the contaminant removal efficiency with an electrode distance of 1 cm and gradually decreases with an increase in electrode distance up to 2 cm. A decrease in BOD and COD removal may be attributed to the formation of ohmic losses that inhibit the production of Al(OH)3 flocs (Shankar et al., 2014)(Hawari et al., 2020). As highlighted in the study by AlJaberi et al., an increase in electrode distance leads to a longer path length for the electrical current to traverse through the solution. Consequently, this results in higher resistance and a greater voltage drop across the electrolyte. Consequently, the effective voltage applied to the electrodes diminishes, negatively impacting the efficiency of the electrocoagulation process. These findings underscore the importance of optimizing electrode spacing to maximize the efficiency and effectiveness of electrocoagulation in treating dairy wastewater (AlJaberi, 2019a). Similarly, from the Taguchi method, it can be found that there exists a direct relationship between the resistance and the distance between the electrodes (Panizza et al., 2001). Therefore, as the inter-electrode distance is extended, the electric current has a corresponding drop. Consequently, to attain the desired current density, it becomes necessary to augment the voltage. In the current investigation, the range of inter-electrode spacing spanned from 1.0 to 2.0. According to the data presented in Figs. 5, 6, and 7, there is a noticeable decline in the elimination percentage as the inter-electrode distance increases. Table 9 serves as a tool for assessing the relative significance of the factors influencing the electrocoagulation process in the context of pollutant removal. The analysis of the delta ranking method, as presented in the aforementioned tables, reveals that IED plays a significant role in mitigating BOD and COD over the voltage and time in the Taguchi method.

Statistical analysis, regression model, and design validation of the study for RSM

The statistical analysis and the regression model were created using Design Expert software (Aldemir et al., 2021; Bajpai et al., 2020). According to response surface methodology, the experimental and predicted responses for coded Box-Behnken Designs (BBD) are illustrated in Fig. 4. ANOVA, regression equations, and experimental and predicted responses are presented in Tables 3, 4, and 5 by using three independent variables, voltage (A), time (B), and IED (C), along with the response values Y1 (BOD), Y2 (COD), and Y3 (nitrate) obtained from the software.

An analysis of variance (ANOVA) was used to test the predicted model’s validity and the multiple responses for BOD, COD, and nitrate (Ansari et al., 2022; Bajpai & Katoch, 2020; Bajpai et al., 2020; Ebba et al., 2022; Karichappan et al., 2014). The F-test was done to determine the statistical significance of the model (Behera et al., 2018). The probability value (p-value) was used to evaluate model terms with a 95% confidence level (Akarsu et al., 2016). All six responses were statistically significant, with F-values of 244.36, 129.46, and 95.59 for BOD, COD, and nitrate, respectively. Furthermore, the p-value for all six responses was less than 0.0001 to 0.002, indicating that the model is more accurate and highly significant. The model’s estimated lack of fit value was not significant for all six responses, indicating that it is acceptable, suitable, and considerable for wastewater treatment via EC processes (Amran et al., 2021; Bashir et al., 2019). The correlation between R2, adjusted R2, and predicted R2 for the six responses are shown in Table 3, and their differences are less than 0.2, which again proves that the model is acceptable (Acharya et al., 2020; Aygun et al., 2021; Kumar et al., 2022). The statistical regression equation obtained from the analysis is shown in Table 6 for all the response values.

Statistical analysis, regression model, and design validation of the study for Taguchi analysis

Table 7 displays the Taguchi orthogonal design matrix L9, which represents the chosen three factors at three different levels for each factor. A total of 9 experimental runs were conducted in order to examine the impact of uncontrollable factors, specifically the signal-to-noise ratio, on this particular procedure. The responses for different combinations are shown with the signal-to-noise ratio (S/N) (Figs. 5, 6, and 7). In order to assess the relative significance of each component on the levels of BOD, COD, and nitrate, an ANOVA was conducted at a confidence level of 95% (with a level of significance α = 0.05). Table 8

The ANOVA results for the replies are presented in Table 9. All variables exert a substantial influence on the outcome of BOD and COD values, with the exception of nitrate. The statistical analysis reveals that the p-values associated with the BOD and COD are all less than 0.05. This indicates that all operating characteristics have a substantial impact on the performance of the system. Nevertheless, the p-value associated with the time and IED is 0.093 and 0.068 each for nitrate, exceeding the predetermined confidence level of 0.05. Therefore, based on statistical analysis, it can be concluded that Time and IEDs do not have a substantial impact. An alternative method for determining and ranking each element’s relative importance is utilizing F-values and sums of squares. The parameters that possess the highest F-values are the most influential factors, and they can be found in the respective tables of all the responses (Tables 8 and 9) (Zuo et al., 2014). The regression equation, optimum condition, and validation from the analysis are presented in Tables 10 and 12.

Table 10 The statistical regression equation obtained from the analysis by Taguchi method

Optimization and operating cost of the EC process

The optimization of the EC process for dairy wastewater is shown in Table 11. The optimization was carried out with the help of the Design Expert software and is based on the criteria required at the end. The parameters were kept in range, and all the responses were at maximum.

Table 11 Optimization value of independent variables based on optimum conditional criteria for RSM

It should be emphasized that prior research on EC provides optimum conditions based on maximal pollution removal. However, this investigation showed that treatment voltage might be optimized concurrently with maximum elimination percentages for all the responses, as indicated in Table 11, with maximum desirability of 1.

Optimum conditions were obtained as per Table 8 using signal-to-noise ratio for all three responses, with the larger-the-better ratio. The values of predicted to actual value with optimum conditions are shown in Table 12. The results obtained meet the actual value.

Table 12 Optimization value of independent variables based on optimum conditional criteria for the Taguchi method

The operational cost of the EC unit, regarding dairy wastewater, has been estimated based on prevailing unit prices in the Indian market as of May 2024, with a power cost of 0.08 cent/kWh (KERC, 2024) and the cost of 1 kg of aluminum at USD 2.54 (“Aluminium Price Chart”, 2024). The operating cost, calculated using Eqs. 8, 9, and 10 with optimal values derived from the response surface methodology (RSM) and Taguchi methods, is detailed in Tables 11 and 12. Notably, the Taguchi method yielded higher values compared to the RSM approach. For the Taguchi method, power consumption was 23.44 kWh/m3, electrode consumption was 1.88 kg/m3, and the operating cost was 6.67 USD/m3. In contrast, the RSM method resulted in lower values, with power consumption at 19.45 kWh/m3, electrode consumption at 1.66 kg/m3, and an operating cost of 5.77 USD/m3.

Conclusion

In this present study, dairy wastewater was used to examine the effectiveness of EC using aluminum electrodes. The process was optimized using Design Expert software for the response surface methodology and Minitab Software for the Taguchi method. BBD was employed to study and optimize the process variables under different operating conditions, such as voltage, electrode distance, and electrolysis time in RSM.

This study used the Taguchi approach and the response surface methodology to determine the functional relationships between the electrocoagulation (EC) process parameters and the reduction of pollutants, specifically Biochemical Oxygen Demand (BOD), Chemical Oxygen Demand (COD), and nitrate. The process parameters under investigation include voltage, time, and IED. This study leads to the following conclusions:

  1. 1)

    The RSM proposed a total of 15 experimental runs for the design, but the Taguchi method suggested a reduced number of 9 tests. Hence, considering all the interaction factors, it can be observed that the Taguchi approach can potentially decrease the number of tests compared to the RSM.

  2. 2)

    The findings showed that the EC process is significantly impacted by operational factors. Based on the statistical data analysis, using RSM techniques, BBD was used to check the experimental accuracies to eliminate BOD, COD, and nitrate. The data showed that the suggested model is more reliable and sustainable, with solid evidence that both the actual and predicted values acquired are less than 5% of the expected values, with R2 values (> 0.995 ~ 0.998) and adj R2 values (> 0.994 ~ 0.998) obtained from ANOVA for all three responses. The optimum condition for removing the maximum pollutants from all the responses was BOD at 79.06%, COD at 84.35%, and nitrate at 79.64% with a voltage of 23.75 V, time of 90 min, and IED at 1.07 cm for RSM.

  3. 3)

    The Taguchi approach has successfully improved specimens’ performance in relation to parameters such as BOD, COD, and nitrate removal while exhibiting minimal prediction errors for all measured responses. The optimum condition for BOD exhibited a value of 90.54%, a COD of 89.28%, and nitrate at 82.74% for a voltage of 25 V, time of 90 min, and IED of 1.00 cm. Comparatively, the experimental values for BOD, COD, and nitrate were found to be close to predicted optimum condition values for the same parameters with 90.14%, 89.12%, and 82.42%, respectively.

  4. 4)

    The Taguchi method and RSM are effective statistical tools for electrocoagulation experimental design and process optimization. The Taguchi method qualitatively shows factorial effects and determines optimal parameter combinations with fewer experiments but may miss the best results. RSM quantitatively describes problems by fitting the full quadratic model via ANOVA analysis, achieving global optimal conditions. However, large-scale parameters may be time-consuming in experiments.

  5. 5)

    The operating cost analysis indicates that the Taguchi method resulted in a higher cost of 6.67 USD/m3 compared to the RSM approach, which yielded a lower cost of 5.77 USD/m3, highlighting the impact of optimization methods on cost-effectiveness in dairy wastewater treatment.

  6. 6)

    Finally, the study showed that dairy wastewater treatment using the EC process has a high potential and is efficient and eco-friendly. In-depth research is also required to assess other issues, such as the EC process scaling and the operational costs associated with pollutant removal.