A Coumarin-azo Derived Colorimetric Chemosensor for Hg2+ Detection in Organic and Aqueous Media and its Extended Real-world Applications

Pollution caused by the release of toxic heavy metals into the environment by industrial and farming processes has been regarded as a major problem worldwide. This has attracted a great deal of attention into restoration and remediation. Mercury is classified as a toxic heavy metal which has posed significant challenges to public and environmental health. To date, conventional methods for mercury detection rely on expensive, destructive, complex, and highly specialized methods. Evidently, there is a need to develop systems capable of easily identifying and quantifying mercury within the environment. In this way, organic-based colorimetric chemosensors are gaining increasing popularity due to their high sensitivity, selectivity, cost-effectiveness, ease of design, naked-eye, and on-site detection ability. The formation of coumarin-azo derivative AD1 was carried out by a conventional diazotization reaction with coumarin-amine 1c and N,N-dimethylaniline. Sensor AD1 displayed remarkable visual colour change upon mercury addition with appreciable selectivity and sensitivity. The detection limit was calculated as 0.24 µM. Additionally, the reversible nature of AD1 allowed for the construction of an IMPLICATION type logic gate and Molecular Keypad Lock. Chemosensor AD1 displayed further sensing applications in real-world water samples and towards on-site assay methods. Herein, we describe a coumarin-derived chemosensor bearing an azo (N = N) functionality for the colorimetric and quantitative determination of Hg2+ in organic and aqueous media.


Introduction
The pollution caused by the release of toxic heavy metals into the environment by industrial and farming processes has been regarded as a major problem worldwide, especially in third-world countries, which has attracted a great deal of attention into restoration and remediation [1][2][3]. In developing countries, like South Africa, the culmination of poorly maintained waste-water treatment and disposal facilities; and increased agricultural, industrial, and mining activities have all contributed to contamination of soil and water sources [4]. This poses a potential risk to informal households where groundwater and surrounding water bodies are utilized as primary sources of drinking-water. Environmental proliferation of heavy metals into the soil and marine/aquatic ecosystems has been shown to elicit numerous health risk to humans and organisms and also impedes on the overall functioning of the ecosystem [5,6]. Once these heavy metals are released into the environment, they quickly alter the physical, chemical, and biological properties of soil and water bodies [7,8]. When these metals are released into aquatic environments, particles can be absorbed via biogeochemical cycles which can be lethal to surrounding organisms and the overall health of the ecosystem. Furthermore, heavy metals can also accumulate in the sediments of aquatic and marine water bodies. As a result, seaports, river-systems, and industrial coastlines exposed to continuous influx of heavy metals display the greatest amounts of polluted sediments [9,10]. Heavy metals and metalloids are elements possessing an atomic density greater than 4 g/cm 3 ; this includes copper (Cu), cadmium (Cd), zinc (Zn), lead (Pb), mercury (Hg), arsenic (As), silver (Ag), chromium (Cr), iron (Fe) and platinum (Pt) group elements [11].

3
Mercury is classified as a toxic heavy metal which has posed significant challenges to public and environmental health and has caused great concern to the World Health Organization (WHO). These metals are classified as trace metals that are not required by organisms, even at low concentrations [12]. Specifically, Hg 2+ has been ascribed as one of the largest dispensed toxic heavy metals of any foreign species into the environment [13]. Three chemical forms of mercury are shown to exist in the environment, namely elemental, inorganic, and organic mercury [14]. Elemental mercury (Hg 0 ) can be readily released into the atmosphere by conversion to its vapour form owing to its high vapour pressure. This elemental vapour can be oxidized to Hg 2+ , also referred to as inorganic mercury, and removed from the atmosphere by deposition on land and in marine/aquatic ecosystems [15]. Among the three forms of mercury found in the environment, organic mercury, usually methylmercury, is deemed as the most toxic form as a result of efficacy by which it can pass through biological membranes, respiratory, and digestive systems [16,17]. Methylmercury (CH 3 HgX; X = halide) is formed by the biomethylation of inorganic mercury by microorganisms in the environment [18][19][20]. As methylmercury is regarded as non-biodegradable, it readily bioaccumulates in the tissues of animals and plants [21][22][23][24]. Humans are capable of absorbing and accumulating mercury in their tissues through the dietary intake of affected aquatic, agricultural, and livestock products. This accumulation of excessive mercury in the body can result in deafness, headaches, hypertension, neurological disorders, and even irreversible brain damage [25][26][27][28][29]. The WHO has set the maximum permissible contamination level (MCL) of mercury in drinking water at 6 ppb for inorganic and 1 ppb for total mercury [30]. The concentrations, sources, toxicity metrics, and health implications of the most hazardous heavy metals has been extensively outlined in recent literature [31,32]. The WHO determines these values based on the concentrations at which adverse effects can occur over long-term exposure, and the availability of resources to detect and remove contaminants at the levels set [33]. Evidently, there is a need to develop systems capable of easily identifying and quantifying mercury within the environment.
To date, conventional methods for mercury detection rely on expensive, destructive, complex, and highly specialized methods such as inductively coupled plasma mass spectrometry (ICP-MS), atomic absorption spectroscopy (AAS), plasma-atomic emission spectrometry, potentiometry, gas chromatography-mass spectrometry (GC-MS), cold vapor atomic fluorescence spectrometry (CV-AFS), cold vapor atomic absorption spectrometry (CV-AAS), ion-selective electrode (ISE), flame photometry, stripping voltammetry, electrochemical, and fluorescence spectroscopy which are typically used for metal analysis in a laboratory environment [34][35][36]. Owing to the extensive negative effects of toxic heavy metal ions on human health, hassle-free, real-time, reliable, highly selective, and sensitive chemosensors are urgently needed for early pollution warnings and the protection of human health.
In this way, organic-based chromogenic/colorimetric chemosensors are gaining increasing popularity due to their high sensitivity, selectivity, cost-effectiveness, ease of design, naked-eye, and on-site detection ability [37,38]. Chromogenic sensors are generally consisting of two parts, a receptor site used for binding of specific analytes and a signalling unit which produce chemical information upon host-guest interaction either in the form of a nakedeye colour change or by an absorption response [39]. An effective colorimetric sensor is one capable of responding to specific analytes and converting this interaction into an easily detectable signal. Coumarin and its derivatives are a class of heterocyclic compounds that have attracted attention in sensor design due to their excellent optical, structural, and biological properties [40][41][42]. Furthermore, they form a segment of chromogenic compounds owing to their transformable photophysical properties in the visible region [43]. Coumarin-based azo compounds bearing an N = N functionality form a segment of ligands with donor atoms (N and O) capable of coordinating with various metal ions which can be used for the fabrication of colorimetric probes [44]. Azo-dyes are coloured organic compounds that have displayed favourable characteristics such as excellent absorption and emission properties, molar absorption coefficient, solvatochromism, and can undergo photochemical and thermal isomerization [45]. The incorporation of the azo-functionality to the coumarin heterocycle is responsible for the colour production in the visible region forming the coumarin-azo chromophore [46,47]. Additionally, compounds incorporating the azo-functionality have shown potential applications and involvement within the field of pharmaceuticals, non-linear optics, optical data storage devices, dye-sensitized solar cells, photoswitching devices and metal sensing strategies due to structural adaptability that offers multiple proficient coordination sites [48][49][50][51][52]. Literature has reported that the introduction of the azofunctionality to an aromatic heterocyclic structure enhances the chromogenic capabilities of the resultant chemosensor [53,54]. Hence, in light of the importance of colorimetric azo-dyes towards analyte recognition, herein we report a novel coumarin-based sensor labelled AD1 bearing an azo-functionality for the sensitive, selective, and naked-eye colorimetric determination of Hg 2+ in CH 3 CN. Additionally, AD1 exhibited extended optical and environmental applications such as the construction of logic mimicking devices, molecular keypad locks, on-site assay kits, and real-world water analysis.

Instruments and Materials
All chemicals and solvents were purchased from commercial sources and used without further purification unless stated otherwise. The stock solution of coumarin-azo derivative AD1 was prepared by dissolving the compound in methanol and diluting it to the desired concentration (0.001 M). The metal cation stock solutions used were prepared in deionized water from their nitrate salts to a concentration of 0.01 M and diluted further as warranted. The starting compound, ethyl-coumarin-3-carboxylate 1a was synthesized according to literature procedure [55]. Intermediates 1b-d were synthesized by known organic methods. The formation of the coumarin-azo product AD1 was prepared by following previously reported methods. The reactions were continuously monitored by TLC on pre-coated silica gel 60 F254 aluminium sheets (0.063-0.2 mm/70-230 mesh) plates. Compounds were detected by observation under UV light or exposed to iodine vapour. The nuclear magnetic resonance spectra ( 1 H NMR, 13 C NMR) were recorded on a Bruker Advance DPX 400 (400 MHz) spectrometer in CDCl 3, d 6 -DMSO, and CD 3 CN with tetramethylsilane (TMS) as internal reference at room temperature. Coupling constants (J) are given in Hz, whilst chemical shifts are expressed in parts per million (ppm). Infrared FT-IR spectra were recorded on a Bruker TENSOR 27 spectrometer. Column chromatography was performed using silica gel (particle size 0.040-0.063 mm). Single crystal X-ray diffraction analyses were performed at 200 K using a Bruker Kappa Apex II diffractometer with monochromated Mo Kα radiation (λ = 0.71073 Å). APEX2 software was used for data collection and SAINT for cell refinement and data reduction. Data was corrected for absorption effects using the numerical method implemented in SADABS. The structures were solved using SHELXT-2018/2 using a dual-space algorithm and refined by least-squares procedures using SHELXL-2018/3 with SHELXLE as a graphical interface. The absorbance spectra were recorded at room temperature using a Shimadzu UV-3100 spectrophotometer and processes by UV Probe v2.42 software. Molecular Modelling studies were carried out using the Spartan Student v8, Version 8.0.6, Oct 8, 2020, software package. Conformer distribution was done at the MMFF level whereby the different conformers and coordination complexes were obtained. Further geometry optimization was conducted using Semi-empirical methods at PM3 level. All calculations were done in the gas phase.

Synthesis Route
Scheme 1 outlines the general synthetic procedure of derivatives 1a-d and azo-derivative AD1 (For the 1 H NMR, 13 C NMR, and FT-IR of reagents 1a-c and azo-product AD1, see Supplementary Information Figs. S1-S12).

Synthesis of Nitrated Coumarin-Derivative 1b
Coumarin-ester derivative 1a (4.6 mmol) was added in portions to a cold solution of NaNO 3 (23 mmol) in HCl (30 mL) with stirring. The mixture was stirred at 0 °C for 2 h, after which it was poured into ice water and the resulting precipitate filtered and dried to afford 6-nitro-3-ester coumarin derivative 1b as a white solid (0.98 g, 3.7 mmol, 82%). 1

Synthesis of Coumarin-amine Derivative 1c
Nitrated coumarin derivative 1b (1.52 mmol) was added to a solution of Fe-powder (1.52 mmol) in HOAc/H 2 O (30 mL/20 mL) and was left to stir at room temperature for 24 h. The resulting mixture was filtered through celite to remove any residual Fe-powder. The filtrate was separated with ethyl acetate (3 × 50 mL) and washed with deionized water (3 × 20 mL). The organic layers were combined, dried over anhydrous Na 2 SO 4 , and the solvent removed under vacuum. The solid was recrystallized by minimal DCM and ether to afford the product 1c as an orange/brown solid (0.25 g, 1.07 mmol, 71%). 1

Synthesis of Coumarin-azo Derivative AD1
The reaction mixture containing diazonium derivative 1d was added dropwise to a cold solution of N,N-Dimethylaniline (4.3 mmol) in 20 mL by volume EtOH:H 2 O mixture and left to stir at 0 °C for 2 h. The pH of the reaction mixture was adjusted using an ammonia solution to pH 5.5. A precipitate formed which was separated from the reaction by means of filtration. The crude product was monitored by TLC and subsequently purified by column chromatography using hexane:ethyl acetate (80:20) as eluent to afford the pure product as a bright orange solid (0,2108 g, 0.17 mmol, 32%). 1

Synthesis of AD1-Hg 2+ Solid Complex
Mercuric acetate (1.6 mmol) in ethanol-water (9:1) (10 mL) mixture was added to a solution of the azo-compound AD1 (0.6 g; 1.6 mmol) in acetonitrile (20 mL). The resulting mixture was refluxed under stirring for 2 h whereupon the complex precipitated from solution as a dark-red solid. The resulting precipitates were filtered, washed with ethanol and Et 2 O, and dried in the oven at 45 °C.

Spectroscopic Measurements
All stock solutions of the metals were prepared separately in deionized water to the concentration of 1.0 × 10 -2 M from their nitrate salts and diluted accordingly. The stock solution of azo-dye AD1 was prepared in methanol having a concentration of 1.0 × 10 -3 M. Metal screening studies were conducted by adding 0.2 µM aliquots of the metal solution to 4 × 10 -8 M of AD1 in acetonitrile. The metal selectivity study was performed by the addition of 0.2 µM aliquots of Hg 2+ and the competing metal cation to a glass optical cell of 1 cm optical pathlength in acetonitrile to which 4 × 10 -8 M of AD1 was added and the spectral response observed by UV analysis. The absorbance values were measured from 260 to 700 nm at room temperature. Titration experiments were conducted by addition of successive equivalence of a 1 × 10 -3 M Hg 2+ solution through an autopipette to a 2 ml (20 µM) solution of AD1 in acetonitrile and the absorbance spectra recorded. All spectroscopic measurements were undertaken in triplicate and the results averaged.

Determination of Detection Limit (LOD)
The detection limit of chemosensor AD1 towards Hg 2+ was evaluated based on the UV-Vis titration experiments calculated according to the following Eq. 1: where, σ = the standard deviation and m = the slope obtained from the linear calibration curve between A 0 /A and concentration of Hg 2+ [56,57]. The regression curve equation was subsequently reached for the low concentration region of the plot.

Determination of Binding Stoichiometry by Job's Plot Method
The binding stoichiometry of chemosensor AD1 was determined by Job's plot analysis by UV-Vis absorption spectrometry [58]. In this experiment, the total molar concentration is kept constant whilst varying the mole ratio of both analyte and chemosensor. A series of ratios of both analyte and sensor from 0.1-1.0 in increments of 0.1 were prepared with a constant total molar concentration (20 µM). A twominute time delay between addition and spectral processing was employed. The mole fraction of the analyte was plotted against the absorbance value obtained. The maximum absorbance value of the plot indicates the stoichiometric ratio upon which analyte/sensor binding occurs.

Calculation of Association Constant by Benesi-hildebrand Analysis
The association constant of chemosensor AD1 towards Hg 2+ was calculated according to the Benesi-Hildebrand Eq. 2 (B-H): where A 0 and A are the absorption values of the chemosensor in the absence and presence of the analyte respectively. A max is the absorbance value obtained with an excess amount of analyte. [Hg 2+ ] is the concentration of analyte added during the titration whilst n represents the stoichiometric ratio. K represents the association constant whose value (M −1 ) is obtained from the ratio of the intercept/slope of the linear regression obtained by plotting 1/(A 0 -A) vs 1/[Hg 2+ ].

Computational Analysis
Molecular modelling studies were carried out using the Spartan Student v8, Version 8.0.6, Oct 8, 2020, software package. Conformer distribution was done at the MMFF level whereby the different conformers and coordination complexes were obtained. Further Geometry optimization was done using Semi-empirical methods at the PM3 level. All calculations were done in the gas phase. The HOMO and LUMO energies were calculated at the PM3 level with an IsoValue of 0.032 √(e/au 3 ). The AD1-Hg 2+ complex was determined using the conformer distribution calculation, at MMFF level, whereupon the equilibrium geometry was obtained at the PM3 level. The counter ion, NO 3 − , was used to stabilize the complex.

H & 13 C NMR Complexation Analysis
For the 1 H NMR titration analysis of AD1, the chemosensor was prepared in CD 3 CN and the Hg 2+ solution was prepared from Hg(NO 3 ) 2 in deionized water. Different aliquots of the Hg 2+ solution was added directly into the NMR tube containing AD1. The spectra were run with background water suppression. The 13 C NMR analysis of the AD1-Hg 2+ complexation was evaluated from the single NMR tube containing the highest [Hg 2+ ] from the previous 1 H NMR titration analysis. (2)

Synthesis and Characterization of Azo-compound AD1
Coumarin-azo derivative AD1 was synthesized by a fourstep reaction procedure following reported literature [59][60][61][62]. The formation of coumarin-azo derivative AD1 was elucidated by, 1 H NMR, 13 C NMR, FT-IR, and verified by single-crystal XRD analysis (Figs. S4, S8, S12 and S13). The spectroscopic analyses were consistent with the indicated structure. The single-crystal XRD structure gives definitive proof that the desired product was successfully synthesized. Additionally, the characteristic N = N vibration is proposed between 1250-1550 cm −1 in the FT-IR spectra [63,64]. The azo-bond may not always be clearly identifiable due to overlapping with characteristic aromatic bands [65].

Spectral, Visible, and Molecular Orbital Response of AD1 Towards Hg 2+
The metal screening studies of colorimetric sensor AD1 were carried out in acetonitrile at room temperature. The metal cations chosen for screening included Hg 2+ , Ag + , Fe 3+ , Pb 2+ , Cd 2+ , Cu 2+ , Ba 2+ , Zn 2+ , Ca 2+ , Co 2+ , Cr 2+ , Al 3+ , K + , Ni 2+ , and Na + . The UV-Vis spectral and "naked-eye" colorimetric observations of the metal screening studies of AD1 in acetonitrile is shown in Fig. 1. The absorbance spectral results displayed the characteristic azo-derived absorption band from 340 to 540 nm with A max set at 422 nm. This could be attributed to the intramolecular charge transfer (ICT) of the azo skeleton (π-π* and/or n-π*) electronic transitions [45,66]. Notably, after the immediate addition of Hg 2+ to AD1, a striking colour change from yellow to red; and a new charge transfer band with A max of 520 nm was observed. The newly generated absorbance peak is indicative of the AD1-Hg 2+ complex formation. The large bathochromic shift gives rise to the visible colour change upon Hg 2+ complexation. This redshift is necessary for selective colorimetric "naked-eye" response systems [67]. This rapid, notable spectral shift was not observed for other cations under analogous conditions. Although the remaining cations did induce a weak colorimetric response, except for Cu 2+ which induced a decrease in colour intensity which was also observed in the absorption spectra. However, the change is not as striking as that seen with Hg 2+ . This standalone colour and bathochromic shift for Hg 2+ is indication of the affinity of chemosensor AD1 towards Hg 2+ cations [56,67]. Timedependent absorbance fluctuation studies show the rapid response upon Hg 2+ addition (Fig. S14). It could be found that the absorbance of AD1 decreased rapidly and reached steady-state, at 422 and 520 nm, within the first minute interval. The result is consistent with the swift naked-eye response and displays the sensing efficiency and affinity of the chosen chemosensor towards Hg 2+ sensing strategies. The proposed selectivity of AD1 towards Hg 2+ was verified by competition studies.Compound AD1 contains a strong push-pull π-conjugated electronic system with the coumarin moiety postulated as the acceptor (pull) species and the N,N-dimethylaniline derivative as the donor (push) species. The chemosensor was thought to exhibit strong ICT characteristics with a prominent colour change due to the large extent of π-conjugation of the donor-πacceptor (D-π-A) system. This arrangement is a poignant property for effective ICT [68]. It is proposed that the coordination between AD1 and Hg 2+ could enhance the π-delocalization, thereby reducing the energy of the π-π * transitions accounting for the new observable absorption band and visible colour change [54]. This visible red-shift in absorbance wavelength is proposed to be due to analyte interaction with the acceptor unit in the D-π-A conjugated system. Upon complexation, the electron withdrawing character of the acceptor unit increases, leading to a redshift in the absorbance spectrum [69][70][71]. Had complexation occurred on the N,N-dimethylaniline substituent, a blue-shift in absorbance wavelength would occur. The proposed ICT mechanism for AD1-Hg 2+ complexation is shown in Fig. 2.
Moreover, calculated HOMO and LUMO energies of AD1 and the AD1-Hg 2+ complex confirmed the spectral shift and resulting colour change. In an ICT mechanism, red-shift occurs when the energies of the HOMO and LUMO of the resulting sensor-analyte complex are lower in energy relative to that of free chemosensor The HOMO and LUMO energy diagram of AD1 and AD1-Hg 2+ complexation and calculated orbital energies are shown in Fig. 3. Evidently, the HOMO of AD1 resides on the substituted N,Ndimethylaniline and azo-group (donor species) whilst the LUMO resides around the coumarin moiety and carbonyl of the 3-substituted ester functionality. Therefore, the ICT from the N,N-dimethyl to the coumarin moiety is highly feasible. Upon complexation with the carbonyl groups of the coumarin and ester functionalities, an overall decrease in the orbital energies occurs, facilitating the strong spectral shift and rapid, naked-eye colour change upon Hg 2+ complexation. Calculations were conducted once the most energetically preferred conformer of AD1 was calculated (Fig. S15).

Selectivity Studies
Owing to the unique bathochromic shift and visible colour change of AD1 upon Hg 2+ complexation, selectivity studies with competing cations in acetonitrile were conducted. The effects of the competing cations (10 equiv.) on the interaction of AD1-Hg 2+ complexation is shown in Fig. 4. The UV-Vis spectra revealed that the presence of competing cations had Fig. 1 a UV-Vis absorption characteristics of AD1 (24 µM) after the addition of 10 equiv. of different cations in CH 3 CN b unique colorimetric response of AD1 (16 µM) with Hg 2+ c comparative colorimetric response upon cation addition to AD1. All three studies are conducted in acetonitrile at the original pH of the solvent little effect on the absorbance intensity of Hg 2+ at 520 nm. Moreover, complexation of AD1 with Hg 2+ remained reasonably unperturbed when all competing cations were present in solution. The competition between Hg 2+ with competing cations displayed the characteristic red/pink colour of AD1 with Hg 2+ alone. Furthermore, AD1 displayed remarkable selectivity towards Hg 2+ post competing metal complexation, whereby the colour induced upon initial competing metal complexation changed to the characteristic pink/red colour when 1 equivalence of Hg 2+ was added. Sensor AD1 displays promising chemosensing application towards mercuric cations. The selectivity studies were also performed in aqueous solution which indicated the same selectivity towards Hg 2+ in the presence of competing metal cations (Fig. S16).

Titration Studies
UV-Vis spectrophotometric titration experiments were carried out with the sequential addition of analyte. As illustrated in Fig. 5, upon the incremental addition of Hg 2+ (0.98-98 µM) to the solution of AD1 (10 µM), a new absorption band appeared at 520 nm. Conversely, the absorption band at 422 nm subsequently decreased upon Hg 2+ addition, forming a clear isosbestic point at 470 nm. This isosbestic point characterizes the appearance of the new AD1-Hg 2+ complex as a single, stable coordination species [39].

Binding Stoichiometry, Association Constant, and Detection Limit (LOD)
Job's plot analysis was applied to determine the binding stoichiometry of the AD1-Hg 2+ adduct. For this experiment, the total molar concentration for AD1 and Hg 2+ was fixed at 16 µM in acetonitrile. Variation in the absorbance value at 422 nm was used for plotting the Job's plot of absorbance versus mole fraction of Hg 2+ (Fig. 6a). The highest absorbance was observed at 0.5 mol fraction Hg 2+ , a clear indication of 1:1 biding stoichiometry. The association constant (K a ) was calculated by means of the Benesi-Hildebrand (BH) equation (Eq. 2) (Fig. 6b). The plot of 1/(A 0 -A) vs 1/ [Hg 2+ ] resulted in a linear relationship with an R 2 value of 0.99. The linear relationship of the BH plot supports the 1:1 stoichiometric binding ratio as seen from Job's plot analysis [72]. The value for the association constant was determined by the ratio of the intercept to the slope of the double reciprocal plot [73]. The association constant was calculated to be 8.9 × 10 4 M −1 . The appreciable value for the association constant supports the strong binding affinity observed between AD1 and Hg 2+ . The sensitivity of the recognition process is an important characteristic for successful analyte detection systems. This is quantified as the detection limit (DL) or limit of detection (LOD) which refers to the lowest concentration of analyte a system can accurately detect. Thus, the lower the limit of detection, the better the sensor. Herein, the detection limit was calculated in accordance with Eq. 1 and determined to be 2.4 × 10 -7 M or 0.24 µM. This detection limit is lower than what is stipulated as an acceptable level of mercury in drinking water as reported by the WHO and U.S. EPA [30,74,75].

Reversibility of AD1 Towards Hg 2+
The ability of a chemosensor to bind reversibly with a selected analyte is an important feature for practical applications. The reversibility of the AD1-Hg 2+ complex was elucidated by UV-Vis analysis in acetonitrile at room temperature. Experiments were conducted by adding a single aliquot of Hg 2+ and monitoring the absorbance response. Upon sensor-metal complexation, hexadentate chelating ligand EDTA was sequentially added to the solution of AD1 with Hg 2+ and the absorbance response monitored. Figure 7a shows the reversible absorbance response of AD1 upon EDTA titration. Evidently, the complexation of AD1 with Hg 2+ displayed appreciable reversibility. The reversible nature of the complexation was characterised by the increase in the optical density at 422 nm. Upon EDTA addition, abstraction of the Hg 2+ cation from the coumarin and ester carbonyl binding sites occurs, resulting in the increase in electron density of the N,N-dimethylaniline derivative which facilitates the ICT process. Furthermore, upon sequential addition of EDTA to the sensor-metal complex, a colour change from red to yellow was observed (Fig. 7b). This could be repeated for several cycles with high absorbance efficiency and repeated colour changes between red and the original yellow of AD1 (Fig. 7c). The result exhibited the visible and measurable reversibility of sensor AD1 towards the recognition of Hg 2+ . The cyclic reversibility of the chemosensor towards Hg 2+ suggested usability towards molecular mimicking devices.

pH Studies
The influence of pH on sensor-mercury cation binding was conducted by measuring the absorbance intensity at 520 nm before and after Hg 2+ addition. Different solutions with pH ranging from 2-14 in water were used for analysis. Figure 8 shows the effect of pH on the absorbance intensity of AD1 before and after Hg 2+ addition. Evidently, the solvent medium and pH of the solution effects the absorbance response of the sensor upon the introduction of the Hg 2+ cations. Solutions for analysis were prepared in water whilst spectroscopic and sensing properties were evaluated in acetonitrile at the original pH. Acetonitrile is a polar aprotic solvent; therefore, the likelihood of free-floating protons is improbable and are unlikely to affect the sensing and absorbance response. Conversely, water is a polar protic solvent which could cause the sensing and binding discrepancies seen between AD1 and Hg 2+ .

Complexation Site of AD1 with Hg 2+
The complexation site was determined experimentally by 1 H NMR, 13 C NMR, and FT-IR spectral analysis, and verified by Molecular Modelling studies. To better understand the mechanism of the interaction between the sensor and analyte, 1 H NMR titration studies of AD1 with gradual addition of Hg 2+ in deuterated acetonitrile is shown in Fig. 9. Before addition, the free-sensor showed two signals assigned to the protons from the two methyl groups (H a ) and two adjacent protons of aromatic ring (H b ) of the N,N-dimethylaniline substituent at 3.1 and 6.84 ppm respectively. After The 13 C NMR titration analysis of AD1 with Hg 2+ supports the complexation of Hg 2+ with the substituted ester and coumarin carbonyl, and the nitrate counterion with the N,N-dimethylaniline substituent (Fig. 10). The analysis was conducted after 16 µL of the Hg(NO 3 ) 2 solution was added in the 1 H NMR titration. Upon complexation, a minor shift in most of the peak signals was observed, however, four signals related to carbon atoms on the coumarin, and tertiary aniline derivatives displayed notable shifts.
The signals relating to the aniline methyl groups in AD1 are observed as a single peak at 40 ppm. Upon coordination with NO 3 − , a downfield shift to 48 ppm is observed. This deshielding of these respective methyl signals may be attributed to the hydrogen-bonding between the nitrate-oxygen and the methyl-proton atoms, thus withdrawing electron density from these carbon atoms. Conversely, the carbon signal related to the C-N bond observed at 154 ppm has experienced an upfield shift to 133 pm. This indicates a migration in electron density towards this carbon atom, facilitating this observed shielding. Electron density is postulated to be drawn away from the two neighbouring hydrogen atoms, resulting in the observable shift and decrease in resolution seen in the 1 H NMR titration experiments. The two signals for the azo C-N connectivity from the coumarin scaffold and substituted aniline derivative are observed at 150 and 148 ppm respectively. Upon complexation, both signals appear to merge into a singular peak at 149 ppm. Had complexation of Hg 2+ occurred on the azo N = N bond, a greater shift in these respective signals would be expected. The involvement of the carbonyl functionalities towards Hg 2+ complexation was observed by the deshielding and subsequent shift in both peak values from 157 and 163 ppm to 163 and 174 ppm respectively. The comparatively small shift in ppm value suggests that coordination with Hg 2+ is assisted by solvent and water molecules. The observed deshielding is indicative of the shift in electron density from the carbonyl oxygen atoms to the Hg 2+ orbitals. It is postulated that the lone pair of electrons on the oxygen atoms are involved in coordination, resulting in a less noticeable shift than donation from the C = O π-bond.
FT-IR spectral analysis of the solid AD1-Hg 2+ complex confirmed the involvement of the carbonyl functionalities towards Hg 2+ complexation, and the coordination of NO 3 − with the N,N-dimethylaniline substituent (Fig. 11). Furthermore, the FT-IR showed evidence of a tautomeric form of AD1 by which the C-N connection of the dimethylaniline derivative can isomerize between a single-and double-bond via the lone electron pair on the nitrogen atom. As a result, the % transmittance of the signal pertaining to the C = N tautomer decreases drastically upon NO 3 − addition due to the involvement of the nitrogen lone pair towards coordination. In AD1, the signals at 1740 and 1694 cm −1 are due to the C = O vibrations. The tautomeric C = N vibration of the dimethylaniline derivative is observed at 1599 cm −1 . The azo N = N stretching is assigned at 1355 cm −1 whilst the C-N vibrations of the azo nitrogen connectivity to the coumarin and aniline derivatives, and the C-N vibration from the aniline derivative is registered at 1235 cm −1 . Upon complexation, the signals pertaining to the C = O and C = N functionalities showed a drastic reduction in % transmittance. This suggests analyte coordination which greatly prohibits characteristic bond vibrations by "locking" atoms and functionalities in place and preventing tautomerism in the aniline derivative. The two new absorbance bands between 3000-3500 cm −1 and 1000-1500 cm −1 are suggested to arise due to the absorption of water, acetonitrile, and nitrate onto AD1 [76]. Additionally, the new signal observed at 522 cm −1 is indicative of metal-oxygen ν(M-O) interactions [44,77,78].
Computational analysis confirmed the proposed binding site of Hg 2+ and the NO 3 − counterion with AD1.  Calculations of the most preferred binding site agree with what has been shown in the NMR and FT-IR experiments. The most preferred binding site of both ions are shown in Fig. 12. The most energetically preferred conformer of Hg 2+ complexation involves the coumarin and ester carbonyl oxygen atoms; with complexation supported by nitrate and solvent molecules. The binding of NO 3 − with the dimethylaniline substituent was confirmed, accounting for the observable changes in the 1 H & 13 C NMR and FT-IR spectral analysis.

Molecular Logic Gate Based on the Reversible Nature of AD1
Processing input signals by logic gates is one of the focal points in information technology. In recent years, an expanding number of exploratory efforts have been invested to the development of molecular logic gates owing to their practicality [38]. Molecular logic gates are molecules able to execute logical responses by receiving one or more physical or chemical input signals and yielding a singular output. Such input and output responses may include chemical processes, such as ionic recognition and with output signals based on spectral response [39]. The cyclic reversible nature of AD1 to Hg 2+ upon sequential additions of EDTA illustrates the digital action of the sensor and thus it was applied towards a Boolean function molecular logic gate. The two chemical inputs, "input 1" (Hg 2+ ), and "input 2" (EDTA) were defined as binary '1' and '0' states representing their presence and absence, respectively. The appearance and disappearance of the absorbance peak at 422 nm was considered as "output" for the logic gate and assigned as binary states '1' and '0' respectively. AD1 exhibited a UV-Vis absorption peak at 422 nm thus the output is designated as '1'. After the addition of Hg 2+ (input 1 = 1; input 2 = 0) the absorbance decreased to the final absorbance value (output = 0). However, upon the introduction of EDTA to the sensor-analyte complex, the absorbance increased to its initial intensity. Considering the other input combinations ((0,0), (0,1), and (1,1)), the output is equal to '1'. This established a clear "on-off-on" input/output spectral response of AD1 in the presence and absence of Hg 2+ and EDTA imitates the IMPLICATION type logic gate at the molecular level. In other words, the Boolean function provides and output of '1' in all situations, except for the case where one input is '1' (described here as Hg 2+ ). The proposed logic circuit together with the truth table is shown in Fig. 13.

Molecular Keypad Lock
The molecular or chemical computing keypad lock systems have been utilized as a modern strategy for information security and data-restriction applications [29,79]. In the present work, the proposed molecular model was used to construct a sequence-dependent molecular keypad lock based on the appreciable selectivity and reversibility of AD1 with Hg 2+ and EDTA. Herein, AD1, Hg 2+ , and EDTA are introduced as the three chemical inputs (labelled A, H, and E respectively). The six possible ordered input combinations are AHE, AEH, HAE, HEA, EAH, and EHA. The specific ordered combination of chemical compounds that can produce the same absorbance response at 422 nm of AD1 in the absence of Hg 2+ is able to "unlock" the system, much like a combination lock. The combination 'AHE' produced the identical absorbance response compared to that of AD1 alone, whereas contrasting output was unveiled for the remaining five combination inputs (Fig. 14). Although other input signals attain an absorbance intensity in reach of AD1 alone, they do not achieve the correct "turn-on" absorbance response able to "unlock" the system.

On-site Assay Studies
Portable sensing methods for mercury detection and/or quantification warrants detection technologies that can be easily interpreted and manipulated by inexperienced personnel and general population. Given the many ways in which information can be related, optical readouts are among the easiest to interpret. Accordingly, detection based on a nakedeye colorimetric responses using inexpensive and disposable paper substrates are an attractive alternative to conventional analyte detection methods [80]. Cellulose, a large constituent of paper, contains numerous hydroxyl and carboxyl groups; thus, the surface of commonly used filter papers contains negatively charged adsorption sites. Therefore, they exhibit sorption potential for heavy metals [81]. However, there is a clear technological advantage of the laboratory environment over on-site assay methods, however, they are usually hefty and non-portable. Therefore, techniques which are bound to the laboratory environment are at a disadvantage if to consider environmental monitoring and widespread on-line and on-site sensing. To investigate the practical capabilities of AD1 towards on-site naked-eye Hg 2+ determination, a cellulose paper-strip method has been applied. To do this, strips of Whatman filter paper is exposed to a solution of AD1 (0.001 M) and then dried in air. A constant aliquot of different molar concentrations of Hg 2+ (ranging from 3.7-37 µM) was added sequentially to individual test-strips.  The prepared paper strips were orange in the absence of Hg 2+ . Upon Hg 2+ addition, visible naked-eye colour change from orange to pink was observed. The intensity of the colour increased as the concentration of the Hg 2+ solution used increased. A visible colour change was observed from an Hg 2+ concentration as low as 3.7 µM. Therefore, this solidand liquid-state sensing method offers simpler, cost-effective methods for naked-eye on-site detection of Hg 2+ (Fig. 15).

Quantitative Determination of Hg 2+ in Real-world Water Samples
The reliability and practical applicability of AD1 was studied by collecting various water samples from different areas of the 'Swartkops' river system in the Eastern Cape Province of South Africa. Samples were collected from three different sites in the system, namely the upper, middle, and estuary (mouth) (Fig. S17). The system is bordered by different residential suburbs, one of which is an informal settlement named Motherwell. Additionally, the river flows adjacent to numerous industrial sites and wastewater treatment works (WWTW's) located further upstream from where sampling occurred. The introduction of competing cations, anions, and pollutants by anthropogenic and industrial activities into the water system has been investigated for many years. Poorly maintained WWTW's, polluted stormwater runoff and solid waste have all contributed to the deterioration in the water quality of the Swartkops river and estuary. It has been reported that elevated levels of heavy metals in the sediment can be a good indication of anthropogenic activities. Studies have found concentrations of chromium, lead, zinc, titanium, manganese, strontium, copper, iron, and tin in the sediments of the Swartkops. Results indicated that the highest heavy metal concentrations (in both the river and mouth) were recorded where the runoff from the surrounding informal settlements and industrial sites entered the system [82,83]. The 'Motherwell Canal', which runs into the river, has been identified as a major source of nitrogen (particularly as NH 4 + ). The river has also been found to contain phosphorus, with excessive inputs from the cumulative effect of three wastewater treatment plants upstream [84].
Spike and recovery method was used to evaluate the concentration of Hg 2+ in these three water samples. To conduct this experiment, a standard curve was calculated by spiking the solution of AD1 with Hg 2+ (0.94-7.5 µM) and measuring the resulting optical density. Absorbance values were determined in a 50:50 mixture (by volume) of CH 3 CN:H 2 O. The suspended and insoluble particles were removed from the collected samples by means of a syringefilter. To ensure a steady-state system, 50:50 (by volume) of the environmental water sample and acetonitrile was used for the recovery experiments. Increasing concentrations of Hg 2+ were added to the samples and the resulting absorbance intensity recorded. For each location (A, B, C) from which samples were collected, three duplicate spike and recover analyses were tested under analogous conditions. The real water sample analysis data is shown in Table 1. The calculated recovery for the known amount of Hg 2+ added was between 98-100%. Results indicate that AD1 shows remarkable selectivity towards Hg 2+ regardless of the presence of competing cations, anions, and soluble pollutants described above. Furthermore, the increase in salinity from upstream location 'A' to mouth location 'C' had little to no effect on the sensing capabilities and selectivity of AD1 towards Hg 2+ . Henceforth, chemosensor AD1 shows promising applications for mercury determination in real-world samples. Fig. 15 Photograph of the test strips and solutions of AD1 upon addition of increasing concentration of Hg 2+ . Solutions in acetonitrile

Conclusions
(E)-ethyl-6-((4-(diethylamino)phenyl)diazinyl)-2-oxo-2H-chromene-3-carboxylate (AD1), was synthesized and utilized as a colorimetric sensor for the selective and sensitive determination of Hg 2+ in aqueous and organic solvent systems. The colorimetric sensing properties of AD1 towards Hg 2+ was visually characterized by UV-Vis spectrophotometry in acetonitrile. The sensor showed a visible naked-eye colorimetric response upon Hg 2+ addition from yellow to red with an accompanying red-shift in the absorbance spectra from 422 to 520 nm. This spectral shift was due to the complexation of Hg 2+ to the coumarin-and ester-carbonyl functionalities, resulting in an ICT induced shift in wavelength. The binding mechanism between the sensor and mercury cation was elucidated by 1 H & 13 C NMR and FT-IR analysis and supported by Molecular Modelling studies. Experimental outcomes demonstrate a high selectivity towards Hg 2+ in the presence of competing cations and a 1:1 binding stoichiometry between AD1 and Hg 2+ with an accompanying low detection limit. Furthermore, chemosensor AD1 demonstrated a reversible switching process with Hg 2+ and EDTA which could be conducted for multiple cycles. Finally, based on these experimental results, it has been shown that coumarin-azobased colorimetric chemosensor AD1 can be used for logic mimicking devices and environmental monitoring projects. The molecular logic and keypad lock applications, nakedeye cellulose-strips, together with the real-world water Hg 2+ determination was demonstrated as additional functions towards the chemosensors utilization.

Author Contributions
All authors contributed to the study conception and design. Material preparation, data collection and analysis were performed by Aidan Battison and Stiaan Schoeman. Neliswa Mama contributed reagents and analysis tools. The first draft of the manuscript was written by Aidan Battison. All authors read and approved the final manuscript.
Funding This work was supported by Nelson Mandela University.

Availability of Data and Material
All data generated or analyzed during this study are included in this published article (and its supplementary information files).

Declarations
Ethics Approval Not applicable.

Conflicts of Interest/Competing Interest
The authors declare they have no competing interests. AB has received research support from The Council for Scientific and Industrial Research (CSIR).