Introduction

Mercury ions (Hg²⁺) are among the most hazardous environmental pollutants due to their extreme toxicity, bioaccumulation potential, and persistence in aquatic ecosystems. Mercury contamination in water arises primarily from anthropogenic sources such as mining, fossil fuel combustion, and improper industrial waste disposal, and it remains a serious global threat to both ecological and human health1,2,3,4,5,6. Once released into the environment, mercury readily enters the food chain, accumulating in organisms and posing severe health risks. Its toxicity is largely attributed to its strong affinity for thiol (–SH) and amino (–NH2) functional groups in proteins, disrupting vital biological processes and affecting the immune system, nervous system, and organ function7,8.

Recognizing the global health hazard posed by mercury, the Minamata Convention on Mercury was enacted in 2017 to reduce and phase out mercury use in industrial operations9,10. This underscores the urgent need for reliable, sensitive, and selective detection techniques for Hg²⁺ in environmental water samples, particularly at low concentrations relevant to regulatory limits. The World Health Organization (WHO) has established a guideline value of 6 µg/L (6 ppb) for mercury in drinking water, highlighting the urgent need for cost-effective, portable analytical methods with high selectivity and low detection limits to ensure public health safety11.

Traditional analytical techniques, including atomic absorption spectrometry (AAS)12, colorimetry13, inductively coupled plasma mass spectrometry (ICP-MS)14, atomic emission spectrometry (ICP-AES)15, spectrofluorometry16, and chromatography17, offer high sensitivity and accuracy, but are limited by their operational complexity, high cost, and need for skilled personnel without any option for portability. These limitations restrict their applicability in field-based or point-of-care mercury detection, especially in remote or resource-limited settings.

In contrast, electrochemical sensing platforms have gained considerable attention due to their inherent advantages, such as high sensitivity, low cost, portability, and compatibility with miniaturized systems18,19,20,21. To improve the selectivity and performance of such sensors, novel materials, including carbon nanotubes22, graphene23,24, and metal–organic frameworks (MOFs)25,26,27 have been explored. On top of these, porous organic polymers (POPs) represent a particularly attractive class of materials due to their tuneable porosity, high surface area, chemical diversity, and structural stability28,29,30.

POPs are broadly classified based on their pore size into microporous (< 2 nm), mesoporous (2–50 nm), and macroporous (> 50 nm) materials31,32. Numerous subclasses of POPs—including covalent organic frameworks (COFs)33, polymers of intrinsic microporosity (PIMs)34, porous aromatic frameworks (PAFs)35, hyper crosslinked polymers (HCPs), conjugated microporous polymers (CMPs)36,37, advanced porous organic polymers38,39,40, and triazine-based conjugated organic polymers (COPs)41 have been studied for sensing applications.

Square Wave Anode Stripping Voltametric Technique (SWASV) has been gaining quite popularity in the field of electrochemical detection of trace levels (ppb) of heavy metals. Due to its robust pre-concentration-based amplification step, metal ions or analytes present in minuscule amounts in heavily diluted solutions can be detected sensitively and selectively as compared to standard voltametric techniques like Cyclic Voltammetry (CV) or Differential Pulse Voltammetry (DPV). Moreover, this method requires minimal or negligible sample preparation and handling complexity, thus making it ideal for deployment for point-of-care or on-site water testing42,43.

In recent years, the concept of donor (D) acceptor (A) based materials has emerged as a state-of-the-art platform for electrochemical studies44,45. A suitable juxtaposition of donor and acceptor moieties maintains the proper electrical conduction, thereby lowering the charge transfer resistance in the electrochemical studies46. Therefore, for initial material selection, an extended π conjugated D-A type material enriched with soft donor sites would be an ideal candidate for electrochemical sensing of Hg2+. So, in this study, we report the use of a novel metal-free porous organic polymer incorporated with thiadiazole (TDA) and triazine (Trz) moieties (TDA–Trz–POP) as an active sensing material for the electrochemical detection of mercury ions. Again, the triazine-rich centre (Trz) makes the building block electron-deficient (A), which provokes the thiolate (TDA) entity (D) for a nucleophilic attack, thereby maintaining a D-A type arrangement, which helps a suitable electron flow in electrochemical sensing performance. Mercury (II), being a soft Lewis acid, exhibits strong affinity and preferential binding towards soft donor atoms like sulphur and nitrogen in accordance with the Hard Soft Acid Base (HSAB) theory47. Integrated onto planar screen-printed electrodes (SPEs), this sensing platform enables on-site, real-time mercury monitoring. SPEs offer advantages such as low production cost, reproducibility, design flexibility, and suitability for mass production, making them ideal for decentralized water quality monitoring. The structure–function relationship of the TDA–Trz–POP and its electrochemical sensing performance are systematically investigated in this work.

Materials and methods

Chemical reagents

Cyanuric chloride (NCCl)₃, 99%, Sigma-Aldrich), 2,5-dimercapto-1,3,4-thiadiazole (C₂H₂N₂S₃, 99.9%, Sigma-Aldrich), potassium carbonate (K₂CO₃, 99%, Loba Chemie), and acetone (CH₃)₂CO, technical grade, 99.5%, Rankem) were used for the synthesis of TDA-Trz-POP. Nafion solution, carbon cloth, and other solvents were obtained from Sigma-Aldrich and used as received, without further purification. Sodium chloride (NaCl, ACS reagent, ≥ 99.0%), Sodium acetate buffer solution, Tris-HCl Buffer, Sodium hydroxide (NaOH), Hydrochloric Acid (HCl, 37%, ACS reagent) were purchased from Sigma-Aldrich. ItalSens Carbon SPE were obtained from Palmsens, The Netherlands. Mercuric chloride (HgCl2, ACS grade, 99.5%) from LobaChemie, Potassium hexacyanoferrate (III) (K₃[Fe(CN)₆], ACS reagent, ≥ 99.0%), Potassium hexacyanoferrate (II) trihydrate (K₄[Fe(CN)₆]·3 H₂O, ACS reagent, 98.5–102.0%), Potassium Chloride (KCl, ACS reagent, 99.0-100.5%) were procured from Sigma-Aldrich. Copper (II) nitrate trihydrate (Cu(NO₃)₂0.3 H₂O, 99–104%), Lead (II) nitrate (Pb(NO₃)₂, ACS reagent, ≥ 99.0%), Cadmium nitrate tetrahydrate (Cd(NO3)298%) and Iron (III) nitrate nonahydrate (Fe(NO₃)₃0.9 H₂O ACS reagent, ≥ 98%) were obtained from Sigma-Aldrich as well.

Instrument deployed for characterization

The Powder X-ray Diffraction (PXRD) pattern was analysed on Bruker AXS D8 Advanced SWAX diffractometer using Ni-filtered Cu Kα (λ = 0.15406 nm) radiation. The Fourier Transform Infrared Spectroscopy (FTIR) analysis was performed with a Perkin-Elmer Spectrum 100 spectrophotometer. Solid state 13C MAS-NMR spectra were recorded in a 500 MHz Bruker Advanced II spectrometer at a sample spinning rate of 8 kHz. Nitrogen sorption isotherm (BET analysis) was recorded at 77 K using an Anton Paar Quanta Tec Inc. iSorb HP1 gas adsorption analyzer. Prior to the experiment, the sample was degassed at 120C for 3 h for the measurement. Thermo gravimetric analysis (TGA) was performed in a TA Instrument thermal analyzer TA-SDT Q-600, with a heating rate of 10 C min−1 in air flow. Field emission scanning electron microscopic (FE-SEM) images were collected in JEOL JEM 6700 F with an electron diffraction spectroscopy (EDS) detector. High-resolution transmission electron microscopic (HRTEM) images of the specimen were collected on a JEOL JEM 2010 transmission electron microscope. XPS analysis was recorded over the Omicron Nanotechnology XPS 0571 spectrometer.

Synthesis of TDA-Trz-POP

TDA-Trz-POP, a porous organic polymer incorporating thiadiazole (TDA) and triazine (Trz) units, was synthesized via a nucleophilic substitution reaction following a previously reported procedure with some modification48. In a typical synthesis,1.0 mmol of cyanuric chloride (NCCl)₃ (184.41 mg) was dissolved in 15 mL of dimethylformamide (DMF) in a 50 mL round-bottom flask. A basic aqueous solution of potassium carbonate (K₂CO₃) {3.0 mmol in 10 mL deionized water (DI)} containing 1.5 mmol (226 mg) of 2,5-dimercapto-1,3,4-thiadiazole (C₂H₂N₂S₃) was prepared and added dropwise to the cyanuric chloride solution over a period of 1 h under continuous stirring. The resulting reaction mixture was refluxed under a nitrogen atmosphere at a controlled temperature for 24 h. After completion, the reaction mixture was cooled to room temperature (~ 30 °C), leading to the formation of a yellow precipitate. The yellow-coloured product was successively washed with DMF (3 × 15 ml) to remove most of the un-reacted reactant molecules, plenty amount of H2O followed by Ethanol (3 × 15 ml). The as synthesized material was then air dried overnight to get an approximately 86% of product yield. Then the product was purified using Soxhlet extraction water: ethanol (30:70) for 6 h to remove unreacted species and impurities. The final product was dried under vacuum overnight, yielding TDA-Trz-POP in approximately 80% yield relative to cyanuric chloride. All hazardous chemicals were handled using proper Personal Protective Equipment (PPE) kits including gloves, masks, safety goggles and laboratory coats. Waste disposal was carried out safely in accordance with proper chemical and waste removal guidelines. The synthesis pathway is illustrated in Scheme 1. The novel materials were characterised by powder X-ray diffractometer (XRD), 13C solid state Cross Polarization Magic Angle Spinning Nuclear Magnetic Resonance (CP MAS NMR), Fourier Transform Infrared Spectroscopy (FTIR), High-Resolution Transmission Electron Microscopy (HRTEM), Brunauer-Emmett-Teller (BET) analysis, and Thermogravimetric/Differential Thermal Analysis (TG/DTA) before using them as coating materials for electrochemical sensing.

Scheme 1
scheme 1

Synthetic route for TDA–Trz–POP via nucleophilic Substitution between cyanuric chloride and 2,5-dimercapto-1,3,4-thiadiazole under basic conditions in DMF.

Modification of working electrode with TDA-Trz-POP

The working electrode of the sensors was modified by drop-casting a dispersion of TDA-Trz-POP. Briefly, 2 mg of the synthesized TDA-Trz-POP was dispersed in 1 mL of ethanol containing 0.05 wt% Nafion as a binder and ultrasonicated for 30 min to obtain a homogeneous Suspension. Subsequently, 5 µL of this dispersion was carefully drop-cast onto the carbon working electrode area of the SPE and dried at room temperature under a dust-free environment for 12 h to ensure complete solvent evaporation and uniform film formation. The modified electrodes were stored inside a desiccator until further use.

Electrochemical measurements

Electrochemical measurements were conducted using a multi-channel electrochemical workstation (model: MultiPalmSens4, make: Palmsens B.V., The Netherlands) in a three-electrode configuration integrated on the SPE. Square wave anodic stripping voltammetry (SWASV) was employed for Hg2+ detection. The pre-concentration was carried out by applying a deposition potential of −1.2 V for 300 s in 0.1 M NaCl solution containing Hg2+ of resultant pH value of 5.0. The scan was performed from − 0.4 V to + 1.0 V at a frequency of 25 Hz, step potential 4 mV, and amplitude 25 mV.

In the pre-concentration (deposition) step of anodic stripping voltammetry, a strongly negative potential is applied to the working electrode (300 s in our case), reducing dissolved Hg²⁺ ions in solution to elemental Hg⁰ on the electrode surface:

$${\text{Hg}}^{{{\text{2}} + }} + {\text{ 2e}}^{ - } \to {\text{ Hg}}^{0}$$

This thin layer of Hg⁰ constitutes the pre-concentrated analyte. In the subsequent stripping step, the potential is swept positively, oxidizing Hg⁰ back to Hg2+:

$${\text{Hg}}^{0} \to {\text{ Hg}}^{{{\text{2}} + }} + {\text{ 2e}}^{ - }$$

The square-wave anodic stripping voltammetric (SWASV) peak current is directly proportional to the original concentration of Hg2+ in the sample.

Reproducibility and stability assessments

The repeatability of the TDA-Trz-POP-modified screen-printed electrode was evaluated using square wave anodic stripping voltammetry (SWASV). A 50 nM Hg²⁺ solution in 0.1 M NaCl (pH 5.0) was analysed over ten consecutive cycles under optimized parameters (–1.2 V deposition potential, 300 s accumulation time). The peak current was recorded after each cycle to assess signal stability. The relative standard deviation (RSD) across the measurements was calculated to determine reproducibility.

Modified electrodes were stored under ambient laboratory conditions (25 °C, ~ 50% relative humidity) inside a desiccator and tested at fixed intervals over 60 days. The electrochemical response to 50 nM Hg2+ was measured to assess sensor durability. Performance retention was expressed as a percentage of the initial response, and RSD values were calculated to quantify signal variation over time.

Real sample testing

To assess the practical applicability of the TDA-Trz-POP modified electrodes for environmental monitoring, the electrochemical detection of mercury was performed in water samples, collected from different sources. Tap water was collected from the institute premises, while the pond water was collected from the northern part of the city of Kolkata, India. The samples were filtered using a 0.2 μm membrane and Subsequently mixed with 0.1 M NaCl in a 9:1 NaCl solution-to-sample ratio, adjusting the pH to 5.0 to match optimized sensing conditions. In fact, the solution pH was adjusted with drop-wise addition of 35.5% HCl or 1 M NaOH. This enabled precise control of pH levels to evaluate their influence on the electrochemical response of Hg²⁺. To simulate contamination events, the filtered samples were spiked with known concentrations of Hg2+ (30, 50, 80, and 100 nM), and the recovery efficiency was calculated to evaluate the sensor’s accuracy (Table 1).

Table 1 Hg2+ recovery through spiking real water samples.

Statistical analysis

All electrochemical measurements were repeated at least three times. Results are reported as mean ± standard deviation (SD). The limit of detection (LoD) was calculated as:

$${\text{LoD }} = 3\sigma /S$$
(1)

where σ denotes the standard deviation of the measured peak currents (n = 3) obtained under identical SWASV conditions, and S is the slope of the calibration curve.

Results and discussion

Structural, compositional, and morphological properties

The structural framework of TDA-Trz-POP was validated through ¹³C CP/MAS NMR spectroscopy, a robust technique for characterizing amorphous and insoluble polymeric materials. The spectrum (Fig. 1) revealed two prominent resonance peaks: one at 190.0 ppm, attributed to the sp²-hybridized carbon atoms of the triazine ring, and a second at 151.7 ppm, corresponding to the carbon atoms of the thiadiazole moiety49. The downfield shift of the triazine signal arises from the electron-withdrawing effect of adjacent nitrogen atoms, while the thiadiazole carbon signal reflects the Sulphur-rich chemical environment, which induces electronic de-shielding. A minor splitting observed in the 151-ppm region likely originates from structural heterogeneity or non-equivalent thiadiazole environments within the amorphous polymer backbone. The absence of aliphatic or unassigned aromatic carbon peaks further supports the formation of a highly cross-linked, aromatic porous network. Collectively, the NMR data confirm the successful linking of both triazine and thiadiazole building blocks into the polymer structure, establishing the foundation for its selective metal-binding functionality.

Fig. 1
figure 1

Solid-state ¹³C CP/MAS NMR spectrum of TDA-Trz-POP. The spectrum confirms the chemical structure of the polymer through two distinct resonance signal peaks at 178.6 ppm and at 151.89 ppm.

The morphological features of TDA-Trz-POP were analysed using HRTEM and field emission scanning electron microscopy (FESEM). Both the samples were prepared by drop casting of a homogeneous dispersion of the sample solution (in isopropanol) on the respective grids. HRTEM images (Fig. 2A) revealed an amorphous, nanoscale network with loosely aggregated domains and a porous texture, consistent with the amorphous character indicated by powder XRD (Fig. 3B). These interconnected porous regions are favourable for mass transport and ion accessibility during electrochemical sensing. FESEM micrographs (Fig. 2B) showed a sponge-like, rough surface topology, suggesting a high surface area structure derived from the dense cross-linking of triazine and thiadiazole units. Such architecture is advantageous for efficient analyte diffusion and electron transfer at the electrode interface. Elemental mapping (Figs. 2C–F) demonstrated a homogeneous distribution of carbon, nitrogen, and sulphur throughout the polymer matrix. Again, we have measured energy dispersive X-ray (EDX) spectroscopic analysis, which reveals (atom %) 65.88% of C, 24.41% of N, and 9.71% of S in the TDA-Trz-POP (Supplementary Figure S1). The uniform distribution of nitrogen and sulphur atoms in the POP confirms the successful incorporation of the functional moieties, which are essential for mercury ion coordination via soft-soft interactions.

Fig. 2
figure 2

Morphological and elemental mapping analysis of TDA-Trz-POP. (A) High-resolution transmission electron microscopy (HRTEM) image showing an amorphous, nanoscale morphology with loosely aggregated porous domains; (B) Field emission scanning electron microscopy (FESEM) image revealing a rough, sponge-like surface topology, indicative of a high surface area and interconnected pore network; (C-F) Elemental mapping performed via energy-dispersive X-ray spectroscopy (EDS) showing dispersion of C, N and S (D-F) respectively.

Fig. 3
figure 3

Physicochemical characterization of TDA-Trz-POP. (A) FT-IR spectra showing Successful covalent Linkage between cyanuric chloride and 2,5-dimercapto-1,3,4-thiadiazole.; (B) Powder X-ray diffraction (XRD) pattern indicating the amorphous nature of TDA-Trz-POP, consistent with the cross-linked polymeric structure; (C)Nitrogen adsorption–desorption isotherm recorded at 77 K, showing a Type I profile characteristic of microporous materials. Inset: pore size distribution derived from non-local density functional theory (NLDFT), revealing an average pore diameter of ~ 1.25 nm; (D) Thermogravimetric analysis (TGA) in air, illustrating thermal stability up to 260 °C.

These results collectively affirm the formation of a porous, heteroatom-rich polymer network with a morphology well-suited for sensitive and selective electrochemical detection of Hg²⁺. The synthesized TDA-Trz-POP was further characterized by FT-IR spectroscopy (Fig. 3A). The disappearance of the characteristic –C–Cl stretching at 850 cm⁻¹ (from Trz-Cl)50 and the –S–H stretching at 2853 cm⁻¹ (TDA-SH)51 confirms the Successful nucleophilic Substitution between the thiolate group and cyanuric chloride. Retention of peak at 1072 cm⁻¹ in both TDA-SH and TDA-Trz-POP corresponds to –N-N- stretching frequency, which solely comes from TDA unit in TDA-Trz-POP52,53. Peaks corresponding to 1250 cm−1 are due to coupling of exocyclic C–C stretch and a -C-N ring stretching mode, which is present in both the precursor and the TDA-Trz-POP unit54. Additionally, disappearance of –N-H bending peak at 1505 cm−1 from thiadiazoletautomeric form (thiol to thione) to TDA-Trz-POP55 and emergence of a C–S–C stretch at 650 cm⁻¹ supports the formation of the desired linkage between the TDA and Trz moieties. The retention of the triazine-associated stretching and breathing vibrations, despite slight shifts, further confirms the linking of the Trz ring into the polymer backbone56.

Powder X-ray diffraction (XRD) analysis of TDA-Trz-POP (Fig. 3B) shows a broad peak centred at ~ 20–25° 2θ, with no sharp Bragg peaks, confirming its amorphous nature57. This lack of long-range order is attributed to the rigid triazine and angular thiadiazole units, which disrupt periodic packing and lead to a disordered, cross-linked framework. Amorphous porous organic polymers (POPs) such as TDA-Trz-POP often arise from irreversible covalent coupling, yielding structurally robust but amorphous networks. Despite the absence of crystallinity, the amorphous architecture offers flexibility in coordination geometry and enhanced site accessibility, both advantageous for binding soft metal ions like Hg²⁺ in sensing applications.

Nitrogen adsorption–desorption analysis at 77 K revealed a predominantly microporous character in TDA-Trz-POP, as evidenced by the steep gas uptake (~ 45 cc g⁻¹) at low relative N2 pressures (P/P0 < 0.1) (Fig. 3C). While the initial uptake reflects strong micropore filling, the absence of a sharp plateau and the continued adsorption up to P/P0 ≈ 0.8 suggest additional multilayer nitrogen adsorption, likely facilitated by the presence of mesopores or interparticle voids58. This observation is consistent with the amorphous and loosely aggregated morphology seen in electron micrographs. The isotherm’s continuous rise across the full pressure range, without a defined saturation region, is characteristic of a Type II profile, typically associated with materials exhibiting multilayer adsorption on mesoporous or external surfaces. Notably, the adsorption behaviour observed here conforms to that reported in several mesostructured and hybrid porous materials, where micropores coexist with open frameworks that enable extended gas-solid interactions59. The pore size distribution, derived from non-local density functional theory (NLDFT), features a narrow peak centred at ~ 1.15 nm, reinforcing the presence of disordered micropores, while the broader adsorption trend implies a degree of hierarchical porosity. The BET Surface area was calculated to be 152 m²g−1, supporting substantial surface accessibility. Effectively, this dual porosity, localized microporosity within a more open textural framework, enables efficient analyte diffusion and amplifies exposure of electroactive sites, enhancing the sensitivity of the sensor in detecting Hg²⁺ ions.

TGA was performed in air to evaluate thermal stability (Fig. 3D). The material remained stable up to approximately 260 °C, with an initial 9% weight loss attributed to the desorption of residual solvents and surface moisture. Beyond this, the degradation of the polymeric framework ensued, likely due to cleavage of –C–S and –S–H bonds, culminating in a 60% mass loss as the organic backbone decomposed at elevated temperatures60.

Optimization of conditions for electrochemical detection of mercury ions

Electrocatalytic performance of TDA-Trz-POP modified electrode was tested in the presence of 10mM [Fe(CN)6]3−/4− in 0.1 M KCl (Fig. S2). As shown in the figure, the modified electrode displays a markedly enhanced anodic peak current (ip.a. = 243.25 µA) compared to the unmodified electrode (ip.a. = 95.83 µA), underscoring the excellent electrocatalytic activity of the polymer. The porous organic polymer provides a higher electrochemically active effective surface area, which in turn aids in increased electron transfer kinetics, thus showing an increased current response. Though of amorphous nature, the inherent porosity and presence of tuneable interconnected heteroatom-rich porous networks help in rapid ion diffusion and electrolyte penetration. The presence of functional groups like thiadiazole and triazine within the matrix facilitates increased mass transport of electroactive species, even in the absence of long-range crystallinity. To achieve optimal performance for Hg2+ detection, key electrochemical parameters, including buffer composition, pH, deposition potential, and accumulation time, were systematically evaluated using square wave anodic stripping voltammetry (SWASV). All experiments were conducted with a TDA-Trz-POP-modified electrode in the presence of 50 nM Hg2+ under room temperature conditions.

The choice of buffer was found to significantly influence the stripping current response (Fig. 4A). Among the tested Supporting electrolytes, NaCl, sodium acetate, PBS, sodium citrate, and Tris-HCl, 0.1 M NaCl yielded the highest peak current (18.72 µA). This enhancement is attributed to the formation of Hg–Cl complexes, which suppress background current and promote more efficient electron transfer61. Concurrently, Hg2+ ions are presumed to coordinate with nitrogen and Sulphur donor sites within the TDA-Trz-POP framework, facilitating selective pre-concentration and redox activity at the electrode interface. Solution pH was varied from 3 to 8 in NaCl saline solution (0.1 M) to assess its effect on signal response (Fig. 4B). Peak current increased with pH, reaching a maximum at pH 5.0, suggesting optimal conditions for Hg2+ coordination and electron transfer. Below this value, competition with protons may hinder Hg2+ adsorption, while above pH 6.0, hydrolysis of Hg2+ likely reduces its electrochemical activity62,63. Accordingly, pH 5.0 was selected for all subsequent measurements.

Fig. 4
figure 4

Optimization of electrochemical parameters for Hg²⁺ detection using TDA-Trz-POP-modified screen-printed electrodes. (A) Effect of solution type (0.1 M) on the stripping current response of 50 nM Hg²⁺ at pH 5.0 under a deposition potential of − 1.2 V for 280 s.; (B) Influence of solution pH (range: 3–8) on peak current in 0.1 M NaCl. A maximum response was observed at pH 5.0; (C) Variation of accumulation potential (–0.9 V to − 1.3 V) at fixed pH 5.0 and 0.1 M NaCl. Peak current response was highest at − 1.2 V, beyond which water reduction limited performance; (D) Effect of accumulation time (100–300 s) on current response at − 1.2 V in 0.1 M NaCl, pH 5.0.

Deposition potential was examined in the range of − 0.9 V to − 1.3 V (Fig. 4C). The peak current increased with increasingly negative potential and was maximized at − 1.2 V. At − 1.3 V, the signal declined, likely due to hydrogen evolution interfering with surface processes64. Accumulation time was optimized between 100 and 300 s (Fig. 4D). A gradual increase in current was observed with longer deposition, plateauing at around 300 s, indicating saturation of active binding sites with reduced Hg⁰. Prolonging accumulation beyond this time conferred no further analytical benefit (Data not shown). Based on these studies, the optimized parameters for trace-level detection of Hg²⁺ were established as: 0.1 M NaCl (pH 5.0), deposition potential of − 1.2 V, and accumulation time of 300 s. These conditions provided the most reproducible and sensitive response for Hg²⁺ in aqueous media using the TDA-Trz-POP-modified electrode.

Electroanalytical response of TDA-Trz-POP modified electrodes to hg²⁺ ions in water

The electrochemical performance of the TDA-Trz-POP-modified screen-printed electrode (SPE) was evaluated under optimized conditions (0.1 M NaCl, pH 5.0, deposition potential of − 1.2 V, and deposition time of 300 s) using square wave anodic stripping voltammetry (SWASV). The modified electrode exhibited a significantly enhanced stripping current for Hg2+ (18.65 µA) compared to the unmodified electrode (5 µA), highlighting the critical role of the TDA-Trz-POP matrix in facilitating Hg2+ adsorption and electron transfer (Fig. 5A). This improvement in sensitivity is attributed to the porous architecture and heteroatom-rich framework of TDA-Trz-POP, which offers a high density of electroactive sites. The nitrogen atoms in the triazine rings and sulphur atoms in the thiadiazole moieties serve as soft donor sites, promoting strong coordination with the soft acid character of Hg²⁺ ions, in accordance with the Hard and Soft Acids and Bases (HSAB) theory.

Fig. 5
figure 5

Electrochemical sensing performance of TDA-Trz-POP-modified electrode for Hg²⁺ detection. (A)Comparative square wave anodic stripping voltammetry (SWASV) responses of bare and TDA-Trz-POP-modified electrodes recorded for 50 nM Hg²⁺ in 0.1 M NaCl (pH 5.0) under a deposition potential of − 1.2 V for 300 s; (B) SWASV profiles of the modified electrode for Hg²⁺ concentrations ranging from 5 to 100 nM.Colour legend: Each coloured line represents a different Hg²⁺ concentration in the range 50–100 nM, increasing from red to purple. Inset: Calibration plot exhibiting linearity with the equation i = 335.36c + 0.51; the calculated limit of detection (LoD) is 1.5 nM.

A series of SWASV measurements were conducted with varying concentrations of Hg2+ (5 to 100 nM) under the same operating parameters (Fig. 5B). The peak current increased linearly with concentration, and a well-defined anodic peak consistently appeared at ~ 0.09 V, corresponding to the oxidation of electrodeposited Hg⁰ back to Hg²⁺. The calibration curve followed the regression equation:

$$i{\text{ }} = {\text{ }}335.36c{\text{ }} + {\text{ }}0.51\left( {{\text{R}}^{{\text{2}}} {\text{ }} \approx {\text{ }}0.{\text{99}}} \right)$$
(2)

where i is the peak current (µA) and c is the Hg2+ concentration (µM).

The resulting LoD was calculated using Eq. (1) and found to be 1.45nM (≈ 0.4ppb). The LoD indeed indicates superior sensitivity of the TDA-Trz-POP-based sensing platform compared to the other material systems, reported in the literature, for Hg2+ ion detection (Table ST1).

Selectivity of TDA-Trz-POP toward Hg²⁺ in the presence of interfering ions in a real case scenario

To evaluate the selectivity of the TDA-Trz-POP-modified electrode, square wave anodic stripping voltammetry (SWASV) was conducted in the presence of commonly encountered heavy metal ions, including Pb²⁺, Cu²⁺, Cd²⁺, and Fe²⁺. Each interferent was introduced at a fixed concentration of 1.0 µM, while the concentration of Hg²⁺ was varied incrementally.

The stripping voltammograms (Figs. 6A–D) revealed that the peak current associated with Hg²⁺ increased linearly with concentration, even in the presence of interfering species. Pb²⁺ and Cu²⁺ produced distinct anodic signals at higher oxidation potentials but did not overlap with the Hg²⁺ peak. In the case of Cd²⁺, some signal broadening and background interference were observed, likely due to cadmium film formation on the electrode surface. Nevertheless, the Hg²⁺ peak remained distinguishable. Fe²⁺ exhibited negligible interference under the applied conditions. The marginal dampening of Hg²⁺ stripping peaks in the presence of Pb²⁺, Cu²⁺, Cd²⁺, and Fe²⁺ arises from surface-level competition and partial adsorption of these coexisting ions, particularly Cu²⁺ and Cd²⁺, which may transiently alter the local electrochemical environment or form surface films. However, due to the stronger soft-soft coordination affinity of Hg²⁺ with the sulphur and nitrogen sites of TDA-Trz-POP, the sensor maintains selective pre-concentration and signal fidelity, as predicted by HSAB principles and consistent with similar interference-tolerant systems reported in the literature.

Fig. 6
figure 6

Selectivity analysis of TDA-Trz-POP-modified electrode toward Hg²⁺ in the presence of interfering metal ions. SWASV responses were recorded for increasing concentrations of Hg²⁺ in the presence of 1.0 µM of each potentially interfering ion: (A) Pb²⁺, (B) Cu²⁺, (C) Cd²⁺, and (D) Fe²⁺.

Multi-ion interference study was performed where the concentration of each interfering ion was fixed at 1.0 µM, and Hg2+ was introduced progressively at an increasing concentration from 20 nM up to 60 nM. As apparent in Fig. S3, the peaks for Cu2+, Cd2+, and Pb2+ appeared feebly along with distinct current response from Hg2+, whereas that from Fe2+ was undetectable. The presence of multiple ions in the matrix provides minimal hindrance to Hg2+ binding sites on the electrode, which is substantiated due to the presence of TDA-Trz-POP coating of the fabricated sensor.

Reproducibility and stability of the sensors

The operational reliability of the TDA-Trz-POP-modified electrodes was assessed through reproducibility and shelf-life studies under optimized conditions. For reproducibility, the sensor response to 50 nM Hg²⁺ was measured over ten consecutive SWASV cycles (Fig. 7A). The stripping peak current remained stable for the first six cycles, with only a marginal decline observed in Subsequent runs. This slight decrease is attributed to partial fouling of the electrode Surface due to residual mercury accumulation, a common phenomenon in trace metal stripping analysis. Nevertheless, the RSD value was calculated to be around 3.2% and the signal retention across multiple uses confirms the robustness of the polymer-modified interface for short-term repeat measurements.

Fig. 7
figure 7

Reproducibility and stability evaluation of TDA-Trz-POP-modified electrodes. (A) Repeatability test showing the stripping peak current of 50 nM Hg²⁺ over 10 consecutive cycles.; (B) Shelf-life study performed over 60 days at ambient temperature (25 °C, ~ 50% relative humidity) using electrodes exposed to 50 nM Hg²⁺.

To evaluate long-term performance, the modified electrodes were stored under ambient conditions (25 °C, ~ 50% RH) and tested periodically over 60 days (Fig. 7B). The sensor well retained its initial response for 50 nM Hg2+with a relative standard deviation (RSD) of ~ 4.2%, indicating minimal degradation in sensing performance. These results highlight the chemical and structural stability of TDA-Trz-POP and its potential for reliable deployment in decentralized, field-ready sensing applications.

To affirm the chemical stability of the sensing material, the electrodes were drop cast with the POP, and 100 cycles of SWV were run with 100 nM HgCl2 (0.1 M NaCl) to ascertain the material’s electrochemical robustness and chemical stability. The sensors exhibited very Little degradation in current response over the 100 cycles, and the RSD value was found to be around 1.5% which proves that the porous organic polymer remained fairly stable throughout the course of study and exhibited no significant change in chemical composition that could affect the catalytic activity (Fig. S4).

Real sample analysis and practical applicability

To demonstrate the practical viability of the TDA-Trz-POP-modified electrode, the sensor was applied to analyse real water samples collected from a tap and a local pond. Each sample was spiked with known concentrations of Hg²⁺, and recovery tests were performed under the optimized electrochemical conditions. The sensors exhibited recovery rates ranging from 91.1 to 99.9%, with relative standard deviations (RSD) below 5%, indicating high accuracy and precision in complex matrices (Table 1). Unspiked samples were also tested under identical conditions, and no detectable Hg²⁺ signal was observed, confirming that the recovery measurements reflect only the added mercury. The consistent performance across independent sample sets affirms the matrix tolerance and robustness of the TDA-Trz-POP sensing platform. Notably, the porous and heteroatom-enriched framework of TDA-Trz-POP facilitates selective binding of Hg²⁺ even in the presence of dissolved organic matter and competing ions typically present in environmental samples. These findings suggest strong potential for real-time, on-site monitoring of mercury contamination in natural and industrial water sources using disposable, low-cost screen-printed electrodes.

Post sensing sample analysis

Physicochemical characterization has been carried out for the material post-electrochemical sensing via SEM, FTIR, Non-Contact Optical Profilometric Analysis, and Water Contact Angle Measurement. The Water Contact Angle (WCA) decreased from 100° to 74° after modification with material transitioning towards increased hydrophilicity and porosity. The WCA remained more or less similar post-catalysis (77.9°), showing insignificant changes post-catalytic activity (Fig. S5). Optical Profiling of the electrode surface (Fig. S6) revealed that the roughness increases after modification with POP and remains fairly the same post-catalysis, indicating insignificant changes in surface morphology. The sample was further scratched from the working electrode and washed three times with hot ethanol. The collected sample was then subjected to FT-IR analysis (Fig. S7) and FE-SEM (Fig. S8) studies. The result shown in Fig. S7 (FT-IR analysis) demonstrates retention of structure with respect to pristine TDA-Trz-POP. Again, the electron microscopic image from FE-SEM analysis shows an unaltered morphology for the sample. Cumulating all these data suggests a durability and electrochemical stability of our novel TDA-Trz-POP-based electrochemical sensor.

Plausible sensing mechanism of TDA-Trz-POP mediated hg²⁺ detection

The electrochemical selectivity of TDA-Trz-POP for Hg²⁺ stems from its microporous structure, which is rich in heteroatoms and provides both chemical affinity and structural accessibility. The polymer incorporates nitrogen atoms from triazine units and sulphur atoms from thiadiazole rings, both of which are recognized for their ability to coordinate with soft metal ions like Hg²⁺, according to the hard–soft acid–base (HSAB) theory49. When exposed to mercury ions, the open pore network allows diffusion into the matrix, where the ions interact with multiple nitrogen and sulphur sites to form stable coordination complexes. The sulphur–mercury interaction, in particular, is notable for its partial covalent nature, influenced by the high polarizability of Sulphur and the contracted 6s orbital of mercury, which enhances the overall binding affinity as depicted in Fig. 865,66. This interpretation is directly supported by our buffer optimization study (Fig. 4A), where 0.1 M NaCl produced the highest stripping current, consistent with Hg–Cl complex formation in the presence of accessible N/S donor sites, and by the pH-dependent response (Fig. 4B), in which optimal performance under mildly acidic conditions reflects favourable protonation states for Hg2+ coordination. This coordination promotes local enrichment of Hg2+ near the electrode surface and alters the electrochemical interface. From a molecular standpoint, the binding process is thermodynamically driven by the substantial negative free energy associated with Hg2+–S and Hg2+–N coordination, which reduces the activation barrier for adsorption67,68. The conjugated polymer backbone further stabilizes the metal–ligand complex by delocalizing electron density, lowering the overall system energy, and facilitating subsequent electron transfer69.

Fig. 8
figure 8

Illustration of the proposed sensing mechanism of TDA-Trz-POP for Hg²⁺ detection. Hg²⁺ ions diffuse into the porous polymer matrix and coordinate with nitrogen and sulfur atoms via soft–soft interactions, including partial covalent S–Hg²⁺ bonding.

During the pre-concentration step in square wave anodic stripping voltammetry (SWASV), Hg²⁺ is reduced to metallic mercury (Hg0) within the polymer matrix. The BET surface area and pore size distribution (~ 1.15 nm) confirmed that the thiadiazole–triazine-based porous polymer’s hierarchical porosity facilitates rapid Hg2+ diffusion to these active sites, while the selectivity studies (Fig. 5) demonstrated negligible interference from competing cations, supporting preferential Hg2+ binding via soft acid–soft base interactions. Energetically, the porous architecture minimizes diffusional resistance, allowing faster attainment of equilibrium between free and bound Hg²⁺, while the high-affinity coordination sites ensure that desorption during the stripping phase requires higher oxidation potential, yielding sharper and more intense peaks70,71. Nonetheless, the said interaction is followed by a stripping phase, where oxidation of Hg⁰ produces a clear and enhanced peak, aided by efficient electron transfer through the conjugated polymer network72. The amorphous and porous architecture of the material supports effective ion transport and surface interaction, while its flexible framework accommodates mercury ions without significant steric constraints73,74. Overall, the combination of soft donor coordination, strong S–Hg²⁺ binding, and an electroactive, metal-free scaffold contributes to the sensitive detection of trace mercury in complex aqueous environments.

Conclusion

In this study, we report a metal-free, thiadiazole–triazine-based porous organic polymer (TDA-Trz-POP) as a highly effective and environmentally benign platform for the electrochemical sensing of mercury ions in aqueous systems. The polymer’s nitrogen and sulphur-rich architecture provides abundant binding sites for Hg²⁺, enabling sensitive and selective detection through soft-soft Lewis acid–base interactions. When integrated onto planar screen-printed electrodes, the TDA-Trz-POP sensor achieved a detection Limit of 1.5nM (≈0.4 ppb), which is below the World Health Organization’s permissible level for mercury in drinking water. Beyond its high analytical performance, the sensor demonstrated excellent selectivity against common interfering ions, good reproducibility, long-term stability, and successful recovery in real water samples. These attributes collectively underscore the potential of TDA-Trz-POP as a highly potent sensing material for the development of field-deployable sensors for on-site monitoring of drinking water quality, as well as that of aquaculture and natural water bodies. This work advances the growing frontier of sustainable, metal-free sensor technologies and opens up new directions for the designing of heteroatom-engineered porous frameworks tailored for toxic metal ion detection in complex environmental matrices.