Introduction

Water quality monitoring is a critical factor in achieving Sustainable Development Goal 6 (SDG 6), which focuses on water quality and sanitation over ensuring sustainable management1. To achieve this, the development of water sensors is a major concern in detecting pollutants such as heavy metals, pesticides, drug residues and pathogens and providing real-time data to ensure drinking water and effective wastewater treatment2. This type of water standard monitoring sensor is essential to identify developing pollutants such as drug antibodies, improve water protection through smart technologies, and maintain environmental health by monitoring parameters such as pH, dissolved oxygen, pollution levels and turbulence. Antibiotics are essential in the modern medical community to treat bacterial infections, which act as powerful antiseptic and anti-inflammatory agents. The major focus of this work is antibiotic detection, which is the pharmaceutical contamination of the aquatic environment. Antibiotics like sulphonamide, tetracyclines, fluoroquinolone and lincomycin are directly used in agriculture, antibacterial agents, and medicine leading to direct and indirect presence in water bodies3,4,5,6. In addition, biosensors can provide early warnings for water-borne diseases, protecting public health. However, excessive use of antibiotics and misuse have led to significant health problems. Chronic antibiotic exposure or consumption adverse reactions, liver-based disorders and kidney metabolism, and may contribute to a decrease in bacterial resistance to the human system. This reduction can lead to serious health risks, including cancer development7,8. Therefore, it is essential to monitor the amount of antibiotic levels in the environment. SMX and trimethoprim (TMP) are two wide-spectrum antibiotics widely used in medical fields and medicinal industries. SMX Staphylococcus and E. Coley are effectively targeted as bacteria while fighting both TMP-pacific and gram-necrop bacteria. The combination of SMX and TMP provides an integral effect and enhances their anti-bacterial properties by preventing bacterial folate metabolism. This compound is often used to treat various infections9. Traditional methods for detecting the SMX, including liquid chromatography and spectrophotometry, have significant drawbacks, including long processing time, expensive equipment and complex sample products. To overcome these shortcomings, electrochemical techniques have become an excellent alternative because of their rapid, low cost and miniature features. Electrical analysis techniques play an important role in the detection of biological and environmental materials because their high sensitivity is due to this. These methods are widely used to monitor pollutants, drugs and vowel molecules. For example, studies on electrical chemistry approaches and studies can also detect trace levels of contaminants10,11. Furthermore, a new sensor designs that improve detection capabilities. The ongoing research continues to push the boundaries, showing just how important electroanalytical methods are in advancing scientific research12. Despite these advantages, conventional electrochemical methods face challenges such as electrode interface fouling and matrix effect due to interference from other potential substances, which affect their selectivity13,14,15,16,17. Modified GCE with ZnO QD’s is capable of excellent electron transfer which results even in low concentrations of SMX with highly sensitive and selective sensors. The well-improved performance is a good contribution to faster electron transfer provided by GO. And increased in number of catalytic active sites available in the G-ZnO QD’s composite18,19,20,21,22,23,24. With this background, researchers have developed advanced electrocatalyst materials for the better detection of SMX. However, some studies have demonstrated the effectiveness of multi-walled carbon nanotubes (MWCNTs) combined with antimony (Sb) nanoparticles and iron oxide (Fe3O4) for the simultaneous detection of these antibiotics. Reduced graphene oxide (rGO) combined with silver nanoparticles has also shown promising results towards the detection of antibacterial compounds25,26,27,28. The advancements in nanocomposites-based sensors like covalent organic frameworks (COFs), graphene oxide (GO), MOFs and transition metal dichalcogenides (TMDs) offer superior sensitive performance MXene is a novel 2D material discovered in 2011, is priorly suitable for environmental remediation. Because. It has unique structural features, such as high conductivity and excellent chemical stability29,30. On focusing on these properties, mainly such as high surface area and functional groups, high electron transfer kinetics and superior adsorption reduction. This leads to the promising material for water sensing and purification.

MXene/ZIF-8 composite has gained wider attention for its applications in electrochemical analysis and environmental remediation31. However, the potential detection of sulfamethoxazole (SMX) has not been investigated for MXene/ZIF-8. ZIF-8-based materials with structural modifications have been adapted in this work for the detection of SMX and achieved an LOD of 0.02 μM32. MXene/ZIF-8 significantly enhances its conductivity, enabling superior electrochemical performance for hydrazine sensing. The MXene/ZIF-8 sensor achieved a low LOD of 5.1 μM and a wide linear range of 10–7700 μM While MXene and ZIF-8 have independently been utilized for sensing of luteolin, their integration in this work introduces a composite material which mm2enhanced the electrochemical sensing performance for SMX detection33. MXOF-based sensors are emerging in the analytical performance report. In focus, MXene and MOF contribute separately. Hence, MXOF composite is focused on its performance in sensing SMX is detection is carried out in this work. These innovations are crucial for addressing the growing challenges posed by environmental contamination and ensuring a safer and healthier future. This study presents a sensor for SMX detection by synthesizing MXene, ZIF-8, and their composite MXOF, offering enhanced sensitivity for real sample analysis in water.

Results

Structural and morphological analysis

The XRD pattern confirms the successful synthesis of MXene material from the MAX phase Ti3AlC2. After etching with HF, the strongest diffraction peak of Ti3AlC2 at 38.84° (104) disappeared as referred to34, indicating that the MAX phase structure was destroyed and most of the Al layer was etched away. Additionally, the peaks at 8.77° (002) and 18.02° (006) shifted to smaller angles of 8.9° and 18.01°, respectively shown in Fig. 1a. The XRD patterns of the synthesized ZIF-8 sample show distinct peaks that indicate the high crystallinity of the ZIF-8 samples. According to Table 1, the major peaks of the ZIF-8 sample match the XRD patterns recorded35. This match indicates that our synthesis method effectively replicates the established protocol, producing high-quality ZIF-8 with consistent structural characteristics shown in Fig. 1b. The consistency with the XRD patterns reported35,36 confirms the reliability and reproducibility of our ZIF-8 synthesis method. The XRD pattern of the synthesized MXOF composite Fig. 1c shows distinct crystalline planes from both the ZIF-8 component. The peaks indicative of the ZIF-8 confirms its high crystallinity, while those related to the MXene confirm its successful integration into the composite. These combined peak shift to the right is reflected by the MXene imposed over ZIF-8, that verify the synthesis process effectively merged both materials, preserving their individual crystalline properties within the composite structure. The characteristic peaks of the material confirm the successful formation of the MXOF composite, demonstrating the hybrid nature of the material.

Fig. 1: Structural characterization of synthesized materials using X-ray diffraction.
figure 1

XRD patterns of MXene (a), ZIF-8 (b), and the MXOF composite (c). The crystalline structures are confirmed in distinct peaks of each material, specifically composite formation through MXene and ZIF-8 characteristic peaks.

Table 1 Comparative table of XRD ZIF-8

Figure 2a, d represents the two different magnificent 5 µm and 1 µm MXene images. This image shows the clear layer structure of MXene sheets and some more broken particles of sheets in it. These broken particles are an effect of etching for 48 hours. Figure 2b shows in the scale of 1 µm, the exact morphology of the ZIF-8 rhombic structure without any additional by-products in it. A fine image of 500 nm is shown in Fig. 2e. The Composite of MXene and ZIF-8 and examined as a broken sheet, cracked particles and irregular particles in Fig. 2c, f the completed mixture is justified at the nanoscale level.

Fig. 2: Surface morphology of MXene, ZIF-8, and MXOF composite by SEM images.
figure 2

SEM images show the layered structure of MXene at 5 µm (a) and 1 µm (d), the morphology of ZIF-8 at 1 µm (b) and 500 nm (e), and the MXOF composite at 1 µm (c) and 500 nm (f).

Surface modification of working electrode

The conventional electrochemical experiments were conducted using a three-electrode system, which included a platinum wire as the counter electrode, a GCE as the working electrode, and an Ag/AgCl electrode as the reference, with PBS of 0.1 M with 5 mM ferric/ferrocyanide as the electrolyte. To prepare each material solution, 5 mg of powder was sonicated in ethanol for one hour. Subsequently, the GCE was polished with alumina powder and then rinsed with deionized water and ethanol to ensure a clean, smooth surface for the drop-casting procedure. Afterwards, 5 µL of the synthesized materials were separately drop-cast onto the GCE surface and dried in a vacuum chamber.

Electrochemical optimization

The electrochemical optimization of parameters like pH, electrolyte, and scan rate studies was carried out in Fig. 3a, whereas in the case of electrolyte studies, different electrolytes like KCl (1), NaCl (2) and PBS (3) of 0.1 M with 5 mM ferric/ferrocyanide mixture were investigated. Among these three electrolyte PBS of 0.1 M with 5 mM ferric/ferrocyanide exhibited better sensing performance towards the detection of SMX. This is due to the PBS having a buffering capacity that helps to maintain a stable pH, which is essential for many electrochemical reactions. KCl and NaCl do not have buffering capacity, which can lead to pH fluctuations and affect sensor performance. Also, the ionic potential of PBS of 0.1 M with 5 mM ferric/ferrocyanide is higher than KCl and NaCl which helps to increase the conductivity of the solution. The electrolyte depends on the electrochemical behaviour of the developed sensor over various electrolytes.

Fig. 3: Electrochemical response of MXOF in various conditions.
figure 3

Voltammetric responses of the GCE modified MXOF electrode in the presence of SMX were recorded using different electrolytes (a) and under different pH levels (b). The electrolyte and pH level indicating optimal sensing electrolyte conditions for SMX detection.

To investigate the impact of pH on the developed SMX sensor, different pH values were accounted for in the optimization studies Fig. 3b. The pH of that prepared PBS of 0.1 M with 5 mM ferric/ferrocyanide was altered from 3 to 11, and the electrochemical studies were carried out at each pH level. As the pH value increased from 3 to 7, the current value also exponentially increased. Over pH 7 the current response was decreased gradually, which may be due to the isoelectric value changes that occurred. Since the maximum current response value and sensitivity of the electrode were observed at pH 7, the same condition was adapted for further experiments.

Cyclic voltammetry response of MXene, ZIF-8, MXOF

In electrochemical sensing, with a specific focus on the performance of modified electrode surfaces with MXene, ZIF-8 and MXOF. The experimental approach utilized CV as a powerful tool to thoroughly investigate and characterize the electrochemical behaviour of these surface-modified electrodes. It was established that the sensing capabilities of electrode materials are intricately linked to their physical and structural properties, and helps to detect subsequent analyses. PBS of 0.1 M with 5 mM ferric/ferrocyanide was used as the supporting electrolyte. This buffered solution was pivotal in maintaining the stability and consistency of electrochemical conditions throughout the experimental procedures.

To explore the electroactive surface areas of the different nanointerface-modified materials, a scan rate study was conducted systematically by varying the scan rate from the range of 10–100 mV/s. The CV current responses were measured at various scan rates providing deeper insights into the electrode kinetics and mechanisms governing the electrochemical processes at the electrode surface. From Fig. 4a, the current response for MXene, measured at different scan rates, exhibits an anodic peak with a slighter peak shifting from 0.44 V to 0.63 V and a cathodic peak at about -0.069 V to -0.085 V also experiences the same effect of peak shift. These observations highlight the efficient electron transfer at the MXene-modified electrodes. The redox behaviour of the material indicates that MXene is effective as an electrode modifier for non-enzymatic sensors. Studies, including those by Anasori et al.37, demonstrate that MXene enhances redox reactions, making them ideal for use in electrochemical sensors. MXene anodic and cathodic peak potential observed in CV relevant to diffusion surface reaction. The CV analysis of MOF was carried out within the potential range of 1–2 V. The broad potential span was optimised with the observed potential peak. Even the potential peak analysis increases with an increasing scan rate of 10–80 mV/s. The missing scan rate potential when compared with MXene is omitted by the overlapping response. Oxidation reaction occurs at the anodic peak around 1.34 V and promotes the ability of electron transfer. Similarly, the reduction peak at 0.197 V possesses a minor shift across the peak potential on every increasing peak potential. the diffusion reaction notified by the anodic and cathodic concerning the current and Scan rate Fig. 4e. The modified electrode MXOF is investigated for the peak potential between −0.5 to 1 V on varying different scan rates of 10–90 mV/s.

Fig. 4: CV analysis of GCE coated with MXene, ZIF-8 and composites MXOF.
figure 4

CV cycles of MXene (a), ZIF-8 (b), and MXOF (c) demonstrate electrochemical behaviour. Corresponding plots of anodic and cathodic peak currents for MXene (d), ZIF-8 (e), and MXOF (f), reflecting improved charge transfer and electroactivity in the composite material.

The combination of MXene/MOF contributes to the reduction in the shifting potential on increasing scan rate. This resultant with the same anodic response on 0.6 V reflects the same as on cathodic peak 0.197 V. The plotting represents the diffusion control which contributes carried on coated material and Electrode shown in Fig. 4c. The potential investigation exposes, that even though the potential standard represented on different scanning only increased over the current for the MXOF-modified GCE is suitable for the sensing techniques.

Electrode surface area

The significance of the step-wise modified electrodes via understanding the electroactive surface area. The surface area was calculated using the Eq. (1) for pre- and post-modification of the electrode. The analysis is carried out with CV and the current of the anodic peak (Ip) is used for the calculation38.

$${I}_{p}=(2.69\times {10}^{5})\,{{\rm{n}}}^{3/2}{\rm{A}}{{\rm{D}}}^{1/2}{v}^{1/2}{{\rm{C}}}^{* }$$
(1)

where Ip is the peak current of the forward scan, n is the number of electrons (n = 1), v is the scan rate (50 mV/s), C is the concentration of the analyte (mol cm−3), D is the diffusion coefficient of Fe (CN)63−/4− (7.6 × 10−6cm2 s−1) and A represents the active area of the electrode (cm2). The calculated surface area for step-wise modification of each electrode is given below:

Bare = 0.061 cm2, MXene = 0.0712 cm2, and MOF = 0.0342 cm2 and MXOF = 0.261 cm2

The surface area of all sensing materials is analysed from the calculation, surface area of MXOF is higher than other materials, which is the pro-active area for the sensing mechanism.

Square wave voltammetry and sensitivity analysis of MXene, ZIF-8, MXOF

The MXene surface modified GCE was subjected to SWV analysis, the current response was observed in PBS of 0.1 M with 5 mM ferric/ferrocyanide SMX tablet procured and the same was dissolved in methanol to achieve a consistent concentration of 20 mg/50 mL. A novel MXene-based electrochemical sensor was employed for the detection. SWV in the methanol solution revealed a distinct peak at 0.54 V as shown in Fig. 5a, d which shifted slightly with concentration changes, indicating the sensor’s responsiveness. Subsequently, while increasing the concentration of SMX from 100 to 1000 µL the peak current decreases gradually as shown in Fig. 5b. The sensor exhibited a sensitivity of 0.64 µA/mM cm−2 and an LOD of 4.709 mg/L. These results confirm the sensor’s capability to accurately detect and quantify SMX with high precision, underscoring its effectiveness for SMX monitoring. Stock solutions of SMX were prepared from tablet formulations to develop a ZIF-8-based chemical sensor. SMX concentrations were varied from 100 μL to 1000 μL Fig. 5b, e to identify oxidation peaks at 0.41 V, crucial for evaluating sensor performance. The sensor demonstrated a sensitivity of 41.29 µA/mM cm−2 and an LOD of 73.67 µg/L. By focusing on antibiotics in tablet form, our study reflects practical sensor applications and provides insights into the electrochemical behaviour of these pharmaceutical compounds in real-world conditions.

Fig. 5: SWV response of GCE coated with MXene, ZIF-8 and composites MXOF for different SMX concentrations.
figure 5

SWV current response for varying SMX concentrations using MXene (a), ZIF-8 (b), and MXOF (c) electrodes shows increasing peak current with respect to the SMX concentration. Linear Fit calibration plots corresponding to MXene (d), ZIF-8 (e), and MXOF (f) reveal the relationship of peak current and SMX concentration.

SMX detection was performed using SWV at various concentrations in the electrolyte. A novel MXOF sensor was analysed, among all the materials the current is shifted from its original position towards a lesser region from 0.44 V to 0.36 V. This negative shift of the peak potential is attained due to the reduction of the electron transfer barrier. It revealing distinct peaks at 0.39 V that shifted slightly with concentration changes, indicating the sensor’s responsiveness is shown in Fig. 5c, f. The results showed a LOD of 38.062 µg/L and a sensitivity of 77.13 µA/mM cm−2, demonstrating the sensor’s precision and high sensitivity. The comparison of synthesised material analysis is listed in Table 2. MXOF material notably enhances sensor performance by providing a large surface area, which improves electrochemical reactions and sensitivity. This research highlights the effectiveness of MXOF in creating highly sensitive and selective electrochemical sensors for detecting pharmaceuticals like SMX.

Table 2 Comparative table of sensitivity and LOD analysis of synthesized material

Selectivity analysis

The selectivity of the developed sensor with MXOF interface was tested in the presence of 500 µl of SMX along with common potential interferents like (TMP), Tetracycline (TET), Chloramphenicol (CHR), L - Ascorbic acid (ASC) with 10-fold excess concentrations. The current response of these interferent materials was observed with the 10-fold concentration. TMP is the most existing combination with SMX for antibacterial treatments. Other TET and CHR are relevant, and most approachable analytes as the anti-bacterial nature. The observed current response suggests the sensor performance remains unaffected in the presence of interfering species even with a 10-fold excess in concentration Fig. 6a. The overall change in the current response shows the better selectivity of the developed sensor towards SMX. Though it is a non-enzymatic sensor, the matrix effect plays a vital role. The stability interferent of MXOF is carried out for four weeks (Fig. 6b). The performance of the MXOF sensor was compared with previously described antibiotic sensors and also for related 2D materials in Table 3. To overcome the matrix effect in the real-time analysis, a dilution factor will be employed for the sample medium, and which helps to increase the selectivity of the sensor.

Fig. 6: SWV response of MXOF for Selectivity and stability.
figure 6

a Different analytes, trimethoprim (TMP), tetracycline (TET), chloramphenicol (CHR), L-ascorbic acid (ASC) are used to determine the interference with 10-fold to the (sulfamethoxazole) SMX concentration. The current responses are around 12.03, 33.1, 49.8, 52.4, 69.52 µA of TMP, TET, SMX, CHR and ASC, respectively. b The stability of the MXOF electrode is between 49.8 to 42.3 µA for 4 weeks observed analysis.

Table 3 Comparison of modified GCEs for SMX detection: sensitivity, and LOD

Recovery study

The MXOF sensor’s accuracy and practicality were assessed using the standard accession method. A controlled sample of distilled water and tap water in the ratio of 7:3 respectively was prepared as a solution by SMX and introduced at 500 μL, 600 μL, and 700 μL concentrations to test the sensor’s performance. Results in Table 4 showed recovery rates between 97.06% and 99.62%, demonstrating high accuracy in detection. The low Relative Standard Deviation (RSD) of less than 3% confirmed the sensor’s precision and reliability. These findings validate the MXOF sensor’s effectiveness for swift and accurate SMX monitoring in water, making it an essential tool for environmental and water quality analysis.

Table 4 Real sample analysis of SMX levels in tap water

Discussion

The synthesised 2D material MXene, ZIF-8 and its composite MXOF was undertaken electrochemical analysis of CV and SWV. The sensitivity and LOD of the MXOF are 77.13 µA/mM cm−2 and 38.062 µg/L respectively, resulting in effective recovery during the analysis of real-time samples. The parameter is enhanced to the level of composite to the sensitivity and LOD. This shows the valuable detection of SMX antibiotics with this MXOF material. The follow-up of this analysis is to step up to the sensor devices for environmental applications and develop to remove this type of contamination from the water and lead to pharmaceutical pollutant-free and clean water.

Methods

Material

Ti3AlC2 powder, Ultra nanotech (99.5%), Hydrofluoric acid (Concentration 40%), Avra, Methanol, Leishman’s staining solution, 2-Methylimidazole, SRL chemicals (purity 99%), Zinc nitrate hexahydrate, SRL Chemicals (Extra pure 99%), Ethanol, AR Changshu Hong sheng Fine Chemical Co. Ltd, Sulfamethoxazole (SMX), Powdered Co-Trimoxazole Tablet (80%) Real sample -Tap water. All chemicals were directly used without any further treatment.

Characterization

The XRD spectra were characterized by a RIKAGU Japan, Smartlab 9KW with CuKα (1.5406 Å). The morphology was identified by field emission scanning electron microscopy Carl Zeiss NTS GMBH, Germany, SUPRA 55. Cyclic voltammetry (CV) and square wave voltammetry (SWV) electrochemical measurements were Palmsens4, Netherlands.

Etching of MXene

In the detailed execution of the experimental methodology for this scientific investigation, the synthesis and preparation of the material played a critical role in ensuring the accuracy and validity of subsequent analyses. Schematic representation in the abstract express the etching process which was initiated with the careful introduction of precisely 2 g of Ti3AlC2 into a measured solution containing 30 mL of hydrofluoric acid. The subsequent etching procedure occurred under controlled environmental parameters, featuring a stirring rate of 700 rpm to optimize the interaction between the reactants. Maintaining the entire process at room temperature, provides a stable and consistent environment throughout the extended 48-hour period, allowing for a thorough etching reaction.

After the completion of the etching process, the collected residue underwent a purification protocol aimed at eliminating extraneous substances and enhancing the purity of the resulting material. The purification process involved successive cleaning steps, where the residue endured thorough washes with double-distilled water two times and washed with ethanol one time. This multi-step cleaning procedure aimed to remove any residual hydrofluoric acid, by-products, or impurities that might have been components of major precursors. The separation of purified material from the liquid was achieved through centrifugation, utilizing centrifugal force to achieve a clear distinction between the solid residue and the cleaning solvents39,40.

Synthesis of ZIF-8

The initial components zinc nitrate (A) and 2-methyl imidazole (B) were accurately measured, and their calculated quantities were independently dissolved in a Methanol, allowing the complete dissolution of A and B by stirring. Upon achieving homogeneity, the combined solution carried a settling period lasting 24 h, facilitating the precipitation of the desired material. After the precipitation phase, the obtained material, ZIF-8 underwent purification through a centrifuge method with double-distilled water two times and washed with ethanol one time, effectively separating the precipitate from any residual impurities, thereby elevating the purity of the synthesized material. The final product was purified and underwent an overnight drying process at 80 °C to eliminate any remaining solvent or by-products36,41.

Synthesis of MXOF

The MXOF composite by in situ growth of ZIF-8 on MXene, zinc nitrate hexahydrate was dissolved in methanol, while separately, 2-methylimidazole was also dissolved in methanol. MXene powder was added to the 2-methylimidazole solution and sonicated for uniform dispersion. The zinc nitrate solution was then combined with the MXene and 2-methylimidazole mixture, and the mixture was gently stirred for 3 h to promote the growth of ZIF-8 crystals on the MXene surface. Made into the settlement of composite material. The resulting product was collected by centrifugation, washed with deionized water two times and ethanol once to remove unreacted materials, and dried at 80 °C for 6 h to yield the grey-coloured powder, MXOF composite39,40.