Introduction

Frequent use of dyes in industries, such as paper, leather, textile, and rubber, is the main pollution-spreading source due to the illegal direct discharge of effluent from these sectors into receiving water bodies without any treatment applied, which directly deteriorates water resources quality (Lellis et al. 2019). The accumulation of these toxic dyes in streams and other water sources acts as a barrier to sunlight penetration, directly affecting the photosynthesis process that becomes a cause of aquatic life damage (Al-Tohamy et al. 2022). Malachite green (MG), a dye belonging to the triphenylmethane group that is widely used in the dyeing and textile sectors, is genotoxic and carcinogenic even at extremely low concentrations and can disrupt the immune system and reproductive systems (You et al. 2022). Due to their acute toxic, teratogenic, mutagenic, and carcinogenic nature, eradicating residual dyes in effluent streams from different industries before discharge is highly recommended (Ashraf and Faheem 2020b; Oladoye et al. 2022). However, capturing these recalcitrant nature dyes from wastewater streams is highly based on their physicochemical properties and adopted remediation routes under consideration. Therefore, the overall promising elimination of targeted dyes still faces numerous challenges because various wastewater treatment technologies adopted are costly and not desirable in environmental effects (Cheera et al. 2016).

Water pollution remains a significant global issue, aggravated by a variety of toxins introduced into aquatic environments. Recent research has emphasized novel approaches to addressing this problem. For example, oxygen-enhanced multi-walled carbon nanotubes decorated with silica-coated spinel ferrite have emerged as a potential nanocomposite for the quick and effective decolorization of aquatic environments (Wabaidur et al. 2020). Furthermore, co-hydrothermal valorization of food waste has been investigated, yielding efficient methods and described compounds with prospective applications in water decolorization (Alqadami et al. 2023). In addition, treated Ajwa date pits have demonstrated efficacy in removing heavy metal ions from aqueous solutions, with research focusing on kinetic, isotherm, and thermodynamic techniques for a more complete understanding and application (Azam et al. 2022). These achievements highlight the continued attempts to address water pollution issues with breakthrough materials and technologies.

Several treatment technologies have been adopted to remove toxic elements and dyes from wastewater from industrial sectors. These technologies include biological treatment routes, advanced oxidation, photodegradation, combined electrochemical treatment pathways, coagulation, and adsorption (Faheem et al. 2020; Masood Ul Hasan et al. 2023; Rashid et al. 2024; Shindhal et al. 2021). All of these technologies have their own merits and demerits. In contrast, adsorption is considered low-cost, easily operated, simple without any sophisticated instruments involved, and with high removal efficiency (Faheem et al. 2018; Khan et al. 2020). A variety of low-cost carbonaceous materials-based adsorbents such as activated carbon and biochar derived from agricultural waste such as corn cob, rice husk, and perilla leaf have been tested for the adsorptive removal of organic dyes as well as heavy metals (Abdel-Ghani et al. 2015; Mahmoud et al. 2023; Niazi et al. 2018). Nevertheless, results from earlier studies indicate that the uneven distribution of functional groups on the surface of untreated biochars makes them less effective in treating water. Therefore, it is suggested to adopt suitable technical methods to enhance the removal efficiency of biochar for targeted pollutants (Geng et al. 2021; Lee et al. 2018).

Different methodologies, encompassing physical, biological, and chemical techniques, either individually or in combination, can potentially enhance the desirable characteristics of biochars. These enhancements primarily focus on improving its porous structure and introducing surface functional groups or active moieties (Faheem et al. 2019; Rivera-Utrilla et al. 2011). The frequently adopted practice is the chemical modification route for incorporating functional groups on the BC surface, which governs the positive or negative charge to BC depending upon the prevailing pH conditions.

In the last two decades, numerous studies frequently utilized chemical reagents mostly comprised of strong acids and alkalis, KMnO4, MnOx, and a few metal salts (Kaya et al. 2021; Zhang et al. 2020; Zhao et al. 2022b). However, the adoption of these poisonous and corrosive natural chemical substances became a cause of spreading secondary pollution problems. Therefore, further research is needed to develop biochar-based adsorbents through various pathways by incorporating eco-friendly chemical modification reagents (Ashraf and Faheem 2020a). For example, literature confirmed the effectiveness of the H2O2 for the partial oxygenation of pinewood biomass and peanut hull biochar in terms of strong oxidation potential (Huff & Lee 2016; Xue et al. 2012). Furthermore, various low-molecular-weight organic acids (LMWOAs) with mono-, di-, and tri-carboxylic groups have also been adopted as chemical reagents for biochar functionalization through esterification reaction (Lonappan et al. 2020; Peng et al. 2018). These LMWOAs are comparatively less toxic and corrosive than inorganic acids, as these are obtained from the decomposition of biomass and microorganisms. However, limited studies are available that applied LMWOAs for the chemical modification of BC to make it hydrophilic and more effective for removing targeted pollutants (Zhao et al. 2022a). Moreover, further studies are needed to treat BC with ligands of multi-functional groups with different nature functional groups simultaneously, such as hard and soft bases with different pKa values (Chen et al. 2019). The appropriate ligands not only enhance the adsorption performance of modified adsorbent but also provide working conditions over a wide range of pH depending upon their pKa values as well as in the presence of unwanted ions (Sinyeue et al. 2022; Yang et al. 2022).

In this study, thiomalic acid–modified rice husk biochar (TMA-BC) was synthesized utilizing thiomalic acid (TMA), which possesses carboxylic (–COOH) and thiol (–SH) functional groups. The effects of grafted multiple-functional moieties, including hard base –COOH and soft base –SH coupled on BC structure, were investigated on the adsorptive removal of MG dye in a single solution. In addition, the investigation analyzed the contributions made by both functional groups and explored the effects of the TMA-BC mesoporous structure on the removal of MG dye from a binary solution.

Materials and methods

Raw material and chemicals reagents

Rice husk was collected from Yangzhou, Jiangsu, China Mainland. Malachite green (MG) dye was procured from Chengdu Kelong Chemical Co., Ltd. (China). Sodium dodecyl sulfate (SDS) surfactant was provided by Sinopharm Chemical Reagent Co., Ltd., Beijing. Sodium salts including sodium chloride (NaCl), sodium thiocyanate (NaSCN), and sodium hydroxide (NaOH) were supplied by Sigma Aldrich. Phosphotungstic acid (PTA) and humic acid were obtained from Aladdin Industrial Corporation, Shanghai, China.

Characterization techniques

To characterize the adsorbent surface morphology, scanning electron microscopy (SEM) was examined with a field emission scanning electron microscopy (FE-SEM, FEI Quanta 250FEG) at a high voltage of 20 kV and a spot of 3.5. Transmission electron microscopy (TEM) analysis was conducted on a TECNAI G2 20 LaB6 electron microscope operated at 200 kV. XPS analysis was performed using a Thermo ESCALAB 250 instrument. Additionally, the nitrogen absorption measurement was carried out using a Brunauer–Emmett–Teller (BET) apparatus (Micromeritics, ASAP 2020, USA) at a temperature of − 196 °C. The Fourier transform infrared spectroscopy (FTIR, Thermo Scientific, Nicolet iS10, USA) was performed to confirm the presence of available functional groups on the various adsorbents surface. The surface chemistry of adsorbents was measured regarding point of zero charge (PZC) by adopting the pH drift approach (El Haddad et al. 2018). Once the equilibrium stage is achieved, the residual concentration of MG dye and humic acid in the filtrate was analyzed at the wavelength of 615 nm and 254 nm, respectively, with UV–visible spectrophotometry.

Preparation of biochar

The washing of the rice husk was done with distilled water for the sake of adhering to unwanted impurities and dirt removal. Thereafter, the biomass was dried at 105 °C, and finally, the particles with a size less than 0.255 mm were obtained when they passed through sieves. The screened feedstock of uniform size was subjected to carbonization in a tube furnace at 600 °C for 2 h under N2 atmosphere to obtain BC (Faheem et al. 2016).

Pretreatment of rice husk BC

The mercerization of the raw rice husk BC was done by using a 30% NaOH solution to enhance the specific surface area as a result of silica, hemicellulose, and lignin portion removal (Shrestha et al. 2019). The mercerized rice husk biochar was denoted as NaOH-BC. Moreover, mercerization also makes cellulose-incorporated hydroxyl groups more accessible for further multi-functionalization of NaOH-BC when the TMA reagent is applied during next treatment process.

Biochar chemical modification

The chemical treatment route was adopted to modify the surface hydroxyl groups of NaOH-BC with –COOH- and –SH-associated functional groups due to a reaction with TMA in the presence of phosphotungstic acid (PTA), which acted as a catalyst. Typically, 5 g of NaOH-BC was added into 100 mL of ultrapure water in a 250-mL three-neck round bottom flask. Then, a predetermined amount of TMA (2.8 g) was combined with a PTA amount equivalent to 0.8 wt% of the NaOH-BC mass. The mixture was heated to 80 °C, kept for 8 h under 300 rpm stirring speed in the presence of a nitrogen gas environment, and then cooled to room temperature. The desired product was collected by vacuum filtration, washed thoroughly with distilled water many times to remove residual chemical reagents, and labeled as TMA-BC. The final synthesized product was vacuum-dried at 65 °C before further use. To obtain humic acid–loaded TMA-BC (TMA-BC-HA), the TMA-BC was soaked in humic acid (20 mg/L) for 48 h. After that, it was filtered and dried overnight at 45 °C. In summary, the chemical modification route was outlined as presented in Eq. (1) and Eq. (2).

Protonation phase:

$${\text{C}}_4{\text{H}}_6{\text{O}}_4\text{S}+2\text{H}+\xrightarrow{Phosphotungstic\;acid}{\text{C}}_4{\text{H}}_7{\text{O}}_4\text{SH}$$
(1)

Nucleophilic attack phase:

$${{\text{C}}}_{4}{{\text{H}}}_{7}{{\text{O}}}_{4}{\text{SH}}+{\text{Biochar}}\left(-{\text{OH}}\right)\to {\text{Biochar}}-{\text{TMA}}\; {\text{ester}}+{{\text{H}}}_{2}{\text{O}}$$
(2)

Adsorption experiments

To investigate the adsorption potential, a batch experimental study was executed in 100-mL Erlenmeyer flasks with 50 mL solution of known concentration of MG dye by mixing 0.1 g of adsorbents into the solution. The pH of the solution was controlled to the desired value through the addition of 0.1M HCl or NaOH solution. Then, Erlenmeyer flasks containing cationic MG dye and adsorbent mixtures were agitated in a rotary shaker at 180 rpm and 25 °C temperature. For the adsorption kinetics study, the sample suspensions were separated by centrifugation with a duration time of 5 min at 10,000 rpm, and the supernatant was further tested at a subjected wavelength to analyze the MG dye concentration. The MG dye in an initial concentration range of 30–250 mg /L was chosen for the estimation of the adsorption isotherm study. For the desorption study, the MG-loaded TMA-BC adsorbent was added into 50 mL of 0.1 M HCl desorption eluent and stirred for a predetermined period. The mass balance principle was applied between the value of the initial and final concentrations of MG dye monitored in the solution to evaluate the adsorption capacity of adsorbents (qe) and was calculated by Eq. (3) (Alothman et al. 2020).

$${q}_{e}=({C}_{{\text{o}}}-{C}_{{\text{e}}}){\text{V}}/{\text{w}}$$
(3)

where Co (mg/L) represents the initial MG dye concentration, Ce (mg/L) signifies the MG dye concentration at equilibrium, V (L) denotes the solution volume, and w (g) pertains to the weight of the adsorbent. For the sake of precision and to prevent error involvement in readings, the entire experiments were performed in triplicate, and the mean value was presented with error bars to reflect the maximum deviation from the average value.

Results and discussion

Characterization of multi-functional biochar

The morphological changes of BC before and after treatments were explored. The SEM analysis confirmed the porous nature of BC and the presence of silica content, as illustrated in Fig. 1a–c. In SEM images, silica particles were observed as small, spherical, or irregularly shaped entities with smooth surfaces dispersed throughout the carbonized samples (Abe et al. 2023). However, for NaOH-BC, relatively few silica contents were detected, which supports the extraction of silica when BC was treated with NaOH reagent. Moreover, for TMA-BC, besides the mesoporous structure, the feather-like open pores were also created as a result of chemical modification by applying TMA chemical reagent. These structural changes endorsed successful modification when NaOH and TMA were practiced.

Fig. 1
figure 1

SEM for BC (a), NaOH-BC (b), and TMA-BC (c)

Similarly, the HR-TEM analysis was adopted to ensure the changes that occur in the BC porous structure. There were no feather-like open pores identified for BC and NaOH-BC samples. Relatively, the more porous surface was detected for NaOH-BC as compared to BC surface morphology, which supported the extraction of silica content and removal of the amorphous nature hemicellulose and lignin portion as depicted in Fig. 2a and b (Zhang & Park 2017). However, the result of TMA reaction with a carbonaceous portion of BC through the esterification route becomes the cause of incorporation of multi-functional groups on the BC surface as well as the formation of feather-like open pores as disclosed in Fig. 2c (Inyinbor et al. 2016).

Fig. 2
figure 2

HR-TEM for BC (a), NaOH-BC (b), and TMA-BC (c)

Furthermore, Table 1 presents the obtained BET surface area, as well as pore size distribution value, originating from nitrogen adsorption–desorption isotherms for BC, NaOH-BC, and TMA-BC, reflecting the variations that happened when BC was subjected to different chemical modification routes. Figure 3a suggests that the N2 isotherm curves for BC, NaOH-BC, and TMA-BC were best correlated with the type IV patterns as per IUPAC classification, which endorsed mesoporous structure inside these samples. The surface area values for BC, NaOH-BC, and TMA-BC were 234.2 m2/g, 277.1 m2/g, and 305.8 m2/g, respectively, and the pore size values were 2.60 nm, 2.87 nm, and 3.36 nm, respectively. The relatively higher surface area value of NaOH-BC and TMA-BC than bare BC was assigned to the removal of silica, amorphous nature hemicellulose, and lignin portion due to prevailing alkaline conditions as well as the formation of feather-like open pores when TMA was employed for the multi-functionalization purpose. These results were in good agreement with SEM and HR-TEM findings.

Table 1 Chemical composition, textural characteristics, and removal percentage of BC, NaOH-BC, and TMA-BC
Fig. 3
figure 3

BET (a), XPS wide scan (b), and FTIR spectra (c) for BC, NaOH-BC, and TMA-BC

The XPS analysis is frequently applied to detect the changes in the surface elemental composition of BC before and after being subjected to chemical modification routes. The XPS broad spectra for all samples, including BC, NaOH-BC, and TMA-BC, are presented in Fig. 3b. The signals of O content for BC (14.3%), NaOH-BC (16.4%), and TMA-BC (19.2%); C content for BC (82.7%), NaOH-BC (81.3%), and TMA-BC (73.3%); and Si content for BC (3.0%), NaOH-BC (2.3%), and TMA-BC (2.1%) were noticed. The increase in O content exhibited the successful grafting of the –COOH into the biochar matrix. The minute decrease in Si content suggested the extraction of silica from BC during the mercerization stage. In addition, the S content of 5.4% was only detected in TMA-BC, supporting the –SH group functionalization of BC via esterification reaction. The presence of different functional groups on the BC surface before and after treatment was applied was further characterized by the FTIR technique. As depicted in Fig. 3c, the broad and sharp band detected at position 3448 cm−1 was assigned to –OH stretching vibration, which became more robust for NaOH-BC, supporting the incorporation of –OH groups as a result of BC mercerization (Lin et al. 2017). The peak monitored at 2570 cm−1 was referred to –SH-associated functional groups, confirming the successful functionalization of BC when the TMA reagent was employed to modify BC characteristics. Moreover, the additional peaks pointed at 1700 cm−1 and 1389 cm−1 were allotted to –COOH stretching vibration, which could also be considered as the key evidence of TMA grafting with BC associated –OH groups (Zhang et al. 2018b). Some inert functional groups with no reactivity, such as Si–O–Si, were also noticed at the positions of 1087 cm−1 and 809 cm−1 (Zhang et al. 2015).

Adsorption performance of adsorbent towards MG dye

The impact of sequential chemical treatments on the BC adsorption capacity for MG dye removal was investigated. NaOH-BC and TMA-BC were shown to be more effective at removing MG dye with 40.2 ± 1.9% and 96.5 ± 2.2%, respectively, than BC, which was only 28.1 ± 2.3% as shown in Fig. 4a. For TMA-BC, both higher surface area and grafted functional groups were responsible for MG dye maximum removal efficiency than BC and NaOH-BC. Moreover, when compared with TMA-BC, the TMA-BC-HA adsorbent demonstrated relatively less adsorption capacity for MG dye but higher than BC and NaOH-BC. This could be attributed to pore blockage due to the loading of large-size HA molecules into the porous structure of TMA-BC-HA, which were not thought to be accessible for MG dye absorption (Zhang et al. 2018a).

Fig. 4
figure 4

Performance evaluation of BC, NaOH-BC, and TMA-BC for MG dye removal (a), effect of initial pH on TMA-BC adsorption performance for MG dye removal (b)

Effect of pH value on TMA-BC adsorption performance

The surface chemistry of an adsorbent determines its surface charge, which is affected by the ambient pH. The point of zero charge (ZPC) indicates the pH at which the surface of the adsorbent becomes neutral. It is noted that when the solution pH surpasses the ZPC value (pHzpc > solution pH), the adsorbent surface becomes positively charged. Conversely, if the solution pH is lower than the ZPC value (pHzpc < solution pH), the adsorbent surface becomes negatively charged. Due to variations in BC surface chemistry as well as the degree of dye ionization, the pH is regarded as a crucial factor that directly affects the removal efficacy of MG dye (Kenawy et al. 2018; Khan et al. 2019). Therefore, the MG dye adsorptive removal experiments were carried out in the selected pH range of 3–8 to ensure the impact of solution pH on removal efficiency. Above pH 8.0 conditions cause alkaline fading of MG dye due to the creation of a colorless carbinol base, which is also indicated in literature studies for crystal violet (Elaziouti et al. 2011).

Adsorption experiments demonstrated that > 80% MG dye removal was observed in lower acidic to lower basic regions, as shown in Fig. 4b. The maximum removal efficiency (97.2 ± 1.1%) was achieved at pH 8.0, and a minimum of 34.5 ± 2.3% removal efficiency was monitored at pH 3.0, which was in agreement with the literature. For example, the electrospun polymer-Fe3O4 nanocomposite mat exhibited relatively poor removal efficacy at low pH compared to high removal efficacy at higher pH values when tested for MG dye adsorption (Savva et al. 2015).

The variation in MG dye adsorption performance caused by pH variations may be explained by considering the adsorbate’s degree of ionization and the adsorbent’s pHzpc. For the prevailing condition, the possibility of MG dye existence is in anionic form when pH > pKa, and in the cationic form when pH < pKa. It was noticed that the increase in MG dye removal happened with an increase in the pH of the solution to pH 8.0. In a basic pH environment, the degradation of MG dye molecule is not detected due to the formation of carbinol base as a result of –OH group involvement, termed as MG dye alkaline fading (Lee et al. 2013). The MG dye belongs to the triphenylmethane dye family, whose molecular structure is sensitive to pH variation. As the pKa value of MG dye is 6.9, it exists as chromatic MG+ at neutral pH and converts to protonated MGH2+ in acidic pH environments (Singh et al. 2017).

Moreover, MG dye has a different degree of ionization of 100%, 53%, 23%, and 0% at pH values of 4.0, 6.8, 7.4, and 10.1, respectively (Panahi & Behnam 2018). The calculated pHzpc by pH drift method for TMA-BC was 5.8, which revealed that the deprotonation of surface-attached multi-functional groups such as –COOH and –SH results in a negatively charged TMA-BC surface at pH > pHzpc. Furthermore, the original pH value dropped because the deprotonation of multi-functional groups increased H+ ions. As shown in Fig. 4b, the maximum MG dye adsorptive removal was 96.5 ± 2.2% and 97.2 ± 1.1% at final pH values of 5.9 and 6.6 when initial pH values of 7.0 and 8.0 were used, respectively, both of which were more than the pHzpc value (5.8) of TMA-BC. This was attributed to the adsorbent negative surface charge nature during prevailing conditions. In addition, the pKa values for –COOH- and –SH-associated functional groups are reported as 3.8–5.0 (Vaghetti et al. 2009) and 3.5–9.3 (Yu et al. 2014), respectively. As shown in Fig. 4b, the lower acidic pH range (3.0–4.0) resulted in a lower adsorption performance, which was ascribed to the protonation of both –COOH- and –SH-associated functional groups, as indicated by the rise in initial pH and the protonated form of MG dye. For the acidic pH range, the removal of MG dye molecules was driven primarily by TMA-BC’s increased surface area rather than the participation of protonated –COOH- and –SH-associated functional groups, which exert repulsive interactions.

Adsorption kinetics

Conducting a detailed kinetic study is essential to elucidate how the reaction proceeds. The adsorption data revealed that rapid removal of MG dye was monitored for TMA-BC within the first 40 min of reaction compared to BC, NaOH-BC, and TMA-BC-HA adsorbents, as shown in Fig. 5a. Later on, the saturation phase was attained, and finally, the equilibrium stage arrived within 100 min. The observed higher reaction rate for TMA-BC was referred to the involvement of both surface area and grafted functional groups simultaneously.

Fig. 5
figure 5

MG dye adsorption by BC, NaOH-BC, and TMA-BC (a), pseudo-first-order model fitting (b), pseudo-second-order model fitting (c), and Boyd’s model fitting (d) for the removal of MG dye on TMA-BC. Reaction conditions: Cin = 120 mg/L, dosage = 2 g/L at pH 8.0 and 25 °C

In addition, adsorption kinetics studies were performed for reaction rate prediction to confirm the nature of the driving forces. Both the pseudo-first-order model (PFOM) and pseudo-second-order model (PSOM) were tested to confirm their suitability with the MG dye adsorption data obtained through batch experiments. The linear plots of PFOM and PSOM are given in Fig. 5b and c, and the corresponding kinetics parameters are also presented in Table 2. As clear from these results, the regression coefficient (R2) value (0.998) for PSOM was higher than the R2 value (0.914) of PFOM. Moreover, an insignificant difference between qe (exp) and qe (cal) reflected that the adsorption mechanism of MG dye onto TMA-BC could be modeled well with PSOM kinetic equation (Ediati et al. 2023). The fitting of PSOM indicated that the adsorptive elimination of MG dye involved the participation of the chemisorption pathway, which occurred due to electrostatic attraction.

Table 2 Summary of kinetics and isotherm models applied for adsorption of MG dye by TMA-BC at pH 7

In addition, Boyd’s plot was employed to forecast the actual slow step monitored during the saturation phase of the sorption kinetics study to ensure that either intraparticle diffusion or film diffusion was the main factor behind the rate-limiting step. In Fig. 5d, the Bt values were plotted against time (t) in order to predict the mechanism overlaid adsorption process of MG dye during the saturation phase. It was observed that the linear plot was not passing through the origin, which endorsed that the film diffusion played the main role in the rate-limiting step during the saturation phase of MG dye adsorptive removal. The corresponding parameters, including intercept and slope obtained from the plot Bt Vs t, are given in Table 2.

Adsorption isotherm modeling

Adsorption isotherms are used to describe the equilibrium distribution of adsorbate molecules between the solid and liquid phases of a system. The Langmuir and Freundlich pairs of isotherm models were studied to confirm the process involved in the adsorptive removal of MG dye. The availability of limited identical sites with the same energy suggests monolayer adsorption between the adsorbent and adsorbate surfaces in the case of the Langmuir model fitting. The Freundlich isotherm model characterized non-imitative, reversible adsorption onto various sites with different binding energies on the adsorbent surface. Figure 6a and b shows the linear Freundlich and Langmuir adsorption isotherms. Table 2 lists regression-derived adsorption isotherm parameters. The regression coefficient R2 determined which model fit best. The Langmuir model was preferred over the Freundlich model (0.946) due to its better R2 value (0.997). The Langmuir adsorption constant (KL) of 0.216 L/mg indicated favorable sorption. Maximum adsorption capacity (qmax) was calculated by plotting 1/Ce versus 1/qe. The qmax value of MG dye by TMA-BC was determined to be 104.17 mg/g.

Fig. 6
figure 6

Linear plot of Freundlich (a) and Langmuir (b) isotherm model fitting for the adsorption of MG dye on TMA-BC

Furthermore, the ability of TMA-BC to absorb MG dye was compared with a number of adsorbents mentioned in the literature and listed in Table 3. When testing neem sawdust as an adsorbent, Khattri et al. reported that it has a qmax value of 4.35 mg/g for MG dye (Khattri & Singh 2009). The adsorption capabilities of amino group–functionalized single-walled carbon nanotubes (SWCNTs-NH2) and carboxylate group–functionalized multi-walled carbon nanotubes (MWCNTs) were 6.13 mg/g and 11.73 mg/g, respectively, (Rajabi et al. 2016; Setareh Derakhshan & Moradi 2014). A recent study confirmed the effectiveness of multi-functional groups that served as active sites for removing organic dyes. For example, the adsorptive removal of 81.20 mg/g at 25 °C was monitored when 3-marcaptopropanic acid–functionalized phytogenic magnetic nanoparticles were investigated for the removal of toxic MG dye (Ali et al. 2018b). In contrast to the other adsorbents described, TMA-BC had an adsorption capacity for MG dye absorption of up to 104.17 mg/g in the current investigation.

Table 3 Comparison of MG dye adsorption capacities exhibited by various adsorbents

Effect of humic acid on TMA-BC adsorption

According to the literature, natural organic matter (NOM), such as humic acid (HA), is also present in wastewater streams at concentrations between 10 and 20 mg/L (Rodrigues et al. 2009). The presence of NOM, such as HA, in wastewater streams, may inhibit the adsorption of MG dye. Like the single solution system, the binary solution system assessed the influence of HA concentration on MG dye removal ability for pH 3.0–8.0. MG dye removal performance was tested in the binary solution system with HA at Co: 10 and 20 mg/L. Both 10 and 20 mg/L of HA improved MG dye removal performance over a single solution system without HA. However, the effect was more pronounced at the higher dose. The penetration of HA molecules into the porous structure of TMA-BC may result in a greater negative charge on the surface of TMA-BC (Wen et al. 2017). To make sure of this, it was determined that TMA-BC-HA had a pHzpc value of 5.2 rather than the 5.8 recorded for TMA-BC. This outcome verifies the penetration of HA molecules into the porous structure of TMA-BC.

As shown in Fig. 7a, at pH 3.0, MG dye removal efficiency was 21.86 ± 2.8 in binary solution, which was comparatively lower than the 34.5 ± 2.3 noticed in a single solution, possibly due to aggregated or coiled HA in the solution. The coiled forms of HA penetrate the pores of the TMA-BC and obstruct the active sites (de Melo et al. 2016). Nonetheless, there was an improvement in the efficiency of MG dye removal as the pH increased from 5.0 to 8.0, with maximum removal of 100% achieved at pH 8.0. A stretched configuration of HA adsorbed on the surface of TMA-BC, which exists in an activated state, can account for this enhancement. Comparatively, to HA’s aggregated or coiled structure, this form offers additional active groups, such as carboxylic groups and phenolic groups, which promote MG dye removal (Motta et al. 2016).

Fig. 7
figure 7

Effect of initial pH on TMA-BC adsorption performance for MG dye removal in the presence of dissolved humic acid (20 mg L.1) (a), effect of SDS surfactant, humic acid, and sodium salts ions on MG dye removal (b)

In addition, the larger size of HA compared to MG dye is thought to be a driving element behind the improvement in MG dye removal due to the cooperative adsorption pathway. Using magnetic multi-functional resins and activated biochar, researchers found similar results when testing the adsorptive removal of the emerging contaminant ciprofloxacin in the presence of HA (Park et al. 2017; Wang et al. 2016). Moreover, a similar positive impact of dissolved humic acid on the removal of sulfamethoxazole (SMX) using carbon nanotubes (CNTs) has also been reported in a literature study (Pan et al. 2013). The increased efficiency of SMX removal was attributed to the dispersion of CNTs, which offered more active sites for the adsorptive removal of SMX. However, in our specific case, the improvement in MG dye removal was attributed to adsorbed HA on the surface of TMA-BC, which provided additional active sites. The lower pHzpc value of TMA-BC-HA supports this explanation. Furthermore, the influence of HA on the adsorption capacity of a modified magnetic mesoporous silica and graphene oxide composite adsorbent (MMSP-GO) for metal ions Pb2+ and Cd2+ has been investigated (Wang et al. 2013). It was suggested that the removal of both Pb2+ (at pH > 3.0) and Cd2+ (at pH > 4.0) metal ions increased after reaching a certain pH value. The aggregated form of HA molecules attached to the surface of MMSP-GO transformed into a stretched form, and the functional groups of the adsorbed HA molecules became activated under neutral and alkaline conditions. Specifically, under neutral conditions, the presence of 10 mg/L HA resulted in a maximum removal of 72 mg/g and 14 mg/g of Pb2+ and Cd2+ ions, respectively, on the surface of MMSP-GO.

Effect of the ionic strength

The sodium salt is frequently used as a coloring agent and can be found in wastewater released by the dye industry. As a result, this study also looked into the potential effects of salt addition on the effectiveness of MG dye removal. Two distinct sodium salts, NaSCN and NaCl, were chosen and compared. The experiments utilized a concentration of 0.1 mol/L for both NaSCN and NaCl salts. Figure 7b illustrates a 12.7% increase in MG dye adsorption capacity in the presence of NaSCN salt and a 5.4% increase in the presence of NaCl salt. The presence of these salts results in higher ionic strength, promoting the aggregation of MG dye molecules and reducing their solubility (Kaur et al. 2013). The formation of aggregates of MG dye molecules enhances its adsorption capacity. Interestingly, it was observed that the presence of NaSCN salt resulted in a higher level of adsorptive removal of MG dye compared to the case of NaCl salt. Currently, no comprehensive theory thoroughly explains the interactions between ions and solutes, giving detailed insights into why NaSCN salt is more effective in promoting MG dye aggregation than NaCl salt. However, it is hypothesized that this effect could be attributed to the less hydrated nature of SCN anions compared to Cl anions (Mason et al. 2003). Poorly hydrated SCN anions in bulk solution could interact with the MG dye and reduce its solubility, increasing MG dye aggregation. When polyaniline-intercalated bentonite adsorbent was examined, a similar trend of increase in the adsorption capacity of reactive red 2 dye as a result of aggregation on the addition of NaCl and Na2SO4 inorganic salt was observed (Tie et al. 2017).

Effect of surfactant on TMA-BC adsorption

The present study also examined the potential influence of sodium dodecyl sulfate (SDS), an anionic surfactant that is frequently present in wastewater streams originating from dye industries, on the efficacy of MG dye elimination. In order to investigate the potential impact on the performance of MG dye adsorption, the utilization of SDS at concentrations of 4 mM and 8 mM was implemented. The impact of SDS on the adsorption performance of MG dye was investigated by utilizing 4-mM and 8-mM concentrations. The concentration at which the surface tension of a solution reaches a critical value and micelles begin to form, known as the critical micelle concentration (CMC), has been determined to be 8 mM for SDS. It has been observed that a concentration of 4 mM falls below the CMC. Figure 7b illustrates the results for the binary solution system. A decrease of 14.2% in MG dye removal efficiency was observed in the presence of 4 mM SDS compared to the single solution system. Conversely, an increase of 8.7% in MG dye removal efficiency was observed when 8 mM SDS was introduced into the binary solution system. These findings indicate that at the lower dosage of 4 mM SDS, there is an insignificant competition between the electron-rich-activated TMA-BC surface and the anionic nature of SDS for binding with the cationic nature of MG dye. Additionally, the decrease in the removal efficiency of MG dye may be attributed to the decrease in the surface area resulting from the attachment of SDS to the TMA-BC surface through hydrophobic interactions. However, in the case of an 8-mM SDS dosage (at the CMC), the increase in MG dye removal efficiency can be attributed to the possibility of ion-pair formation between MG dye molecules and SDS. This occurs as a result of the newly generated additional binding mode between MG dye and TMA-BC, facilitated by the presence of SDS as a surfactant. In simpler terms, it is evident that the MG dye does not directly attach to the TMA-BC surface but rather binds to TMA-BC with the assistance of SDS molecules (Ali et al. 2018a). Another potential pathway involves the initial formation of complexes between MG dye and freely available SDS molecules at higher concentrations, followed by their subsequent attachment to the TMA-BC adsorbent surface. A similar observation has been documented in the literature when SDS-modified magnetite nanoparticles were employed for the removal of methyl violet dye from aqueous solutions (Keyhanian et al. 2016).

Possible removal mechanism

A combination of XPS and FTIR studies was used to uncover the underlying process of MG dye elimination by TMA-BC. XPS was used to observe changes in the valence states of several surface elements, revealing the interaction between the MG dye and the multi-functional moieties on the TMA-BC surface. The high-resolution O 1s and S 2p spectra of TMA-BC samples before and after the removal of MG dye are presented in Fig. 8a and b. The O1s showed a peak-shifting trend, indicating that TMA-BC’s carboxyl (− COOH) groups interacted with MG dye, as shown in Fig. 8a. The literature showed that the peaks located at position 530.6 eV (carbonyl/quinone), 532.0 eV (ethers/hydroxyl), and 533.2 eV (lactonic/carboxylic) could be ascribed to different functional groups on TMA-BC surface (Zhang et al. 2019). TMA-BC sample O1s spectra were compared before and after MG dye adsorption, and the decrease in intensity at 533.2 eV, which is characteristic of –COOH moieties, indicated that these groups were responsible for the adsorption of the MG dye. Furthermore, Fig. 8b depicts the S 2p detail spectra. The shifting of the peak from 163.5 to 163.2 eV was implying the participation of –SH groups with cationic character MG dye molecules. These results indicated that TMA-BC surface –COOH and –SH moieties adsorbed cationic MG dye.

Fig. 8
figure 8

O1s (a) and S2p (b) high-resolution XPS spectra of TMA-BC before and after MG dye sorption

In addition, FTIR analysis was used to validate TMA-BC functional groups’ role in MG dye removal. According to the FTIR spectrum of MG@TMA-BC as presented in Fig. 3c, the broad peak positioned at 3448 cm−1 referred to –OH functional groups. A small peak detected at 2570 cm−1 could be assigned to –SH groups stretching vibration (Ali et al. 2018b). The peaks at 1700 cm−1 and 1389 cm−1 were attributed to C = O stretching vibration in carboxyl groups (Zhang et al. 2018b). The shifting pattern and decrease in peak intensity revealed that –SH and –COOH groups were involved with the cationic MG dye molecule, which expedited its transition from an aqueous solution to the TMA-BC adsorbent surface. Consequently, it was expected that electrostatic force was the main dominant force for the adsorptive removal of MG dye as a result of TMA-BC-associated –COO and –S moieties’ interaction with a cationic nitrogen atom (N+) of MG dye molecules as interpreted by Eqs. (4)–(5). The positively charged MG dye attached themselves to the TMA-BC surface via an electrostatic interaction in which they exchanged hydrogen ions with the –OH groups. Due to the presence of –SH groups, it was also anticipated that MG dye could be eliminated via the formation of a chelate. In addition, the remaining sides of the MG dye molecule, known as the organic portion, aided in hydrophobic removal via the π-π interaction mechanism.

$$\left[{\text{TMA}}-{\text{BC}}\right]-{{\text{COO}}}^{-}{{\text{H}}}^{+}+\left[{\text{dye}}\right]-{2{\text{RN}}}^{+}\to \left[{\text{TMA}}={\text{BC}}\right]-{{\text{COO}}}^{-}\cdots {2{\text{RN}}}^{+}-\left[{\text{dye}}\right]+{{\text{H}}}^{+}$$
(4)
$$\left[{\text{TMA}}-{\text{BC}}\right]-{{\text{S}}}^{-}{{\text{H}}}^{+}+\left[{\text{dye}}\right]-{2{\text{RN}}}^{+}\to \left[{\text{TMA}}={\text{BC}}\right]-{{\text{S}}}^{-}\cdots {2{\text{RN}}}^{+}-\left[{\text{dye}}\right]+{{\text{H}}}^{+}$$
(5)

MG dye elimination in humic acid (HA) was also examined. As seen in Fig. 9, cooperative adsorption amplifies MG dye removal in humic acid. Neither HA nor MG dyes competed for TMA-BC active sites. Direct competition occurs when the adsorbate and natural organic matter have similar dimensions (Murray & Ormeci 2018). In our case, the molecular weight (MW) of HA used in this study was 1500–3000 g/mol, whereas the MG dye had an MW of 364.9 g/mol. As depicted in Fig. 9, the removal of MG dye involves the participation of TMA-BC’s functional groups and the entrapment of MG dye molecules by the active sites of larger HA. It was suggested that the HA attached to the MG dye molecule finally penetrates the mesoporous structure of TMA-BC. A literature study suggested that pore size starting from ≥ 3 nm and reaching up to 10 nm was best correlated with the adsorption of humic acid (Ebie et al. 1995). Similarly, in a single solution system, the MG dye bulky molecule having primary group size of 1.21 × 1.19 × 0.53 nm could be accommodated only by single-layer adsorption route when the micropore size around 1.1 nm prevailed. Moreover, the multilayer adsorption removal mechanism for MG dye was expected for mesopores with a size ≥ 2 nm (Song et al. 2013). In our case, the TMA-BC adsorbent offered a higher adsorption capacity of MG dye in the presence of HA due to its mesoporous structure features. The numbers of relatively small-size MG dye molecules first interacted with the big-size single HA active sites as a result of cooperative adsorption and then finally penetrated the mesoporous structure of TMA-BC adsorbent. A similar finding was reported when the removal of ciprofloxacin was studied in the presence of HA by applying magnetic multi-functional resins (Wang et al. 2016). It was discovered that the HA molecules adsorbed onto the resins provided extra adsorption sites for the antibiotic ciprofloxacin. Li et al.’s findings also suggested that large-size HA complex compounds were able to penetrate mesopores and macrospores of powdered activated carbon, and micropores and mesopores were best suited for the removal of small-size compounds such as metaldehyde molecules (Li et al. 2018).

Fig. 9
figure 9

Overall mechanism depicting the role of grafted functional groups and mesoporous structure of TMA-BC behind the MG dye removal

In addition, in the presence of the SDS surfactant under CMC dosage, the increase in MG dye removal was attributed to the indirect binding of MG dye with TMA-BC adsorbent surface because of the ion-pair formation between MG dye and free SDS surfactant, which later attached to TMA-BS surface as depicted in Fig. 9. This observation aligns with the findings of Ali et al., who noted that the cationic methylene blue dye was adsorbed by charcoal in the presence of SDS at concentration within the premicellar region (Ali et al. 2018a). Moreover, the presence of sodium salt ions favored the formation of MG dye molecule aggregates which accelerated the penetration of MG dye molecules into the mesoporous structure of TMA-BC through a multilayer adsorption mechanism.

Desorption experiments and reusability potential

To verify the technical and economic feasibility of an adsorption technology before its commercialization, it is imperative that the newly developed adsorbent exhibits distinct characteristics concerning resource recovery and reusability. Therefore, desorption studies were conducted to ensure that the regenerated TMA-BC adsorbent could be utilized again. Desorption was accomplished by applying a 0.1 M HCl treatment to the surface, followed by subsequent rinsing with deionized water. During the first cycle, the desorption efficiency of TMA-BC adsorbent was 88.6 ± 2.6%, indicating its potential for reuse. The progressive decline in MG dye adsorption and desorption removal efficiency was tracked as the number of cycles increased.

As shown in Fig. 10, after three consecutive cycles, the aggregate MG dye adsorption capacity of TMA-BC decreased from 96.5 ± 2.2 to 72.5 ± 2.7%, and the desorption efficiency decreased to 68.7 ± 3.4%. The decrease in adsorption and desorption efficiency observed over three consecutive cycles can be attributed to a fraction of MG dye molecules that were not completely recovered and remained trapped within the porous structure of TMA-BC. This phenomenon occurs due to the retention of a specific proportion of the sorbed material on the adsorbent surface, resulting in the obstruction of the channel.

Fig. 10
figure 10

Desorption and reusability analysis of TMA-BC for MG dye recovery

Conclusions

This study manifested that TMA-BC, with incorporated –COOH and –SH groups, exhibited distinctive surface chemistry and unique porous features than pristine BC. The TMA-BC showed remarkable adsorption capacity (104.17 mg/g) for MG dye due to electrostatic attraction between cationic nitrogen (N+) on the MG dye and activated surface moieties (–COO– and –S–) on TMA-BC. Specifically, MG dye removal increased by 2.8%, 8.7%, 5.4%, and 12.7%, respectively, when binary solution experiments were conducted at optimized dosages of undesired ions, including humic acid, sodium dodecyl sulfate surfactant, NaCl, and NaSCN, which was attributed to the contribution of mesoporous structure of the TMA-BC adsorbent that facilitated pore intrusion. TMA-BC showed above 70% adsorptive removal efficiency after three consecutive cycles, demonstrating reusability. The use of LMWOA in this modification method for multi-functionalizing BC is acknowledged as a safe and eco-friendly approach, providing a cost-effective alternative to commercially accessible adsorbents.

While the study focused on malachite green dye, further research could look at the sorption capability of modified biochar for other contaminants like heavy metals, organic pollutants, and emerging toxins. Evaluating modified biochar’s efficacy across a wider range of contaminants would provide useful information about its possible use in wastewater treatment in a variety of sectors. Furthermore, analyzing the long-term stability and regeneration potential of TMA-BC is critical for determining its practical viability. Future research should look into the effects of prolonged use and regeneration procedures on TMA-BC’s adsorption capacity and structural integrity in order to assure sustainable and cost-effective treatment processes. In terms of soil remediation, TMA-BC functional groups, particularly carboxylic (–COOH) groups, can help to buffer pH in acidic or alkaline soils. TMA-BC, which adsorbs hydrogen or hydroxide ions, can assist in maintaining ideal soil pH levels for plant growth and microbial activity, reducing the negative impacts of soil acidity or alkalinity.