Introduction

Polyethylene terephthalate (PET) plastic bottles are the fourth most produced polymer in the world1. They are commonly used for soft drinks and juice bottles and can take hundreds of years to decompose through natural processes. It is estimated that an additional 33 billion tonnes of plastic will be released into the environment by 2050. Releasing bottle waste into the environment has enormous negative effects on ecosystems, including waterbody pollution and the death of aquatic life through getting stuck in plastic bottle rings, which prevents their growth2,3. According to previous studies, various techniques such as landfilling, energy recovery, incineration, and plastic recycling have been utilized for PET waste disposal4,5, each with its own pros and cons. For instance, the landfilling method requires a large area and releases hazardous materials into the environment6. The incineration process and energy recovery from plastic waste result in toxic gas emissions2. Therefore, recycling PET waste and converting it into new adsorbents has been introduced as an alternative method due to its ability to minimize plastic waste, reduce air pollutants, and produce valuable products. Studies have shown that PET plastic contains carbon (C), oxygen (O), and hydrogen (H), with a carbon content exceeding 60 wt% and very low non-organic impurities7,8. Therefore, because of the environmental regulations, it can be considered a viable carbon precursor for the fabrication of high-quality carbon adsorbents. However, the production of carbon dioxide gas remains a significant challenge in the pyrolysis process of the polymer9,10,11. Mensah et al.12 synthesized graphene from HDPE plastic bottles as a valuable adsorbent for sulfamethazine (SMZ) adsorption. The highest removal of SMZ was achieved at 99.99% with an SMZ concentration of 12.4 mg/L, an adsorbent dose of 0.9 g/L, and pH 3 at 25 ℃, which showed higher adsorption capacity and faster kinetics than other adsorbents utilized in SMZ removal. On the other hand, the discovery of carbon nanotubes (CNTs) with their unique physical and chemical properties, small size, low density, large surface area, and high porosity has led to their use in various industries, including their application as multifunctional nano-materials for pollutant elimination from wastewater13,14. Graves et al.15 successfully converted polypropylene (PP) and polystyrene (PS) waste into MWCNTs. Their research revealed that MWCNTs synthesized from PP and PS possess have a higher content of oxygenated functional groups compared to commercial MWCNTs. Yanyan et al.16 investigated the elimination of acetaminophen (Ace) from wastewater using modified MWCNTs with NaOH, HNO3/H2SO4, and ozone. Their study demonstrated that the maximum removal of Ace with an initial concentration of 10 mg/L, reached 95% when using MWCNTs modified with ozone. In addition to these findings, industrialization and population growth have significantly increased environmental pollutants over the past decades. For instance, dye wastewater containing methylene blue (MB) is produced in large quantities across various processes and poses significant risks to human health, including respiratory problems, mental disorders, irregular heartbeat, chest pain, and gastritis17. Additionally, even at low concentrations, MB has detrimental effects on living microorganisms. The degradation of organic and toxic compounds in MB wastewater is challenging globally due to its complex aromatic molecular structure18,19. The fabrication of graphene oxide (GO) and magnesium oxide (MgO) (GO/MgO) using a periodate activator was conducted by Mohamed et al.20 They revealed that the highest degradation rates achieved were 97.3%, 87.5%, and 85% for RB-222, sulfamethazine, and atrazine, respectively, under optimum conditions. Moreover, the lowest degradation rates for various pollutants were observed in canal water. Gaber et al.21 prepared biosynthesized zinc oxide (ZnO) and magnetite-nanocarbon (Fe3O4-NC) derived from toner powder carbonization. They reported that the maximum tetracycline (TCN) removal rates were 97.27% and 89.79% at a TCN concentration of 12.8 mg/L, persulfate concentration of 7 mM, and catalyst dosage of 0.55 g/L for tetracycline and real pharmaceutical wastewater, respectively. Also, their results demonstrated that ZnO/Fe3O4-NC exhibited higher TCN degradation efficiency compared to ZnO and Fe3O4-NC.

It is important to note that the regeneration potential of adsorbents plays a crucial role in their practicality because the adsorption method can lead to secondary pollution. Furthermore, the active sites of adsorbents become saturated and the regeneration process is costly and energy-intensive, with adsorption efficiency decreasing after regeneration22. To address these problems, the degradation of contaminants into safe materials using photocatalytic technology has garnered significant attention in recent years23,24. Recently, graphitic carbon nitride (g-C3N4) has attracted substantial interest from the research community owing to its remarkable properties, including a large bandgap of 2.7 eV, low cost, nontoxicity, and superior physical and chemical properties, making it highly suitable for applications in photocatalysis processes25,26. Therefore, incorporating g-C3N4 into the CNTs composition has enhanced the degradation of pollutants in aquatic environments, establishing it as an excellent catalyst in previous research27,28.

Despite these advantages, g-C3N4 has several drawbacks, including a small specific surface area, weak absorption of visible light, and a high recombination rate of photogenerated electrons and holes. These limitations collectively reduce its photocatalytic efficiency29,30. Consequently, the incorporation of metal and metal oxide nanoparticles (NPs) as modifying materials has shown improvements in photocatalytic potential31. Silver (Ag) NPs, in particular, are widely utilized in various fields, including medicine, electronics, wastewater treatment, catalysis, and biotechnology32,33. Nanoparticle (NP) preparation can be achieved through physical, chemical, biological, or green synthesis methods34. Recent studies have shown that green synthesis, utilizing different plants and fruits to reduce ions into NP atoms, is a preferable alternative to conventional physical and chemical production processes. This preference is due to its cost-effectiveness, eco-friendliness, non-toxicity, and desirable optical properties, as well as the absence of by-product generation35,36. Samy et al.37 compared ZnO and biochar (BC) derived from agricultural lignocellulosic waste fermentation for the adsorption of pesticides in agrochemical industrial wastewater. They found that the removal of lambda-cyhalothrin (LM), malathion (MA), and oxamyl (OX) was enhanced to 55%, 70%, and 46.9% on ZnO/BC compared to 38%, 3%, and 24% on pristine ZnO. Additionally, increasing the ZnO amount from 0.1 to 1 g/L had a positive effect on wastewater treatment. Elmitwalli et al.38 investigated the sulfamethazine (SMZ) removal using mulukhiyah-derived biochar (MBC) and potato-derived biochar (PBC) at different periodate concentrations. They found that the synthesized MBC displayed a higher removal rate of SMZ compared to PBC. The SMZ degradation declined to 99.7%, 97%, 76.1%, 45.2%, and 38.8% in distilled, tap, sea, canal, and drain water environments, respectively.

Mo et al.39 investigated the synthesis of Ag NPs from eucalyptus leaves, demonstrating that the Ag NPs range in size from 4 to 60 nm. They concluded that eucalyptus waste is a cost-effective and eco-friendly material for catalyst application and effluent purification due to its abundance. Consequently, coupling Ag NPs with g-C3N4 photocatalyst compounds has been proposed to significantly enhance the formation rate of g-C3N4, facilitate the transfer of photoinduced charges, and improve g-C3N4 visible light absorption40. Studies have shown that the Ag/g-C3N4 catalyst exhibits excellent activity in the photodegradation of dyes such as methyl orange (MO), Rhodamine B (RhB), and methylene blue (MB)41. Sun et al.42 evaluated the total ammonia nitrogen (TAN) elimination from wastewater using the prepared Ag/g-C3N4-CNT catalyst. They compared the performance of g-C3N4 and Ag/g-C3N4-CNT for TAN removal and demonstrated that TAN degradation significantly increased from 42.5 to 88.2% with the Ag/g-C3N4-CNT catalyst.

To the best of our knowledge, the investigation of plastic waste upcycling and dye wastewater treatment is critical global environmental issues that have garnered increasing attention from researchers. The main objectives of the current study are as follows:

(1) MWCNT Adsorbent Fabrication: To develop an environmentally friendly method for fabricating MWCNTs from PET bottle waste, significantly reducing plastic waste.

(2) Enhanced Pollutant Removal Efficiency: To modify the synthesized MWCNTs with a novel photocatalyst, g-C3N4, to improve the degradation performance of pollutants in aqueous media for the first time. Unlike many common photocatalysts, g-C3N4 is easily synthesized, performs well under UV light and contains no metal compounds.

(3) Utilization of Ag NPs for Photodegradation: To overcome the drawback of pure g-C3N4, this study investigates the use of Ag nanoparticles, extracted from eucalyptus plant leaves, to enhance the photocatalytic performance of g-C3N4 and increase its activity under visible-light (which has not yet been declared in detail in the literature).

(4) MB Treatment in Aqueous Environments: This paper presents the first use of a novel MWCNT@g-C3N4@Ag photocatalyst to study MB removal from an aqueous environment.

Finally, this study aims to optimize the effects of various parameters, including solution pH, catalyst dosage, reaction time, and initial wastewater concentration on MB degradation using the response surface methodology (RSM) approach. The findings of this investigation provide a framework for the synthesis of greener catalysts for future studies.

Experimental and material

Materials

The PET was collected from discarded bottles in the environment. MB (≤ 95%), Ferrous chloride tetrahydrate (FeCl2.4H2O, ≤ 99%), ammonia solution (NH3, 25%), ethanol (98%), and methanol (98%) were purchased from Sigma Aldrich Company, USA. Ferrocene (Fe (C5H5)2, 99%), sodium hydroxide (NaOH, 99%), hexamethylenetetramine (CH2)6N4 (99%), sodium nitrate (NaNO3, ≤ 99.5%), melamine (99%), sodium borohydride (NaBH4, 96%), and silver nitrate (AgNO3, 99%) were obtained from Merck Company, Germany. Eucalyptus leaves were collected from the Bushehr Province, Iran.

Synthesis procedure

Firstly, MWCNTs were prepared from PET bottle waste using ferrocene as a source of Fe catalyst, heated at 850 ℃ in a furnace. In the second stage, magnetic MWCNTs were synthesized using FeCl2.4H2O and the final sample was separated using a strong magnet. Then, g-C3N4 and silver (Ag) nanoparticles were synthesized from melamine and eucalyptus plant leaves, respectively. Subsequently, the g-C3N4@Ag catalyst was obtained by the oxidation-reduction method43. Finally, the magnetic MWCNTs@g-C3N4@Ag photocatalyst was successfully synthesized based on the methods reported by Liu et al.44. Detailed stages of the synthesis process are illustrated in the Supplementary Information (SI) and a schematic diagram of the magnetic MWCNTs@g-C3N4@Ag synthesis is shown in Fig. 1.

Characterization of synthesized samples

The morphological and surface properties of MWCNTs and the prepared photocatalysts were examined using field emission scanning electron microscopy (FESEM). Additionally, energy dispersive X-ray spectrometry (EDX) and elemental mapping were conducted on magnetic MWCNTs and g-C3N4@Ag. X-ray diffraction (XRD) was employed to determine the crystallographic structure of synthesized samples, and the Raman spectrum was used to analyze the as-prepared pristine MWCNT. Quantitative dynamic light scattering (DLS) was also utilized to measure the particle size of the nanoparticles.

Fig. 1
figure 1

Schematic diagram of the synthesis of the magnetic MWCNTs@g-C3N4@Ag photocatalyst.

Photocatalytic procedure

Initially, a 250 ml Pyrex beaker was used as a photoreactor, and 100 ml of MB wastewater (15 mg/L) was mixed with a specific amount of the prepared catalyst. The solution was magnetically stirred in the dark for 30 min to achieve adsorption-desorption equilibrium. After this period, the MB removal rate remained almost constant at 18%. Subsequently, the performance of the magnetic MWCNTs@g-C3N4@Ag catalyst for MB degradation in synthetic wastewater was evaluated under a 9 W ultraviolet (UV) lamp emitting at 254 nm. The experiments were conducted at room temperature, with an ice bath used to maintain temperature conditions for 7 h to optimize the concentration of MB dye and photocatalyst loading. Samples of the solution were taken at regular intervals and centrifuged at 1000 rpm for 10 min. The degradation efficiency of the MB dye was then determined using a UV-vis spectrophotometer, based on light absorbance at λ = 664 nm, using the following equation:

$$R\% =\frac{{{C_i} - {C_e}}}{{{C_i}}}$$
(1)

where, R% is the MB removal percentage, and Ci and Ce represent the initial and equilibrium concentrations of MB (mg/L), respectively.

Experimental design

The optimization of the experimental procedure was conducted using RSM to understand the interactions between dependent and independent operational variables, namely pH (X1), MB concentration (X2), photocatalyst dosage (X3), and time (X4). This approach aimed to achieve the minimum optimal number of experiments required for the effective removal of MB from wastewater. The central composite design (CCD) was employed to model the RSM and elucidate the roles and interactions of the selected variables45,46. The independent parameters, along with their respective values were evaluated by Design-Expert software, as presented in Table 1, while the experimental design matrix, based on the RSM-CCD model, is shown in Table 2. It is noteworthy that the extreme values of the independent variables were chosen based on preliminary experiments and relevant literature47,48.

Table 1 Independent parameters and their values for the experimental design.
Table 2 CCD matrix with experimental and predicted results.

The experimental results obtained from the CCD were fitted to a second-order polynomial model to develop a statistical representation. The second-order polynomial equation was employed to describe the relationship between the independent variables and the output response, as shown in the following equation:

$$y={\beta _0}+\sum\limits_{{i=1}}^{k} {{\beta _i}{X_i}+\sum\limits_{{i=1}}^{k} {{\beta _{ii}}X_{i}^{2}+\sum\limits_{{i=1}}^{k} {\sum\limits_{{j=1}}^{k} {{\beta _{ij}}{X_i}{X_j}+\varepsilon } } } }$$
(2)

where y represents the predicted response, ß0 denotes the constant coefficient, and ßi, ßii, and ßij are the linear, quadratic, and interaction coefficients, respectively. K indicates the number of factors. Xi and Xj are the independent variables, and represents the random error49.

Results and discussion

The XRD patterns of the synthesized samples are presented in Fig. 2. Two prominent peaks at 2θ values of 23.5° (0 0 2) and 44.4° (1 0 0) were observed for MWCNT. These peaks indicate the presence of carbon in the sample and a highly crystalline structure, consistent with previous studies50,51. The synthesis of pure g-C3N4 was confirmed by a strong peak at 27.5° (0 0 2) and another peak at 13.1° (1 0 0), corresponding to the crystal plane and π-conjugated aromatic structure of g-C3N4 40. Moreover, evident diffraction peaks at 2θ values of 13.1°, 27.5°, 38.2°, 44.5°, 64.6° and 77.4° indicate the presence of face-centered cubic silver crystals and g-C3N4 in the photocatalyst structure52. Additionally, the peak at 23.5° disappeared after the incorporation of magnetic MWCNTs into g-C3N4@Ag, likely due to the small content of MWCNTs and the intense g-C3N4@Ag peaks covering the weaker ones.

Fig. 2
figure 2

The XRD diffraction patterns of all synthesized samples.

The DLS analysis technique was employed to measure the size of synthesized Ag NPs derived from eucalyptus leaves. The particle size distribution of the Ag NP ranged from 38 to 63 nm, as shown in Fig. 3. Moreover, the majority of Ag nanoparticles were observed to have a size range of 48–51 nm, with a differential intensity of 21–23%.

Fig. 3
figure 3

DLS analysis of Ag NPs.

(a-c) presents the morphological analysis of the pristine MWCNTs, g-C3N4, and MWCNTs@g-C3N4@Ag using FESEM images. It is evident from Fig. 4a that the synthesized MWCNTs from PET waste exhibit lengths of several micrometers with thick walls and relatively larger diameters. However, these MWCNTs also display an irregular and coiled structure along with some defects. The pure g-C3N4 shows aggregated particles with smooth surfaces, possibly due to its multilayer framework (Fig. 4b). Furthermore, Fig. 4c reveals that the photocatalyst has an agglomerated structure, indicating a uniform distribution of a significant amount of Ag on the g-C3N4 surface. This interaction results in a rough texture on the photocatalyst particles.

Fig. 4
figure 4

FE-SEM images of the as-prepared samples (a) magnetic MWCNT, (b) g-C3N4, (c) MWCNTs@g-C3N4@Ag.

Elemental mapping images (Fig. 5a, c) indicate a homogeneous distribution of elements within the prepared products. Furthermore, Fig. 5b and d show the EDX spectra of the magnetic MWCNTs and g-C3N4@Ag, respectively. The spectra reveal the presence of C, O, and Fe in magnetic MWCNTs, and elements of C, N, O, and Ag in g-C3N4@Ag Quantitative analysis of the EDX results confirms the successful fabrication of the magnetic MWCNTs and the loading of Ag onto the g-C3N4 catalyst.

Fig. 5
figure 5figure 5

The EDX elemental mapping of (a) magnetic MWCNT and (c) g-C3N4@Ag; (b, d) EDX spectra of magnetic MWCNT and g-C3N4@Ag, respectively.

The Brunauer-Emmett-Teller (BET) surface areas and pore-size distribution of the synthesized catalysts were evaluated using nitrogen adsorption-desorption isotherm curves. BET surface areas for pure g-C3N4, g-C3N4@Ag, and MWCNT@g-C3N4@Ag were found to be 55.3, 41.5, and 75.8 m2. g− 1, respectively. This indicates that the SBET of the samples increases when MWCNT is combined with g-C3N4@Ag, resulting in more active sites on the catalyst and an expanded light absorption spectrum53. Moreover, Ag NPs block the pores of g-C3N4, which is the reason for the decrease in the specific surface area for the g-C3N4@Ag catalyst. Figure 6a exhibits the nitrogen adsorption enhanced with higher relative pressure and an adsorption H3 hysteresis loop is observed for all samples. Figure 6b reveals a narrow pore size distribution in the range of 2–25 nm, which confirms the mesoporous and microporous structures.

Fig. 6
figure 6

Nitrogen adsorption-desorption isotherms (a) and the dV dlog (W) pore volume versus pore width distribution (b).

The Raman spectrum analysis of pure MWCNTs, demonstrating the purification of CNTs achieved during the synthesis process, is displayed in Fig. 7. The results identified the following prominent peaks: the D band (1335 cm-1) confirms the presence of MWCNTs, consistent with previous studies54,55. This peak is related to disorder in sp3-hybridized carbon, indicating a defect-induced peak or the existence of carbon impurities in the prepared MWCNTs. The G band (1593 cm-1) is associated with sp2 hybridized carbon and represents the stretching of C-C bonds, measuring the graphitization in graphitic materials55. The G´ band, observed around 2648 cm-1, signifies the strong characteristics of sp2 CNTs. The ratio of the intensities of the D and G bands (ID/IG) is 0.93, which is less than 1, indicating a low defect amount and demonstrating the high quality of the MWCNT structure.

Fig. 7
figure 7

Raman spectra of MWCNT obtained.

Response surface methodology

The experimental and predicted results for MB removal using the magnetic MWCNTs@g-C3N4@Ag photocatalyst are illustrated in Table 3. Various models (linear, two- factorial, quadratic, and cubic) were fitted to the experimental data. The ANOVA results indicated that MB removal was best represented by the reduced quadratic model, as summarized in Table 3. The coefficient of determination (R2) was 0.95, confirming the high predictive accuracy of the reduced quadratic model for MB removal efficiency within the experimental range. Additionally, the R2 value was consistent with the predicted R2 of 0.93, and a low coefficient of variation (CV) of 1.32 demonstrated the reliability and reproducibility of the applied model. The predicted and actual values were closely aligned, as indicated by a standard deviation (Std. Dev.) of 1.14. This proposed model demonstrated significance, with an F-value of 44.07 and a corresponding P-value < 0.0001. The lack of fit for the model was also determined to be non-significant. Adequate precision (AP), which measures the signal-to-noise ratio, is deemed acceptable if greater than 4. In this study, the AP was 25.09, indicating a strong relationship between the independent variables and responses. Hence, the findings showed that factors A, B, C, D, and A2 played significant roles in the elimination of MB, while other parameters with a probability value greater than 0.05 were not significant, as shown in Table 4. The final equation, in terms of the coded factors for MB removal, is presented in Eq. 3.

Table 3 ANOVA for the reduced quadratic model of MB removal.
Table 4 Numerical optimization for CCD.

MB Removal% = +85.23 + 2.8 A − 2.53B + 1.17 C + 1.58D -0.0437AB- 0.2812BC − 0.3812BD + 0.7807A2 (3).

The significance of the independent variables and their interactions is evident from the above equation. The key reaction variables are ranked in the following order: pH (2.8) > MB concentration (-2.53) > time (1.58) > photocatalyst dosage (1.17) > second order effect of pH (0.7807) > interaction between the MB concentration and time (-0.3812) > interaction between MB concentration and photocatalyst dosage (-0.2812) > interaction between MB concentration and pH (-0.0437). Negative coefficients indicate a contrary effect on the photodegradation efficiency, while positive coefficients indicate an interactive effect.

Figure 8a presents the normal probability plot of the residuals, which is used to analyze the validity of the model. This plot demonstrates that the residuals follow a normal distribution, as they are closely aligned with the straight line. Moreover, Fig. 8b displays a plot of experimental results versus predicted values, revealing an acceptable agreement between actual and predicted outcomes. All experimental values are scattered within a constant range of residuals at ± 3.62, as shown in Fig. 8c. Consequently, this graph confirms the reliability and adequacy of the proposed models.

Fig. 8
figure 8

(a) Normal probability plot of residuals, (b) predicted vs. actual values plot, (c) plot of residuals versus predicted response for MB dye removal.

Influence of different variables on the MB removal

Effect of initial concentration and photocatalyst dosage

The effects of initial concentration and photocatalyst dosage during the degradation process are illustrated in Fig. 9. Increasing the MB concentration leads to a decreased removal rate because the photocatalyst’s surface-active sites become saturated, limiting their interaction with the dye molecules. At low MB concentrations, UV light can more effectively diffuse within the aqueous solution, creating more charge carriers. Consequently, more MB molecules are decomposed by free radicals56. Additionally, increasing the photocatalyst loading enhances the number of active sites and generates more free radicals, such as hydroxide and peroxide radicals, on the catalyst surface. These powerful oxidants positively impact the photodegradation performance57,58. A plausible reason for this observation is that the distribution of light intensity becomes more uniform with an increase in the catalyst dose. Higher light intensity provides greater energy for more catalyst particles to generate electron-hole pairs, thereby increasing the reaction rate59. The MB removal rate increased from 83.2 to 86.3% with an increase in catalyst dosage from 0.3 g/L to 0.7 g/L under constant conditions.

Fig. 9
figure 9

The response surface and contour plots of MB removal efficiency (%) as a function of photocatalyst dosage and initial concentration (mg/L).

Effect of initial concentration and pH

The effects of initial concentration and pH during the degradation process are illustrated in Fig. 10. The pH of the aqueous solution significantly affects the photocatalytic decomposition of dyes by altering the catalyst surface charge properties. Under alkaline conditions, the number of hydroxide ions increases, which can capture electrons produced by the photocatalytic process. This capture enhances the hydroxyl radicals generation through the oxidation of HO from the solution, resulting in an improved removal trend60,61. Furthermore, at higher pH levels, less O2̅ is consumed due to decreased concentration of H+, leading to an increased production of OH radicals. This increase results in enhanced photodegradation performance of MB62.

Fig. 10
figure 10

The response surface and contour plots of MB removal efficiency (%) as a function of (a) pH and initial concentration (mg/L).

Effect of reaction time and initial concentration

Figure 11 illustrates the interaction effects of reaction time and initial concentration on MB degradation. Experimental findings revealed that reaction time played a crucial role in the photocatalyst’s performance. Specifically, MB removal increased slightly to over 94% at a constant initial concentration of 10 mg/L when the reaction time was extended from 120 to 240 min. This increase can be attributed to the prolonged contact time between photocatalyst radicals and contaminant molecules in photocatalytic reactions, which enhances the attack of hydroxyl radicals on MB, subsequently improving its removal63,64.

Fig. 11
figure 11

The response surface and contour plots of MB removal efficiency (%) as a function of reaction time (min) and initial concentration.

Process optimization

In numerical optimization, the maximum removal of MB from wastewater was determined using the desirability function with an ‘importance’ level of 5 and parameters within the default range of the CCD design. The optimal conditions, as determined by this setting, are shown in Table 5. The selected conditions were an MB concentration of 12.6 mg L− 1, a pH of 9, and a photocatalyst dosage of 0.52 g L− 1 for 231 min, which predicted a maximum MB removal of 99.89%. The validity of the proposed model was tested by conducting MB removal experiments under these optimal conditions three times, using the desirability function. The average MB degradation was 98.7%, demonstrating the reliability of the experimental data compared to the predicted data, with an error margin of 1.2% (Table 4).

Table 5 Comparison of predicted and experimental removal at the optimum operation conditions by RSM.

Mineralization of MB dye

The degree of MB dye wastewater mineralization was conducted by measuring total organic compounds (TOC) under optimum conditions. Figure 12 displays that the TOC removal remarkably improved with time and the MWCNTs@g-C3N4@Ag catalyst removed 91% TOC after 240 min, which indicates that MB was effectively decomposed into carbon dioxide (CO2) and water (H2O). The release of CO2 and H2O during the oxidation process confirms that some amount of degraded dye was mineralized.

Fig. 12
figure 12

TOC removal of MB dye under the optimal conditions.

Regeneration studies

Regeneration of the photocatalyst plays a significant role in affordable wastewater treatment applications. Therefore, to determine the reusability of the prepared photocatalyst in MB removal, a sodium hydroxide solution (0.1 M) was used under optimal conditions. After each cycle, the photocatalyst was collected using a magnet, washed with deionized water and NaOH solution, and then dried. As can be seen in Fig. 13, the MB degradation rate remained high, reaching approximately 94% after four cycles, indicating acceptable performance and stability of the photocatalyst over multiple uses. The slight decrease in the degradation rate may be attributed to mass loss during catalyst recovery and the reduction of active sites on the MWCNTs@g-C3N4@Ag catalyst due to dye molecule adsorption in each cycle65.

Fig. 13
figure 13

Cycle runs of MWCNTs@g-C3N4@Ag photocatalysts.

for the MB degradation.

Comparison of the performance of the synthesized materials

Figure 14a compares the efficiency of removing MB dye without any catalyst to that achieved using MWCNT, g-C3N4, g-C3N4@Ag, and MWCNTs@g-C3N4@Ag under optimum conditions. The results indicate that without any catalyst, only 5% of the MB dye was removed. However, the MB dye removal using the MWCNTs@g-C3N4@Ag photocatalyst achieved a significant removal rate of 98.7%, demonstrating superior performance compared to other catalysts.

Figure 14b shows the effects of different photocatalysts on the MB dye removal efficiency (photocatalyst amount = 0.5 g/L, pH = 7 and reaction time = 180 min) at varying initial concentrations (10, 15, and 20 mg/L). The highest MB removal at an initial concentration of 10 mg/L was attained at 91%, 82% and 69.4% for MWCNTs@g-C3N4@Ag, g-C3N4@Ag, and g-C3N4, respectively. The MWCNTs@g-C3N4@Ag photocatalyst consistently demonstrated superior performance compared to the other catalysts at the same conditions, highlighting the positive effect of MWCNT on the g-C₃N₄@Ag composite. As the initial MB concentration increased from 10 to 20 mg/L, the MB removal efficiency of MWCNTs@g-C3N4@Ag decreased from 91.1 to 79.8%.

Fig. 14
figure 14

(a) Comparison of the MB removal rate without any catalyst and using MWCNT and MWCNT@g-C₃N₄@Ag under the optimum conditions, (b) effects of synthesized photocatalysts on the MB removal at different concentrations under the conditions: photocatalyst amount = 0.5 g/L, pH = 7, and reaction time = 180 min.

Comparison of MB removal efficiency with similar studies

To demonstrate the effectiveness of the synthesized photocatalyst for MB dye degradation, MWCNTs@g-C3N4@Ag nanoparticles were compared with similar studies. A comparative analysis of dye removal using various g-C3N4-based photocatalysts is summarized in Table 6. This comparison considers factors such as photocatalyst dosage (g/L), dye concentration (mg/L), and type of dye. In this study, MWCNTs were prepared from bottle waste to reduce plastic waste in the environment, demonstrating acceptable activity in enhancing catalyst performance compared to commercial MWCNTs, as reported by Ding et al.66. Notably, the highest MB removal efficiency achieved by MWCNTs@g-C3N4@Ag reached 98.7%, with a catalyst dosage as low as 0.52 g/L and an MB concentration of 12.6 mg/L. As shown in Table 6, the green synthesis of this photocatalyst is particularly significant due to its dual importance in reducing plastic waste and treating dye effluent. This is especially noteworthy given the lower catalyst dose and higher dye initial concentration of dye (12.6 mg/L) compared to previous works. Therefore, this photocatalyst exhibited superior performance in the purification of dye effluents.

Table 6 A comparative study of MWCNTs@g-C3N4@Ag photocatalyst with g-C3N4-based photocatalysts for dye degradation.

Photocatalytic mechanism

To gain a deeper understanding of the degradation mechanism, the MB dye degradation by the magnetic MWCNTs@g-C3N4@Ag photocatalyst is illustrated in Fig. 15. During the photocatalytic reaction, UV light irradiation of the composite generates conduction band electrons (e) and valence band holes (h+). However, these electrons and holes typically vanish quickly due to rapid recombination44. Introducing MWCNTs allows the photogenerated electrons from the conduction band (CB) of g-C3N4 to transfer to the MWCNTs, preventing the recombination of electron-hole pairs. This transfer favors the photocatalytic reaction and significantly enhances the formation of superoxide radicals (O2̅)72. Additionally, the presence of Ag particles enhances the interfacial electron transfer process due to their strong surface plasmon resonance (SPR) effect73. Furthermore, metallic Ag NP can trap photoexcited electrons because of their high Schottky barriers, which facilitate the separation of photogenerated electron-hole pairs. These trapped electrons can then react with molecular oxygen (O2) on the surface, producing more O2̅, which enhances the photocatalyst performance. Eventually, O2̅ radicals react with MB dye, resulting in the formation of CO2 and H2O. According to the results, MB removal improved from 92 to 96.7% when the amount of MWCNTs@g-C3N4@Ag increased from 0.4 to 0.6 g/L under the same conditions. The increased presence of photogenerated holes in the Valence band leads to the formation of OH radicals, which contribute to pollutant oxidation. Scavenger studies revealed that the photocatalytic mechanism is predominantly driven by the generation of •OH radicals as the main active species, which oxidize MB into smaller, non-toxic molecules74,75. Therefore, the incorporation of MWCNTs and Ag-doping on the g-C3N4 catalyst significantly enhances its photocatalytic activity in effluent treatment.

Fig. 15
figure 15

Schematic diagram of the MB degradation mechanism on the magnetic MWCNTs@g-C3N4@Ag photocatalyst under UV light irradiation.

Conclusion

Water scarcity worldwide has led researchers to prioritize water reclamation as a crucial solution. This study, for the first time, reports the enhanced performance of a g-C3N4 photocatalyst using synthesized MWCNTs derived from PET waste and Ag NPs derived from eucalyptus leaves. This novel photocatalyst was developed for MB wastewater treatment. The statistical model’s significance and adequacy were tested through ANOVA, revealing a high R2 of 0.95, which ensures an acceptable fit between the reduced quadratic model and the experimental results. The study found that pH and initial concentration were the most influential operational factors in MB removal, and the interaction between wastewater concentration and reaction time was mainly responsible for wastewater treatment effectiveness. Moreover, the maximum experimental and predicted removal efficiencies were 98.7% and 99.89%, respectively. The optimized parameters were predicted as follows: an MB dye concentration of 12.6 mg L− 1, a pH of 9, a photocatalyst dose of 0.52 g L− 1, and a reaction time of 231 min.

Also, MB removal decreased only slightly from 99 to 94% after four cycles, which exhibited the catalyst’s remarkable reusability. The MWCNTs@g-C3N4@Ag demonstrated high efficiency in removing MB from wastewater. Based on these results, the synthesized photocatalyst indicates great potential for the sustainable treatment of MB wastewater and can provide a framework for future research.