1 Introduction

While technological developments offer many new and alternative products for the benefit of humanity, they create considerably different wastes in qualitative/quantitative terms. Therefore, in recent years, it is seen that as the industrial demands increase on a global scale, environmental problems have also increased. One of these problems is undoubtedly water pollution and constitutes an important part of environmental problems. Organic and inorganic pollutants are released by industries especially to water basins and pose a threat to global water resources. Or, traditional treatment methods used by these industries cause the formation of large amounts of secondary pollutants and bring environmental problems with it [31]. Water resources, which are getting more polluted every year, affect the life of living things negatively and cause significant changes in the ecological balance of nature. The dyestuffs given to the receiving water sources constitute a part of this pollution as organic load,however, even the presence of very low concentrations of dyestuff in the receiving environment is aesthetically undesirable. In particular, colored wastewater given to the receiving environment reduces the light transmittance in the aquatic environment and adversely affects the photosynthetic activity. In addition, the accumulation of dyestuffs in some aquatic organisms brings the risk of toxic and carcinogenic products [50]. For this reason, color removal processes from industrial wastewater containing dyestuffs are ecologically very important.

Industry branches such as textile, paper, cosmetics, paint, medicine, plastic, and leather are the leading industrial establishments that increase environmental pollution and play an important role in the deterioration of ecological balance. Dyestuffs are one of the organic pollutants that are found in high rates in the waste water of these industries and are highly resistant to biological degradation. If an effective treatment is not done, the discharge of these wastewaters containing dyestuffs to receiving environments such as lakes, rivers, seas, and oceans is highly dangerous (toxic) for all living life. Congo red (CR) is among the dyestuffs that are found in wastewater and have a carcinogenic effect on living things. In particular, almost 15% of Congo red in wastewater comes out only from the textile industry [15]. For this reason, in the treatment of wastewater containing dyestuff, which is an important problem not only for the textile industry but also for many industrial organizations, extensive scientific research is carried out on treatment processes that are economically inexpensive and practical, because the treatment of such wastewater cannot be done at a sufficient level with the existing conventional treatment processes or an effective treatment can be very expensive for the relevant industrial organizations.

In recent years, various technologies for wastewater treatment and/or recycling of used water have been reported in the literature. These technologies differ from each other in terms of physical, chemical, biological, thermal, and electrical principles. The most important water treatment technologies are coagulation-flocculation, filtration, biological treatment, oxidation, reverse osmosis, ion exchange, electrochemical methods, and adsorption. Among these purification techniques, the adsorption process has become the most popular purification method due to its universality, low operating and maintenance cost, and ease of use. The efficiency of removing all kinds of inorganic, organic, and biological pollutants from wastewater by adsorption is quite high [5]. The most important feature determining the efficiency of the adsorption process is the porosity, pore size distribution, and surface area of the adsorbent used. When evaluated in this context, it is thought that biochar products whose surface properties are improved by activation processes can be a good adsorbent. Some studies in the literature have reported that if biochar is used in treatment processes, the efficiency of treatment obtained in removing organic pollutants from water increases significantly compared to systems that do not use biochar. Therefore, biochar products have a great potential in adsorption studies [19].

The most general definition of biochar is stated as a carbon-rich solid material obtained as a result of thermochemical transformation of biomass in an environment where oxygen is limited. In recent years, biochar has been recognized as an important tool that can improve environmental management [34]. Many organic wastes such as agricultural, industrial, urban, and domestic solid waste can be used as raw materials to produce biochar. Biochar is a promising adsorbent due to its advantages such as rich carbon content, high cation exchange capacity, large surface area, and structural stability. Therefore, there has been a significant increase in the number of studies on the use of biochar in the last decade, and it has attracted all the attention [61]. Biochar products can be used not only as adsorbents, but also as catalysts, soil conditioners, and energy storage products [69].

It is very important to activate biochar products to be used for environmental applications and many methods have been developed for this purpose. These methods are divided into two main groups as chemical and physical activation. Chemical activation has been one of the most preferred methods in recent years. Chemical activation can be performed using appropriate acid, base, and metal salts [61]. In general, the chemicals such as ZnCl2, KOH, or H3PO4 are used as activating reagent to produce biochar with high porosity and surface area. The porosity of activated biochars is created by dehydration reactions of these reagents [39]. Among these chemical agents, KOH takes the first place to develop microporous activated biochars with extremely high surface area [63]. In the literature, it has been reported that KOH activation at high temperatures (higher than 700 °C) resulted in a high surface area in the synthesized carbon materials [7]. Carbonaceous materials can be produced through one-step or two-step pyrolysis process. In contrast to one-step process, activated biochars with high surface area can be prepared by pre-carbonized of biomass using two-step process. Pre-carbonization process increases the microcrystalline size of the raw material by reducing surface functional groups. Therefore, it makes it possible to control the pore size distribution of activated biochars. In other words, it is highly effective on the porosity development of solid product [68].

The general reaction steps of KOH activation are as follows; when the carbonized solid product obtained as a result of pre-carbonization of the biomass is treated with KOH, potassium metal becomes active and/or mobile (Eqs. 1 and 2).

$$\mathrm{C}+2\mathrm{KOH}\to 2\mathrm{K}+\mathrm{H}_{2}^{\uparrow }+\mathrm{CO}_{2}^{\uparrow }$$
(1)
$$\mathrm{C}+2\mathrm{KOH}\to 2\mathrm{K}+{\mathrm{H}}_{2}\mathrm{O}+{\mathrm{CO}}^{\uparrow }$$
(2)

Metallic potassium bonded between carbon layers expands these layers and creates a porous structure. With the increasing activation temperature, potassium metal expands even more and breaks down the structure, causing the formation of micropores. K2CO3, which is released as a result of the gasification reaction and other side reactions (Eqs. 3 and 4) occurring during this time, causes well-developed internal porosity and the activation process is resulted in high efficiency [27].

$${\mathrm{CO}}_{2}+2\mathrm{KOH}\to {\mathrm{K}}_{2}{\mathrm{CO}}_{3}+{\mathrm{H}}_{2}\mathrm{O}$$
(3)
$${\mathrm{H}}_{2}\mathrm{O}+\mathrm{C}+2\mathrm{KOH}\to {\mathrm{K}}_{2}{\mathrm{CO}}_{3}+{{2\mathrm{H}}_{2}}^{\uparrow }$$
(4)

Activated biochars obtained by this method are amorphous carbonaceous materials with high internal surface area and functionalized surfaces. They are used extensively as sorbent-materials in industrial purification and chemical recovery operations.

In literature, there are limited studies using activated biochar on removal of CR from aqueous solution. For example, the maximum amount of Congo red adsorbed by (NH4)2HPO4-pretreatment and KOH-activated biochar obtained from the pyrolysis of silkworm cocoon waste biomass was reported to be 512 mg/g [39]. In another study, the maximum amount of Congo red adsorbed by H3PO4-activated biochar obtained from the pyrolysis of apricot kernel was reported as 32.85 mg/g [1]. As seen from these studies, agricultural by-products are generally used as sorbent-materials on CR removal in the literature. This study has been carried out to generate added value product from forestry wastes such as pine cones as an economic and technological solution for CR removal from aqueous solution, and also to minimize the disposal problems of these wastes. It is known that pine cones cause the fire to spread over a wider area, especially in forest fires, the number of which is increasing every year around the world in recent years. Especially the resin in the pine cones melts at high temperature during the fire, evaporates, and pine cones explode with the resulting pressure. With the impact of the explosion, it is throwed to a long distance like a fireball. Therefore, the fire spreads more quickly over a large area. For this reason, one of the precaution to be taken in order to prevent forest fires is the disposal of this forestry waste. This study provides an opportunity to dispose of the pinecones and transform it into an environmentally friendly material. In addition, when the studies in the literature are examined, there is only one study in which activated biochar prepared from pine cones was used in the removal of CR from aqueous solution in recent years. In this study carried out by Dawood et al. [21], the activation process was performed using H3PO4. Therefore, KOH activated pinecone biochar has never been used in CR removal before in the literature. The results to be obtained from the study will close this gap in the literature.

Artificial neural networks (ANNs) are mathematical models that simulate the behavior of biological neural networks. Its most important feature is the ability to solve problems and learn through experience. The artificial neural network is not programmed; it is trained through a learning process based on experimental data [12]. Neurons are the basic element of ANN. Neurons accept inputs from other neurons and fire their synapses, producing an output. Neurons perform a weighted sum over all their inputs, and then the result goes through a transfer function to produce an output. ANN is divided into layers. It has an input layer, an output layer, or in some cases one or more hidden layers. Hidden layers are the root of ANN because they perform their actual calculations in the network [20].

Artificial neural networks are widely used as modeling tools in many areas such as medical diagnosis, waste management, structural health monitoring, manufacturing system, automotive, industry, data mining, renewable, and sustainable energy systems [58]. Recently, artificial neural networks have been used as a tool to model adsorption processes [29]. In particular, it is applied to model the adsorption data of various pollutants [43]. For example, Chakraborty and Das [14] created an artificial neural network model to predict Cr adsorption of nano-silica-coated biochar they synthesized from thermal transformation of sawdust. In another study, Wong et al. [62] used an artificial neural network to model the adsorption of Cu (II) from aqueous solution using biochar produced from the Rambutan (Nephelium lappaceum) peel. Hence, ANN is an important prediction method that can be used for the removal of all environmental pollutants, especially wastewater treatment [48, 49, 65].

The aim of this study is to determine the adsorption properties of KOH-activated biochar produced by pyrolysis of pine cone, which is forestry waste, in the removal of Congo red from aqueous solutions. For this purpose, Brunauer–Emmett–Teller (BET), SEM, and FT-IR analyses were performed to determine the chemical and surface properties of the produced biochar and it was characterized. Afterwards, the effect of the adsorption parameters (initial concentration, temperature, adsorbent amount, pH, and contact time) for the effective removal of the specified dyestuff from the aqueous solution with the batch adsorption experiments carried out under different conditions were examined and the optimum conditions were determined. After the adsorption process, the change in the chemical and surface properties of biochar was determined by FT-IR and SEM analysis. Finally, artificial neural network was used to model Congo red removal from aqueous solution by using activated biochar obtained from pine cone as an adsorbent.

2 Material and methods

2.1 Preparation of pine cones

In this study, pine cones (PCs), one of the forestry wastes, were used as biomass. The PCs were collected from Ankara province in Turkey and air-dried for several days. The dried samples were reduced in size by passing it through a stainless steel blade mill (Waring, USA). The raw material obtained as a result of the size reduction process was subjected to sieve analysis and then used in pyrolysis process for preparing pine cone biochar.

2.2 Pyrolysis processes and preparation of activated pine cone biochar

Although the simple and energy-saving single-stage strategy seems to be more competitive, in this study, activated biochar was prepared using the multi-stage activation method. In other words, the pyrolysis and activation processes required to produce the APC biochar were carried out separately. An electrically heated cylindrical furnace was used for this purpose. Firstly, 500 g of the raw PCs were pyrolyzed for 1 h under carbonization conditions at 600 °C, 10 °C /min heating rate, and 100 mL/min nitrogen flow rate. And then, the carbonized solid product (biochar) obtained at the end of the pyrolysis process was impregnated using concentrated KOH solution. The impregnation ratio was taken as one-fourth for weight of carbonized sample/weight of impregnation reagent. Activation was carried out at 10 °C /min heating rate, 100 mL/min nitrogen flow rate, and maximum temperature of 800 °C for 1 h by using the impregnated PC biochar. The activated PC biochar obtained at the end of the activation process was neutralized using dilute HCl solution. APC biochar, which was separated by filtration, was washed with silver nitrate solution until no chloride reaction occurred. Finally, APC biochar was dried at 105 °C for 24 h and was used in adsorption experiments [36, 37].

2.3 Characterization of activated pine cone biochar

2.3.1 BET analysis

Surface area of APC biochar was obtained from nitrogen adsorption analyses at 77 K by using Micromeritics/Tristar II 3030 Surface Area Analyzer. Prior to gas adsorption measurement, the sample was degassed at 200 °C under vacuum for 12 h. The N2 adsorption data were obtained in a relative pressure (P/P°) range of 10−2 to 0.99. The surface area was calculated from N2 adsorption isotherms by using BET equation. The total pore volume was calculated from the amount of N2 adsorbed at a relative pressure of 0.95. BJH method was used to calculate the meso/macropores volume and determine the pore size distribution of APC biochar.

2.3.2 FT-IR analysis

The surface functional groups of APC biochar before and after adsorption process were examined by FT-IR spectroscopy (Perkin Elmer, Spectrum Two, USA). FT-IR spectra were recorded between 600 and 4000 cm−1 by using pellets made with KBr.

2.3.3 SEM analysis

To examine the surface properties and microstructure morphology of APC biochar before and after adsorption process, topographic images of the sample surface were taken with the ZEISS/LEO EVO 40 brand SEM device and structural changes were determined.

2.3.4 Determination of the point of zero charge (pHpzc) of APC biochar

The pHpzc value was determined by a simple electrochemical method. NaCl solution (0.01 M, 50 mL) was taken into different beakers, and their initial pH were adjusted between 2 and 12 by using 0.1 M HCl or 0.1 M NaOH solutions. Then, 0.15 g APC biochar was added to the each beaker and the suspensions were left to equilibrate for 48 h at 25 °C, in order to determine the final pH. The final pH was plotted against the initial pH, and the pHpzc value was determined at the point where the curve crosses the line pHinitial = pHfinal [59].

2.4 Determination of effectiveness of APC biochar in removal of Congo red from aqueous solution

Congo red (CR) dyestuff was selected as a typical model pollutant due to its potential risk for environment. It was purchased from Sigma-Aldrich. It was of analytical grade and was used without further purification. The detailed information of dyestuff is given in Table 1.

Table 1 Characteristic properties of CR dye

A stock solution of CR dye at a concentration of 1000 mg/L was prepared. By diluting the stock solution, test solutions at different concentrations in the range of 25–100 mg/L were obtained. Initial pH of test solution was about 6.12. Batch adsorption experiments under different conditions were carried out using 250 mL of these test solutions. Some parameters affecting the adsorption process such as pH (2–10), adsorbent dosage (0.1–0.5 g/250-mL solution), and temperature (25–45 °C) were studied in a batch system. The pH was adjusted using HCl (1 M) and NaOH (1 M) solutions. The adsorption experiments were conducted using a batch technique under constant stirring at 150 rpm. For this purpose, a constant temperature shaking water bath was used. The experiments were carried out for 400 min to ensure that the equilibrium was reached. The samples were collected at predetermined time intervals and adsorbent separated from the samples by filtering in order to minimize the interference of the carbon particles. The residual dye concentration in samples was measured using a UV–Visible Spectrophotometer (DR2400, Hach Company, USA). Spectrophotometric measurements were carried out at a wavelength (λmax) which was suitable for the color of the initial test solution (Table 1), because the color of the test solutions changed from red to blue during the pH adjustment process especially with acid addition. This color change, observed only initially when preparing the test solutions, was not observed throughout the adsorption process. The remaining dye concentration in the solution was calculated by using the absorbance values measured at the wavelengths changed depending on the color of the test solution and the calibration graph. The amount of CR dye adsorbed per unit mass of the adsorbent (qe) at equilibrium was calculated according to the following Eq. (5) and the percentage of CR dye removed was calculated by using Eq. (6) [53].

$${q}_{e}=({C}_{0}-{C}_{e})\times \frac{V}{m}$$
(5)
$$\mathrm{CR dye removal}\left(\mathrm{\%}\right)=\frac{{C}_{0}-{C}_{e}}{{C}_{0}}\times 100$$
(6)

where qe is the amount of adsorbed dye per gram of adsorbent in equilibrium (mg/g), Co and Ce are the initial and final dye concentration in solution phase, respectively (mg/L), V is the volume of dye solution (L), and m is the weight of adsorbent (g). In order to ensure the reproducibility of the results, all the adsorption experiments were performed in triplicate with the help of prepared control solutions at the same experimental conditions, and the average values were used in data analysis. Relative standard deviations were found to be within ± 1.5%. It was very important to prepare control solutions, especially in adsorption processes carried out at different pH and different temperatures, because some dyes such as CR can change color during the preparation of the initial test solution because they are sensitive to solution pH. And also, anionic dyes such as CR can degrade with temperature.

The variable parameters selected while performing the adsorption experiments (temperature, pH, adsorbent dosage, initial dye concentration, and contact time) were used as input parameters for modeling of the adsorption process using artificial neural network. The % CR removal, which is tried to be maximized during the modeling phase, was selected as the model estimation parameter and defined as output to the system.

2.5 ANN modeling of Congo red adsorption onto APC biochar

Artificial neural networks explore relationships with target values using a set of input independent variables. It is also defined as a set of data-driven models used in mapping-based output estimation. Feed forward back propagation ANN is a classic architecture used for predictive models. The general architecture of the model consists of an input layer, a hidden layer, and an output layer [4].

The input layer accepts signals and data from the outside world. The output layer performs the output of the system processing result. The hidden layer processes data between the input and output layers and cannot be viewed from outside the system. Back propagation network (BP), widely used in artificial neural networks, is a multi-layer feed forward neural network trained according to the error back propagation algorithm. The basic BP algorithm includes two processes, propagation of signals forward, and propagation of errors backward. Statistical parameters are used in the literature to evaluate the performance of the developed ANN model. These parameters are root-mean-square error (RMSE) (Eq. 7), mean absolute error (MAE) (Eq. 8), mean bias error (MBE) (Eq. 9), and correlation coefficient R2 of each ANN structure [610].

$$RMSE=\sqrt{\frac{1}{N}\sum_{i=1}^{N}{({H}_{i}-{H}_{i,model})}^{2}}$$
(7)
$$MAE=\frac{1}{N}\sum_{i=1}^{N}\left|{H}_{i}-{H}_{i,model}\right|$$
(8)
$$MBE=\frac{1}{N}\sum_{i=1}^{N}({H}_{i}-{H}_{i,model})$$
(9)

Artificial neural network modeling is an advanced tool used to determine the effects of variable parameters on output. In the modeling studies of adsorption process, temperature, pH, adsorbent dose, initial concentration, and contact time are selected as input parameters generally. These parameters are indicated by the symbols of T, pH, m, Co, and t, respectively. Correlation graphs presented for the estimation of the % removal efficiency by testing single or multiple variables in the adsorption analysis are used to measure the suitability of linear or nonlinear relationships.

3 Results and discussion

3.1 Yield and structural characterization of activated PC biochar

Biochar products obtained from biomass eliminate many environmental problems as well as cost problems. But at this point, it is very important to characterize the biochar product, because their characterization plays a role in determining their applications in industry and environmental fields [34]. Biochar products with high surface area and high porosity interact more easily with organic pollutants such as dyestuffs in water during adsorption process due to their various surface functional groups. Therefore, the adsorbent properties of biochar products vary depending on the size of the surface area, porous structure, and richness of functional groups [31]. In particular, biochars with high surface area can be produced by chemical activation method, and it is known that the surface area increases as the chemical ratio or impregnation ratio increases in this process. However, while increasing the impregnation ratio increases the surface area, it also changes the pore structure of the biochar. While the activated biochars obtained at low impregnation ratios have a microporous structure, the activated biochars become predominantly mesoporous as the amount of impregnation agent increases. In addition, the yield of the activated biochar product is also affected by the impregnation ratio [24].

In this study, by pyrolysis of lignocellulosic raw material (PC) at 600 °C carbonization temperature, a solid product, namely, biochar, was obtained with 30% yield. In order to increase the surface area of this product obtained, the activation process was carried out at 800 °C by using 1:4 impregnation ratio and KOH solution.

High impregnation ratio increased the yield of resulting activated biochar product (42.5%) due to the inhibition of the formation of tar and volatiles by KOH, which was used as a chemical agent [24]. This result is compatible with the results of similar studies producing activated biochar in the literature [26, 33, 55, 56]. The surface area of APC biochar was determined by N2 adsorption at 77 K by using BET equation. Additionally, the pore size distribution of activated biochar was determined by BJH method. Adsorption/desorption isotherm graph and pore size distribution of APC biochar are given in Fig. 1. BET surface area and pore volume values of the activated biochar product were measured as 1714.5 m2/g and 0.684 cm3/g, respectively. Chemical activation caused a considerable increase in the surface area. In our previous study, the surface area of the non-activated PC biochar was 259.74 m2/g [36, 37], but this value increased by approximately 6.7 times as a result of the chemical activation process. At the same time, it has been determined that KOH used in the activation process is a very effective chemical activation agent, because Biswas et al. [11] determined the surface area value of the biochar which is activated with H3PO4 obtained from the pine cone as 171.85 m2/g. It was seen that the surface area value of the KOH-activated biochar obtained from pine cone was quite high compared to many studies especially in the field of water treatment in the literature. This result suggests that activated PC biochar may be a good carbon based material to be used as adsorbent for removing of environmental pollutants.

Fig. 1
figure 1

a N2 adsorption/desorption isotherm graph and b pore size distribution graph of APC biochar

3.2 Adsorption of Congo red onto activated PC biochar

The adsorption capacity of the produced APC biochar was tested for the removal of CR from aqueous solution. The effects of different adsorption parameters such as pH of solution, initial concentration of dye solution, contact time, adsorbent dosage, and temperature on the adsorption of CR onto APC biochar were investigated and optimized in batch experimental system. The equilibrium of adsorption was modeled using Langmuir, Freundlich, and Temkin isotherm models. Pseudo first-order, pseudo second-order, and intra particle diffusion kinetic models were used to test the adsorption data. Thermodynamic parameters such as Gibbs free energy, enthalpy, and entropy were determined. Finally, artificial neural network was used to model CR removal from aqueous solution by using APC biochar as an adsorbent.

3.2.1 Effect of initial solution pH

pH is one of the most important parameters affecting the adsorption process due to the possibility of binding of hydronium (H3O+) and hydroxyl (OH) ions in the solution to the adsorbent surface strongly. Therefore, the effect of solution pH on the adsorption of CR dye onto APC biochar was studied in the pH range of 2–10. When determining the pH effect, all other process variables such as initial dye concentration (25 mg/L), adsorbent dosage (0.5 g/250-mL solution), and temperature (25 °C) were kept constant. The effect of pH on the adsorption of CR dye on APC biochar is shown in Fig. 2. While the CR removal efficiency at pH 2.0 was 43.52%, this value increased rapidly during the increase of the solution pH up to 4.0 and reached its maximum value (90.07%). However, the experimental results obtained showed that as the initial pH of the solution increased further, the removal efficiency decreased significantly in the adsorption process and decreased to approximately 55% at pH 10. As it is known, the increasing concentration of hydroxyl ions in the solution at high pH values causes the net surface charge of the adsorbent to be negative. Therefore, the anionic CR dye, which exists in the form of negatively charged ions in aqueous solution, could not adhere sufficiently to the adsorbent surface due to the absence of electrostatic interaction between the dye molecules and the adsorbent surface at high pH values [53]. In addition, the ionization degree of organic compounds such as dyestuffs at high pH levels significantly decreases. This situation may have caused a decrease in the interaction between the CR dye molecule and the adsorbent and thus the low removal efficiency [28]. Although the surface charge of the adsorbent was positive at low pH values and therefore the CR removal efficiency was increased, the decrease in the adsorption efficiency was observed in extremely acidic environments (around pH 2.0). This result can be explained by the fact that H+ ions in the solution adhere more primarily to the adsorbent surface compared to the CR dye molecules. Therefore, this situation caused a decrease in the number of active binding centers to which CR dye molecules can be attached on the adsorbent surface. As a result, since the natural pH of the aqueous solution containing CR dye was 6.3 at the beginning, this study revealed the importance and necessity of pH adjustment in the adsorption of CR dye on APC biochar.

Fig. 2
figure 2

The adsorption efficiencies (%) achieved in the removal of CR dye from aqueous solutions at different pH values (C0 = 25 mg/L; adsorbent dosage = 0.5 g/250 mL solution; T = 25 °C)

The point of zero charge (pHpzc) is an important factor that determines the adsorption ability of the adsorbent surface. It is the pH for which the net surface charge of adsorbent is equal to zero. When pH > pHpzc, the adsorbent surface is deprotonated and gives a negative charge. Therefore, cationic dye adsorption is favored in this case [16]. In this study, in order to better understand of adsorption mechanism, the pHpzc value was determined. The pHpzc value of APC biochar was observed as 5.2, which means that the adsorbent surface was positively charged at pH below 5.2. This result showed that the negatively charged CR dye molecules which is an anionic dye was electrostatically attracted to the protonated adsorbent surface at pH below 5.2. Thereby, the removal efficiency increased due to a strong ionic interaction between the CR molecules with APC biochar surface, and CR adsorption occurred mainly on the surface through electrostatic forces [57]. As a result, how CR dye molecules were captured on the surface of the APC biochar depending on the pH of the environment was explained with this feature.

3.2.2 Effect of temperature

Another important parameter affecting the adsorption process after pH of solution is undoubtedly temperature. Therefore, batch adsorption experiments were performed at different temperatures ranging from 25 to 45 °C. Experimental data are presented in Fig. 3. Experimental results showed that the efficiency of CR removal increase with increasing temperature, so the adsorption process is chemical (Fig. 3a). Although the temperature increase caused about 5% efficiency increase in CR removal, the time to reach equilibrium in adsorption process considerably shortened. While this process was completed in 180 min at 25 °C, the adsorption ended in 60 min at 45 °C and the maximum removal value (94.62%) was obtained (Fig. 3b). Therefore, the temperature increase significantly reduced the duration of the adsorption process rather than the increase in efficiency. This result can be explained by the high temperature allowed a better mobility for dye molecules, and was improved adsorption process, because the diffusion rate of the dye molecules from the solution to the adsorbent surface increased with the increase in temperature [32]. Additionally, experimental results indicated that the adsorption process is endothermic in nature for CR dye removal. There was no significant change in the adsorption capacity values as the temperature increased (Fig. 3b).

Fig. 3
figure 3

a The adsorption efficiencies (%) achieved in the removal of CR dye from aqueous solutions at different temperatures (C0 = 25 mg/L; adsorbent dosage = 0.5 g/250 mL solution; pH = 4). b Change in adsorption capacity of APC biochar with temperature

3.2.3 Effect of initial dye concentration and adsorbent dosage

Adsorption generally occurs in three stages. In the first stage, the pollutant is moved from the solution to the solid surface of the adsorbent (surface boundary layer). This phenomenon is called “film diffusion.” In the second stage, the pollutant coming into the boundary layer is diffused into the macropores and micropores on the adsorbent surface. This phenomenon is called “pore diffusion.” In the last stage, the adhesion of the contaminant occurs on the inner surface of the pores. Therefore, this process is basically a diffusion process and the most intense mechanism is the mass transfer from the liquid phase to the solid phase. Therefore, the driving force in this process is the difference in concentration. The initial concentration provides an important driving force to overcome the mass transfer resistance of all molecules between the aqueous and solid phases [23, 30]. When the activated biochar obtained from the pine cone is used as an adsorbent, the effect of different initial CR concentrations on adsorption yield and adsorption capacity values are shown in Fig. 4. Experimental results showed that by changing the initial concentration of CR dye solution at the range of 25–100 mg/L, the adsorption efficiency decreased, whereas the adsorption capacity values increased. All dye molecules in the solution, particularly at low concentrations, interacted with the binding sites of the adsorbent, resulting in high removal efficiencies. However, due to the limited number of binding sites of adsorbent, adsorption occurred in a more inefficient manner at high concentration compared to low initial concentration [17]. Decrease in the removal efficiency as the initial dye concentration increases was not a sign that the APC biochar was not effective to remove high amount of CR dye from aqueous solution. This result reveals that the amount of adsorbent used should be increased in order to obtain high dye removal efficiency at high initial concentrations. On the other hand, the increased initial concentration caused an increase in the equilibrium adsorption capacity. An increase in the initial concentration of CR dye solution from 25 to 100 mg/L resulted in an increase of the adsorption capacity of APC biochar from 11.83 to 34.19 mg/g, because the driving force required on the mass transfer resistance of the dye molecules to be held on the solid surface was increased by the concentration increase. This situation increased the adsorption capacity values. Similar results were observed in the study conducted by Kaur et al. [35].

Fig. 4
figure 4

The adsorption efficiency (%) and adsorption capacity (mg/g) values for different initial dye concentrations (T = 45 °C; adsorbent dosage = 0.5 g/250-mL solution; pH = 4)

Surface area is very important in the adsorption process. It is known that carbon-based adsorbents, especially with small particle size and large surface area, are very effective in dye removal from aqueous solutions. APC biochar prepared in this study was added to 250 mL test solution containing CR dye in different doses (0.1–0.5 g). Homogeneous distribution of the adsorbent was ensured by shaking the test solutions in a water bath with constant temperature until the adsorption process was completed. As seen from Fig. 5, increase in the amount of adsorbent positively affected the adsorption process, the highest percentage of removal (94.62%) was obtained at 0.5 g adsorbent amount. APC biochar, which is used as an adsorbent, has caused high removal efficiency when used even in very small quantities due to its very large surface area and its highly porous structure. In addition, the adsorption capacity values calculated at different adsorbent amounts are seen from the Fig. 5. The maximum capacity value reached in the adsorption process was determined as 45.68 mg/g for 0.1 g of adsorbent dosage.

Fig. 5
figure 5

The adsorption efficiencies (%) and adsorption capacities (mg/g) achieved in the removal of CR dye from aqueous solutions at different adsorbent dosage (T = 45 °C; pH = 4; Co = 25 mg/L)

3.2.4 Effect of contact time

Rapid adsorption and short time to reach equilibrium is an important parameters showing the effectiveness of adsorbents to be used in water treatment. Figure 6 gives the amounts of dye adsorbed per unit mass of the adsorbent at the time of equilibrium and optimum contact time in the removal of CR dye from aqueous solutions at optimum conditions and different initial dye concentrations. In this study, it is seen that dye adsorption on APC biochar occurred very rapidly. Most of the removal of CR dye molecules took place within the first 60 min. The higher adsorption rate at the initial stage of the process may be due the availability of more vacant active sites on biochar surface at the beginning [47]. When the effect of contact time on adsorption capacity is examined, it was found that by increasing the contact time, the amount of adsorbed dye molecules increased and the time to reach equilibrium was 60, 85, 100, and 240 min at the initial concentrations of 25, 50, 75, and 100 mg/L, respectively. When the equilibrium was reached, there was no change in the adsorption capacities. Experimental results indicated that the duration of the equilibrium increased with increasing initial dye concentration. At the same time, increasing concentrations of dye molecules in the aqueous solution led to an increase in the adsorption capacity over time.

Fig. 6
figure 6

Effect of contact time and initial concentration on the adsorption of CR dye onto APC biochar (pH = 4, T = 45 °C, adsorbent dosage = 0.5 mg/250-mL solution)

As a result, it is concluded that APC biochar was a superior adsorbent for CR removal because the value of the removal efficiency was quite high in comparison to several other reported adsorbents in literature (Table 2). The results obtained from these studies show that in order to obtain high CR removal efficiency, the biochar used as adsorbent must be activated using one of the physical or chemical methods. Especially with chemical activation, it is possible to obtain high removal values in a short time in an acidic environment. At the same time, it is clearly seen from Table 2 that the CR removal efficiency increased from 81% to approximately 95% by activating the biochar obtained from pine cones with KOH instead of H3PO4.

Table 2 Maximum adsorption efficiencies (%) for removal of CR dye using different biochars

3.2.5 Adsorption isotherm models

The relationship between the concentration of solute remaining in solution at equilibrium at constant temperature and the amount of solute adsorbed per unit weight of the adsorbent can be determined by the resulting function called “adsorption isotherm.” However, the adsorption isotherm generally provides some important information about the adsorbent capacity, adsorption energy, and its mechanism. For this purpose, many isotherm models, some of which are empirical, have been developed. It is possible to examine these isotherms according to the number of unknown parameters in two groups as two-parameter and three-parameter. Freundlich, Langmuir, Dubinin-Radushkevich, and Temkin models are two-parameter isotherm models and are more commonly used. Redlich-Peterson, Sips, Khan, and Toth models are among the three-parameter isotherm models [28].

In this study, three well-known isotherm models (Freundlich, Langmuir, and Temkin) were applied to investigate the adsorption process mechanism in the removal of CR dye from aqueous solution by using APC biochar as adsorbent. Freundlich isotherm model refers to a non-uniform distribution on a heterogeneous surface. According to this model, the adsorption areas on the surface of an adsorbent are heterogeneous; that is, they are formed from different types of adsorption areas. In contrast, according to the Langmuir isotherm model, the adsorbed molecules form a saturated single layer on the surface of the adsorbent, and the adsorbed molecules are stable and do not move on the adsorbent surface. In addition, the adsorption rate is directly proportional to the concentration of the adsorbed substance. The Temkin isotherm model, on the other hand, was developed by considering the adsorption heat of all molecules in solution. In this model, the decrease in the adsorption heat is considered linear and the binding energy homogeneous. The linear form of the Langmuir (Eq. 10), Freundlich (Eq. 11), and Temkin (Eq. 12) equations are commonly given by

$$\frac{{C}_{e}}{{q}_{e}}=\frac{{C}_{e}}{{q}_{\mathrm{max}}}+(\frac{1}{{q}_{\mathrm{max}}{K}_{\mathrm{L}}})$$
(10)
$$\mathrm{ln}{q}_{e}=\mathrm{ln}{K}_{f}+\frac{1}{n}\mathrm{ln}{C}_{e}$$
(11)
$${q}_{e}=\mathrm{BlnA}+{\mathrm{BlnC}}_{\mathrm{e}}$$
(12)

where Ce is the equilibrium concentration of solute in the bulk solution (mg/L), qe is the amount of solute adsorbed per unit mass of adsorbent (mg/g), qmax is the maximum adsorption capacity (mg/g), KL is the constant related to the free energy of adsorption (L/mg), Kf is a Freundlich constant indicative of the relative adsorption capacity of the adsorbent (mg/g (L/mg)1/n), 1/n is the heterogeneity factor which is the constant characteristics of the system, A is the Temkin isotherm equilibrium binding constant (L/g), and B is the constant related to heat of sorption (J/mol) [18]. With the application of the results obtained experimentally to the Langmuir, Freundlich, and Temkin isotherm models, the linear isotherm graphs Ce/qe versus Ce, lnqe versus lnCe, qe versus lnCe were drawn and the model parameters calculated from these graphs are given in Table 3.

Table 3 Langmuir, Freundlich, and Temkin isotherm constants for the adsorption of CR dye onto APC biochar

When Langmuir, Freundlich, and Temkin isotherm models are evaluated together, the experimental results were more compatible to the Freundlich isotherm model due to the highest correlation coefficient. As it is seen from Table 3, the adsorption process is a chemical process because of the fact that 1/n values were smaller than 1. This result was similar to those obtained by studies on the effect of temperature on the adsorption process in order to characterize the adsorption model.

3.2.6 Adsorption kinetics and thermodynamic study

Determination of adsorption kinetics is very important to find the effective adsorbate-adsorbent contact time, i.e., retention time. In addition, adsorption kinetics is an important step in understanding the adsorption steps that affect the speed of this process. Many different kinetic models can be used to determine reaction degrees of adsorption systems. The commonly used kinetic model is a first-order reaction equation developed by Lagergren. Apart from this, the pseudo second-order rate equation can be used, which states that the adsorption rate is independent of the adsorbate concentration, depends on the adsorption capacity in the solid phase and time. In addition, in order to explain the change in velocity in gradual equilibrium systems, a velocity equation or intra particle diffusion model is also used. This model is particularly important in determining which mechanism is effective in adsorption [42].

In this study, in order to examine the mechanism of adsorption process, pseudo first-order, pseudo second-order, and intra particle diffusion adsorption models were used to adjust kinetic experimental data. The linear form of pseudo first-order, pseudo second-order, and intra particle diffusion rate equations are presented in Eqs. 13, 14, and 15, respectively.

$$\mathrm{ln}\left({q}_{e}-{q}_{t}\right)=\mathrm{ln}\left({q}_{e}\right)-{k}_{1}t$$
(13)
$$\frac{t}{{q}_{t}}=\frac{1}{{k}_{e}{q}_{e}^{2}}+\frac{t}{{q}_{e}}$$
(14)
$${\mathrm{q}}_{\mathrm{t}}={\mathrm{k}}_{\mathrm{i}}.{\mathrm{t}}^{1/2}+\mathrm{C}$$
(15)

where qt and qe denote the sorption capacity (mg/g) at a given time and at equilibrium, respectively; k1 is the pseudo first-order rate constant (min−1); k2 is the pseudo second-order rate constant (g mg−1 min−1); ki is the intra particle diffusion rate constant (mg/g.min0.5); C is the constant; and t is the time (min) [22]. The linear graphs of ln(qe-qt) versus t, t/qt versus t, and qt versus t0.5 are shown in Fig. 7. The values of kinetic parameters (the rate constants of the three models with the correlation coefficients and theoretical adsorption capacity values) of linear form of rate equations are presented in Table 4.

Fig. 7
figure 7

Kinetic model curves obtained at different initial concentrations: a pseudo first-order kinetic model, b pseudo second-order kinetic model, and c intra particle diffusion kinetic model

Table 4 Rate constants of pseudo first-order, pseudo second-order, and intra particle diffusion kinetic models with correlation coefficients for CR adsorption onto APC biochar

As can be seen from Table 4, CR dye adsorption onto APC biochar was more compatible with the pseudo second-order kinetic model because the correlation coefficient values were closest to 1. Besides, qe(exp) (mg/g) values obtained experimentally and qe(cal) (mg/g) values obtained from the model equations were very close to each other. It was determined that as the initial concentration of adsorbate increased, values of qe(cal) and qe(exp) were increased. This result showed that as the initial dye concentration increased, the amount of CR molecules adsorbed increased. However, the rate constant (k2) decreased with increasing initial dye concentration. This result showed that as the initial dye concentration increases, greatly adsorption occurred but it was more slowly than lower concentrations. When the experimental results are examined, while the time to reach the equilibrium when the adsorption was completed in the solution with an initial concentration of 25 mg/L was 60 min, this time increased to 240 min in the solution with an initial concentration of 100 mg/L. This result is an indication that the rate of adsorption slowed down with increasing dye concentration; thus, the reaction rate constant of this process decreased.

Since pseudo second-order kinetic model did not suggest a definite mechanism for adsorption, the results were analyzed using the intra particle diffusion model. As can be seen Fig. 7c, the adsorption process took place by creating two zones. First zone was surface adsorption, while the second zone represented intra particulate diffusion. The CR dye molecules came to the film layer in the first stage and then have moved in the micro and macro pore cavities of the adsorbent and attached to the surface of the pores in the second stage. This result revealed that the adsorption process was not controlled by one step; rapid surface adsorption and intra particle diffusion stage happened together. Additionally, as the initial concentration of CR molecules increased, rate constant (ki) were increased, and therefore, adsorption was faster at higher initial concentrations.

Examining the adsorption process thermodynamically is very important in terms of the applicability of the process. Thermodynamic parameters (ΔH°, ΔS°, and ΔG°) determined for this purpose are shown in Eqs. 1618. These parameters are calculated by using the adsorption equilibrium constant values (Kc) determined for different temperatures.

$$\Delta G=-\mathrm{RTln}{K}_{c}G$$
(16)
$$\mathrm{ln}{K}_{c}=-\frac{\Delta H}{\mathrm{RT}}+\frac{\Delta S}{R}$$
(17)
$${K}_{c}=\frac{{C}_{\mathrm{ads}}}{{C}_{e}}$$
(18)

where R (8.314 J/mol K) is the universal gas constant, T (K) is the absolute solution temperature, Cads is the adsorbed CR dye concentration at equilibrium, and Ce is the concentration of CR dye remaining in the solution at equilibrium [67]. The values of ΔH° and ΔS° were determined from the slope and intercept of the graph of lnKc versus 1/T. The calculated thermodynamic parameters are given in Table 5.

Table 5 Thermodynamic parameters of CR dye adsorption onto APC biochar at different temperatures

As can be seen from Table 5, the negative Gibbs free energy of the process indicated that adsorption occurs spontaneously. In other words, the applicability of the adsorption process was understood by the negative Gibss free energy. While the positive value of ΔH° showed that adsorption was endothermic, the positive value of ΔS° showed the increase of randomness in the solid/solution interface. In particular, the high positive entropy value revealed that CR dye molecules better retained at the interface and showed highly interest to the adsorbent used.

3.3 Surface characteristics of activated PC biochar (before and after CR adsorption)

In this study, the change in the structure of APC biochar after the adsorption process was determined by FT-IR analysis. When compared with the spectrum obtained before adsorption, the change in the structure was determined by the change in the intensity of the peaks given by the surface functional groups particularly. The FT-IR spectrums before and after CR adsorption are given in Fig. 8. When the FT-IR spectrum of APC biochar was examined, the bands observed at approximately 2200 and 2300 cm−1 correspond to C≡N and C≡C stretching vibrations. The peaks at 3000 cm−1 were C-H stretching vibrations caused by aliphatic hydrocarbons. After adsorption process, aromatic C-H stresses appeared to be more intense and were observed between 3000 and 2950 cm−1. The peak belonging to the C = C aromatic stretching vibration was observed at 1590 cm−1. The peak at 3705 cm−1 was N–H stretching vibrations caused by amine group compounds. This peak indicated the presence of compounds with amine groups. The reason for this could be attributed to the nitrogen-containing groups in the chemical structure of the CR dye [41, 64]. In literature, it has been reported that hydrogen bonds were formed between activated biochar and dye molecules thanks to these groups [2, 3, 8, 45, 60, 64]. In both spectra, bands belonging to C-O, C-N, and C–C stress vibrations were observed at approximately 1000–1500 cm−1. Especially, the band at 1100 cm−1 was assigned to the C–O stretch originating from alcohol, ether or hydroxyl group. The peak at 1285 cm−1 belonged to the S = O stretching group in the structure of CR. As a result, functional groups such as N–H, C-O, and C-N groups found on the APC biochar surface might have played an important role in binding the CR dye molecules to the biochar surface [13, 40, 45, 46, 51]. Also, it can be said that NH2, -N = N-, and -SO3 groups in the structure of CR were involved in the adsorption process [3, 60].

Fig. 8
figure 8

The FT-IR spectra of activated PC biochar a before CR adsorption and b after CR adsorption

To clarify the mechanism of CR dye adsorption onto APC biochar, the interaction between adsorbate and adsorbent was explained with supporting data result obtained from FT-IR analysis. The schematic representation to visualize the mechanisms interactions between CR molecules with the carbon surface are presented in Fig. 9. As can be seen from the figure, the activated pine cone biochar product has potential adsorption sites such as C = C, C = O, and O–H. It can be said that the adsorption mechanism of CR dye on the activated biochar surface was occurred by two different interaction types. While one of them was hydrogen bond, the other can be said as weak interactions (such as Van der Waals force and π-π interactions) [2, 54].

Fig. 9
figure 9

Schematic diagram of adsorption mechanism of CR onto APC biochar

In this study, topographic images of APC biochar were taken and the morphological change of adsorbent was investigated after adsorption process. SEM photographs taken before and after adsorption are given in Fig. 10. When SEM photographs are examined, it was seen that the low porosity, which is usually seen in non-activated carbonized samples, was developed as a result of KOH activation and highly distinctive high porous structure was obtained. Although the interaction mechanism of each biomass type with KOH is different, this interaction in pine cone had very positive results in both the surface area and the pore size distribution. Therefore, with the application of pyrolysis and activation processes together, very favorable pore structure for the adsorption process was obtained. It was clear that these pores are empty before adsorption. Surface images taken after adsorption clearly showed that the surface of the adsorbent changes considerably after the treatment, and that CR dye molecules, which were desired to be removed from the aqueous solution in operation, were held by the pores significantly. As a result, it was supported by surface images in which the adsorption process has been successfully performed and very high dye removal values have been achieved. Additionally, the high surface area obtained was attributed to the high porosity in the sample, and this result was supported by SEM images. In other words, with the results obtained from the SEM analysis, it was visually proven that the surface of APC biochar has a heterogeneous and porous structure and due to this structure; the CR dye molecules can bind to different regions on the surface of the adsorbent.

Fig. 10
figure 10

SEM images of the APC biochar a before CR adsorption and b after CR adsorption

3.4 ANN modeling

Usually, a great number of laboratory experiments are done in water treatment to evaluate the effectiveness of different purification techniques and/or to determine the optimum treatment conditions for different pollutants. These experiments are always very time-consuming and costly. In particular, it is difficult to predict the interactions between input and output parameters in the adsorption mechanism by experimental methods. Mathematical models are often used in addition to laboratory experiments for a better understanding of system behavior. Artificial neural networks (ANN) have been used successfully in the modeling of adsorption systems, recently [9, 52]. Therefore, we preferred to apply the ANN model to estimate the adsorption capacity of activated pine cone biochar in this study.

In modeling study, 5 different input sets and 40 different network structures were created. The amount of CR adsorbed by activated pine cone biochar was estimated against input parameters in different network structures. The performance results of the different network structures based on root-mean-square error (RMSE), mean absolute error (MAE), mean bias error (MBE), and determination of coefficient (R2) are presented in Table 6. These errors were estimated using Eqs. 35. ANN modeling was performed using Matlab. Levenberg–Marquardt algorithm was used for the training of artificial neural network. This algorithm, which is included in MATLAB was chosen since if often has higher rates of convergence than the other algorithms provided in the toolbox. The data was randomly divided into 3 sets: 70% for training the network, 15% for validation, and 15% for testing.

Table 6 The comparison of performance of different ANN network structure

This study investigated the applicability of 40 different ANN models with various network structures using transfer functions. The structural diagram of the selected ANN10 model, which has three hidden layers with 10 neurons, is shown in Fig. 11. The training, validation, and test performance of the ANN10 model are given in Fig. 12. Model performance of ANN10 was evaluated by taking into account the correlation coefficients between RMSE, MBE, and MAE values in Table 7.

Fig. 11
figure 11

Structural diagram of ANN10

Fig. 12
figure 12

Training, validation, and test performance of ANN10 model

Table 7 Statistical parameters of the ANN10 model

In general, almost all of the 40 models tested had a RMSE value of more than 1.0 and these models are presented in Table 6. ANN10 as a tangent sigmoid model 3–10-1 had a lower RMSE value (0.770), lower MBE value (0.310), and lower MAE value (0.037) than other studied models. The low value of these errors and the high correlation coefficient (R2) showed that ANN10 was the best among many models. In addition, the performance of the ANN10 model selected as the best was evaluated with different statistical parameters such as R2, MAE, RMSE, and MBE and the results are presented in Table 7. As can be seen from the results, the ANN10 model had high R2 and low MAE, RMSE, and MBE values for training, validation, and test performance. This result proved that the ANN10 model has a high and effective performance. The prediction results showed well agreement with experimental results.

Correlation graphs (Fig. 13) presented for the estimation of the % removal efficiency of CR dye by testing single or multiple variables in the adsorption analysis were used to measure the suitability of linear or nonlinear relationships. As shown from these graphs, the effect of the adsorbent dosage on the output was very small since the correlation value was low. Although it has seen that the correlation increased with the initial dye concentration and contact time variables, these two variables alone were not satisfactory for the estimation of % removal efficiency. Therefore, temperature, pH, adsorbent dosage, initial dye concentration, and contact time variables were all used to accurately estimate the % removal efficiency and the highest correlation was obtained using these variables together.

Fig. 13
figure 13

Relationships between % removal efficiency of CR and input parameters

3.5 Reusability of APC biochar

One of the most important features sought in an adsorbent is its high desorption rate, and reusability. Because, the cost of treatment efficiency due to the consumption of adsorbent will decrease. For this purpose, the reusability analysis was carried out to determine the effectivity of APC biochar. To regenerate adsorbent, 0.5 g of dye loaded APC biochar which was used in the adsorption process was equilibrated with 50 mL of absolute ethanol for 1 h [38]. The desorbed amount of CR was determined as 99% by spectrophotometrically. The shift of the absorption of the chromophore group to a longer wavelength due to a change in solvent or removal of conjugation is called the bathochromic effect. In the regeneration process, the bathochromic effect was observed, while the spectrophotometric measurement was taken by using the solutions obtained by dissolving the CR dye in ethanol instead of water, because the dissolution of the CR dye in ethanol increased the wavelength at which the maximum absorption occurred to 560 nm. Therefore, measurements were taken at this wavelength. The regenerated adsorbent obtained at the end of the process was employed for further CR adsorption process.

Figure 14 shows the reusability of APC biochar for CR adsorption. The removal efficiency slightly decreased from 94.21 to 85.45% up to the fifth cycle. However, at the 5th cycle, removal efficiency of CR onto regenerated APC biochar significantly decreased about 30%. This considerable loss of the adsorption capacity was mainly due to an incomplete desorption process. As a result, the regenerated APC biochar showed good performance for the removal of CR dye molecules, even, after 3rd regeneration.

Fig. 14
figure 14

Regeneration efficiency of APC biochar

4 Conclusions

The removal of toxic materials from aqueous solution is very important because of their persistence in the environment and adverse health effects. It is known that biochar products can adsorb well organic pollutants such as dyes. In this study, the effect of temperature, pH, initial dye concentration, contact time, and adsorbent dosage on CR adsorption onto KOH-activated carbonized pine cone was investigated. PC biochar was produced by carbonization in inert nitrogen atmosphere at 600 °C for 1 h. The carbonized solid product obtained at the end of the process was impregnated using concentrated KOH solution. Activation was carried out by using the impregnated PC biochar, at 10 °C /min heating rate, 100 mL/min nitrogen flow rate and maximum temperature of 800 °C for 1 h. When using APC biochar obtained at the end of the process with a surface area of 1714.5 m2/g as an adsorbent, the maximum adsorption capacity was obtained as 45.68 mg/g for 25 mg/L initial dye concentration at pH = 4.0 and 45 °C. From the experimental results, it was found that the isotherm model and kinetic rate order fitted Freundlich and pseudo second order, respectively. Thermodynamic functions, the change of free energy (ΔG°), enthalpy (ΔH°), and entropy (ΔS°) of CR adsorption on APC biochar were calculated as − 7.578 kJ mol−1 (at 45 °C), 24.94 kJ mol−1, and 106.01 J mol−1 K−1, respectively. These results indicated the spontaneous, endothermic, and the increased randomness nature of CR adsorption.

The prediction of the CR adsorption capacity of the activated PC biochar using an artificial neural network algorithm was modeled. The optimum ANN topology comprised of 5 inputs, 3 first hidden neurons, 10 s hidden neurons, and 1 output neurons using tangent function and purelin activation functions in hidden and output layers, respectively. Temperature, pH, adsorbent dosage, initial dye concentration, and contact time were selected as input parameters. Data was divided into 3 sets: training, validation, and testing: training (70%); validation (15%); and testing (15%). In addition, many different artificial neural network models were developed. Among them, ANN10 gave the best results. According to ANN10 results, root-mean-squared error (RMSE), mean bias error (MBE), mean absolute error (MAE), and correlation coefficient (R2) were estimated as 0.770, 0.310, 0.037, and 0.999, respectively. Consequently, the prediction results showed well agreement with experimental results. These research findings provided an environmentally friendly and inexpensive adsorbent for removal of ionizable CR dye from aqueous solution.