Introduction

With the rapidly increasing industrialization, it is very important for the environment to ensure the result-oriented treatability of the wastewater generated and to create an industrial model (Fung and Wibowo 2013). Among the industries, especially metal plating industry wastewater treatment is absolutely mandatory due to the toxic components they contain (Al-Shannag et al. 2015). As it is known, metal plating industry wastewaters or sludges are toxic wastewaters and solids for the environment and living life, especially due to their cyanide and acidic nature, as well as many heavy metal species (Poges et al. 2018). Due to their structure, heavy metals can enter the human body through the food chain and cause serious disorders as a result of their bioaccumulation in vital organs (Shaheen et al. 2016).

In metal plating industries, various chemicals, organic solvents, organic or inorganic acids and bases, surfactants, complex organic substances, metal salts such as cadmium, nickel and chromium are frequently used in plating baths (Kobielska et al. 2018; Shao et al. 2014). Metal plating industries are among the industries that use toxic chemicals and constitute a major source of pollutants discharged to all receiving environment such as air, surface waters and soil (Carolin et al. 2017).

As it is known, the removal of metals is mostly achieved by chemical treatment at high pH levels (Aziz et al. 2000). However, because the buffering capacity of metal plating wastewater is very high, high costs are encountered. Considering the need for different pH values for each metal type, there are serious problems in the treatment of water originating from this process (Li et al. 2007).

Electroplating is defined as plating another metal on a metal surface by applying an electric current (electrolysis) (Priya et al. 2009). Electrode plating baths contain metal salts, complexing chemicals, pH buffers, as well as organic and organometallic additives (Sciscenko et al. 2016).

In order to prevent corrosion of many metals (elements) used in natural conditions and similar oxidizing environments, plating them with another more durable element that is not affected by these environments is called "Galvanotechnical" plating (Ghaferi et al. 2017).

Each of the wastewaters generated in metal plating processes has different chemical characteristics and volumes (Al-Shannag et al. 2015; Hosseini et al. 2016). The total liquid wastes generated in metal plating plants are not very bulky, but they are very dangerous and highly toxic wastes (Lee et al. 2017). The most important toxic components are metals, acids, chromium VI and cyanides (Akbal and Camci 2011; Scarazzato et al. 2015; Wijenberg et al. 2015). In addition, wastes with high chromium content come from chrome plating facilities, and cyanide wastes from zinc plating facilities (Hosseini et al. 2016) (Akbal and Camci 2011).

Excessive sludge formed after classical alkali metal precipitation, which is the most common method used during the chemical treatment of wastewater originating from metal plating processes, should also be considered as another important problem(BrbootI et al. 2011; Kabuk et al. 2014; Williams-Beam and Twidwell 2003). Therefore, there is a need to apply new methods to obtain more stable sludge using less chemicals (Rastegar et al. 2014). In order to eliminate these negativities, electrocoagulation process should be considered as an alternative method instead of chemical precipitation (Kobya et al. 2017).

The basic principle of electrocoagulation is the use of iron electrodes instead of iron sulfate, which is used as a coagulant by means of electric current (Chen 2004). Metals dissolved by electric current can act as coagulants (Ahmad et al. 2020). One of the most important advantages of the electrocoagulation process is that as a result of the electrolytic reactions that occur during the process, adsorption, oxidation and flotation (air stripping in waters containing ammonia) processes are carried out simultaneously due to the mechanism in addition to chemical coagulation (Emamjomeh and Sivakumar 2009; Moussa et al. 2017). At the same time, since pure coagulant (iron) passes into the water during the reaction, the anions (Cl-, SO4 2- etc.) in the chemical coagulation process do not pass into the water (Akbal and Camci 2010). The only disadvantage of the process, as the name suggests, is the energy cost. Compared to chemical coagulation alone, as the chemical cost and sludge cost are lower, it seems to be more economical (Yuksel et al. 2012). Due to all these advantages of electrocoagulation, it is widely used in the treatment of domestic and industrial wastewater(Kurt et al. 2008; Lu et al. 2023; Mollah et al. 2001; Moussa et al. 2017). One of the most important operating conditions in the electrocoagulation process is pH (Bayramoglu et al. 2007; Canizares et al. 2009). Generally, while the EC process is applied after pH adjustment, if the EC process is applied beforehand, the pH of the sample will also change due to the reaction (a small increase), and the cost will also decrease (Kabuk et al. 2014).

For all these reasons, it is seen that the electrocoagulation process can be a very efficient method for metal plating industrial wastewater (Al-Shannag et al. 2015; Kabuk et al. 2014; Piri et al. 2020). When the iron electrode is used in the electrocoagulation process, the electro-dissolution resulting from the electrical voltage will lead to the formation of metal hydroxides such as the dissolving iron electrode Fe(OH)3. The purification in the system starts after that. This treatment method, which is based on the principle that metal hydroxides with very high adsorption capacity adsorb various pollutant parameters in water and remove them from the water by precipitation, has been used in many places today (Mollah et al. 2001). During this process, as a result of the electrochemical processes occurring in the electrodes, tiny gas bubbles begin to emerge from the water. Considering that these gas bubbles form the basis of electroflotation, it will be seen that some pollutants are also removed from the water by electroflotation during electrocoagulation (Harif et al. 2012). In addition, the electrooxidation mechanism can be realized, albeit partially, by activity in the anode region (Yavuz and Ogutveren 2018). In other words, as a result of these common reactions in the electrocoagulation process, a high removal efficiency can be obtained depending on the pollutant concentration and pollutant parameters in the wastewater.

The aim of this study is to investigate the removal of Cu and Ni, which are two important heavy metals that are problematic in the removal of metal industry wastewater. In the study, yields close to 100% were obtained at both low pH and high pH values.

Materials and methods

Analyses

All analyses in the study were carried out in accordance with Standard Methods (Eaton et al. 2005). Heavy metal analyses were performed with Perkin-Elmer AAS 400 atomic absorption spectrophotometer device according to the Standard Method 3110 method. Conductivity and pH analysis was performed with the conductivity and pH probes with the Thermo Scientific brand Orion 5-Star Plus multimeter according to Standard Methods 4500 and 2510, respectively.

The wastewater used in the experimental study was taken from the inlet channel of İkitelli Galvanoteknik Metal Plating Industry Wastewater Treatment Plant in Istanbul. Wastewaters were kept in the waste water tank at + 4 °C in the laboratory. As a result of the analyses made, the characteristics of the wastewater were determined as given in Table 1.

Table 1 Characteristics of raw metal plating industry wastewater

Reactors (pilot scale EC)

The power supply of the pilot plant operates between 100 and 300 A, and there is an electrical component that continuously measures voltage, current and pH values. The filter installed at the EC outlet, on the other hand, can separate the coagulated wastewater after EC from the sludge phase and collect the filtrate and sludge in separate tanks.

The EC system used in the pilot plant application consists of 4 reactors of the same size, each with a volume of 30 L, operating in series with each other. The reactors, made of cylindrical stainless steel, have internal dimensions of 0.15 m in diameter and 2.2 m in height. The interior of these reactors also acts as a cathode. Inside, there are circular rod-shaped anodes. The thickness of these anode rods is 0.075 m. In each series of EC applications, a total of 120 L water was electrocoagulated. There are anode electrodes inside the cathode outside of the reactors, and depending on the EC working principle, the inner cylinder can be easily replaced when the anode is worn. Schematic representation and general information about the system are given in Fig. 1 and Table 2, respectively.

Fig. 1
figure 1

Basic mechanism of the pilot scale of the EC unit

Table 2 Information on the pilot scale of the EC process

Optimization

The operating conditions determined by the preliminary study (Ithan et al. 2019; Karunakaran et al. 2022) were selected as 3 factor 5 level with Taguchi design, taking into account the suitability of the pilot scale system. For ease of comparison between studies, only pH was changed before and after EC. Operating conditions and levels are given in Table 3. Optimization studies were carried out using Design Expert 12.0 software.

Table 3 Taguchi experimental design 3 factors/5 levels

Results and discussion

In the study, it was investigated whether the pH adjustment process should be done before or after the EC process considering the removal efficiencies. After that, the optimum conditions were determined.

Application of EC process after pH adjustment

In the study, EC application was made after the pH value of the original wastewater, which was pH 1.5, was increased. For this purpose, pre-EC pH values were studied at levels between 6 and 10, and data were created according to the results obtained under 100–300 A-current, and these values are presented in Table 4.

Table 4 Cu and Ni removal efficiencies by EC application after pH adjustment (pH + EC)

When the results obtained were examined, the values of approximately 87.5% for Cu and 98.4% for Ni were obtained as the maximum removal efficiency. Moreover, these values are the values realized under different operating conditions. In order to determine the optimum operating condition, a model study related to these values is needed (Sun et al. 2013).

Optimization studies

Treatment studies give results for certain operating conditions. However, optimum operating conditions are often different from these selected operating conditions. For this purpose, one of the most important stages is the optimization studies to be carried out after the experimental design selection. For this purpose, the results of the optimization made using the Design Expert 12.0 software and the visually expressed figures are given in the following headings.

Copper (Cu) removal

One of the most important parameters expressing the consistency of this regression equation is the R2 value. Another is the adjusted R2 value. The following is the regression equation for the optimization of Cu removal when the EC process is run at the original pH and then the pH is increased.

Model summary
$$\frac{{{\text{R}} - {\text{sq}}\quad {\text{R}} - {\text{sq}}\left( {{\text{adj}}} \right)}}{96.31\% \quad 94.10\% }$$

The equation obtained as a result of the regression studies was obtained depending on 3 different variables, current (A), time (min) and the actual values of pH, and is given as follows:

Regression equation:

$${\text{Cu}}\,{\text{ Removal eff}}.\left( \% \right) = \left[ \begin{gathered} - 30.97231 \, {-} \, 0.00344 \, \times {\text{ Current }} + \, 0.340374 \times {\text{Time }} + \, 7.84921 \times pH \hfill \\ - 0.000406 \, \times {\text{ Current }} \times {\text{ Time }} + \, 0.000179 \, \times {\text{ Current }} \times \, pH \, + \, 0.011868 \, \times {\text{ Time }} \hfill \\ \times \, pH \, + \, 0.000021 \, \times {\text{ Current}}^{2} {-} \, 0.014262 \, \times {\text{ Time}}^{2} {-} \, 0.411145 \, \times \, pH^{2} \hfill \\ \end{gathered} \right]^{2}$$

Analysis of variance is a statistical analysis model used to express the consistency of the data and the consistency of the model results. For this purpose, the results of analysis of variance performed in this study (EC application after pH adjustment) are given in Table 5.

Table 5 Results of analysis of variance for Cu removal performed in this study (pH + EC)

The Model F value of 43.54 implies that the model is significant. There is only a 0.01% chance that an F value this large could occur due to noise. P values less than 0.0500 indicate model terms are significant. In this case, B, C, and C2 are significant model terms. Values greater than 0.1000 indicate that the model terms are not significant.

The graphic of the model, which is consistent according to the ANOVA test evaluations, is given in Fig. 2.

Fig. 2
figure 2

Comparison of experiment and model results on Cu removal (pH + EC)

As can be seen from Fig. 2, it is seen that the experimental results of Cu removal in both graphs are consistent with the model results. It is seen that the results are more consistent especially in high removal efficiencies where the yields are concentrated. As a matter of fact, consistency in the desired region is more important as seen in the literature (Nizamuddin et al. 2016). Moreover, when examined for Cu removal, it is seen that similar results were obtained in laboratory-scale studies (Akbal and Camci 2011).

Nickel (Ni) removal

One of the most important parameters expressing the consistency of this regression equation is the R2 value. Another is the adjusted R2 value. The following is the regression equation for the optimization of Ni removal when the EC process is run at the original pH and then the pH is increased.

Model summary
$$\frac{{{\text{R}} - {\text{sq}}\quad {\text{R}} - {\text{sq}}\left( {{\text{adj}}} \right)}}{95.43\% \quad 92.69\% }$$

The equation obtained as a result of the regression studies was obtained depending on 3 different variables, current (A), time (min) and the actual values of pH, and is given as follows:

Regression equation

$${\text{Ni}}\,{\text{ Removal}}\,{\text{ Eff}}. \, \left( \% \right) = \, \left[ \begin{gathered} - 48.17795 \, + \, 0.002567 \, \times {\text{ Current }} + \, 0.527479 \, \times {\text{ Time }} \hfill \\ + \, 11.94145 \, \times \, pH \, {-} \, 0.000388 \, \times {\text{Current }} \times {\text{ Time }} \hfill \\ {-} \, 0.001588 \, \times {\text{ Current }} \times \, pH \, {-} \, 0.009829 \, \times {\text{Time }} \times \, pH \, \hfill \\ + \, 0.000041 \, \times {\text{Current}}^{2} {-} \, 0.019349 \, \times {\text{Time}}^{2} {-} \, 0.621689 \, \times \, pH^{2} \hfill \\ \end{gathered} \right]^{2}$$

As can be seen, the model result R2 value is 95.43% and is extremely close to Adjusted R2. This is one of the most important parameters showing the consistency of the results of the equation.

Analysis of variance is a statistical analysis model used to express the consistency of the data and the consistency of the model results. For this purpose, the results of analysis of variance performed in this study (EC application after pH adjustment) are given in Table 6.

Table 6 Results of analysis of variance for Ni removal performed in this study (pH + EC)

The Model F value of 34.83 implies that the model is significant. There is only a 0.01% chance that a F value this large could occur due to noise. P values less than 0.0500 indicate that model terms are significant. In this case, C and C2 are significant model terms. Values greater than 0.1000 indicate that the model terms are not significant. The consistency of the experimental data and the model results in the pH adjustment study applied before EC is as given in Fig. 3.

Fig. 3
figure 3

Comparison of experimental and model results on Ni removal ((pH + EC)

As can be seen in Fig. 3, it is seen that the experimental results are consistent with the model results in both graphs. The fact that the predictive line and the actual data are concentrated on the line is extremely important in terms of showing the consistency of the model (Ilo et al.  2022). Moreover, when examined for Cu removal, it is seen that similar results were obtained in laboratory-scale studies (Akbal and Camcı 2011).

Figure 4 shows the shapes created by the equations obtained for both Cu and Ni removal efficiencies obtained in the EC process after the pH adjustment.

Fig. 4
figure 4

Removal efficiencies obtained in the EC process after the pH adjustment a Cu and b Ni

As can be seen from the surface graphs in Fig. 4, pH is the most effective parameter in both processes. As expected, a removal efficiency of the order of 95% was achieved in studies carried out at high pH after treatment. The studies carried out by putting the EC process forward and then increasing the pH are below. As can be seen from the graphics, it is seen that the most effective parameter in this process is pH. Therefore, the importance of the study (whether the pH should be adjusted before or after) has emerged. Although pH is not seen as the most effective parameter in the electrocoagulation process (Coskun et al. 2012), this situation changes when the parameters to be removed are heavy metals (Al-Qodah and Al-Shannag 2017).

Application of EC process before pH adjustment (EC + pH)

At this stage of the study, the EC process was first applied to the wastewater and then the pH was increased. Moreover, the OHions formed as a result of the EC process allowed a partial pH increase and reduced the possible base cost. The results obtained are given in Table 7.

Table 7 Cu and Ni removal efficiencies obtained by increasing the pH after the EC process

According to Table 7, when the results obtained are examined, it is seen that Cu removal has reached to 89% and Ni removal has reached to 98%. Optimum operating conditions for both values can be found by model studies.

Optimization studies

Determining what kind of result will be obtained under which operating conditions by modeling the experimental data allows to determine both the consistency of the studies and the approximate removal efficiencies with the help of the obtained equations.

Cu removal

The following is the regression equation obtained as the first step in the optimization of Cu removal after electrocoagulation was studied at the original pH and then pH increased.

Model summary
$$\frac{{{\text{R}} - {\text{sq}}\quad {\text{R}} - {\text{sq}}\left( {{\text{adj}}} \right)}}{91.9\% \quad 86.15\% }$$

As can be seen, the model result R2 value is 91.9% and is extremely close to adjusted R2. This is one of the most important parameters showing the consistency of the results of the equation.

Regression equation

$$\begin{aligned} {\text{Cu}}\,{\text{ Removal}}\,{\text{ Eff}}. \, \left( \% \right) = & - 205.422 \, + 0.937913 \, \times {\text{ Current }} + \, 25.94442 \, \times {\text{ Time }} \\ & + \, 20.256206 \, \times \, pH \, - 0.085294 \, \times {\text{ Current }} \times {\text{ Time }} \\ & - \, 0.043646 \, \times {\text{ Current }}x \, pH \, {-} \, 1.82752 \, \times {\text{ Time }} \times \, pH \, \\ & - \, 0.000792 \, \times {\text{ Current}}^{2} - \, 0.180137 \, \times {\text{ Time}}^{2} \\ & - \, 0.109276 \, \times \, pH^{2} + \, 0.007315 \, \times {\text{ Current }} \times {\text{ Time }} \times \, pH \\ \end{aligned}$$

The equation in terms of actual factors can be used to make predictions about the response for given levels of each factor. Here, the levels should be specified in the original units for each factor. This equation should not be used to determine the relative impact of each factor because the coefficients are scaled to accommodate the units of each factor and the intercept is not at the center of the design space.

One of the most important parameters expressing the consistency of this regression equation is the R2 value. Another is the adjusted R2 value. The following is the regression equation for the optimization of Cu removal when the EC process is run at the original pH and then the pH is increased.

Analysis of variance (ANOVA) tests the hypothesis that the means of two or more populations are equal. ANOVAs assess the importance of one or more factors by comparing the response variable means at the different factor levels. The null hypothesis states that all population means (factor level means) are equal while the alternative hypothesis states that at least one is different.

Analysis of variance is a statistical analysis model used to express the consistency of the data and the consistency of the model results. For this purpose, the results of analysis of variance performed in this study (pH adjustment after EC) are given in Table 8.

Table 8 Results of analysis of variance for Cu removal performed in this study (EC + pH)

The Model F value of 15.93 implies that the model is significant. There is only a 0.01% chance that an F value this large could occur due to noise. P values less than 0.0500 indicate that model terms are significant. In this case, B and C are significant model terms. Values greater than 0.1000 indicate that the model terms are not significant. The consistency of the experimental data and the model results in the pH adjustment study applied before EC is as given in Fig. 5.

Fig. 5
figure 5

Comparison of experimental study and model result on Cu removal (EC + pH)

As can be seen in Fig. 5, it is seen that the experimental results are consistent with the model results in both graphs. The fact that the predict line and the actual data are concentrated on the line is important in terms of showing the consistency of the model (Batista and Graczyk 2013) Considering this situation, it is seen that the model results reflect the experimental results (Vigneswaran et al. 2012).

Nickel (Ni) removal

One of the most important parameters expressing the consistency of this regression equation is the R2 value. Another is the adjusted R2 value. The following is the regression equation for the optimization of Cu removal when the EC process is run at the original pH and then the pH is increased.

Model summary
$$\frac{{{\text{R}} - {\text{sq}}\quad {\text{R}} - {\text{sq}}\left( {{\text{adj}}} \right)}}{94.24\% \quad 90.13\% }$$

The regression equation obtained for Ni removal after pH increase after electrocoagulation process at original pH is given as follows:

Regression equation

$$\begin{aligned} {\text{Ni}}\,{\text{ Removal}}\,{\text{ Eff}}. \, \left( \% \right) = & - 515.41444 \, + \, 1.37727 \, \times {\text{ Current }} + \, 33.49266 \, \times {\text{ Time}} \\ \, & + \, 86.54913 \times \, pH \, - \, 0.102013 \, \times {\text{ Current }} \times {\text{ Time }} \\ & - \, 0.144871 \, \times {\text{Current }} \times \, pH \, - \, 3.67975 \, \times {\text{Time }} \times \, pH \, \\ & - \, 0.000292 \, \times {\text{Current}}^{2} + \, 0.00514 \, \times {\text{Time}}^{2} - \, 2.15146 \, \times pH^{2} \\ \end{aligned}$$

The equation in terms of actual factors can be used to make predictions about the response for given levels of each factor. Here, the levels should be specified in the original units for each factor. This equation should not be used to determine the relative impact of each factor because the coefficients are scaled to accommodate the units of each factor and the intercept is not at the center of the design space.

The model result is very close with the R2 value of 94.24% and Adjusted R2 as seen. This is one of the most important parameters showing the consistency of the results of the equation.

Another important analysis while examining the model results is the analysis of variance, and the analysis of variance table of this model is given in Table 9.

Table 9 Results of analysis of variance performed in this study

The Model F value of 22.91 implies that the model is significant. There is only a 0.01% chance that an F value this large could occur due to noise.

P values less than 0.0500 indicate that model terms are significant. In this case, B, C, and ABC are significant model terms. Values greater than 0.1000 indicate that the model terms are not significant. If there are many insignificant model terms (not counting those required to support hierarchy), model reduction may improve your model.

The consistency of the experimental data and the model results in the pH adjustment study applied after EC is as given in Fig. 6.

Fig. 6
figure 6

Comparison of experimental study and model result (Ni removal)

As can be seen from Fig. 6, it is understood that the experimental results in both graphs are consistent with the model results. Predict and actual graphics are very important in optimization studies. The figures obtained in this study are the most important expression of this consistency (Ilo et al. 2022). When compared with the literature data, it is seen that the optimization study is successful (Abdel-Shafy et al. 2022).

Surface Plots: Optimization results are plotted with the response surface methodology. In this context, the graphs prepared for the said equation are given in Fig. 7. Part a and b show Cu and Ni removals, respectively.

Fig. 7
figure 7

Removal efficiencies obtained by pH adjustment after EC process a Cu and b Ni

When Fig. 7 is examined, the effects of each operating conditions on the removal efficiency and the efficiencies obtained as a result of the model according to these operating conditions are seen. As can be seen from the graphics, it is seen that the most effective parameter in this process is pH. It is seen from both the graphs and the coefficients in the equations that the time is also effective after pH. Considering the importance of pH, the importance of the study (whether pH should be adjusted before or after) has emerged. Although pH is not seen as the most effective parameter in the electrocoagulation process (Coskun et al. 2012), it is seen how this situation changes when the parameters to be removed are heavy metals (Al-Qodah and Al-Shannag 2017). This reveals the importance of this study.

Figures 8 and 9 show desirability graphs showing what kind of removal will occur under which operating conditions. Desirability is an objective function that ranges from zero outside of the limits to one at the goal. The numerical optimization finds a point that maximizes the desirability function. The characteristics of a goal may be altered by adjusting the weight or importance. For several responses and factors, all goals get combined into one desirability function. Figure 8 shows the removal efficiencies obtained under different operating conditions.

Fig. 8
figure 8

Heavy metal removal efficiencies by EC process before pH adjustment (EC + pH)

Fig. 9
figure 9

Heavy metal removal efficiencies by EC process after pH adjustment (pH + EC)

As can be seen in Fig. 8, removal efficiency of over 93% and 93,7% was achieved for Cu and Ni, respectively, in a period of 11.75 min under 220 A (current density of 31.15 mA/cm2) and at pH 10. And again, as can be seen in Fig. 8, it is seen that the most effective parameter is pH (Ahmad Tajudin, Azim, Syakeera, Jefferson, and Rogers 2017). This shows that this is due to the precipitation of heavy metals in the form of metal hydroxide (Likon and Zemljič 2020).

As can be seen from Fig. 9, removal efficiency of over 95.6% for Cu and 95.2% for Ni is achieved under 300 A (current density of 45 mA/cm2) in a period of 11.75 min and when pH adjustment is made before EC (around 10) has been obtained. And again, when we pay attention to Figs. 8 and 9, it is clearly seen that the most effective parameter is pH. As a matter of fact, these results show similarities with the literature data (Akbal and Camci 2011; Beyazit 2014; Kabuk et al. 2014; Lu et al. 2023).

Conclusion

In this study, it has been studied that wastewater with highly variable character originating from the metal plating industry can be treated with a pilot scale EC process. High removal efficiencies have been achieved even in very low times such as 3 min, and the necessity of pH adjustment has come to the fore. It was observed that whether the pH adjustment was before or after did not have a major effect. As a result, it is seen that the precipitation of metal complexes in the form of metal hydroxides is also related to pH and that the outlet pH is also important in the EC process. As a matter of fact, pH was the most effective parameter in the modeling studies, as expected.

With the EC process proposed in this study, it was determined that discharge limits below 5 mg/l for Cu and Ni were achieved in cases where discharge limits could not be met with the classical chemical treatment method available in the existing wastewater treatment plant.

The average removal efficiency for two different heavy metals (Cu and Ni) obtained in this study using iron electrodes in the EC process was at the level of 95%. The regression coefficients for these two different heavy metal types were determined between 90.15 and 96.31% in two different optimization results according to the pH adjustment status. When these data are taken into consideration, the results are quite consistent with the model study.