Optimization of the Preparation of Activated Carbon from Prickly Pear Seed Cake for the Removal of Lead and Cadmium Ions from Aqueous Solution

In this study, we evaluated the use of prickly pear seed cake, a by-product of prickly pear seed oil extraction, as a new precursor for producing activated carbon by phosphoric acid activation, and the obtained carbon’s capacity for heavy metal removal from aqueous solution. Response surface methodology based on the full factorial design at two levels (24) was developed to reduce the number of experiments and reach optimal preparation conditions for the removal of cadmium and lead ions from aqueous solutions. Design Expert 11.1.2.0 Trial software was used for generating the statistical experimental design and analyzing the observed data. Factors influencing the activation process, such as carbonization temperature, activation temperature, activation time, and impregnation ratio, were studied. Responses were studied in depth with an analysis of variance to estimate their significance. Each response was outlined by a first-order regression equation demonstrating satisfactory correspondence between the predicted and experimental results as the adjusted coefficients of correlation. Based on the statistical data, the best conditions for the removal of heavy metals from aqueous solution by the obtained activated carbon were indicated. The maximum iodine number and methylene blue index were 2527.3 mg g−1 and 396.5 mg g−1, respectively, using activated carbon obtained at the following conditions: Tc = 500 °C, Ta = 500 °C, impregnation ratio = 2:1 (g H3PO4: g carbon), and activation time of two hours. The maximum adsorption reached 170.2 mg g−1 and 158.4 mg g−1 for Cd2+ and Pb2+, respectively, using activated carbon obtained at the following conditions: Tc = 600 °C, Ta = 400 °C, impregnation ratio = 2:1 (g H3PO4: g carbon), and activation time of one hour. The activated carbon obtained was characterized by Boehm titration, pH of point of zero charge (pHPZC), Brunauer–Emmett–Teller surface area (SBET), and scanning electron microscopy. Adsorption was performed according to different parameters: pH solution, adsorbent dosage, temperature, contact time, and initial concentration. Regeneration experiments proved that the obtained activated carbon still had a high removal capacity for Cd2+ and Pb2+ after five regeneration cycles.


Introduction
With the development of industry, environmental contamination has become increasingly alarming [1][2][3]. Indeed, liquid discharges contaminated with pollutants have become an issue of major concern [4,5], given the environmentally unfriendly harmful effects induced [6]. The problem is further aggravated when it comes to non-biodegradable and toxic pollutants such as heavy metals, which are classified as among the most hazardous elements [7]. Toxic and carcinogenic heavy metals include cadmium (Cd) and lead (Pb). Their main sources are the wastewater treatment stations of various industries [8]. Cd and Pb are toxic metals and are proven to have harmful impacts on the human body; they mostly accumulate in the kidneys and have a long biological half-life in the human body [9][10][11]. Several treatment technologies have been adopted for the removal of heavy metals from wastewater, such as electrochemical treatment [12], reverse osmosis [13,14], flocculation [15], precipitation [16,17], membrane filtration [18], ion exchange [19,20], and adsorption [21,22]. Among these processes, adsorption is one of the most favorable and economical methods for the removal of heavy metals due to its effectiveness and simplicity [23]. It proved interesting to develop an adsorbent with high efficiency and low cost for the removal of heavy metals. Activated carbon is mostly used for treating wastewater due to (i) its important porous structure [24],(ii) its high surface area and high adsorption capacity [25], and (iii) its wide availability and rapid biodegradability [26,27]. Different agricultural biomasses of rice husk [28], animal manure [29], fruit peel [30], orange peels [31], date palm petiole [32], Opuntia ficus indica [33], and Posidonia oceanica [34] have been used for the production of activated carbon. Motivated by the search for a new precursor, prickly pear seed cake was considered in this study. Prickly pear is an edible fruit that cultivates spontaneously in Tunisia. The fruit consists of about 10-15% seeds [35]. These seeds are usually rejected as waste, although their use as a by-product generates a novel and valuable source of oil [36], as well as functional ingredients that are used in the food industry (seed cake). Prickly pear seed cake is produced in large quantities as a by-product of the prickly pear seed oil extraction industry. Consequently, preparing activated carbons with prickly pear seed cake is an interesting approach to valorize this raw material [37,38]. The preparation of activated carbon from lignocellulosic biomasses can be divided into two different methods: chemical and physical activation. The physical process consists of the thermal oxidation of carbon at a temperature between 300 and 1000 • C in the presence of oxygen, carbon dioxide, or water vapor [39]. Thus, chemical activation produces highly porous activated carbon by impregnation of the carbon precursor with chemical activating agents such as phosphoric acid [40], potassium hydroxide [41], and zinc chloride [42], at temperatures ranging between 400 and 800 • C. To generate activated carbons having some particular characteristics, it is necessary to have detailed knowledge of the effects of several parameters of the production process on the ultimate performance of the activated carbons.
The main purpose of the present study was to evaluate the feasibility of developing activated carbons with high porosity from prickly pear seed cake biomass after bio-oil extraction. Thus, the effects of the main preparation process parameters on the performance of adsorbents produced from residual biomass were investigated and optimized. Phosphoric acid activation was applied to produce activated carbon and the resulting properties were examined. The factors included in the experimental design were the carbonization temperature (Tc), impregnation ratio (IR), activation temperature (Ta), and activation time (t). Four responses are analyzed: methylene blue index (MB index), iodine number (IN), and cadmium (Cd removal) and lead (Pb removal) ion removal. Response surface methodology based on the full factorial design at two levels (2 4 ) was used to acquire the optimal preparation conditions and to investigate the greatest removal efficiency of heavy metals. The statistical experimental design and the observed data were generated and analyzed by Design Expert 11.1.2.0 Trial software. The obtained activated carbons were characterized and analyzed by scanning electron microscopy, Boehm titration, pH of point zero charge (pH PZC ), and Brunauer-Emmett-Teller surface area (S BET ). The effects of pH and time on the adsorption of Cd 2+ and Pb 2+ processes on the optimized activated carbon were studied. Moreover, the equilibrium data were analyzed using Langmuir and Freundlich models of the adsorption of Cd 2+ and Pb 2+ onto the optimized activated carbon.

Prickly Pear Seed Cake Characterization
Prickly pear seed cake was chosen as a precursor in the preparation of activated carbon because of its availability and its physicochemical characteristics. The prickly pear seed cake used in this study was provided by Omega Tunisia ltd., a company operating in Sidi Bouzid, Tunisia. The cake is a by-product of oil extraction from prickly pear seeds. The chemical composition of prickly pear cake was determined according to TAPPI standardized methods as previously described [43][44][45][46][47], namely, ash content T211 om-07,lignin T222 om-06, holocellulose Wise et al. method [48], and α-cellulose T 203 cm-99. Elemental analysis of prickly pear cake was performed with the Thermo Scientific Flash 2000 CHNS-O Analyzer.

Preparation of Activated Carbon
Prickly pear seed cake was crushed and sieved. Then, it was carbonized in a rotary kiln under nitrogen gas at a flow rate of 100 mL min −1 . The carbonized cake was activated using phosphoric acid. Phosphoric acid was diluted with distilled water to obtain a solution of 85 wt % and then used as an activating agent in a mass ratio of 2:1 (g H 3 PO 4 /g carbon).
For each sample, a mass of 20 g of carbon was used. The residual phosphoric acid was eliminated from activated carbons by washing with hot distilled water until reaching a neutral pH. The obtained filtrate was then dried at 105 • C until reaching a constant weight. The product was kept in a hermetic bottle for subsequent tests.

Experimental Design and Analysis
Factorial experimental design is an expeditious method used to reduce the number of experiments required. It studies possible interactions between factors and their effects on the responses to optimize process performance [49]. Factors and their levels including temperature of carbonization (Tc = 500 or 600 • C), impregnation ratio (IR = 1:1 or 2:1 (g:g)), temperature of activation (Ta = 400 or 500 • C), and activation time (t = 1 or 2 h) were considered in this study. These variables with their respective domains were chosen from the literature as well as preliminary experiments. The experiments were performed according to a full factorial design at two levels (2 4 ), with 16 experiments, to investigate not only the effects of factors but also the possible interactions between factors. Design Expert 11.1.2.0 software was used to generate the experimental design and analyze the observed data. A first-order model with all possible interactions was chosen to fit the experimental data (Equation (1)). The goodness of fit of the model was checked by the coefficient of determination R 2 and R 2 adj . R 2 value is a statistical measure of how well a model fits the real data points. The R 2 values range from 0 to 1, where 1 represents the ideal model.
where A, B, C, and D refer to the factors of the study. Y represents the responses of interest: MB index, IN, Cd removal, and Pb removal. Response surface methodology was applied to optimize the combination effect of the important reaction variables.

Adsorption Capacity Evaluation
The adsorption capacity of the prepared prickly pear seed cake-derived activated carbon was assessed using batch adsorption tests. We investigated adsorption of iodine, methylene blue, cadmium, and lead. During these adsorption tests, a given quantity of activated carbon was added to the adsorbate solution, and the mixture was stirred using a tilting shaker at 120 rpm for 1080 min at room temperature.
In the iodine adsorption experiment, 1 g of each activated carbon was treated with 10 mL of 5% HCl and then boiled for 30 s, and cooled. Then, 100 mL of 0.1 mol L −1 iodine solution was added to the mixture and stirred for 30 min. The resulting solution was filtered, and 50 mL of the filtrate was titrated with 0.1 mol L −1 sodium thiosulfate solution using starch as an indicator [50]. IN was determined using the ASTM D4607-94 method.
The MB index was used to evaluate the macroporosity of activated carbon and therefore its adsorptive capacity concerning large molecules (diameter ≥1.5 nm). In practical terms, the MB index was determined by agitating 50 mg of activated carbon and 10 mL of 2000 mg L −1 of a methylene blue solution for 4 h. Afterward, the suspension was filtered, and the residual concentration of MB in the filtrate was determined by a Beckman UV/Vis DU800 spectrophotometer at a wavelength of 664 nm [51]. With respect to the adsorption of cadmium and lead, metal solutions were prepared by dissolving 268.7 mg of lead chloride and 327.3 mg of cadmium chloride in one liter of distilled water to obtain a concentration of 200 mg L −1 . At room temperature (25 ± 2 • C), 50 mL of the solution was poured at a concentration of 200 mg L −1 into a series of flasks containing 50 mg of activated carbon. The initial pH of the solution was adjusted to 6 using 0.1 mol L −1 HCl or NaOH. The samples remained under agitation for 3 h and were subsequently filtered and analyzed using atomic absorption spectroscopy (AAS, Thermo Fisher Scientific instrument, iCE 3500) equipped with an air-acetylene flame. The gas flow rate was 1.8 L min −1 and 2 L min −1 for Cd and Pb, respectively. Calibrations were performed by consecutive dilution using standard solutions. Absorption wavelengths of 228.8 nm and 217.0 nm were maintained for the determination of Cd and Pb, respectively. The slit was adjusted to 0.5 nm. The detection limits of the spectrophotometer were0.01 mg/L and 0.07 mg/L for Cd and Pb, respectively. Determination was based on average values of triplicates for each sample.

Characterization Methods
The SEM photos were obtained with a JEOL JSM-IT 100 type device. Basic and acidic surface groups were quantified using the Boehm titration method as previously described [32]. The pH of point zero charge (pH PZC ) of the adsorbent is an important characteristic that was determined using Newcomb's method [52] as previously described [32]. The Brunauer-Emmett-Teller surface area (S BET ) and pore structure parameters [49] of the adsorbent were acquired from nitrogen adsorption-desorption measurements at 77 K using a Micromeritics ASAP 2020 instrument. Before the measurement, activated carbon (40 mg) was degassed at 300 • C for 8 h.

Adsorption Study on the Optimized Activated Carbon
The adsorption of Cd 2+ and Pb 2+ , separately, on the optimized activated carbon AC 2 was carried out in batch mode. To investigate the influence of the initial pH of the solution, 50 mL of the metal ion solution (200 mg L −1 ) was put in contact with 50 mg of the adsorbent. The initial pH was adjusted from 2 to 7 using HCl and NaOH solutions (0.1 mol L −1 ). The different solution samples were agitated for 720 min. Then, the samples were filtered, and metal ion concentration was determined.
To determine the suitable contact time on the adsorption, the same steps described previously were followed; 50 mg of activated carbon was agitated with 50 mL of the metal ion solution (200 mg L −1 ) (initial pH = 6) for the desired contact time up to 720 min.
For the effect of initial concentration, experiments were performed at the optimal determined conditions: initial pH = 6, adsorbent dose = 1 g L −1 , 50 mL of the solution, varying the initial metal ion concentration from 20 to 200 mg L −1 . Once filtered, the solution was analyzed to determine the metal ion concentration, which was used to measure the adsorption capacity of the metal ion solution. The equilibrium adsorption capacity Q (mg g −1 ) was determined according to Equation (2): where C 0 is the initial concentration (mg L −1 ), C e is the equilibrium concentration (mg L −1 ), V is the volume of solution (L), and m is the weight of the adsorbent (g). All adsorption experiments were performed in triplicate.

Regeneration Study
The process of regeneration of the spent adsorbent was investigated to assess the economic and operational feasibility. The chemical regeneration method is the most widely applied in separating adsorbed molecules from the adsorbent sites, as it is relatively fast and occurs without affecting the pore structure of the activated carbon. In our experiment, 0.1 g of activated carbon saturated with Cd 2+ or Pb 2+ was treated with 50 mL of 1.0 mol L −1 HCl for 12 h. After separation by centrifugation, the treated adsorbent was washed several times with distilled water to completely remove Cl − , and then 50 mg of activated carbon was reused in 50 mL of 200 mg L −1 Cd 2+ or Pb 2+ . The adsorption/desorption procedure was repeated five times using the same procedure, and the concentrations of Cd 2+ and Pb 2+ in the supernatant after centrifugation were measured.

Adsorption Capacity of the Newly Prepared Activated Carbon
The MB index ranged from 380.4 to 396.5 mg g −1 , indicating high porosity of the prepared samples (Table 2). The activated carbon with the greatest IN (2527.3 mg g −1 ) and MB index (396.5 mg g −1 ) was obtained at Tc = 500 • C and Ta = 500 • C for 2 h with an IR = 2:1. The highest adsorption capacity of Cd 2+ was 170.2 mg g −1 and 158.4 mg g −1 for Pb 2+ . The maximum adsorption capacities of both metal ions were obtained with the following conditions: Tc = 600 • C, IR = 2:1, Ta = 400 • C, and t = 1 h.

Analysis of Variance (ANOVA) and Surface Response Analysis
The analysis of variance (ANOVA) was employed to assess the significance of the curvature in the responses at a confidence level of 95%. The results shown in Table 3 allow us to determine adequate equations that represent the actual interaction between each response and the significant variables. The second-and third-order interactions between these effects were considered insignificant relative to the other effects. The mathematical models for the determination of the IN, MB index, cadmium, and lead removal were used to build response surfaces as well as to determine the optimal conditions of this process. Figures 1 and 2 present the 3D response surface plots for the significant interactions.
Tc and (IR_Ta) presented a negative impact on the MB index response. IR, Ta, and (Tc_Ta) presented a negative effect. The ANOVA results show that the equations adequately represent the actual relationship between the response and the significant variables with a coefficient linear regression R 2 = 0.913and adjusted coefficient of determination R 2 adj = 0.87.
For the MB index, the most significant interactions were (Tc_Ta) and (IR_Ta). Figure  1a shows that MB index increased with increasing Ta and decreasing Tc, and increased with increasing IR. Then, a greater MB index appeared with an IR of 2:1 (g:g), Tc was fixed at 500 °C, and the activation temperature was at 500 °C. Hence, an increase in porosity was observed with the increase in the phosphoric acid concentration, in the range of studied temperatures, due to the dehydration that occurred during the activation stage, leading to the development of the structure and the formation of pores. These results are in agreement with those found by previous studies about different precursors from lignocellulosic biomasses [55,56].
For the IN, the significant effects are Tc, IR, t, and the interactions (Tc_IR) and (IR_t) (Equation (4) The correlation between the theoretical and experimental responses, calculated by the model, is satisfactory with a coefficient linear regression R 2 = 0.84 and adjusted coefficient of determination R 2 adj = 0.81. It can be seen that IN is higher with an increase in impregnation ratio and activation time. In fact, at a low temperature, the activation may take place slowly, producing the development of the porosity of the obtained activated carbons, as well as an increase in the microporosity. The combination of the carbonization and impregnation ratio showed a positive effect on the IN (Figure 1b). Moreover, an increase in the micropores indicated by the IN occurred in the case of low levels of carbonization. Its maximum value was observed at Tc = 500°C, IR = 2:1, and Ta = 500°C. However, the increase in iodine value with increasing activation time could be explained by the fact that prickly pear seed cakes are hard, and thus a long activation time allows for the development of carbon porosity [57]. These findings are in accordance with those of Khalili et al. [58]. Measured values of IN and MB index showed that the activated carbons obtained were also capable of adsorbing small and large molecules, thus suggesting the existence of micropores and macropores, as expected for activated carbons prepared by chemical activation from lignocellulosic biomass.
Based on the ANOVA data for the cadmium removal response, the most significant factors are Tc, Ta, activation time (t), and the interactions (Tc_Ta), (Tc_t), and (Ta_t) (Equation (5) For the lead removal, Tc, IR, activation time (t), and the interaction (IR_t) were the most significant effects (Equation (6)).
MB index = +389.7 − 1.58 Tc + 3.16 IR + 1.58 Ta + 0.56 (Tc_Ta) − 0.82 (IR_Ta) Tc and (IR_Ta) presented a negative impact on the MB index response. IR, Ta, and (Tc_Ta) presented a negative effect. The ANOVA results show that the equations adequately represent the actual relationship between the response and the significant variables with a coefficient linear regression R 2 = 0.913and adjusted coefficient of determination R 2 adj = 0.87. For the MB index, the most significant interactions were (Tc_Ta) and (IR_Ta). Figure 1a shows that MB index increased with increasing Ta and decreasing Tc, and increased with increasing IR. Then, a greater MB index appeared with an IR of 2:1 (g:g), Tc was fixed at 500 • C, and the activation temperature was at 500 • C. Hence, an increase in porosity was observed with the increase in the phosphoric acid concentration, in the range of studied temperatures, due to the dehydration that occurred during the activation stage, leading to the development of the structure and the formation of pores. These results are in agreement with those found by previous studies about different precursors from lignocellulosic biomasses [55,56].
For the IN, the significant effects are Tc, IR, t, and the interactions (Tc_IR) and (IR_t) (Equation (4) The correlation between the theoretical and experimental responses, calculated by the model, is satisfactory with a coefficient linear regression R 2 = 0.84 and adjusted coefficient of determination R 2 adj = 0.81. It can be seen that IN is higher with an increase in impregnation ratio and activation time. In fact, at a low temperature, the activation may take place slowly, producing the development of the porosity of the obtained activated carbons, as well as an increase in the microporosity. The combination of the carbonization and impregnation ratio showed a positive effect on the IN (Figure 1b). Moreover, an increase in the micropores indicated by the IN occurred in the case of low levels of carbonization. Its maximum value was observed at Tc = 500 • C, IR = 2:1, and Ta = 500 • C.
However, the increase in iodine value with increasing activation time could be explained by the fact that prickly pear seed cakes are hard, and thus a long activation time allows for the development of carbon porosity [57]. These findings are in accordance with those of Khalili et al. [58]. Measured values of IN and MB index showed that the activated carbons obtained were also capable of adsorbing small and large molecules, thus suggesting the existence of micropores and macropores, as expected for activated carbons prepared by chemical activation from lignocellulosic biomass.
Cd-removal = +114.01 + 18.71 Tc − 3.11 Ta − 9.51t − 4.26 (Tc_Ta) − 14.03 (Tc_t) + 5.78 (Ta_t) ANOVA results show that the equations sufficiently represent the actual relationship between the response and the significant variables with a coefficient linear regression R 2 = 0.82 and adjusted coefficient of determination R 2 adj = 0.70. The Tc was the most influential factor, having a positive effect. Thus, the effects of activation time and temperature were negative. The significant interactions included (T C _Ta), (T C _t), and (Ta_t). Figure 2a shows that cadmium adsorption increased with increasing Tc and decreasing Ta and t. A maximum response in adsorption of Cd 2+ was obtained at a Tc of 600 • C, a Ta of 400 • C, and an activation time of 1 h.
For the lead removal, Tc, IR, activation time (t), and the interaction (IR_t) were the most significant effects (Equation (6)).
Pb-removal = +116.28 + 9.67 Tc + 11.69 IR − 10.40t − 5.34 (IR_t) (6) The coefficient linear regression and the adjusted coefficient of determination were statistically significant (R 2 = 0.82; R 2 adj = 0.78). Therefore, Pb removal increased with the increase in Tc and IR also with a low-level activation time (t). It can be seen from Figure 2b that Pb removal increased with increasing the impregnation ratio and decreasing activation time. The maximum response in adsorption of Pb 2+ was at a Tc of 600 • C, IR of 2:1, and an activation time of 1 h.
The correlation between the theoretical and experimental responses calculated by the model shows that the experimental data are in agreement with the data predicted by the model. The predicted coefficient of determination R 2 pred of each response is in reasonable agreement with R 2 adj (the difference is less than 0.2). Values of p-Value Prob>F are less than 0.05, indicating that the model terms are significant. In addition, large values of F-Value and reduced values of p-Value Prob confirm the significant effect of the corresponding variables. The relatively low values of the standard deviation demonstrate the small difference between the experimental and predicted values and also confirm the validity of the acquired models.

Characterization of Optimized Activated Carbon
In general, the appearance of pores in the case of AC 1 and AC 2 activated carbons is due to the decomposition of the sample matrix by the activating agent (H 3 PO 4 ), followed by the removal of tars during heat treatment under nitrogen atmosphere (Figure 3). These observations allowed us to conclude that the texture of the activated carbons obtained is favorable for applications in the removal of heavy metals. increase in Tc and IR also with a low-level activation time (t). It can be seen from Figure  2b that Pb removal increased with increasing the impregnation ratio and decreasing activation time. The maximum response in adsorption of Pb 2+ was at a Tc of 600 °C, IR of 2:1, and an activation time of 1 h. The correlation between the theoretical and experimental responses calculated by the model shows that the experimental data are in agreement with the data predicted by the model. The predicted coefficient of determination R 2 pred of each response is in reasonable agreement with R 2 adj (the difference is less than 0.2). Values of p-Value Prob>F are less than 0.05, indicating that the model terms are significant. In addition, large values of F-Value and reduced values of p-Value Prob confirm the significant effect of the corresponding variables. The relatively low values of the standard deviation demonstrate the small difference between the experimental and predicted values and also confirm the validity of the acquired models.

Characterization of Optimized Activated Carbon
In general, the appearance of pores in the case of AC1 and AC2 activated carbons is due to the decomposition of the sample matrix by the activating agent (H3PO4), followed by the removal of tars during heat treatment under nitrogen atmosphere (Figure 3). These observations allowed us to conclude that the texture of the activated carbons obtained is favorable for applications in the removal of heavy metals.
Surface functional groups have an important influence on adsorption processes. These functional groups are mainly subdivided into acidic or basic groups, affecting the surface charge of the adsorbent and, as a result, the efficiency of adsorption [59,60]. Boehm titration was used for the activated carbons to quantify acidic functional groups; the results are reported in Table 4. Based on the obtained results, it can be seen that both of the obtained activated carbon surfaces have mainly acidic groups due to the existence of carboxylic, phenolic, and lactonic groups, and a lower number of basic groups.  Surface functional groups have an important influence on adsorption processes. These functional groups are mainly subdivided into acidic or basic groups, affecting the surface charge of the adsorbent and, as a result, the efficiency of adsorption [59,60]. Boehm titration was used for the activated carbons to quantify acidic functional groups; the results are reported in Table 4. Based on the obtained results, it can be seen that both of the obtained activated carbon surfaces have mainly acidic groups due to the existence of carboxylic, phenolic, and lactonic groups, and a lower number of basic groups. These results indicate a higher adsorption performance of activated carbon for metal ions. The pH PZC values of the adsorbents were 6.8 and 5.8 for AC 1 and AC 2 , respectively, indicating their relatively acidic nature. This is in accordance with the result of the Boehm titration, which indicates a dominance of acid groups on the surface of the activated carbon.
Nitrogen (N 2 ) gas adsorption-desorption isotherms of the samples were performed to investigate their porous characteristics. The obtained activated carbons had large specific surface areas S BET equal to 551 m 2 g −1 and 404 m 2 g −1 for AC 1 and AC 2 , respectively.

Adsorption Study: Effect of pH, Adsorbent Dose, Time, and Initial Metal Concentrations
For the effect of pH of solution, metal ion distributions were determined using Visual MINTEQ (V 3.1). The proportion of metal ion species was calculated at 0.001 M ionic strength at 30 • C by adjusting the pH. The results demonstrate that the only ionic species present in the solution are Cd 2+ or Pb 2+ for a pH < 7 (Figure 4). On the other hand, for pH > 7, it was evident that precipitation has the main effect on the removal of Cd 2+ or Pb 2+ , corresponding to the formation of Cd(OH) 2 or Pb(OH) 2 precipitates. Therefore, in the present work, all tests were performed at pH ≤ 7.0. These results are also confirmed by other previous work [61]. The variation in adsorption capacity in this pH range is mainly due to the influence of pH on the surface adsorption characteristics of the adsorbent [38]. These results indicate a higher adsorption performance of activated carbon for met ions. The pHPZC values of the adsorbents were 6.8 and 5.8 for AC1 and AC2, respectivel indicating their relatively acidic nature. This is in accordance with the result of the Boeh titration, which indicates a dominance of acid groups on the surface of the activated ca bon.
Nitrogen (N2) gas adsorption-desorption isotherms of the samples were performe to investigate their porous characteristics. The obtained activated carbons had large sp cific surface areas SBET equal to 551 m 2 g −1 and 404 m 2 g −1 for AC1 and AC2, respectively.

Adsorption Study: Effect of pH, Adsorbent Dose, Time, and Initial Metal Concentrations
For the effect of pH of solution, metal ion distributions were determined using Visu MINTEQ (V 3.1). The proportion of metal ion species was calculated at 0.001 M ion strength at 30 °C by adjusting the pH. The results demonstrate that the only ionic speci present in the solution are Cd 2+ or Pb 2+ for a pH < 7 (Figure 4). On the other hand, for p > 7, it was evident that precipitation has the main effect on the removal of Cd 2+ or Pb corresponding to the formation of Cd(OH)2 or Pb(OH)2 precipitates. Therefore, in the pr sent work, all tests were performed at pH ≤ 7.0. These results are also confirmed by oth previous work [61]. The variation in adsorption capacity in this pH range is mainly du to the influence of pH on the surface adsorption characteristics of the adsorbent [38].  An increase in removal efficiency was observed with increasing pH values. The max imum removal capacity of Pb 2+ was 172.5 mg g −1 and 186.8 mg g −1 for Cd 2+ at pH 6 (Figur 5a). A decrease in removal efficiency was found at low pH values (1-3) due to the hig protonation process, which leads to the accumulation of positive charges on the surfac layer of the adsorbent, resulting in electrostatic repulsion between the positive metal ion and the positively charged surface of the activated carbon. The possible mechanism reac tions that could occur are represented by the following equations [62].  An increase in removal efficiency was observed with increasing pH values. The maximum removal capacity of Pb 2+ was 172.5 mg g −1 and 186.8 mg g −1 for Cd 2+ at pH 6 ( Figure 5a). A decrease in removal efficiency was found at low pH values (1-3) due to the high protonation process, which leads to the accumulation of positive charges on the surface layer of the adsorbent, resulting in electrostatic repulsion between the positive metal ions and the positively charged surface of the activated carbon. The possible mechanism reactions that could occur are represented by the following equations [62].
2 AC Sur f ace − COH 2+ 2 + M + ↔ AC Sur f ace − COM 2+ + 2H + 2 AC Sur f ace − COH + M + ↔ AC Sur f ace − (CO 2 )M + + 2H + where M = metal ion of Cd or Pb and AC Surface = surface of the activated carbon.  An increase in removal efficiency was observed with increasing pH values. The maximum removal capacity of Pb 2+ was 172.5 mg g −1 and 186.8 mg g −1 for Cd 2+ at pH 6 ( Figure  5a). A decrease in removal efficiency was found at low pH values (1-3) due to the high protonation process, which leads to the accumulation of positive charges on the surface layer of the adsorbent, resulting in electrostatic repulsion between the positive metal ions and the positively charged surface of the activated carbon. The possible mechanism reactions that could occur are represented by the following equations [62].
where M = metal ion of Cd or Pb and ACSurface = surface of the activated carbon. As the pH increased, there was a reduction in positive charges, and thus the adsorption sites became available and subsequently, the adsorption of metal ions increased; these results are in agreement with those found in previous research [63,64].For the study of the effect of adsorbent dose, as shown in Figure 5b, there was an increase in metal ion (Cd or Pb) removal whenever there was an increase in adsorbent dose from 0.2 to 1 g L −1 .This can be expected because with a higher dose of adsorbent in the solution, there is greater availability of exchangeable sites for the metal ions [65]. Beyond an adsorbent dose of 1 g L −1 , the metal ion removal remains unchanged. In this way, an adsorbent dose of 1 g L −1 was chosen as the optimal dose.
In order to establish the contact time required to reach the equilibrium adsorption of a pollutant on activated carbon, it is necessary to follow the adsorption kinetics of metal ions in aqueous solution on the optimized activated carbon. The adsorption of the Cd 2+ and Pb 2+ increased as the contact time varied from 0 to 720 min before becoming constant after 240 min (Figure 5c). The investigation of the effect of the initial concentrations of the metal ions shows that the adsorbed quantities of Pb 2+ and Cd 2+ increase significantly with the increase in the initial concentration (Figure 5d). According to the literature [66], this increase is mainly due to the fact that in the presence of a high concentration of Cd 2+ and Pb 2+ , the diffusion forces of the solute to the pores become significantly higher, thus promoting the retention of metal ions.

Regeneration Study
Metal desorption studies are useful for adsorbent recycling and metal resource recovery. The results of the multiple cyclic adsorption/desorption tests are presented in  As the pH increased, there was a reduction in positive charges, and thus the adsorption sites became available and subsequently, the adsorption of metal ions increased; these results are in agreement with those found in previous research [63,64].For the study of the effect of adsorbent dose, as shown in Figure 5b, there was an increase in metal ion (Cd or Pb) removal whenever there was an increase in adsorbent dose from 0.2 to 1 g L −1 .This can be expected because with a higher dose of adsorbent in the solution, there is greater availability of exchangeable sites for the metal ions [65]. Beyond an adsorbent dose of 1 g L −1 , the metal ion removal remains unchanged. In this way, an adsorbent dose of 1 g L −1 was chosen as the optimal dose.
In order to establish the contact time required to reach the equilibrium adsorption of a pollutant on activated carbon, it is necessary to follow the adsorption kinetics of metal ions in aqueous solution on the optimized activated carbon. The adsorption of the Cd 2+ and Pb 2+ increased as the contact time varied from 0 to 720 min before becoming constant after 240 min (Figure 5c). The investigation of the effect of the initial concentrations of the metal ions shows that the adsorbed quantities of Pb 2+ and Cd 2+ increase significantly with the increase in the initial concentration (Figure 5d). According to the literature [66], this increase is mainly due to the fact that in the presence of a high concentration of Cd 2+ and Pb 2+ , the diffusion forces of the solute to the pores become significantly higher, thus promoting the retention of metal ions.

Regeneration Study
Metal desorption studies are useful for adsorbent recycling and metal resource recovery. The results of the multiple cyclic adsorption/desorption tests are presented in Figure 6.
The adsorption capacities of AC 2 for Cd 2+ and Pb 2+ werereduced from 180.5 and 166.3 mg g −1 to 163.3 to 147.8 mg g −1 , respectively (decreases of 7% and 9% of efficiency between the first and fifth cycles, respectively, for Cd and Pb). This demonstrates that the surface sites occupied by the metal ions could be recovered by acid treatment (Figure 7a), and as previously proven in the study of the effect of pH, adsorption is favored at pH between 3 and 7 ( Figure 7b) and precipitation is favored at pH above 7 (Figure 7c). In acidic medium, H + ions substitute for metal ions through ion exchange, thus promoting the phenomenon of metal ion desorption. In addition, hydrochloric acid is commonly used to desorb these ions from adsorbents in industrial production, presenting a relatively low cost [67]. The results show that the adsorbent exhibits excellent regeneration performance and high adsorption capacity after five cycles, proving its excellent potential for the treatment of wastewater containing metal ions. The adsorption capacities of AC2 for Cd 2+ and Pb 2+ werereduced from 180.5 and 166.3 mg g −1 to 163.3 to 147.8 mg g −1 , respectively (decreases of 7% and 9% of efficiency between the first and fifth cycles, respectively, for Cd and Pb). This demonstrates that the surface sites occupied by the metal ions could be recovered by acid treatment (Figure 7a), and as previously proven in the study of the effect of pH, adsorption is favored at pH between 3 and 7 ( Figure 7b) and precipitation is favored at pH above 7 (Figure 7c). In acidic medium, H + ions substitute for metal ions through ion exchange, thus promoting the phenomenon of metal ion desorption. In addition, hydrochloric acid is commonly used to desorb these ions from adsorbents in industrial production, presenting a relatively low cost [67]. The results show that the adsorbent exhibits excellent regeneration performance and high adsorption capacity after five cycles, proving its excellent potential for the treatment of wastewater containing metal ions.

Conclusions
In this study, we demonstrated that activated carbon synthesized from prickly pear seed cake is suitable for heavy metal removal from industrial wastewater. The operating  The adsorption capacities of AC2 for Cd 2+ and Pb 2+ werereduced from 180.5 and 166.3 mg g −1 to 163.3 to 147.8 mg g −1 , respectively (decreases of 7% and 9% of efficiency between the first and fifth cycles, respectively, for Cd and Pb). This demonstrates that the surface sites occupied by the metal ions could be recovered by acid treatment (Figure 7a), and as previously proven in the study of the effect of pH, adsorption is favored at pH between 3 and 7 ( Figure 7b) and precipitation is favored at pH above 7 (Figure 7c). In acidic medium, H + ions substitute for metal ions through ion exchange, thus promoting the phenomenon of metal ion desorption. In addition, hydrochloric acid is commonly used to desorb these ions from adsorbents in industrial production, presenting a relatively low cost [67]. The results show that the adsorbent exhibits excellent regeneration performance and high adsorption capacity after five cycles, proving its excellent potential for the treatment of wastewater containing metal ions.

Conclusions
In this study, we demonstrated that activated carbon synthesized from prickly pear seed cake is suitable for heavy metal removal from industrial wastewater. The operating Figure 7. Proposed mechanism of adsorption/desorption of Cd(II) and Pb(II) on activated carbon: (a) pH < 3, (b)3 < pH < 7, (c) 7 < pH < 12.

Conclusions
In this study, we demonstrated that activated carbon synthesized from prickly pear seed cake is suitable for heavy metal removal from industrial wastewater. The operating conditions and the use of phosphoric acid as an activating agent were optimized using the experimental design methodology and the results were processed with the DesignExpert software 11.1.2.2.0. The optimal response corresponding to a maximum MB index and iodine number (395.49 mg g −1 and 2527.30 mg g −1 , respectively) was obtained when the Tc, impregnation ratio, Ta, and activation time were set to 500 • C, 2:1 (g H 3 PO 4 /g carbon), 500 • C, and 2 h, respectively. At a Tc of 600 • C, a mass activation ratio of 2:1 (g H 3 PO 4 /g carbon), an activation temperature of 400 • C, and an activation time of one hour, the maximum adsorption of heavy metals was reached, with 170.2 and 158.4 mg g −1 for Cd 2+ and Pb 2+ , respectively. The activated carbons with the most developed porosities (AC 1 ), and the most adsorbent power (AC 2 ) with respect to Cd 2+ and Pb 2+ , were selected for subsequent analysis using different analysis techniques. Scanning electron microscopy showed that a very porous surface was developed. The chemical characteristics of Boehm titration and pH of zero charge showed the presence of carboxylic, phenolic, and lactonic groups on the surface of the activated carbons and their acidic character.
The adsorption experiments indicate that the adsorption equilibrium was achieved in about 240 min, and the optimum adsorbent was found to be 1 g L −1 . Maximum adsorption occurred at pH 6. The desorption studies showed that the adsorbent exhibits excellent regeneration performance and high adsorption capacity after five cycles. The results of this study focus on the valorization of prickly pear seed cake to reduce environmental pollution and preserve natural resources. In this way, researchers are encouraged to undertake more in-depth studies in this field.