Introduction

Water plays an essential role in human life. Typically, the average daily use of water per person in developed countries exceeds 180 L per day. With the increase in population, the amount of water needed to grow food and livestock has significantly increased. The distribution of earth water comprises 97% saline water and only 3% fresh water (mostly icecaps). Only 30% of that fresh water is ground and surface water, which makes only 1% of water on earth fresh and accessible. Moreover, large amounts of fresh water are used for industry (20%) and irrigation (70%). For many reasons, water has been contaminated by various pollutants that affect not only human health but the aquatic life as well (Goel 2006; Owa 2013).

Dyes are among the common aquatic pollutants. The existence of dyes in water does not only affect water’s esthetic properties, but it also diminishes the light penetration into the stream disturbing the photosynthetic activity of the aqueous flora (El-Azazy et al. 2021a, b; El-Shafie et al. 2021). Methyl orange (MO) is a typical water-soluble azo dye that has been used in a plethora of applications. Yet, the most popular use of MO is as a pH indicator (Alardhi et al. 2023; Aljuaid et al. 2023; Iwuozor et al. 2021). The physicochemical properties of MO and its chemical structure are shown in Table S1.

Removal of MO has been accomplished using different approaches, such as advanced oxidation processes (Dai et al. 2023; Wang et al. 2023; Zhang et al. 2023), ultra-filtration (Yu et al. 2023), and electrochemical degradation (Leng et al. 2022; Wang et al. 2020a, b). Despite their effectiveness, these techniques are time consuming, require high cost, and are sophisticated with limited applicability on a large scale (El-Azazy et al. 2021a, b; Iwuozor et al. 2021). In the same context, adsorption and photocatalysis were widely applied for synthetic dye removal. While each technique has its pros and cons, the cost-effectiveness, efficiency, scalability, and simplicity remain to be the most important features to judge the performance of either technique.

Surveying the literature shows that the adsorptive removal of MO has been achieved using various natural and synthetic adsorbents (Table S2). Natural adsorbents included biochar derived from coffee, and rice husks, wattle bark, lemon, orange, and banana peels (Annadurai et al. 2002; Bhatnagar et al. 2009; Cuong Nguyen et al. 2021; Loc et al. 2022; Yu et al. 2018). Synthetic adsorbents such as chitosan, and carbon nanotubes have also been used (Ahmad et al. 2017; Sui et al. 2012; Yao et al. 2011). By and large, the individual application of these techniques brings certain inadequacies such as a limited sportive capacity, poor photocatalytic efficiency, elevated regeneration costs, and the generation of secondary pollutants (Alardhi et al. 2023; Aljuaid et al. 2023; Bhatnagar et al. 2009; Chen et al. 2011; Da Dalt et al. 2013; El-Azazy et al. 2021a, b; El-Shafie et al. 2021; El Amri et al. 2023; Haque et al. 2010; Hidayat et al. 2023; Iwuozor et al. 2021; Loc et al. 2022; Zhang et al. 2021). Therefore, the development of a multifunctional “hybrid” material that can perform both as an adsorbent and photocatalyst remains a challenge.

Nevertheless, an efficient adsorbent serves to foster the photocatalytic degradation of the contaminant by accumulating the pollutant on the surface and hence increasing the contact with the photocatalyst. Moreover, in the hybrid material, the photoexcitation of electrons is usually followed by trapping of the excited electrons by the carbonaceous adsorbent. In the interim, the charge carriers will react with the adsorbed oxygen forming the superoxide radical reactive species, which in turn could be transferred to the adsorbed organic pollutant (either on the surface or inside the pores) fostering its degradation (Fito et al. 2022; Irani & Amoli-Diva 2020; Lim et al. 2011; Luo et al. 2019; Qiao et al. 2020; Shi et al. 2020; Yu et al. 2021).

Biochar (BC) – a carbonaceous material produced under oxygen-deficient conditions – is among the materials that have been commonly implemented in a nanocomposite photocatalyst (Fito et al. 2022; Lim et al. 2011; Yu et al. 2021). While BC can be produced from different sources, the BC sourced from biomasses and specifically agricultural wastes offers a renewable, cost-effective, and sustainable solution for several environmental challenges such as wastewater remediation via sensing, adsorptive removal, and photocatalytic degradation of pollutants (El-Azazy et al. 2023; El-Shafie et al. 2023; Ganesapillai et al. 2023; Lo Bello et al. 2022; Lu et al. 2022; Osman et al. 2022). Among the agro-wastes that are copiously produced and consumed worldwide are nuts – sourced from argan, cashew, hazelnut, walnut, pecan, Macadamia, shea, pistachio, etc. Official reports show that 30 × 106 metric tons of pistachio nut waste is produced yearly from nuts processing industries with no fate other than incineration or landfill causing further pollution (Foo & Hameed 2011).

Photocatalysis using metal oxides (for instance titanium oxide TiO2) for wastewater treatment has been widely explored, where TiO2 possesses high stability and photoactivity. Yet, such an activity only appears under UV light with a high possibility of very fast electron–hole pair recombination suppressing the photoactivity. Moreover, the agglomeration and consequently the decrease in surface area, the wide band gap, the sluggish response for trace contaminants and complex wastewater matrices, and the production of toxic intermediates, are all limitations for single application of using TiO2 as a photocatalyst (Fazal et al. 2020; Shan et al. 2020). Therefore, synthesis of hybrid materials with TiO2 being loaded on the BC serves to resolve these glitches thanks to the oxygen functionalities-rich BC surface.

In the current approach, therefore, synthesis of TiO2@BC of pistachio nutshells (PNS) nanocomposites (TiO2@PNS-BC) will be employed to investigate the MO adsorptive-photocatalytic decolorization. Optimization of process variables will be approached via a multivariate-based conspiracy executing Box-Behnken (BB) response surface design and operating five independent parameters; %TiO2, dose of the nanocomposite (PNS-Ti), reaction time (RT), dye concentration [MO], and pH of the solution. Following such a scheme serves to alleviate the negative impact of chemicals on the environment via a reduced number of runs and producing trustworthy data (Akazdam et al. 2018; Box & Behnken 1960; El-Azazy, Kalla, et al. 2019a, 2019b; Farhan et al. 2021; Ferreira et al. 2007). A single dependent variable (%R) will be adjusted as a function of the 5 independent variables. Moreover, the structure of adsorbent is studied using numerous characterization techniques. The goal of this investigation is creating biochar with high efficiency, and low cost, via a sustainable approach.

Materials and methods

Chemicals

All chemicals were of high purity and were utilized as procured from the vendor (Sigma-Aldrich, USA) without further purification. Drugs used for testing the adsorbent selectivity (econazole nitrate, procaine hydrochloride, amantadine, raltegravir, and sulfisoxazole) were procured from Biosynth® Carbosynth Ltd. (UK). All investigations utilized deionized (DI, 18.2 MΩ cm) water acquired from a Millipore-Q water system (Merck, USA). The waste left over from consuming local, unroasted, unsalted pistachio nuts was used to obtain pistachio nutshells (PNS). MO was procured from BDH Chemicals Ltd (UK). For batch adsorption studies, a 100 ppm stock solution of MO was prepared in DI water. Further dilutions were prepared in the same solvent.

Instrumentation: synthesis and characterization

PNS was initially dried using an oven (Memmert, Germany). Following this process, carbonization was performed in a Thermolyne™ furnace (USA). The obtained carbonized material was labeled as PNS-BC. The pH of the water in which the adsorbents were suspended was measured using a pH meter (Jenway 3305, UK). To change the pH levels, diluted aquatic solutions of HCl or NaOH were employed. A centrifuge (Thermo Fisher Scientific, USA) was used to help separating the adsorbent from the adsorbate. MO-adsorbent suspensions were filtered using nylon, 0.45 µm Millex membrane filters.

A UV–Vis spectrophotometer (Agilent diode-array, Agilent, USA) was used to determine the absorbance and, consequently, the quantity of MO in the filtrates using 10 mm matched quartz cuvettes. Photocatalysis experiments were performed using Spectroline® CM UV-viewing mini-cabinet with 4 W removable lamps (combination UV light source; 365 nm/254 nm), Sigma-Aldrich (USA). CHN elemental analysis was done using Thermo Scientific™ FLASH 2000 CHNS/O analyzer (USA). FT–IR spectroscopy was used to analyze the surface function groups of the tested adsorbents (Perkin Elmer, USA). A scanning electron microscope (SEM, FEI, Quanta 200, Thermo Fisher Scientific, USA) fitted with an energy-dispersive X-ray spectrometer (EDX) was used to study the morphologies and the elemental structure of the adsorbent. Raman spectroscopy was performed using a DXR Raman microscope (wavelength of 532 nm, 40 scans, and the laser power used is 9.2 mW using 50⨯ microscope objectives, USA). The thermal stability of the prepared adsorbents was established using thermogravimetric analysis (TGA/dTA). Using an ASAP2020™ accelerated surface area and porosimetry system (Micrometrics, USA), surface features such as pore size, surface area, and volume were calculated. After degassing, N2-adsorption and desorption were investigated. The isotherms recorded at 77 K were used to calculate the surface area and pore volume using the Brunauer–Emmett–Teller (BET) equation and t-plots and Barrett-Joyner-Halenda (BJH) equations. The BB design was created using Minitab®19 software (Minitab Inc., USA).

Preparation of pistachio nutshells (PNS)-based sorbents

Neither roasted nor salted pistachios were used, and the shells were peeled off, washed several times using tap water and a few times with DI water to eliminate dust and any residuals. Nutshells were dried in oven for 3 days at 80 °C (El-Azazy, El-Shafie, et al., 2019a, 2019b). Later, shells were pulverized using a non-metal blade blender to obtain powdered PNS which was sieved using a 125 mm sieve. Sieved powder was further split, one portion was labeled as PNS. The second portion was burned in a sealed crucible in the furnace for 60 min at 600 °C. The resultant material was placed in sealed vials and labeled as PNS-BC.

Synthesis of TiO2@PNS-BC binary composites

Synthesis of TiO2 nanoparticles was performed using the hydrothermal method. In this regard, a surfactant solution was employed to control the particle size. Therefore, 100 mL of 0.1 M of oleylamine dissolved in n-propanol was set aside stirring for 1 h and heated to 80 °C with fixed speed of 650 rpm. Thereafter, 68 mL of 0.09 M TiCl4 solution was added, and pH of the solution was adjusted to 1.8 using 26% ammonia solution dropwise. The mixture was stirred for 2 h at 80 °C and 650 rpm. Later, the solution pH was adjusted to ~ 8 using 26% ammonia solution. After that, mixture was left at room temperature stirring for 20 h. Finally, the product went through centrifugation at 4000 rpm, washed with DI water, dried in the oven at 80 °C for dehydration overnight, and resultant product was labeled as TiO2@PNS-BC (Marwa El-Azazy et al. 2021a, b).

Determination of the point-of-zero-charge (pHPZC)

To determine the pHPZC of the three adsorbents (1%, 2%, and 3% of TiO2@PNS-BC), an amount of 0.2 g of the former was mixed with 0.01 M NaCl aqueous solution in 50 mL volumetric flasks. The initial pH was adjusted to a pH value in the range of 2.00–10.00 ± 0.20 using aqueous solutions of 0.1 M NaOH or 0.1 M HCl. Samples were placed in the automatic shaker at 150 rpm for 48 h. Solutions were filtered and their final pH was measured. Graphs of final pH versus initial pH were plotted, and the pHPZC value is determined as the intersection of the horizontal part of plot with the initial pH axis (Andas & Wazil 2019; Babić et al. 1999).

Batch adsorption experiments: box-behnken (BB) design

BB design was used to explore the impact of five variables on the dependent response variable, %R of MO, Table 1. Equation (1) is used to calculate %R of MO.

$$ {\text{\% }}R = { }100{ } \times { }\frac{{C_{o} - { }C_{e} }}{{C_{o} }} $$
(1)
Table 1 Variables (independent and dependent) with their levels for the BB design

Where C0 and Ce symbolize the initial and equilibrium concentrations of dye [MO] (ppm), correspondingly. The experimental rehearsal as shown in Table 2 consisted of 46 experimental runs (including 6 central points, Ct Pt, level 0) performed over 2 blocks. For each experimental run, the scenario shown in Table 2 was followed and the %R was recorded. All runs were performed in triplicates and the average reading is noted. Response optimization was carried out using the individual desirability function (d) feature provided by Minitab®. Analysis of variance (ANOVA) was performed, and findings were compared to the quality tools used to assess the BB design. Regression paradigms were obtained and model features such as coefficient of determination (R2), adjusted R2 (R2adj), and predicted R2 (R2pred) were noted and used to decide upon model linearity and prediction power. Predicted values are listed in Table 2. Calibration curves of different MO concentrations prepared at different pH values (Table 1) were constructed. The maximum wavelength (λmax) for MO at pH = 6 and 10 is 462 nm, while at pH = 2 is 502 nm.

Table 2 BB design setup for the removal of MO

Equilibrium and kinetic investigations

To investigate the adsorption equilibrium, MO stock solution of 400 ppm was prepared. Further dilutions (1–200 ppm) of MO were prepared in DI water and the pH was adjusted using aqueous solution of 0.1 M HCl to 6.00 ± 0.20. A blank was similarly prepared omitting MO. A mass of 0.100 ± 0.001 g of the adsorbent (3% TiO2@PNS-BC) was then added to each tube. Later, the tubes were placed in automatic shaker at 150 rpm for 24 h. Solutions were filtrated, and absorbance of the sample was measured afterward at 462 nm. To study the adsorption kinetics, 0.500 ± 0.001 g of adsorbent (3% TiO2@PNS-BC) was mixed with 150 mL of 100 ppm solution of MO, pH adjusted to 6.00 ± 0.20. While stirring at 750 rpm at room temperature, and at different time intervals, aliquots of 10 mL were taken out over a total duration of 120 min. Solutions were filtered using 0.45 µm filter, and absorbance was measured at 462 nm.

Photocatalytic degradation of MO: reaction kinetics

To test the efficiency of TiO2@PNS-BC as a photocatalyst, an amount of 0.500 ± 0.001 g of the adsorbent (TiO2@PNS-BC, with 1%, 2% and 3% of TiO2) was mixed with 150 mL of 100 ppm aqueous solution of MO, then pH was adjusted to 6.00 ± 0.20. Solutions were continuously stirred at 750 rpm while being irradiated using the UV lamp (short wavelength, 254 nm). During irradiation, aliquots of 10 mL were withdrawn, and filtered using 0.45 µm syringe filter over a period of 120 min. Absorbances of the filtrates (average of triplicate measurements) were recorded at 462 nm. The experimental data were fitted to a second-order polynomial fitting.

The photocatalyst effectiveness was quantified with reference to its decolorization efficiency (%DE) toward MO, calculated using Eq. (2).

$$ {\text{\% DE}} = 100 \times \frac{{C_{o} - C_{t} }}{{C_{o} }} $$
(2)

Where C0 symbolizes the initial [MO], while Ct denotes concentration of [MO] after a certain irradiation time, both expressed in ppm.

Adsorbent selectivity

The selectivity of 3% TiO2@PNS-BC nanocomposite for MO was evaluated by equating the removal efficacy of 3% TiO2@PNS-BC toward MO with its efficiency for eight other organic compounds including three dyes (methylene blue, rose bengal, basic fuchsine) and five drugs (econazole nitrate, procaine hydrochloride, amantadine, raltegravir, and sulfisoxazole) (Cantarella et al. 2019; El-Azazy et al. 2023). In this respect, volumes of 13 mL from each suggested pollutant (50 ppm aqueous solution) were mixed with 0.100 ± 0.005 g of 3% TiO2@PNS-BC. The pH of the solution was then adjusted to 6.00 ± 0.20 using 0.1 M aqueous solution of HCl. The mixture was stirred at 150 rpm for 30 min. Samples were filtered, and the filtrate absorbance was recorded at λmax of each pollutant solution.

Results and discussion

Characterization of the as-prepared adsorbents

SEM and EDX analyses

The morphology and the composition of the prepared binary composites were evaluated using SEM and EDX techniques. The SEM micrographs of the PNS-BC sample in Fig. 1a, b confirmed the presence of pores with different sizes that could aid in the removal of the studied dye. At a higher magnification, the pores of PNS-BC resemble a honeycomb showing the capability of the BC to uptake MO. Furthermore, the SEM micrographs of the samples loaded with TiO2 nanoparticles showed an increase in the existence of nanoparticles on the surface, which was proportional to the amount of loaded TiO2. Specifically, Fig. 1d, e shows a small amount of TiO2 nanoparticles on the surface of the PNS-BC for the 1% TiO2@PNS-BC sample, while Fig. 1g, h reveals an increase in the existence of nanoparticles on the surface for the 2% TiO2@PNS-BC sample. Finally, Fig. 1j, k shows a heavy existence of TiO2 nanoparticles which have covered almost all the surface and the pores of the PNS carbonaceous material in the case of 3% TiO2@PNS-BC sample.

Fig. 1
figure 1

SEM graphs of a, b PNS-BC, d, e 1% TiO2@PNS-BC, g, h 2% TiO2@PNS-BC, j, k 3% TiO2@PNS-BC at different magnifications, c, f, i, m EDX analyses of PNS-BC, 1% TiO2@PNS-BC, 2% TiO2@PNS-BC, and 3% TiO2@PNS-BC, respectively

The findings from the SEM micrographs were supported by the EDX analysis in Fig. 1c, f, i, and m. The data showed a decrease in carbon concentration from 88.74% for PNS-BC to 81.84% in 3% TiO2@PNS-BC due to the presence of TiO2 on the surface. In contrast, the oxygen concentration on the surface increased from 10.71% in PNS-BC to 14.73% in 3% TiO2@PNS-BC due to the formation of metal oxide on the surface. The presence of titanium was confirmed by an increase in titanium concentration from 1.20% in 1% TiO2@PNS-BC to 3.29% in 3% TiO2@PNS-BC, thereby confirming the successful preparation of different concentrations of TiO2 loaded-PNS-BC.

CHN analysis

Table 3 presents the results of the CHN analysis conducted on the as-prepared samples. According to the data, the %N increased from 0.02% for PNS-BC to 0.08% for 3% TiO2@PNS-BC, which could be attributed to the use of oleylamine in the synthesis of TiO2 nanoparticles. Similarly, the H% increased from 1.45% in PNS-BC to 2.64% in 3% TiO2@PNS-BC. However, the percentage of C% decreased from 87.40% in PNS-BC to 70.05% in 3% TiO2@PNS-BC due to the presence of TiO2 on the surface, as confirmed previously using SEM and EDX analyses.

Table 3 CHN analysis of PNS-BC before and after loading of different concentrations of TiO2 (1%, 2% and 3% TiO2)

Raman spectroscopy and TGA analyses

Raman analysis was employed to study the structure of as-prepared TiO2@PNS-BC binary composites, as illustrated in Fig. 2a. The obtained spectra exhibited the representative Raman modes; the characteristic peaks of the anatase phase of TiO2 (active form), including the Eg mode at 139 cm−1, B1g mode at 412 cm−1, B1g/A1g at 549 cm−1, and the Eg mode at 638 cm−1. The obtained data agrees with the reported data for the previously prepared anatase TiO2 nanoparticles (Antonio-Cisneros et al. 2015; Pang et al. 2021; Yu et al. 2014). Figure 2a also showed the presence of two strong bands at 1361 cm−1, which corresponds to a D band which is associated with the presence of sp3 C–C atoms, and the second band at 1595 cm−1, known as the graphitic band, related to the E2g phonon of the sp2 carbon (C=C) atoms, and both are characteristic peaks of carbonaceous materials (Beams et al. 2015; Fernández-Ibáñez et al. 2015). Additionally, the ID/IG ratio decreased from 0.67 in PNS-BC to 0.63 in 3% TiO2@PNS-BC, indicating that the number of defects on the biochar surface decreased after loading of TiO2 nanoparticles, which could potentially affect the adsorption and photocatalytic activity of the prepared binary composites.

Fig. 2
figure 2

a Raman spectra of the as-prepared samples including PNS-BC, 1% TiO2@PNS-BC, 2% TiO2@PNS-BC, and 3% TiO2@PNS-BC, b TGA/dTA analysis for PNS-BC and 3% TiO2@PNS-BC

The TGA/dTA analysis for the two samples, PNS-BC and 3% TiO2@PNS-BC, is shown in Fig. 2b. The results indicate that both binary composites exhibited weight loss between 50 and 250 °C (16.49% for PNS-BC and 21.48% for 3% TiO2@PNS-BC), which can be attributed to the loss of surface-free water. Furthermore, a second weight loss was observed in the temperature range of 460–800 °C, with PNS-BC and 3% TiO2@PNS-BC showing weight losses of 30.18% and 22.48%, respectively. This could be due to the loss of organic matter and the carbonization of the polymeric components in the carbonaceous material. The final weight loss for PNS-BC was 51.95%, and for 3% TiO2@PNS-BC, it was 55.87%, with a difference of 3.92%, representing the amount of TiO2 nanoparticles impregnated onto the PNS-BC. Moreover, the presence of TiO2 nanoparticles on the surface of the biochar enhances the thermal stability of the prepared nanosorbent.

FT–IR analysis and point-of-zero-charge (pHpzc)

The FT–IR assignments for the as-prepared PNS-BC samples before and after loading with different concentrations of TiO2 nanoparticles show the presence of significant functional groups that could participate in removing MO from wastewater. The IR spectrum, Fig. 3a reveals the presence of several peaks in the TiO2-impregnated sample and during the preparation process. These peaks include the absorption band at 2928 cm−1, corresponding to the stretching vibration of aliphatic C–H (methylene) bonds, a characteristic feature of carbonaceous materials. The peak at 2845 cm−1 corresponds to aliphatic C–H stretching vibrations, while the absorption peak at 1045 cm−1 is often associated with the stretching vibration of C–O or C–N bonds in carbonaceous materials and it can be also attributed to the bending vibration of the Ti–OH (León et al. 2017; Mugundan et al. 2015). Furthermore, the absorption band at 873 cm−1 corresponds to the bending vibration of Ti–O–Ti bonds in titanium oxide, confirming the presence of TiO2 on the surface of PNS-BC (Lu et al. 2019; Marwa et al. 2022; Pang et al. 2021).

Fig. 3
figure 3

FT–IR spectrum of a as-prepared samples including PNS-BC, 1% TiO2@PNS-BC, 2% TiO2@PNS-BC, and 3% TiO2@PNS-BC, b pHPZC for the four samples

On the other hand, the remaining peaks in the spectrum are related to carbonaceous materials and appear in all the as-prepared samples. For instance, the peak at 2163 cm−1 is attributed to the stretching vibration of a C≡C triple bond, often present in certain carbonaceous materials. The band at 1961 cm−1 may be assigned to the stretching vibration of a carbonyl functional group (C=O) on the surface of PNS-BC carbonaceous material. Additionally, the absorption peak at 1561 cm−1 is related to the stretching vibration of C=C bonds in aromatic structures, which can be present in carbonaceous materials.

The surface charge of the studied nanosorbents was investigated, and the obtained data revealed that the pHPZC of PNS-BC was 6.34 ± 0.20. After loading with TiO2 nanoparticles, the pHPZC values for 1% TiO2@PNS-BC, 2% TiO2@PNS-BC, and 3% TiO2@PNS-BC were 4.87, 5.11, and 5.08 ± 0.20, respectively, Fig. 3b. These figures indicate that the surface of the as-prepared adsorbents has more acidic functional groups, which could positively affect the removal efficiency of the studied adsorbents. Furthermore, the surface of 3% TiO2@PNS-BC is positively charged at pH values lower than 5.08 ± 0.20 and negatively charged at pH values higher than 5.08 ± 0.20.

Analysis of the surface area and pore size

The results of the BET analysis for PNS-BC and 3% TiO2@PNS-BC are presented in Fig. 4a–d and Table 4. The obtained data reveals that the multi-point BET surface area (SA) for PNS-BC and 3% TiO2@PNS-BC were 5.77 m2/g and 33.37 m2/g, respectively. The acquired data confirms that the surface area of PNS-BC has increased with the addition of TiO2 nanoparticles. The increase in the surface area directly affects the adsorption efficiency of 3% TiO2@PNS-BC toward MO. The single point total pore volume decreased from 0.168 cm3/g in PNS-BC to 0.028 cm3/g in 3% TiO2@PNS-BC due to the coverage of most pores on the surface of the PNS-BC with the TiO2 nanoparticles, as observed from the SEM micrographs. Additionally, both samples contained two types of pores: mesopores with pore sizes ranging from 2 to 50 nm and macropores with pore sizes greater than 50 nm, Fig. 4b and d. Figure 4a, c shows that the adsorption isotherm and hysteresis loop for both samples is of type IV and H3 form, which is characteristic of porous carbonaceous materials.

Fig. 4
figure 4

Nitrogen adsorption–desorption isotherms for a PNS-BC, c 3% TiO2@PNS-BC and the pore diameter for b PNS-BC, d 3% TiO2@PNS-BC

Table 4 Collected BET analysis data for PNS-BC and 3% TiO2@PNS-BC

X-ray diffraction (XRD) analysis

Performing XRD analysis is crucial for identifying the crystalline phase of powdered materials. In this study, the samples were subjected to X-ray diffraction analysis to confirm the crystalline phase of the as-prepared PNS-BC before and following the loading of TiO2 nanoparticles. Figure 5 depicts the XRD diffractogram patterns of the prepared samples, namely PNS-BC, 1% TiO2@PNS-BC, 2% TiO2@PNS-BC, and 3% TiO2@PNS-BC. The XRD pattern of the PNS-BC sample shows a broad peak between 2θ: 15° and 30°, indicating the amorphous state of the PNS-BC. This peak was also present in TiO2@PNS-BC, indicating the presence of a carbon layer with TiO2 nanoparticles (Elamin et al. 2023; Pravakar et al. 2021). Furthermore, the XRD pattern, Fig. 5 of the as-prepared TiO2@PNS-BC reveals two small peaks at 28°, 34°, 40°, 50°, and 58°, which could be corresponding to the (101), (004), (200), (105), and (211) planes, respectively (ICSD: 01–089) (Wang et al. 2020a, b). These characteristic planes confirm the presence of TiO2 nanoparticles in the anatase phase, which agrees with the Raman analysis findings.

Fig. 5
figure 5

Powder XRD pattern of PNS-BC, 1% TiO2@PNS-BC, 2% TiO2@PNS-BC, and 3% TiO2@PNS-BC

BB design analysis: quality charts and ANOVA

BB design is a response surface methodology (RSM)–based design. This design requires three levels for each parameter, highest (+ 1) and lowest (\(-\) 1) (Box & Behnken 1960; El-Azazy, Kalla, et al., 2019a, 2019b; Ferreira et al. 2007; Tripathi et al. 2009). One of the advantages of the BB design is that for all experiments needed, none of the experiments contain a combination where all factors are neither at the highest nor at the lowest levels. This is done to avoid extreme conditions in the generated set of experiments, as that may result in undesirable results.

In the current investigation, removal of MO was studied as a function of 5 variables. Pareto chart, Fig. 6a was used to demonstrate the variables’ significance. In this study, the most significant variables were the squared effect of the %TiO2 (AA). On the other hand, pH (E) had the lowest influence on %R among all studied main effects. As also revealed by the Pareto chart, variable-variable interactions such as BD (AD and [MO]), and CE (RT and pH) had the most statistically insignificant effect on the removal of MO. Figure 6b shows the contour plots depicting the data in a 2D format. The dark red zones designate regions with the lowest %R of MO, in contrast to the dark gray areas.

Fig. 6
figure 6

a Pareto chart of standardized effect, b 2D-contour plots

Analogous inferences could be drawn from the ANOVA performed at 95.0 confidence interval. Acquired results – not shown, reveals that terms with p-value < 0.05 are statistically significant.

Regression equation

Regression model in terms of coded variables is given by Eq. (4). In addition to showing the magnitude of each effect (whether main, squared or variable-variable interactions), the regression model shows the direction of the effect on the measured response. To find the overall impact of any term, the total contribution of such term should be considered.

$$\sqrt{\%R}=-13.23+15.226 A-0.0212 B+0.0521 C+0.0728 D+0.631 E-3.426 {A}^{2}-0.000558 {B}^{2}-0.000524 {C}^{2}-0.00068 {D}^{2}-0.04974 {E}^{2}+0.03301 AB+0.01118 AC -0.03813 AD -0.1397 AE+0.000223 BC+0.000302 BD+ 0.00636 BE+0.000417 CD -0.001556 CE -0.00899 DE$$
(3)

In this regard, the values of R2 and R2adj were 98.81% and 97.77%, respectively, which are high enough to confirm the goodness-of-fit and the good linearity. While R2pred was found to be 95.08%, which confirms a good prediction power for new observations.

Optimization phase

As the aim of this investigation is to maximize the removal of MO, the individual desirability function (d) value was used to decide upon the optimum adsorption conditions. Acquired results show that a factorial combination of %TiO2 ≈ 3% (a plateau started at ~ 2.7%), AD = 78.11 mg/13 mL, RT = 120 min, [MO] = 5 ppm, and pH = 5.74 could achieve the target which is the maximum removal of MO as reflected by the high value of the d function. Optimum conditions were further utilized for all subsequent experiments.

Equilibrium and kinetics investigations

To investigate the MO adsorption process, the adsorption isotherms were used to estimate the amount of MO accumulation on the adsorbent surface and the type of interaction of MO-adsorbent. Adsorption of MO onto 3% TiO2@PNS-BC at a constant temperature was studied using four equilibrium isotherms; Langmuir, Freundlich, Temkin, and Dubinin–Radushkevich (D–R) (Araújo et al. 2018; Guo & Wang 2019; Langmuir & Herman 1980; Moussavi & Barikbin 2010).

The Langmuir isotherm frequently suggests one of the following three main hypotheses:

  1. (i)

    The adsorption sites have identical adsorption energy,

  2. (ii)

    The adsorbate molecule occupies only one site on the surface, and there is no interaction between the adsorbate molecules,

  3. (iii)

    The adsorption is mostly confined to the adsorbent surface.

Equation (4) was used to demonstrate the Langmuir isotherm as follows:

$${q}_{e}=\frac{{q}_{m} {K}_{L} {C}_{e}}{1+{K}_{L} {C}_{e}}$$
(4)

where qm and KL represent the maximum adsorption capacity (mg/g) and Langmuir equilibrium coefficient (L mole−1), respectively. Moreover, Langmuir model can be expressed using Langmuir equilibrium coefficient as shown in Eq. (5).

$${R}_{L}=\frac{1}{1+{K}_{L} {C}_{0}}$$
(5)

Thus, RL and Co refer to the separation factor and initial concentration of MO, respectively. The RL is used to determine the desirability of the adsorption process, thus, if calculated RL is = 1 then the adsorption process is unfavorable, while if RL value is between 0 and 1, then the process is favorable and spontaneous. If RL = 0, the reaction is considered irreversible. The determined value (Fig. 7a and Table 5) of RL for MO onto 3% TiO2@PNS-BC was < 1, denoting that the adsorption process is favorable, and happened spontaneously. Moreover, the adsorption of MO became irreversible when [MO] was high. The calculated parameters in Table 5 show that the maximum adsorption capacity for MO was 142.38 mg/g. The resultant data indicates that the adsorption of MO onto 3% TiO2@PNS-BC fit well with the Langmuir isotherm with R2 = 0.9913. The obtained data confirms that the adsorbent (3% TiO2@PNS-BC), has high adsorptive capability toward MO.

Fig. 7
figure 7

a Equilibrium models including Langmuir, Freundlich, Temkin, D-R, b kinetic models including PFO, PSO, Elovich and Weber Morris for the adsorption of MO onto 3% TiO2@PNS-BC

Table 5 Equilibrium and kinetic models for the adsorption of MO onto 3% TiO2@PNS-BC

The Freundlich isotherm, on the other hand, is a useful tool for describing the energy of a heterogeneous surface, as shown by Eq. (6):

$${q}_{e}= {K}_{F}{C}_{e}^\frac{1}{n}$$
(6)

where Ce is [MO] at equilibrium (mg/L), qe is amount of MO adsorbed per unit mass (mg/g), Kf (mole.g−1) (L.mole−1), and 1/n is Freundlich coefficient that determines the adsorbent capacity and the change in its intensity, in addition to the deviation form linearity. The calculated parameters in Table 5 show that the Freundlich coefficient 1/n = 0.85, and n = 1.176. As a result, the adsorption potential calculated using Eq. (7)  = 2.913 kJ, meaning that all MO molecules with potential energy < 2.913 kJ will be adsorbed onto 3% TiO2@PNS-BC. Besides, the MO adsorption process will be favorable and irreversible.

$$ A = n\;R\;T $$
(7)

Temkin isotherm is the model used to describe the interaction between adsorbent and adsorbate and can be illustrated using the following Eq. (8):

$${q}_{e}= \frac{RT}{{b}_{T}} \mathrm{ln}({A}_{T} {C}_{e})$$
(8)

Where R is the universal gas constant (8.314 J/mol.K), T is the temperature (K), bT quantifies the sorption energy, and AT is the Temkin isotherm equilibrium binding constant. According to Fig. 7a and Table 5, MO has sorption energy is 416.06 J/mol. The obtained results suggest that MO adsorbs favorably on the surface of 3% TiO2@PNS-BC adsorbent, these results confirm the Langmuir and Freundlich findings.

Dubinin–Radushkevich (D–R) isotherm was studied at room temperature to determine the adsorption mechanism of MO on 3% TiO2@PNS-BC adsorbent and be expressed by using Eq. (9) as follow:

$${q}_{e}= {q}_{s }. \mathrm{exp }(-\upbeta .{\epsilon }^{2})$$
(9)

In this equation, qs is the maximum adsorption capacity, β is the activity coefficient and it is used to measure the sorption energy E (kJ/mol), and \(\epsilon \) is the Polanyi potential. The potential sorption energy and the Polanyi potential are illustrated by Eqs. (10) and (11), respectively:

$$\epsilon =RT\left(1+ \frac{1}{{C}_{e}}\right)$$
(10)
$$ E = {\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\sqrt {2\beta } }}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${\sqrt {2\beta } }$}}{\text{ }} $$
(11)

Therefore, based on the data shown in Table 5, the adsorption energy equals 2.59 kJ/mole. This suggests that the MO adsorption is physisorption onto 3% TiO2@PNS-BC, with adsorption energy < 8 kJ/mole. Yet, the presence of various functional groups on the surface of the adsorbent, as confirmed by the FT–IR analysis, reveals that the possibility of occurrence of chemisorption cannot be neglected. The resulting data implies that the adsorption of MO onto the 3% TiO2@PNS-BC adsorbent depends on the surface area of the studied adsorbent.

The adsorption of MO onto 3% TiO2@PNS-BC was studied through four kinetics models: pseudo-first order (PFO), pseudo-second order (PSO), Elovich model, and Weber Morris model (Ezzati 2020; Machado et al. 2021; Wu et al. 2009). Figure 7b and Table 5 illustrate the relationship of qt (mg/g) versus time (t, min) for MO adsorption on 3% TiO2@PNS-BC and the calculated parameters for the four models. The obtained results indicate that R2 value for the PSO model is the highest among the four models (R2 = 0.9531). The resultant data demonstrate that adsorption rate of MO is affected by both dye and adsorbent concentrations, and can be expressed by Eq. (12):

$$MO+PNCBC@Ti{O}_{2}\stackrel{K}{\to } MO-PNSBC@Ti{O}_{2}$$
(12)

On the other hand, R2 values of the other models including Elovich and Weber Morris were significantly lower compared to PSO and PFO, and equals 0.8659, and 0.6188 for Elovich and Weber Morris, respectively, and these models cannot be used to describe the adsorption of MO on 3% TiO2@PNS-BC.

Efficiency of the tested adsorbent compared to literature

Table S2 shows literature efforts for removing MO from wastewater using different biochar-based as well as synthetic adsorbents. The table shows these efforts arranged based on the qmax compared to the current investigation. Results of the current approach indicate that 3% TiO2@PNS-BC has the highest adsorption capacity (142.38 mg/g) when compared to other types of adsorbents (Ahmad et al. 2017; Annadurai et al. 2002; Bhatnagar et al. 2009; Cuong Nguyen et al. 2021; Loc et al. 2022; Sui et al. 2012; Yao et al. 2011; Yu et al. 2018).

Photocatalysis reaction kinetics

In the current investigation, photocatalysis was used to speed up the decolorization of MO. Adsorption kinetics together with the design optimization findings showed an almost 100% decolorization of MO could be achieved, however, after a period of 120 min of staying in contact with 3% TiO2@PNS-BC. Investigation of photocatalysis kinetics shows that with UV-irradiation of MO-3% TiO2@PNS-BC, an almost complete decolorization of MO could be accomplished over a period of just 30 min. Figure 8a shows the photocatalysis reaction kinetics compared to the adsorption kinetics. Plots of ln(C0/Ct) versus time (t, min) were fitted to the following first-order kinetics model given by Eq. (13).

Fig. 8
figure 8

a Photocatalytic decolorization kinetics of MO using 3% TiO2@PNS-BC compared to the kinetics of a control experiment (only adsorption with no photocatalysis) over a period of 30 min, b Photocatalytic decolorization kinetics of MO over catalysts, c Photocatalytic degradation of MO using different concentrations of TiO2, and d Absorption spectra of MO recorded over 30 min of UV-irradiation of MO-3% TiO2@PNS-BC. Triplicate measurements are expressed using error bars

$$\mathrm{ln}\left({\mathrm{C}}_{0}/{\mathrm{C}}_{\mathrm{t}}\right)={k}_{1}\mathrm{t}$$
(13)

Where C0 and Ct signify the initial [MO], and the [MO] after a certain irradiation time in case of photocatalysis or the equilibrium concentration following adsorption without photocatalysis, both expressed in ppm, k1 is the rate constant (min−1) calculated from the slope of the linear fit, and t is the time (min). A clear increase in the value of k1 (min−1) of the linear plots could be observed implying an increase in the speed of the decolorization of MO using photocatalysis compared to adsorption alone. This control experiment shows a synergistic effect of the BC and TiO2, where the existence of TiO2 has accelerated the decolorization of MO, probably due to the anatase crystal form.

In this regard, the influence of increasing the concentration of the loaded TiO2 (%TiO2) on the BC surface on the photocatalysis kinetics was explored, Fig. 8b. As could be concluded comparing the slopes of the three curves (rate constants), 3% TiO2@PNS-BC was the best catalyst compared to the 2% and the 1% counterparts with a decolorization rate constant of 0.12741 min−1 which is almost 1.5 × faster compared to the decolorization of MO using adsorption alone. These findings infer that the increased concentration of TiO2 on the BC surface up to 3% implies an increase in the existence of the anatase crystal form, an issue which was also clearly reflected by the SEM micrographs where at a 3%, layers of TiO2 exist on and almost completely cover the surface.

Comparing the 1% and 2% irradiated candidates. Figure 8b with the control experiment conducted without irradiation (adsorption alone), Fig. 8a, the rate constant has almost doubled, from 0.02978 min−1 (1%—irradiated) to 0.06129 min−1 (2%—irradiated) compared to 0.08707 min−1 for a 3%—non-irradiated sample (adsorption only). These figures reflect the importance of finding the optimum concentration of TiO2 (the preceding BB design optimization step). The lower performance of the 1% and 2%—irradiated samples compared to the adsorption only experiment could be attributed to the shelter effect of the biochar, where the excess biochar compared to the %TiO2 could block the light reaching to the photocatalyst surface. Therefore, an optimum value of 3% TiO2 is the best for the synthesis of the photocatalyst.

In the same itinerary, and in accord with the BB design output where 3% TiO2@PNS-BC had the highest adsorptive efficiency, Fig. 8c shows that the highest decolorization efficiency (%DE) of MO could be achieved using 3% TiO2@PNS-BC. Figure 8c shows that after 30 min, almost complete (99.47%) of MO could be recognized compared to 88.44% and 81.38% using the 2% and 1% commodities, respectively. Figure 8d shows the absorption spectra of MO recorded over 30 min of UV-irradiation of MO-3% TiO2@PNS-BC. An obvious decrease in absorbance could be noted over time.

A comparison between the current MO decolorization efficiency in terms of the degradation rate constant, %DE, and the time consumed to achieve this %DE with the literature reported efforts is shown in Table 6 (Annadurai et al. 2002; Bhatnagar et al. 2009; Chen et al. 2011; Loc et al. 2022; Zhang et al. 2021). For the sake of a fair comparison, chosen efforts were all biochar-based investigations. Obtained data showed the superior performance of the 3% TiO2@PNS-BC compared to the rest of catalysts. The rate constant (decolorization speed) was almost the highest with a %DE of 99.47% achieved over the shortest period, only 30 min.

Table 6 A comparison of biochar-based photocatalysts for the decolorization of MO with the current approach

Proposed adsorption/photocatalysis mechanism

Mechanism of the adsorption of MO onto 3% TiO2@PNS-BC and the photocatalysis processes is summarized as in Fig. 9. The removal of MO from the solution could happen through different processes such as hydrogen bonding, electrostatic interaction, \(\pi -\pi \) stacking, precipitation and ion exchange, Fig. 9. The \(\pi -\pi \) stacking, for example, occurs between the aromatic ring of MO and the aromatic structure of the biochar. In addition, the electrostatic interaction could result from bonds being created between MO and the functional groups of TiO2@PNS-BC as identified by the FT–IR analysis. The surface of 3% TiO2@PNS-BC is negatively charged, given that the pHPZC is 5.08, lower than the solution pH (pH = 6.00 ± 0.20). The charge difference between the surface of the studied adsorbent and MO, coupled with the high surface area of the adsorbent, supports the applicability of both chemisorption and physisorption mechanisms in discussing the adsorption of MO onto 3% TiO2@PNS-BC. On the other hand, photocatalytic degradation happens by exciting the electrons on the surface through the exposure to the ultraviolet (UV) radiation. The electron in valence band (VB) gets excited to conduction band (CB) upon absorption of a suitable wavelength of light, in this case UV light, and the distance between VB and CB is known as the band gap. Therefore, the minimum energy required for excitation of an electron is equal to the energy of the band gap.

Fig. 9
figure 9

Possible mechanism of adsorption/photocatalysis of MO onto 3% TiO2@PNS-BC surface

Selectivity of the prepared binary composites

To investigate the binding specificity, the adsorption effectiveness of 3% TiO2@PNS-BC was tested for in nine different aqueous solutions of MO, methylene blue, rose bengal, fuchsine, sulfisoxazole, amantadine, raltegravir, econazole nitrate, and procaine HCl, all at a concentration of 50 ppm and under the same optimal adsorption conditions for MO removal as determined by the BB design. As shown in Fig. 10, the results demonstrate that 3% TiO2@PNS-BC exhibits a significant adsorption efficiency toward MO, with a removal efficiency of 97.69% compared to 42.53%, 30.47%, 29.40%, and 21.69% toward rose bengal, fuchsine, amantadine, and methylene blue, respectively. The %R of the remaining compounds was less than 16%, indicating the low preference of 3% TiO2@PNS-BC for adsorbing these compounds compared to MO.

Fig. 10
figure 10

Adsorption selectivity of 3% TiO2@PNS-BC toward MO compared to other pharmaceuticals and dyes

Conclusion

According to the obtained data, recycling pistachio nutshells can create efficient and cost-effective biochar-based adsorbent. Numerous characterization techniques were applied on both PNS-BC and TiO2@PNS-BC for the determination of the structure and morphology of both. Among the tested adsorbents, the 3% TiO2@PNS-BC showed a better adsorption efficiency Compared to PNS-BC, 3% TiO2@PNS-BC had larger surface area (33.37 m2/g) and smaller pore size (0.028 cm3/g). BB design was used to maximize the removal efficiency of the TiO2@PNS-BC as a function of five variables. The aim was to minimize the usage of chemicals and resources while maximizing MO removal. In design analysis, pH had the lowest influence on the response compared to %TiO2, AD, RT, and [MO]. While squared effect of %TiO2 (AA) had the highest effect. Equilibrium studies showed that the obtained results matched Langmuir isotherm, and that the adsorption process is favorable and spontaneous with qmax = 142.38 mg/g. Investigation of adsorption kinetics showed that PSO model perfectly matched the adsorption of MO onto 3% TiO2@PNS-BC indicating that the process was physisorption with sorption energy of 2.59 kJ/mole. Therefore, 3% TiO2@PNS-BC can be utilized as effective adsorbent for the removal of MO from aqueous solutions. Additionally, photocatalytic decolorization experiment data shows that after 30 min, almost complete removal (99.47%) of MO could be recognized compared to 88.44% and 81.38% using the 2% and 1% commodities, respectively.