1 Introduction

The widespread use of synthetic dyes in industries such as textiles, paper, and printing has led to a significant increase in the release of dye-contaminated wastewater. These dyes, often resistant to degradation, pose serious environmental and health risks by persisting in water bodies. Consequently, there’s an urgent need for efficient and sustainable methods to remove dyes and safeguard ecosystems and water quality [1,2,3]. The textile industry, while pivotal in modern society for providing colorful fabrics, also bears a significant environmental burden due to the hazardous effects of synthetic dyes [4, 5]. These dyes, enhancing aesthetic appeal, endanger aquatic ecosystems and human health when released into water bodies. Industry statistics underscore the massive scale of dye production and release, with significant volumes entering water bodies annually, negatively impacting aquatic life and water quality [6]. To address this pressing issue, researchers have explored various dye removal techniques, including physical, chemical, and advanced oxidation processes [7, 8]. However, these methods often present challenges such as high costs and the generation of toxic by-products [9,10,11]. Adsorption-based techniques utilizing materials like activated carbon and zeolites have shown promise but are not without limitations [12, 13]. In recent years, biochar (BC) has emerged as a promising adsorbent for dye removal, offering high surface area and abundant functional groups. BC’s eco-friendly nature, lower cost, and renewable sourcing make it an attractive option for wastewater treatment. Several studies have demonstrated BC’s efficacy in removing dyes from wastewater, showcasing its potential for real-world applications [14,15,16,17,18,19].

Focusing on BC, the study elucidates its unique properties and effectiveness compared to conventional materials, aiming to contribute to innovative and sustainable solutions for dye wastewater treatment. Through comprehensive evaluation, this research seeks to pave the way for more effective and environmentally friendly approaches to tackling dye pollution. In the realm of scientific research, the application of statistical methods is crucial for analyzing and interpreting data. One such method widely used to quantify the strength and direction of a linear relationship between two variables is Karl Pearson’s correlation coefficient, denoted as “r.” Equation 1 displays the widely used correlation coefficient of Karl Pearson, which measures the degree of connection between two variables.

$$r= \frac{\left[\sum \left({X}_{i}-X\right) \times \left({Y}_{i}-Y\right)\right]}{n\times {\sigma }_{X}\times {\sigma }_{Y}}$$
(1)

where X and Y are Karl Pearson’s correlation coefficient variables. Xi and Yi represent the ith value of independent variables, and σx and σy represent standard deviations of X and Y. X and Y represent values of c and c/W, respectively, for Langmuir isotherm and c and W, respectively, for Freundlich adsorption isotherm.

When it comes to studying the effectiveness of adsorbents, like BC in the removal of synthetic dyes from wastewater, the correlation coefficient becomes a valuable tool for researchers [20]. “r” is often referred to as Karl Pearson’s correlation coefficient, which is a measure of the linear relationship between two variables. It quantifies the degree to which changes in one variable correspond to the changes in another variable. The range of this coefficient falls between − 1 and + 1 and a positive value of (r) represents a positive correlation, while a negative value indicates a negative correlation. Naturally, as one variable increases, the other tends to decrease. When the value of (r) is 0, then there is no linear correlation between the variables [21]. In the context of studying the effectiveness of BC as a dye adsorbent, researchers often employ Pearson’s correlation coefficient to understand the relationship between different factors. For instance, researchers might correlate the surface area of BC particles with their dye adsorption capacity. A positive correlation would imply that as the surface area increases, the adsorption capacity also increases, indicating the importance of surface area in adsorption efficiency. Interpreting the magnitude of (r) is essential. A coefficient close to + 1 or − 1 signifies a strong linear relationship. For example, if a research study finds a correlation coefficient of + 0.9 between the pore size of BC and its dye adsorption efficiency, it indicates a robust positive correlation. On the other hand, a coefficient close to 0 suggests a weak or no linear relationship [22]. While Pearson’s correlation coefficient is a valuable tool, it is important to note its limitations. It assumes a linear relationship between variables, which might not always be the case in complex systems. Additionally, correlation does not imply causation; even if two variables are correlated, it does not mean that changes in one variable cause changes in the other. In the context of studying BC’s effectiveness in dye removal, researchers must carefully select the variables to correlate. Factors like BC surface area, pore size distribution, and chemical composition can be correlated with dye adsorption capacity. By applying Pearson’s correlation coefficient in these studies, researchers gain valuable insights into the key factors influencing the efficiency of BC as a sustainable solution for wastewater treatment. This statistical analysis not only enhances the understanding of the adsorption process but also guides further research and development in the field of environmental remediation.

2 The novelty of this work is as follows:

  • River tamarind (RT) stem biochar (BC) is investigated for its efficacy in adsorbing hazardous dyes from polluted water sources.

  • The utilization of RT stem, a commonly used culinary ingredient, for BC production offers a sustainable approach to address water pollution challenges.

  • This study aims to elucidate the adsorption behavior and capacity of RT stem BC using established Langmuir and Freundlich adsorption isotherms.

  • Comprehensive statistical analyses, including t-tests, ANOVA, paired t-tests, and chi-square tests, are employed to understand correlations between experimental conditions and BC’s dye adsorption properties.

  • Karl Pearson’s coefficient is calculated to explore potential relationships among key variables.

  • The novelty of this work lies in its exploration of RT stem biochar as a viable solution for removing phenol dye from polluted water, with a high removal efficiency of 98%.

3 Statistical analysis of experimental data

In the realm of scientific research, statistical analysis plays a key role in drawing meaningful conclusions from experimental data. One of the essential components of statistical analysis is hypothesis testing, a systematic method used to make inferences about population parameters based on sample data. The process of hypothesis testing involves the formulation of hypotheses, determining the level of significance, and selecting appropriate statistical tests based on the nature of the data.

3.1 Null hypothesis and alternative hypothesis

The null hypothesis (H0) is assumed to be true initially, serving as the basis for statistical analysis. The alternative hypothesis ((Ha), on the other hand, presents an opposing view, indicating what the researcher aims to establish. Depending on the experimental findings, either the null hypothesis is rejected in favor of the alternative hypothesis or vice versa [23].

3.2 Application in experimental data analysis

In the context of studying the effectiveness of BC in dye removal, researchers can utilize hypothesis testing to assess various parameters. For example, they might use a t-test to compare the mean dye adsorption capacity of BC samples with that of traditional adsorbents. Alternatively, the chi-square test could be employed to analyze the categorical data related to different experimental conditions. The choice of the appropriate test depends on the type of data collected and the specific hypotheses being tested.

4 Adsorption isotherms

Utilizing equations known as adsorption isotherms, researchers often analyze experimental data to clean insights into underlying phenomena. The isotherm, though not rigid, is subject to variation, and the coefficient of correlation plays a pivotal role in this determination. A notable correlation coefficient of 0.90 was achieved through the linear fitting of experimental data, demonstrating its robustness [24]. Equation 2 represents a Langmuir isotherm:

$$W= {W}_{{\text{max}}}(\frac{{K}_{c}}{1+{K}_{c}})$$
(2)

where W is the adsorbent loading grams adsorbed per gram of solid. For evaluating the Langmuir isotherm model, the values of c (dye concentration mg/l) are plotted against c/W. This graphical representation elucidates the Langmuir constants K and Wmax. A highly favorable isotherm is indicated by a large K value and Kc exceeding 1. Conversely, when Kc < 1, the isotherm exhibits near linearity [25].

The Freundlich isotherm, described by Eq. 3, also signifies a favorable type of isotherm:

$$W= b.{c}^{m}$$
(3)

To scrutinize the Freundlich isotherm model, a log-log plot of log c versus log W is employed. This graphical depiction aids in the determination of the Freundlich constants, b and m. A stronger fit for adsorption from liquid environments is indicated when m < 1, suggesting its applicability in practical scenarios [26].

5 Materials and method

5.1 Preparation method of biochar

In the present study, BC was prepared from river tamarind (Leucaena leucocephala) tree stems to investigate its efficacy in dye adsorption (Fig. 1). First, mature tree stems were collected from a sustainable source to ensure the ecological balance. The stems were carefully selected, free from any signs of decay or damage. The collected tree stems were thoroughly cleaned to remove dirt, debris, and any adhering materials. After cleaning, the stems were left to air dry under natural sunlight, allowing them to achieve the desired moisture content. Once the tree stems were completely dry, they were chopped into smaller pieces using a mechanical cutter. These smaller pieces were further shredded into uniform particles to facilitate uniform pyrolysis. The shredded tree stem particles were subjected to pyrolysis, a process involving the heating of organic materials in a controlled environment with a limited oxygen supply. In a specially designed pyrolysis chamber, the tree stem particles were heated at a high temperature (typically around 500–700 °C) for a specific duration, usually several hours. This controlled heating process ensured the conversion of the organic material into BC while driving off volatile compounds [27].

Fig. 1
figure 1

Camera image of a RT (Leucaena leucocephala), b stem, c naturally dried stem, and d BC

After the pyrolysis, the BC was allowed to cool down gradually to room temperature. During this cooling phase, the BC stabilized, and its physical and chemical properties were optimized for adsorption. The cooled BC was further ground into a fine powder using a mortar and pestle. The powdered BC was then sieved to obtain particles of a specific size range, typically between 100 and 200 mesh, ensuring uniformity [28]. The prepared BC powder was stored in an airtight container to prevent moisture absorption and maintain its adsorption efficiency until further use in dye adsorption experiments.

5.2 Characterization of biochar

Thus prepared BC was characterized using advanced techniques: Brunauer-Emmett-Teller (BET) (model: Quantachrome TouchWin v1.2 4) surface area analysis, HR transmission electron microscopy (TEM) (model: JEOL JEM 2100 plus), and Fourier-transform infrared spectroscopy (FTIR) (model: Agilent Cary 630 ATR-FTIR). These techniques provided detailed insights into the structural, morphological, and chemical properties of the BC, enhancing our understanding of its potential for dye adsorption [29]. BET surface area analysis determines the specific surface area and porosity of the BC. The analysis revealed substantial information on the surface area, indicating the presence of numerous active sites for adsorption. The high surface area suggested that the BC possessed a significant capacity to interact with dye molecules, enhancing its adsorption capacity [30]. HRTEM was used to investigate the morphological features of the BC at the nanoscale level. The images captured through HRTEM showcased the porous structure and surface morphology of the BC particles. These images provided valuable information about the particle size distribution, porosity, and the presence of any nanoparticles or microstructures on the BC surface, offering insights into its adsorption capabilities [31]. FTIR spectroscopy was used to study the functional groups present on the BC surface. The FTIR spectrum exhibited distinct peaks corresponding to various functional groups, such as hydroxyl (–OH) and carbonyl (C=O) groups. The presence of these functional groups indicated the BC’s chemical composition and its potential to form hydrogen bonds with dye molecules during adsorption. Additionally, FTIR analysis provided information about the BC’s surface chemistry, elucidating the nature of interactions between the BC and the dyes [32]. The combined results from BET surface area analysis, HRTEM imaging, and FTIR spectroscopy provided a comprehensive characterization of the BC material.

5.3 Batch adsorption of dye using biochar

5.3.1 Preparation of dye solution

To ensure precision and reproducibility, a meticulous approach was adopted for the preparation the of dye solution. The stock solution was crafted by dissolving an appropriate amount of dye in deionized water (DIW), ensuring a homogeneous mixture. Subsequent dilutions were executed with precision to achieve the desired concentrations for the adsorption experiments. This stringent preparation methodology laid the foundation for accurate and reliable batch adsorption experiments [33].

5.4 Batch adsorption experiments

The batch adsorption experiments were orchestrated using a shaker apparatus, introducing a level of sophistication to the process. Carefully measured quantities of BC were methodically introduced into a series of phenol red dye solutions, each featuring distinct initial concentrations. The mixtures underwent agitation within the shaker for a meticulously defined duration, facilitating the attainment of equilibrium adsorption. The entire adsorption process unfolded under closely monitored pH conditions, optimizing the experimental parameters for enhanced precision. An advanced dye adsorption study was performed to find the selectivity of the adsorbent. Phenol red shows maximum adsorption (Fig. 2) and is thus selected for further study.

Fig. 2
figure 2

Selection of dye

5.5 Dynamic monitoring of adsorption process

In this real-time monitoring, the adsorption process was prioritized. The use of a shaker apparatus ensured dynamic agitation, fostering efficient interaction between BC and the dye. Continuous observation of the pH conditions throughout the experiment added an extra layer of control, allowing for a nuanced understanding of the interplay between the adsorbent and the dye molecules.

5.6 Quantification using UV-Vis spectrophotometry

Post adsorption, the remaining concentrations of phenol red dye in the solutions were quantified with heightened accuracy. A UV-Vis spectrophotometer was employed to measure the absorption intensity at a specific wavelength. The establishment of a comprehensive calibration curve, utilizing standard solutions of known concentrations, facilitated a precise determination of the remaining phenol red dye concentration in each sample. This refined quantification approach enhanced the reliability of the results, ensuring a robust foundation for data interpretation. In essence, this improved methodology for batch adsorption of phenol red dye combines meticulous preparation, dynamic experimentation, and advanced quantification techniques. The result is a sophisticated and precise approach that not only enhances the reliability of experimental outcomes but also sets a benchmark for future studies in the field of dye adsorption using BC. After equilibrium, the supernatant was collected, and the concentration of phenol red was analyzed by UV-Vis method at λmax = 556 nm [34].

5.7 Data analysis for adsorption of phenol red dye on biochar

The collected adsorption data underwent a comprehensive analysis employing sophisticated adsorption isotherm models, namely the Langmuir and Freundlich models. These models were instrumental in unraveling the intricate adsorption behavior of phenol red dye on the BC surface. This analytical approach provided a nuanced understanding of the interaction dynamics between the BC and the dye molecules, shedding light on the efficacy of the adsorption process.

To quantitatively assess the efficiency of dye removal, a meticulously formulated formula was applied:

$$\mathrm{\%Removal}=\left[\frac{{C}_{i}-{C}_{o}}{{C}_{i}}\right]\times 100$$
(4)

where Ci represents the initial concentration of the dye and Ce signifies the equilibrium concentration post adsorption [35].

6 Result and discussion

6.1 Characterization of biochar

Figure 3a displays the HRTEM images of BC. It is evident that the BC possesses a nanostructure (Fig. 3a), with particle sizes ranging from 70 to 90 nm. It also reveals the distinct contrast between the central region and the margins of the sphere, which indicates the presence of a core-shell structure in the BC [36, 37]. The N2 adsorption-desorption analysis (Fig. 3b) exhibits a type IV isotherm with an H3-type hysteresis loop, indicating that BC possesses mesoporous structures. Furthermore, the hysteresis loop exhibited a P/Po value ranging from 0.4 to 0.95, indicating the presence of a uniformly distributed mesoporous structure [38, 39]. The BC is found to have a surface area (SBET) of 28.04 m2/g, a pore diameter (d) of 3.052 nm, and a total pore volume (Vtot) of 0.0552 cm3/g. The FTIR spectra of BC are depicted in Fig. 3c. The spectra exhibit a broad hydroxyl (–OH) band spanning from 3000 to 3500 cm−1. The FTIR spectra exhibited a prominent peak at 1585 cm−1, which was attributed to the stretching vibration of the C=C aromatic ring [40, 41]. The broad peak observed at 1086 cm−1 is attributed to the stretching vibration of the C–O bond in the ester compound [42, 43]. The band observed at 734 cm−1 is attributed to the out-of-plane bending of C–H bonds in the margins of aromatic rings [44, 45].

Fig. 3
figure 3

a HRTEM image, b BET spectra, and c FTIR spectra of BC

6.2 Statistical analysis

6.2.1 Testing hypotheses

The information about dye concentration obtained from the filtrate analysis fulfilled several functions in the study:

  1. A.

    Checking the theories:

    1. a)

      The data we acquired by examining the dye concentration in the filtered liquid was beneficial to us in a number of ways.

      1. 1.

        It assisted us in determining the ideal pH (acidity level) to extract the maximum amount of dye from the mixture.

      2. 2.

        It verified the success of our experiments.

      3. 3.

        It demonstrated that more dye was removed when more adsorbent material was used.

      4. 4.

        Using it, we computed a value known as “K” to determine whether our adsorption procedure adhered to the Langmuir model.

      5. 5.

        We also computed a value known as “m” using it to determine if our adsorption procedure adhered to the Freundlich model.

6.3 Assessment of data reliability using Karl Pearson’s correlation coefficient

We also used a statistical method called Karl Pearson’s correlation coefficient to check how reliable our data was and if there were any relationships between the different variables we measured. This helped us ensure the accuracy of our results and the strength of any connections we found in our data.

6.3.1 Hypothesis testing to determine the optimal pH value for maximizing dye removal from a solution containing 15 ppm dye

The process of identifying the most favorable pH level to achieve the highest possible dye removal from a solution with a dye concentration of 15 ppm entails a systematic hypothesis testing methodology. The analysis in this study utilizes a two-tailed t-test performed at a significance level of 5%, as outlined in Table 1.

Table 1 pH-depended %removal of phenol red dye

The hypotheses for this testing are as follows:

  • Null hypothesis (Ho): The optimum pH for maximizing phenol red dye removal is 5.

  • Alternative hypothesis (Ha): The optimum pH for maximizing phenol red dye removal is not 5.

For (n − 1), the degree of freedom is the calculated value of t

$$t=\frac{({X}_{{\text{avg}}}-\mu )}{\frac{{\sigma }_{s}}{\sqrt{n}}}={t}_{{\text{obs}}}$$
(5)

where σs is the standard deviation = \(\surd \sum [\frac{{{({\text{X}}}_{i}-{X}_{{\text{avg}}})}^{2}}{n-1}]\), Xavg is the average value of X, and n is the sample size.

The calculation is based on Eq. 5, where the standard deviation’s value is determined as 25.41. The calculated t-value is − 2.5040, and the tabulated t-value is 2.262, considering 9 degrees of freedom (d.f.) and a 5% level of significance for a t-distribution with two tails. Upon scrutinizing the comparison between the calculated t-value and the tabulated t-value, it is evident that the null hypothesis proposing that the optimal pH value is 5 is accepted. This decision is founded on the principle that the observed t-value is less than the calculated t-value (Fig. 4), signifying that the obtained results align with the null hypothesis [46, 47]. The hypothesis testing undertaken to ascertain the optimal pH level for maximizing phenol red removal from a 30 ppm solution employs a comprehensive t-test procedure. The acceptance of the null hypothesis underscores the inference that the optimal pH for effective phenol red removal indeed aligns with the assumed value of 5.

$${t}_{{\text{calculated}}}=\frac{({D}_{{\text{avg}}}-0)}{\frac{{\sigma }_{{\text{diff}}}}{\sqrt{n}}}$$
(6)

where n is the number of matched pairs, Davg is the mean of differences, and σdiff is the standard deviation of differences.

Fig. 4
figure 4

Probability chart for t-distribution for two-tailed test

$$\left({D}_{{\text{avg}}} \left(\mathrm{mean\;of\;differences}\right)=\sum {D}_{i}\right)/n = 11.25$$
$$\mathrm{Standard\;deviation\;}{\upsigma }_{{\text{diff}}}=\surd [\sum \{\frac{{{D}_{i}-{(D}_{{\text{avg}}})}^{2}.n}{n-1}\}]=0.6454$$

Based on the data of Table 2 Eq. 6 was solved and t-value was calculated as 4.97. In contrast, the tabulated t-value stands at 2.365, calculated at a 5% significance level for 9 degrees of freedom (d.f.) within the context of a two-tailed t-distribution [48, 49].

Table 2 Concentration of phenol red dye in the solution before (Xi) and after (Yi) the experiment

In this scenario, the calculated t-value (8.395) significantly surpasses the tabulated t-value (2.365), indicating a substantial departure from the expected outcome (Fig. 5). This divergence between the calculated and tabulated t-values reflects a statistically significant effect within the data. Consequently, given that the calculated t-value (tcalculated) is notably greater than the observed t-value (tobserved), the alternate hypothesis emerges as a more plausible explanation. In essence, this signifies that the experimental approach undertaken to remove phenol red from the contaminated solution was indeed successful. Clearly, the null hypothesis is rejected as it says that the experiment can not change the concentration of dye within the solution [50]. This outcome implies that the experimental process exerted a substantial impact on the concentration of phenol red within the solution, thereby leading to the acceptance of the alternate hypothesis. This analytical approach, grounded in statistical significance, underscores the validity of the experimental method and its tangible influence on the system under investigation. Referring to Eq. 5, the calculated t-value is observed as 8.395. Meanwhile, the corresponding tabulated t-value for a 5% significance level, considering 9 degrees of freedom (d.f.) for a two-tailed t-distribution, is found to be 2.365 as indicated by Kothari [51].

Fig. 5
figure 5

t-distribution probability chart for two-tailed test

Upon contrasting the calculated t-value and the tabulated t-value, a significant discrepancy becomes apparent. The observed t-value of 8.395 remarkably surpasses the tabulated t-value of 2.365, clearly demonstrating an extensive difference between the experimental outcome and the expected values. This substantial variation is indicative of a pronounced impact resulting from the experimental intervention. Given that the calculated t-value (tcalculated) is significantly greater than the observed t-value (tobserved), the ensuing interpretation follows a stringent course. The alternate hypothesis, asserting the triumph of the experiment in successfully removing phenol red from the contaminated solution, is readily embraced. This acceptance of the alternate hypothesis underscores the experiment’s efficacy in producing a discernible transformation in the phenol red concentration within the solution [52, 53]. Simultaneously, the null hypothesis, postulating that the experimental procedure fails to induce any alteration in the phenol red concentration within the solution, finds itself discarded. This dismissal of the null hypothesis stems from the irrefutable evidence presented by the calculated t-value, underscoring the substantial shift observed in the experimental results. The scientific evaluation of the calculated and observed t-values, in conjunction with the pertinent tabulated values, serves as the cornerstone of the decision-making process. This rigorous analysis empowers the researcher to confidently accept the alternate hypothesis, thereby acknowledging the experiment’s success in phenol red removal, while concurrently rejecting the null hypothesis that implies no significant change in the phenol red concentration [54].

If Oij = observed frequencies of the cell in the ith row and jth column

Eij = expected frequencies of the cell in the ith row and jth column

$${\chi }^{2}=\sum \left\{{({O}_{ij}-{E}_{ij})}^{2}/{E}_{ij}\right\}$$
(7)

By referring to the data from Tables 3 and 4 to solve Eq. 7, the computed value of the chi-square statistic (χ2) is found as 0.4155. This evaluation is set against the backdrop of the tabulated chi-square value (χ2 tabulated), which stands at 3.841 for a 5% significance level (Fig. 6). This determination is made considering a single degree of freedom (d.f.) and employing the chi-square distribution as outlined by Kothari [51]. A careful examination of the relationship between the computed and tabulated chi-square values reveals a notable discrepancy. The observed chi-square value (χ2 observed) of 0.4155 is notably lower than the tabulated chi-square value (χ2 tabulated) of 3.841. This distinct disparity underscores a substantial difference between the anticipated outcomes and the empirical results [55, 56]. Given that the observed chi-square value (χ2 observed) is notably lower than the tabulated chi-square value (χ2 tabulated), the ensuing scientific interpretation is grounded in a meticulous analysis. The null hypothesis, positing that a higher dose of adsorbent correlates with a heightened percentage of phenol red removal, is embraced. This decision to accept the null hypothesis stems from the clear indication provided by the observed chi-square value, reinforcing the association between the increased adsorbent dosage and the elevated phenol red removal efficiency [57, 58]. The intricate interplay between the calculated and tabulated chi-square values, within the context of the experiment and its underlying hypothesis, forms the bedrock of the analytical process. This diligent assessment empowers researchers to confidently accept the null hypothesis, acknowledging the positive influence of a higher adsorbent dose on the enhanced removal percentage of the phenol red.

Table 3 Observed frequencies of different adsorbent dosages (100 and 120 mg) in different dye concentrations (15 and 30 ppm) at pH 5
Table 4 Calculation for chi-square
Fig. 6
figure 6

Chi-square distribution probability chart

6.4 Adsorption isotherms

The adsorption isotherm equations for Langmuir and Freundlich (Eqs. 2 and 3) were used to analyze the experimental data.

6.5 Langmuir isotherm

In a systematic effort to ascertain the favorability of the Langmuir isotherm equation, the investigation employed empirical data garnered from the experimental procedures. This endeavor included the creation of an isotherm curve, intricately woven into an arithmetic graph. This plot artfully juxtaposed the concentration of phenol red, denoted as “c” in parts per million (ppm), against the quotient “c/W.” Here, “W” signifies the adsorbent loading, quantified as grams adsorbed per gram of solid (g adsorbed/g solid) [59, 60]. This comprehensive depiction of the experimental data is meticulously presented in both Table 5 and Fig. 7. Here, the coefficient of determination (R2) was found to be 0.986, which unequivocally pointed toward a favorable isotherm configuration. This favorable trend was unequivocally underscored by the linear nature attributed to the value of K(1), further confirming the positive connotation of the isotherm equation’s favorability [61, 62]. To delve into the correlations with greater rigor, the calculation yielded a remarkable Karl Pearson correlation coefficient of 0.993, as established through Eq. 1. This value, widely recognized as a benchmark of the correlation strength between two variables, emphatically attested to the exceptionally high degree of correlation existing between the variables under scrutiny [63, 64]. This scientific exposition delves into a meticulous analysis that utilizes empirical data to unravel the favorability of the Langmuir isotherm equation. Through a well-structured graphical representation, supported by critical numerical values, the study effectively substantiates the linear nature of the isotherm equation and attests to a robust correlation between the variables. These comprehensive findings underscore the scientific integrity of the conducted experimentation and its conclusions regarding the Langmuir isotherm equation’s favorability [65, 66]. However, the current adsorbent has a substantially better phenol red dye adsorption capacity (qmax = 98%) than previously described adsorbents, demonstrating that this BC is effective for dye removal. The Langmuir model absorption capabilities of certain adsorbents are shown in Table 6.

Table 5 Data obtained from the experiment to validate with Langmuir isotherm
Fig. 7
figure 7

Langmuir isotherm plot

Table 6 Data obtained from the experiment to validate with Freundlich isotherm

6.6 Freundlich isotherm

The assessment of the positivity inherent in the Freundlich adsorption isotherm was undertaken through a deliberate investigation of the Freundlich isotherm condition. This analytical process encompassed the construction of an isotherm curve, meticulously crafted by plotting the logarithmic values of the phenol red concentration “c” (measured in parts per million, ppm) against the logarithmic values of the adsorbent loading “W” (expressed as milligrams adsorbed per gram of solid, mg adsorbed/g solid). The presentation of this comprehensive endeavor is meticulously documented both in Table 6 and Fig. 8. The pivotal parameter to emerge from this endeavor was the R2 of the isotherm curve, ascertained to be 0.998. This numerical value is instrumental in informing the nature of the adsorption process. It is noteworthy that the Freundlich adsorption isotherm, renowned for its versatility, was discernibly mirrored in the experimentation’s slope of one. This alignment served as compelling evidence for the suitability of the Freundlich model in effectively capturing and representing the underlying adsorption data [64, 67]. Equally enlightening was the insight provided by the calculation of Karl Pearson’s correlation coefficient, a robust statistical metric signifying the degree of correlation between two variables. In this instance, the computed coefficient attained a remarkable value of 0.998, an unmistakable indicator of the exceedingly high correlation existing between the variables under examination [68, 69]. This rigorous scientific exposition delves into the intricate evaluation of the Freundlich adsorption isotherm’s positivity. Through a meticulous plotting of logarithmic values, supported by pertinent numerical indicators, the study effectively reinforces the compatibility of the Freundlich isotherm with the observed adsorption data. This comprehensive understanding, augmented by the high correlation coefficient, solidifies the scientific credibility of the conclusions drawn from the experimentation’s assessment of the Freundlich adsorption isotherm [70, 71].

Fig. 8
figure 8

Freundlich isotherm of phenol red adsorption in the BC adsorbent

Electrostatic interaction is the most important mechanism for the adsorption of organic compounds on the biochar surface (Fig. 9). The pH substantially influences the kind and type of interaction that will take place between the dye molecules and adsorbent. As point of zero charge (pHpzc) of prepared biochar is 7.5, its surface is positively charged below this pHpzc, and under acidic conditions (low pH), phenol red occurs as a zwitterion, with the sulfate group having a negative charge and the ketone group carrying an extra proton [78]. The symbolic representation of this type is occasionally expressed as H2+PS. Here, phenol red is adsorbed on the surface of biochar due to the electrostatic interaction between these oppositely charged species [79]. Figure 10 shows the adsorption capacity (percentage) of the phenol red after several regeneration cycles. The adsorption capacity was found to decrease as the biochar is reused more frequently. The fresh biochar showed an adsorbing capacity of 98%, whereas after the 5th regeneration cycle, it dropped to 84%. This decrease in adsorption percentage can be attributed to the decrease/blockage of the adsorption sites and also changes in the physiochemical changes that occurred during the regeneration process [77]. Table 7 shows the phenol red adsorption capacity of the new BC with other previously reported adsorbents.

Fig. 9
figure 9

Schematic representation of adsorption process and mechanism

Fig. 10
figure 10

Adsorbent regeneration study

Table 7 Phenol red adsorption capacity of the new BC and other previously reported adsorbents

7 Conclusion

This new BC is found to have a surface area (SBET) of 28.04 m2/g, a pore diameter (d) of 3.052 nm, and a total pore volume (Vtot) of 0.0552 cm3/g. BC possesses a nanostructure with particle sizes ranging from 70 to 90 nm. The extensive scientific study found that BC could effectively remove phenol red from aqueous solutions. This new BC showed nearly 98% adsorption efficiency, when 200 mg/l BC was exposed to 30 ppm phenol red for 60 min in 250 ml solution volume. Statistical study findings, supported by careful hypothesis, confirmed BC efficiency and showed how critical variables affect adsorption. These findings can help adjust adsorption processes under different conditions, making BC more viable for similar applications. The isotherm results suggest that the BC can confirm to Langmuir and Freundlich models and handle different phenol red concentrations in aqueous solutions. This basic understanding of the adsorption mechanism proposed for BC design and its application. The combination of statistical study data, hypothesis testing, and isotherm analysis supports its use in phenol red contamination problems. This study advances our understanding of BC-based adsorption and helps us find a sustainable and effective phenol red mitigation strategy for aquatic settings. This study uses BC and statistical analysis to assess BC’s phenol red adsorption. Integrating Langmuir and Freundlich models with statistical techniques allows a full assessment of BC adsorption capability, advancing sustainable water filtration.