Introduction

Chemosensors are defined as molecules that change their absorption or emission properties upon interacting with other molecules [1,2,3,4,5]. Due to their low cost, high sensitivity, and environmental friendliness, chemosensors have attracted considerable attention [6,7,8,9,10,11,12]. The structure of the chemosensor has two parts a chromophore/fluorophore and a suitable receptor to select the analyte [13, 14]. Proton-sensitive chromophores have been extensively studied for various applications, among them pH sensing. The protonation/deprotonation of the pH indicator chromophore is the primary process responsible for pH sensing [15, 16]. They are extensively used in biological processes as well as for the determination of dye photostability [17,18,19,20]. Furthermore, hydroxide is widely used in several industrial processes; however, its detection is challenging because of the instability of the glass of the pH electrodes at high concentrations [21, 22]. Thus, there is a necessity of developing new detection methods such as chemosensors [23,24,25].

Recently, azo dyes have found applications in several fields such as pharmacy and biology [26], high-tech applications such as lasers and nonlinear optical systems [27], thermal transfer printers, and fuel cells [28]. Besides, azo dyes display physicochemical stability and optical properties that make them appealing for applications in numerous areas [29, 30]. The most studied are color analysis, tautomerism, indicator, and acid–base equilibrium [31,32,33,34].

Moreover, the dyes bearing a coumarin moiety substituted at 7-position with a diethylamino are extensively researched as chemosensors, laser dyes, nonlinear optical materials (NLO), and luminophores for organic light-emitting diodes (OLED) [15, 35,36,37,38]. The coumarin containing an electron-donor group at 7-position exhibits a redshift of the maximum absorption due to the intramolecular charge transfer (ICT) from the alkylamino group to lactone carbonyl [39]. When the 3-position of coumarin contains an acceptor group, the bathochromic shift is detected, and by varying this group, a diversity of chemosensors exhibiting different photophysical properties can be obtained [34, 40, 41].

This study aims to develop visual chemosensors capable of pH and hydroxide sensing by synthesizing two novel coumarin-based azo dyes derivatives by coupling 2-amino-4-(7-(diethylamino)-2-oxo-2H-chromen-3-yl)thiophene-3-carbonitrile 3 and 2-Aminothiazole derivatives. The obtained compounds were characterized by FT-IR, 1H/13C NMR, and HRMS techniques. The influence of different solvents with variable polarity on absorption spectra of the dyes was studied. The sensitivity of dyes to acidic and basic media in organic and aqueous solutions was investigated by UV–Vis spectroscopy. Moreover, colorimetric changes were determined. The ability to reuse the chemosensors was also studied via a reversibility test. Finally, the effect of pH on the absorbance of the obtained chemosensors was investigated. The density functional theory (DFT) and time-dependent DFT (TD-DFT) calculations were used to support and gain more information about the suggested deprotonation and protonation mechanisms. The thermal stability of the dyes was determined by TGA analysis.

Experimental

Materials and instrumentation

4-(N,N-diethylamino)salicylaldehyde, ethyl acetoacetate, malononitrile, elemental sulfur, 2-Amino-5-methylthiazole, ammonium acetate, tetrabutyl ammonium hydroxide, trichloroacetic acid acetic acid, propionic acid, and hydrochloric acid are purchased from Merck (Darmstadt, Germany). Dimethylsulfoxide, methanol, ethanol, dichloromethane, chloroform, and tetrahydrofuran acid are purchased from Carlo Erba Reagents (Cornaredo MI, Italy). All materials are analytical grade and directly used without any other purification. Thin-layer chromatography (TLC) was used for monitoring the reactions using precoated silica gel 60 F254 plates (Merck, Darmstadt, Germany). NMR spectra were measured on Bruker Avance (1H: 300 MHz, 13C:75 MHz) spectrometers at 20 °C (293 K). Chemical shifts (δ) are given in parts per million (ppm) using the residue solvent peaks as a reference relative to TMS. Coupling constants (J) are given in hertz (Hz). Signals are abbreviated as follows: singlet, s; doublet, d; doublet-doublet, dd; triplet, t. FT-IR (ATR) spectra were recorded on Thermo Scientific Nicolet spectrophotometer. High-resolution mass spectra (HRMS) were recorded at Gazi University Faculty of Pharmacy using electron ionization (E.I.) mass spectrometry (Waters-LCT-Premier-XE-LTOF (TOF-MS) instruments; in m/z (rel. %). The melting points were measured using Electrothermal IA9200 apparatus. Absorption spectra were recorded on a Shimadzu 1800 spectrophotometer. Thermal analyses were performed with a Shimadzu DTG-60H system, up to 700 °C (10 °C min−1) under a dynamic nitrogen atmosphere (15 mL min−1).

Synthetic strategy

Synthesis of 3-acetyl-7-(diethylamino)-2H-chromen-2-one (1)

1 was synthesized according to the literature procedure [42]. To a mixture of 4-(N,N-diethylamino)salicylaldehyde (5 mmol) and ethyl acetoacetate (6 mmol) in ethanol (20 mL), a few drops of piperidine were added. The mixture was heated under reflux for 2 h. At the end of the reaction, the mixture was allowed to cool to room temperature, and the precipitate formed was filtered off and recrystallized from ethanol to afford pure compound 1 [42].

Bright yellow crystals, Yield: 84%. m.p = 151–152 °C. FT-IR (cm−1): 2969, 2937, 1715. 1659, 1569, 1509, 1477, 1436, 1256. 1H NMR (300 MHz, DMSO-d6) 8.49 (s, 1H), 7.66 (d, 1H, J = 9,04 Hz), 6.80 (dd, 1H, J = 2.45 and J = 9.00 Hz), 6.58 (d, 1H, J = 2.26 Hz), 3.49 (q, 4H, J = 7.03 Hz), 2.51 (s, 3H), 1.14 (t, 6H, J = 7.00 Hz).

Synthesis of 2-(1-(7-(diethylamino)-2-oxo-2H-chromen-3-yl)ethylidene) malononitrile (2)

2 was synthesized according to the literature procedure [42]. A mixture of 3-Acetyl-7-(diethylamino)-2H-chromen-2-one 1 (4 mmol) and malononitrile (8 mmol) in an NH4OAc/AcOH buffer (10 mL) and ethanol (5 mL) mixture was refluxed for 2.5 h. After cooling to room temperature, a solid product was formed. The solid was then filtered off and washed several times with hot ethanol to afford compound 2 [42].

Dark red crystals, Yield: 88%. m.p = 145–146°. 1H NMR (300 MHz, DMSO-d6) 8.60 (s, 1H), 7.56 (d, 1H, J = 9.04 Hz), 6.83 (dd, 1H, J = 2.30 and J = 7.02 Hz), 6.62 (d, 1H, J = 2.14 Hz), 3.50 (q, 4H, J = 6.93 Hz), 2.55 (s, 3H, CH3), 1.15 (q, 6H, J = 6.91 Hz).

Synthesis of compound 2-amino-4-(7-(diethylamino)-2-oxo-2H-chromen-3-yl)thiophene-3-carbonitrile (3)

An equimolar mixture of coumarin–malononitrile 2 (4 mmol) and elemental sulfur (4 mmol) was mixed in ethanol (25 mL). Few drops of triethylamine were added, and the mixture was refluxed for 3 h and 30 min. At the end of the reaction, monitored by TLC, the mixture was allowed to cool to room temperature for a few minutes, and the solid formed was filtered off, dried and recrystallized from ethanol to afford pure coumarin–thiophene hybrid molecule 3 [42]. Orange solid, Yield: 92%. m.p = 211–213 °C. 1H NMR (300 MHz, DMSO-d6) 7.98 (s, 1H), 7.47 (d, 1H, J = 8.92 Hz), 7.20 (s, 2H, NH2), 6.73 (dd, 1H, J = 2.38 and J = 6.50 Hz), 6.66 (s, 1H), 6.56 (d, 1H, J = 2.21 Hz), 1.71 (q, 4H, J = 6.89 Hz), 1.13 (t, 6H, J = 6.87 Hz).

General procedure for the preparation of 4 and 5

(3) (1 mmol) was dissolved in the water-hydrochloric acid mixture (2:1) and was rapidly cooled in an ice/salt bath to 0 °C/− 5 °C. A solution of 1.5 mL of water-soluble NaNO2 (0.1 g) was cooled and added slowly to the other mixture over 30 min. The mixture was stirred for 1 h. After 45 min, urea is added to the mixture to remove excess nitrous acid. In another beaker, 1 mmol of the coupling component was dissolved in an acetic acid/propionic mixture (4/1.5 mL) and cooled. The solution prepared in step 1 was slowly added to the solution in step 2 to ensure that the temperature did not exceed 0 °C. After completion of the addition, the mixture was stirred for 1 h. After 1 h, the pH was adjusted to 5–6. After the pH adjustment was complete, it was stirred for an additional 1 h, and the resulting solid was filtered off and washed with water. The solid obtained was crystallized from ethanol and dried in air.

(E)-2-Amino-4-(7-(diethylamino)-2-oxo-2H-chromen-3-yl)-5-(thiazol-2-yldiazenyl)thiophene-3-carbonitrile (4): black solid, Yield: 78%, m.p = 282–283 °C FT-IR (cm−1) 3288, 2976, 2114, 1722, 1624, 1469, 1244. 1H NMR (300 MHz, DMSO-d6) δ 9.19 (s, 2H), 8.18 (s, 1H), 7.82 (d, J = 3.3 Hz, 1H), 7.56 (d, J = 9.0 Hz, 1H), 7.51 (d, J = 3.3 Hz, 1H), 6.79 (dd, J = 9.0, 2.1 Hz, 1H), 6.63 (d, J = 1.8 Hz, 1H), 3.49 (q, J = 6.9 Hz, 4H), 1.15 (t, J = 7.0 Hz, 6H). 13C NMR (100 MHz, DMSO-d6) δ177.4, 169.5, 158.9, 157.1, 152.2, 148.6, 147.0, 143.5, 136.6, 131.2, 120.1, 114.4, 110.3, 110.1, 108.0, 96.7, 96.8, 44.8, 12.8. HRMS (m/z), (M + H)+: C21H19N6O2S2, calculated: 451.1006; found: 451.1011.

(E)-2-Amino-4-(7-(diethylamino)-2-oxo-2H-chromen-3-yl)-5-((5-methylthiazol-2-yl)diazenyl) thiophene-3-carbonitrile (5): black solid, Yield: 86%, m.p = 290–291 °C FT-IR (cm−1) 3371, 2967, 2206, 1709,1622, 1455, 1263. 1H NMR (300 MHz, DMSO-d6) δ 9.09 (s, 2H), 8.14 (s, 1H), 7.55 (d, J = 9.1 Hz, 2H), 6.80 (d, J = 8.8 Hz, 1H), 6.63 (s, 1H), 3.49 (d, J = 6.9 Hz, 4H), 2.37 (s, 3H), 1.15 (t, J = 6.7 Hz, 6H). 13C NMR (100 MHz, DMSO-d6) δ 174.8, 168.5, 158.5, 156.6, 151.7, 147.6, 141.1, 136.4, 134.1, 130.6, 114.1, 109.8, 107.5, 96.2, 44.3, 12.3. HRMS (m/z), (M + H)+: C22H21N6O2S2, calculated: 465.1149; found: 465.1167.

Photophysical properties of the dyes

The dyes (4 and 5) (30 μM for absorption) were studied in five solvents with different polarities (THF, DCM, CHCl3, DMSO, and MeOH). Samples were prepared by placing 60 μL stock solution of dyes (1 mM in DMSO) and 1940 μL solvent in the cuvette [43].

Hydroxide selectivity study

The UV–Vis spectra were recorded at room temperature to study the sensitivity of tetrabutylammonium hydroxide (TBAOH) towards the dyes. To a DMSO solution of the dyes (30 μM), 20 equiv. of TBAOH (10 mM in DMSO) were added. After thorough trials on varieties of solvent combinations and ratios, the system DMSO/water: 4/6 (v/v) was chosen for the selectivity studies [43].

Calculation methods

The calculations were carried out using Density Functional Theory (DFT) within the Gaussian 09 program [44] at the B3LYP/6–311 + g(d, p) level [45, 46]. The absorption spectra were calculated using time-dependent DFT (TD-DFT) methods at the same level. The polarized continuum model (PCM) [47, 48] was used to calculate solvents.

Results and discussion

Synthesis

The synthesis of two novel coumarin-based azo dyes derivatives (4 and 5) was achieved. The azo dyes were prepared according to the routes given in Scheme 1, by coupling 2-amino-4-(7-(diethylamino)-2-oxo-2H-chromen-3-yl)thiophene-3-carbonitrile 3 and 2-Aminothiazole derivatives with high yields (78% and 86%, respectively). The molecular structures of synthesized azo dyes (4–5) were confirmed by IR, 1H NMR, 13C NMR, and HRMS techniques. The spectral data are provided in the Supplementary Information (Figs. S1–11).

Scheme 1
scheme 1

Synthesis routes of dyes: (i) malononitrile, NH4OAc/AcOH, MWI, (ii) S8, TEA, EtOH, (iii) 2-Aminothiazole, NaNO2/H2SO4, (iv) 2-Amino-5-methylthiazole, NaNO2/H2SO4

Photophysical properties

Photophysical properties of the dyes were investigated using UV–visible spectroscopy. The absorption spectra of the dyes were measured at room temperature in five different solvents with various polarities (30 μM solutions): dimethyl sulfoxide (DMSO), methanol (MeOH), dichloromethane (DCM), chloroform (CHCl3), and tetrahydrofuran (THF) (Figs. 1 and S12). The dyes did not show emissive properties, and it may be due to the presence of an azo group [49]. The absorption coefficients (ε) also were calculated according to the Beer-Lambert law, and the values are given in Table 1 (Figs. S13–22). Dye 4 displayed a double absorption band at 397–408 and 478–491 nm and a shoulder at about 530 nm in the visible region. However, dye 5 presented a double absorption band at 395–409 and 476–539 nm except for DMSO, with only two bands at 408 and 491 nm. The bands located closer at 400 nm can be attributed to the presence of nπ ∗ (charge transfer) due to the ICT from N,N-diethylamino coumarin (donor) to the thiophene (π) bridge, and the bands at ~ 480–550 nm could be ascribed to the presence of thiazolylazo thiophene moiety because of nπ ∗ charge transfer in this moiety [50]. Dye 5 showed increment at molar extinction coefficients with polarity.

Fig. 1
figure 1

The absorption of 4 (a) and 5 (b) spectra of 4 and 5 (c = 30 μM) in different polarity solvents. Insets: photographs of 4 and 5 (c = 60 µM) in different polarity solvents under ambient light

Table 1 Photophysical properties of the 4–5 (c = 30 µM) in different solvents

Investigation of the sensitivity of the dyes in acidic and basic media

The ability of chromophores to change color upon interaction with acid or base made them a promising alternative for pH sensors, therefore, using organic chromophores as pH sensors in different mediums has attracted many studies [50,51,52,53]. For this purpose, first, dyes 4 and 5 were investigated for hydroxide sensing in DMSO and DMSO:water media. The dyes were titrated with tetrabutylammonium hydroxide (TBAOH) (up to 20 equiv.). Figure 2 shows the change in the UV–Vis spectra after adding the TBAOH solution to dyes. Upon addition of 20 equiv of hydroxide anion, absorption bands at 408 and 491 nm and 408 and 492 nm for dyes 4 and 5 were shifted to 435 and 579 nm, respectively. The bathochromic shifts were caused by a change in the deprotonation of the amino group (NH2) at the thiophene ring, and the possible anion sensing mechanism is given in Scheme 2. Furthermore, after the addition of 20 equiv. of OH into the solution of dyes, a color alteration was observed from red to grey by the naked eye.

Fig. 2
figure 2

UV–Vis titration spectra titration spectra of 4 (a) and 5 (b) (c = 30 μM in DMSO) with 20 equiv. of TBAOH in DMSO. Insets: photographs of 4 and 5 (c = 60 μM in DMSO) after addition of 20 equiv. of TBAOH (c = 0.01 M in DMSO) under ambient light

Scheme 2
scheme 2

The suggested mechanism for hydroxide anion sensing of dyes

A reversibility study also supported the deprotonation mechanism by adding trifluoroacetic acid (TFA) to hydroxide-containing solutions of dyes (Fig. 3). After the addition stoichiometric amount of TFA, red-shifted absorption bands were returned to their original wavelengths. Moreover, the grey color of solutions after hydroxide interaction changed to the original red color. The obtained results confirm the possibility of regeneration of 4 and 5 after adding the acid and supporting the amino group deprotonation. In addition, several usages of these chromophores is possible.

Fig. 3
figure 3

UV–Vis spectra of 4 (a) and 5 (b) (c = 30 µM) after addition of OH and its reversibility control using TFA acid (c = 1.0 M in DMSO) in DMSO. Insert: photographs of 4 and 5 (c = 60 µM in DMSO) upon the addition of 20 equiv. of OH and TFA after addition 20 equiv. OH under ambient light

Dyes 4 and 5 have nitrogen atoms in molecular structure, and they have the potential to display an acidochromic property due to the protonation of basic nitrogen, especially in the β-nitrogen in the azo bridge and nitrogen on thiazole moiety. Therefore, the influence of protonation for 4 and 5 in the presence of DCM and DMSO after TFA addition was investigated. The titration spectra of 4 and 5 with TFA in DCM and DMSO are given in Figs. 4 and 5, respectively. Upon addition of 20 equiv. of TFA (1 M) to a solution of the dyes in DCM, the absorption band at 478 nm shifted to 550 nm, and a new shoulder at 630 nm was observed. The dyes showed spectral changes with the addition of TFA in DCM while exhibiting no apparent change in the optical properties except the band at 498 nm was shifted to obtain two bands at ~ 500 and ~ 540 nm in DMSO. This behavior could be explained by the presence of the (S=O) group of DMSO that can behave as a proton acceptor. The non-bonding electrons on amino- and N,N-diethylamino groups are conjugated to an aromatic moiety. Therefore, the protonation possibility of both parts is very low. In addition, protonation of nitrogen on N, N-diethylamino group would cause a shift in absorption band at ~ 400 nm, which belongs to the coumarin–thiazole moiety. Therefore, the two most like protonation regions; are the azo bridge (I) and thiazole group via nitrogen (II). Scheme 3 shows two plausible protonation regions. The possible protonation region was determined by DFT calculations, and results are given in “Calculation results on deprotonation and protonation of 4 and 5”.

Fig. 4
figure 4

The variation of UV–Vis absorption spectra of 4 (c = 30 µM) upon the addition (50 equiv) of TFA (1 M) in a DCM, b DMSO. Inset: photographs of dye under ambient light

Fig. 5
figure 5

The variation of UV–Vis absorption spectra of 5 (c = 30 µM) upon the addition (50 equiv) of TFA (1 M) in a DCM, b DMSO. Inset: photographs of dye under ambient light

Scheme 3
scheme 3

Possible protonation regions of the dyes

pH-sensitive study

To examine the potential application of the dyes as basic sensors in different media, titration experiments were conducted in different pH media. First, the titration studies were done in the partial aqueous medium (Fig. S23). Absorption spectra of the dyes 4 and 5 in different mixtures of water and DMSO were taken after adding 30 equiv. of TBAOH (Figs. S24–25), and the best ratio of DMSO:water was decided as 4:6 (v/v). In addition, photographs of dyes with and without hydroxide anion were taken and can be seen in Figs. S26–27. The pH-dependent spectral changes of the dyes (10 μM) were evaluated in a Britton Robinson buffer solution where pH values ranged between 3.0 and 11.0, with DMSO as a co-solvent (Fig. 6). Absorption bands of the dyes did not show significant shifts, only increment in absorbance at acidic pH (from 3 to 7). However, bands shifted to the bathochromic region from 418 and 488 nm to 442 and 569 nm, respectively, after pH changed from 7 to 8–11. Furthermore, color changes were observed from pink to red at pH 3–7 and brownish-red in basic media (Fig. 7). These results indicate that 4 and 5 are potential chromophores for pH sensing in a basic medium. pKa values of the dyes 4 and 5 were calculated using a spectrophotometric method and found as 7.45 and 7.44, respectively (Figs. S28–29).

Fig. 6
figure 6

UV–Vis spectra of 4 (a) and 5 (b) at different rate pH

Fig. 7
figure 7

Photographs of 4 (a) and 5 (b) (c = 30 µM) in different rate pH under ambient light

LOD and LOQ of the dyes towards hydroxide in DMSO and aqueous medium

The limit of detection (LOD) and limit of quantification (LOQ) are two important performance characteristics in method validation. LOD and LOQ are terms used to describe an analyte’s smallest concentration that an analytical procedure can reliably measure. The LOD is the lowest concentration of an analyte in a sample that can be detected but not necessarily quantified. However, The LOQ is the lowest concentration of an analyte in a sample that can be determined with acceptable precision and accuracy. The LOD and LOQ can be expressed as LOD = 3S/b, LOQ = 10S/b. S is the standard deviation of the response, and b is the calibration curve slope. LOD and LOQ of the dyes towards hydroxide anion were calculated from absorbance titration experiments in DMSO and an aqueous medium. The absorption calibration curve of OH is given in Figs. S30–33 and the values are given in Table 2. Dye 5 presented a smaller LOD value than dye 4 in DMSO. However, 4 has a lower LOD value in the binary solution. These values are in accord with previous studies [23]. Dyes 4 and 5 could be used as chemosensors for the sensitive and selective quantification of OH. Furthermore, 4 and 5 can be used as an alternative for ion chromatography [54].

Table 2 Values of LOD and LOQ of in DMSO and water medium

Test strip application

The potential applicability of the dyes has been investigated by detecting hydroxide anion on test paper strips (Fig. 8). Small cellulose paper strips were soaked in a separate solution of the dyes (10 mM) in DCM. The hydroxide-containing solution was dripped onto the dried paper strips. Wet and air-dried strips were visualized under ambient light. The naked-eye visibility of color on the strip was found to be good in which the color of paper strips of dyes 4 and 5 (dark red) was changed to brown with hydroxide instantly and to light pinkish brown after dried. Further, tissue paper was used instead of filtration paper. Similar results were obtained that the red color of the dyes changed to grey and light pink after dripping the hydroxide anion (Fig. 9). The primary naked-eye sensitive color of the 4 and 5 with hydroxide anion suggested the applicability of the dyes.

Fig. 8
figure 8

Chromogenic responses of 4 (top) and 5 (bottom) on test paper strips before (left) and after addition of hydroxide anion (middle and right)

Fig. 9
figure 9

Chromogenic responses of the dyes on tissue paper strips before (left) and after addition of hydroxide anion (right)

Calculation results on deprotonation and protonation of 4 and 5

The DFT calculations were performed to gain insight into the suggested deprotonation mechanism for hydroxide anion sensing (Scheme 2) and protonation of 4 and 5 via azo bridge nitrogen atom (4-H+N-azo, 5-H+N-azo) and the thiazole nitrogen atom (4-H+N-thiazole, 5-H+N-thiazole) (Scheme 3). The ground state of the compounds and their deprotonated forms with OH anion are presented in Fig. 10. As seen from the figure, there were no significant geometrical changes after interaction with the OH anion for each compound. However, TD-DFT calculations in DMSO showed that the absorption spectra have two maxima that are at 387 nm (oscillator strength, f = 6743), the corresponding transition from HOMO to LUMO + 1 with the greatest contribution (89%) and at 476 nm (f = 0.5793) corresponding transition from HOMO-1 to LUMO with greatest contribution (92%) for 4 (Table S1). Considering the major contributing transitions, the electron density of HOMO and HOMO-1 orbitals is located on the whole skeleton of the compound, while LUMO is mainly localized on the aminothiophene and azothiazole part with a small contribution from the coumarin part. The distribution of LUMO + 1 was on the coumarin part with a small contribution of the aminothiophene and azothiazole part for 4 (Fig. S34). In the case of interaction with hydroxy anion, the peaks shifted to longer wavelengths at 449 nm (f = 0.4217, HOMO → LUMO-1, 77%) and at 537 nm (f = 0.5298, HOMO → LUMO, 88%). Similar behavior was also seen for 5 (Fig. S34 and Table S1). Consistent with experimental suggestions, the increase in negative charge on the amino group (NH2) at the thiophene ring after deprotonation may be responsible for the bathochromic shift in the absorption spectra.

Fig. 10
figure 10

The ground state of the compounds and their deprotonated forms with OH– anion a for 4, b for 5

In Fig. 11, the possible protonated forms of 4 and 5 with total energy (Et) and relative energy (ΔEt) values in the gas phase are presented. As depicted in figure and Table 3, the protonated form of the compounds via thiazole nitrogen atom (on the left side) are more stable than the protonated via azo bridge nitrogen atom (in the right site) in the gas phase and DCM. According to Boltzmann distribution (\({n}_{i}={e}^{-{E}_{i}/{k}_{B}T}\), where \({E}_{i}\) is total ground state energy, \({k}_{B}\) Boltzmann constant and \(T=298.15\) Kelvin), the molar fraction equals 1.00 for 4-H+N-thiazole and 5-H+N-thiazole, i.e., the form 4-H+N-azo and 5-H+N-azo are negligible.

Fig. 11
figure 11

The possible protonated forms of 4 and 5 with total energy (Et) and relative energy (ΔEt) values in the gas phase

Table 3 The total energy (Et) and relative total energy (ΔEt) of the protonated forms of 4 and 5 in gas phase and DCM

The absorption spectra of 4 and 5, and their protonated forms 4-H+N-thiazole and 5-H+N-thiazole were calculated using the TD-DFT method in DCM, and the results are listed in Table S2. For 4, the first peak was seen at 384 nm with f = 0.6406 and major contributed transition HOMO → LUMO + 1, the second broad peak corresponding to the two transitions at 475 nm with f = 0.5605 the HOMO-1 → LUMO transition and at 580 nm with f = 0.3376 and the HOMO → LUMO transition. For 4-H+N-thiazole, the absorption spectra exhibit three peaks at 386 nm f = 0.3152, 506 nm f = 0.5501, and 689 nm f = 0.5612. These results show that a sharp peak at 506 nm is seen instead of the broad peak of 4 in almost the same region, and a new peak occurs at 702 nm upon protonation of the thiazole nitrogen atom, in accordance with the experimental results. Similar results were obtained for 5 (Table S2).

Thermal stability

Thermogravimetric analysis (TGA) is a technique that investigates the thermal stability of the synthesized compounds by evaluating the loss in weight as a function of temperature. The synthesized compounds have the potential to be used as optical dyes. Therefore, they must be thermally stable. The prepared dyes were submitted to TGA to investigate their thermal stability, and the results are given in Fig. 12. TGA was carried out under nitrogen gas in a temperature range of 50–800 °C at a heating rate of 10 °C min−1. The TGA results showed that the dyes samples are stable up to 200 °C. The onset decomposition temperature (Td) of 4 and 5 is 209 °C (96%) and 212 °C (97%), respectively. The results demonstrate that the dyes have good thermal stability, which is proper for optical dyes’ applications.

Fig. 12
figure 12

TGA curves of dyes 4 and 5 under nitrogen gas in the temperature range of 50–600 °C at a heating rate of 10 °C min−1

Conclusions

The two novel thiazolylazo dyes (4 and 5) bearing coumarin–thiophene were synthesized within mild conditions and with good yields. The dyes are sensitive to hydroxide anion in organic and aqueous media. Especially, dyes displayed an excellent potential for hydroxide sensing with a LOD value of 0.78 µM in DMSO with 4 and 72 µM in binary aqueous mixture with 5. The reversibility test confirmed the regeneration of the dyes. The obtained results implied that both compounds could be reverted to their original state by adding an acid to the mixture. Furthermore, the change in pH from neutral to basic media can be determined by the dyes and pKa values found as ~ 7.45. Test strips study showed that the dyes could be easily used for strip for real-time naked-eye detection of hydroxide anion. The thermogravimetric analysis indicated good thermal stability (up to 200 °C) for potential application as optical dyes.