Introduction

Chromism has become a booming research field in various scientific domains (Bamfield 2001; Golchoubian et al. 2019; Van der Schueren et al. 2012). Some dyes show chromic properties, which means that their color changes depending on external influences such as thermochromism, photochromism and halochromism properties. (Bamfield 2001; Barachevskii et al. 2012; De Meyer et al. 2014; Kim 2006; Kulinich and Ishchenko 2019; Kulinich et al. 2018; Surati and Shah 2015; Zollinger 2003). A halochromic material is a material whose color changes, when pH changes occur. The pH indicators have this property. To this day, the halochromic behavior of many dyes (azo, sulfonphthaleine, phenolphthalein, phenolate, quinolone dyes, etc.) has been studied experimentally and theoretically (De Meyer et al. 2014, 2016; Ghanadzadeh Gilani et al. 2017; Hermosilla et al. 2017; Hosseini et al. 2014; Van der Schueren et al. 2012; Zhang et al. 2009), but so far, and to the knowledge of the authors, the theoretical study of the effect of physical factors on the color change pH of the sulfonphthaleine dyes has not been done. In this research, we focus on three types of sulfonphthaleine dyes including phenol red, cresol red, and bromophenol blue. Sulfonphthaleine dyes form a relatively small dye class, but are widely used as acid–base indicators because they show a clear color transition in function of pH. Therefore, they find application in various other areas, such as detection of pesticides, acid vapours, ammonia, CO2, the quantitation of proteins in solution, the textile sensor, the development of new glassy carbon electrodes and wound bandages (Chang et al. 2011; Chen et al. 2005; Clayton and Byrne 1993; De Meyer et al. 2016; Ensafi et al. 2010; Flores 1978; Hua et al. 2013; Kurzweilová and Sigler 1993; Nakamura and Amao 2003; Yang et al. 2010).

The basic structure of sulfonphthaleine dyes and substituents of the studied molecules are given in Fig. 1. The dye set in this work covers most commercially available sulfonphthaleine compounds. These products have numerous applications, often in biological and medical fields (Byrne and Breland 1989; De Meyer et al. 2014; Flores 1978; Marona and Schapoval 2001; Yao and Byrne 2001). The color changing mechanism of sulfonphthaleine dyes can be ascribed to a protonation/deprotonation reaction, as illustrated in Fig. 1. The dyes can exist in a neutral form, X, in powder or in very acidic media. The most interesting molecular change (and thus color change), however, is the deprotonation of a single anion, Xa, to a resonance stabilized double anion, Xb. When it solvated, deprotonation will allow for a rearrangement of the internal bonds. The driving force behind this deprotonation is twofold: the internal rearrangement results in a larger conjugated system and a SO3 group is formed. The latter allows for a high interaction with the surrounding solvent molecules and is thus energetically favorable. This internal rearrangement can be confirmed experimentally by drop in pH upon solvation and theoretically (a molecular dynamic simulation with explicit solvent) by drop in calculated Gibbs free energy (De Meyer et al. 2014). Therefore, in this study, only the equilibrium of single anion, Xa, and double anion, Xb, forms are considered to investigate the changes in the behavior of halochromic dyes with physical agents.

Fig. 1
figure 1

Basic structure of sulfonphthaleine dyes, substituents of the studied molecules and general color changing mechanism for sulfonphthaleine dyes. While the neutral structure X is observed only in very acidic solutions or in powder, the relevant color change originates from a deprotonation from the single anionic form, Xa, to a double anion, Xb (De Meyer et al. 2014)

Since pH monitoring is one of the most important parameters in many industrial processes such as food, pharmaceutical, water and wastewater therefore, continuous online pH control and maintaining a proper pH range is essential in many of the physical and chemical reactions. pH variation can be affected on product quality and efficiency of chemical reactions. pH determination can be performed by using different methods. For example, pH test paper strips, electrochemical and photochemical sensors, etc. Although the pH test paper strips are available and easy to use, they are not used in high accuracy applications. In recent years, development of electrochemical and optical sensors has been a great interest that indicates the importance of this field in various sciences (Hosseini et al. 2014; Kelly and Cochrane 2015; Matějec et al. 2019; Steyaert et al. 2015; Sun et al. 2015). This research aims at theoretical and computational study of changes of pH indicators ranges (used in pH optical sensor) by physical factors of temperature, pressure, ionic strength of solvent, substituent groups and isotopic type of constituent atoms. The measure of the acid concentration in an organic media is a common issue in chemistry (Mineo et al. 2019). With the aim to study this subject in a facile and widely way, the halochromic properties of indicators in solvents with different dielectric constant are calculated. The importance and prevalence of isotopic types studies provide an incentive for development of new methods that can be used for rapid and selective detection and monitoring of the isotopic types both in the gaseous and in the liquid phases. Some traditional detection methods such as electrolysis, laser, NMR and MS spectroscopic techniques are usually employed for isotope sensing and detection; however, these methods are believed to be expensive and time consuming. The many uses of indicator or sensors of this type include monitoring air quality, indicating agricultural regime (nitrogen isotope relationships between crops and fertilizer), detecting volatile organic compounds, detecting toxic gases and controlling fossil fuel combustion products (Bateman et al. 2005; Gibson et al. 2012; Mineo et al. 2019; Özyiğitoğlu 2020).

The results of this research can be used in the design of favorable indicators and suitable and predictable conditions for implementation and synthesis of pH-sensitive sensors. Furthermore, the methodology of this work is applicable to other dye classes as well.

Materials and methods

In this study, all calculations on the structures of three types of indicators including phenol red, cresol red, and bromophenol blue, in modes of single anionic (acidic form) and a double anion (base form) were carried out in Gaussian03 using Density Functional Theory. Geometries were fully optimized using B3LYP/6-31G** level of theory (Frisch et al. 2004). The optimized molecular structures of indicators in various forms are displayed in Fig. 2. Vibrational frequency calculations were performed at the same level of theory on the optimized structures to ensure the stability of structures and to calculate thermodynamic quantities. In acidic form, substituent element of hydroxyl in all dyes is protonated and deprotonated in basic form. The results of vibrational frequencies calculations indicate that all the studied structures contain real vibrational frequencies or number of zero negative imaginary frequency (NIMAG = 0).

Fig. 2
figure 2

The optimized molecular structures of a phenol red, b cresol red and c bromophenol blue indicators in the forms of 1) single anion, Xa, and 2) double anion, Xb, obtained at the B3LYP/6-31G** level of theory

The purpose of this research is to investigate the effect of physical factors on pH range of color change of indicators; therefore, all thermodynamic studies were done under different conditions of temperature (273.15, 298.15, 323.15 and 373.15 K), pressure (1, 5 and 10 atm), different phases (vacuum, benzene and water) and change of the isotopic type of carbon, oxygen and hydrogen atoms of the studied indicators (12C → 13C, 16O → 18O and 1H → 2H).

In this study, Conductor—like Polarizable Continuum Model (CPCM) is used to consider the effect of solvent. The CPCM model was spread in the scientific community due to its accuracy and the relative simplicity of the expressions involved in the definition of the solvent reaction field. First and second derivatives of the molecular free energy with respect to nuclear motions needed for geometry optimizations and frequency calculations can be computed with accurate and very efficient algorithms. In this model, the solvent is considered as a continuous environment with a uniform dielectric constant inside which the soluble remains as a spherical cavity. Molecule polarity can create bipolarity in the environment, and the electric field created by solvent polarity can interact with the soluble molecule bipolarity which results in system stability (Cossi et al. 2003; Tomasi and Persico 1994).

Results and discussion

In the equilibrium reaction (Eq. 1), the equilibrium constant between the acid and the base states of indicators, Ka, and the relationship between equilibrium constant and Gibbs free energy change for the desired equilibrium, ∆Ga, are written as follows:

$${\texttt{HIn}} \Leftrightarrow {\texttt{H}}^{ + } + {\texttt{In}}^{ - }$$
(1)
$$K_{{\text{a}}} = \frac{{\left[ {{\text{H}}^{ + } } \right] \times \left[ {{\text{In}}^{ - } } \right]}}{{\left[ {{\text{HIn}}} \right]}}$$
(2)
$$\Delta G_{{\text{a}}} = \, - RT\;{\ln}\left( {K_{{\text{a}}} } \right)$$
(3)

Enthalpy change, ∆Ha, entropy change, ∆Sa, Gibbs free energy change, ∆Ga, and equilibrium constant of ionization process of indicator, Ka, are calculated for the equilibrium reaction (Eq. 1) under different conditions and are reported in Tables 1, 2 and 3.

Table 1 Thermodynamic quantities ∆Ha, TSa and ∆Ga in kcal/mol and equilibrium constants, Ka, for the indicators dissociation equilibrium of phenol red, cresol red and bromophenol blue in the gas phase and the different pressures and temperatures, respectively in K and atm obtained at the B3LYP/6-31G** level of theory
Table 2 Thermodynamic quantities ∆Ha, TSa and ∆Ga in kcal/mol and equilibrium constants, Ka, for the indicators dissociation equilibrium of phenol red, cresol red and bromophenol blue in the different solvents obtained at the B3LYP/6-31G** level of theory
Table 3 Thermodynamic quantities ∆Ha, TSa and ∆Ga in kcal/mol and equilibrium constants, Ka, for the indicators dissociation equilibrium of phenol red, cresol red and bromophenol blue with change of isotopic type of constituent atoms obtained at the B3LYP/6-31G** level of theory

The reported results in Tables 1, 2 and 3 show that ∆Ha is positive in all conditions which means the ionization process of indicators is endothermic. As the temperature increases under constant pressure, ∆Ha increases, and it remains constant under constant temperature by increasing the pressure; that is, ∆Ha does not depend on pressure. Since the enthalpy of ideal gases is pressure independent (\(\left( {\partial H/\partial P} \right)_{T} = 0\)) and in all calculations, reaction components are considered ideal gases; so the enthalpy changes of the reaction are independent of pressure. Ionization processes of indicators are less endothermic in dissolved state. ∆Ha decreases by increasing the solvents polarity (in water, ∆Ha is less than ethanol, and in ethanol, it is less than vacuum). ∆Ha increases by considering isotopic effect of constituent atoms in all cases. TSa is positive in all the studied conditions. Considering the fact that the number of process components in products is higher than raw materials, such conclusion is logical and correct. TSa increases by increasing the temperature under constant pressure and it decreases by increasing the pressure under constant temperature. By paying attention to thermodynamic relationships of \(\left( {\partial S/\partial P} \right)_{T} = - \alpha V\) and \(\alpha = 1/V\left( {\partial V/\partial T} \right)_{P}\) that α for ideal gases equals to \(\alpha = 1/T\) is resulted \(\left( {\partial \Delta S/\partial P} \right)_{T} = - \;\Delta V/T\) that ∆V and T both are positive quantities, therefore, ∆S must be decreased by increasing pressure under constant temperature. ∆Ga is positive in all conditions which means ionization process of indicators is non-spontaneous. Results show that ∆Ga decreases by increasing temperature under constant pressure and it increases by increasing pressure at constant temperature. Therefore, it is concluded that high temperature and low pressure conditions are favorable for the reaction. The comparison of ∆Ga values with ∆Ha and TSa values indicates that acid ionization of indicators is controlled by entropy agent (entropy of the process) and ∆Ga values in the solvents phase are much smaller in gas phase (in view of the interactions of soluble and solvent in the CPCM model, the species become more stable, especially the pregnant species). As a result, high-polarity solvents are other favorable conditions for ionization process of indicators. In this study, all static calculations in solvents phase were carried out in Gaussian09 using density functional theory (DFT) and CPCM model as these methods are computationally efficient. However, to fully understand the origin of the ∆Ga values, a QM/MM molecular dynamic simulation study in a solvent molecular environment was used in combination with inclusion of implicit solvent, CPCM calculations, that takes into account the flexibility of the dye and the explicit interactions with the surrounding solvent molecules. This procedure allowed us to reach to a remarkable agreement between the theoretical and experimental ∆Ga values and enabled us to fully unravel the pH-sensitive behavior of sulfonphthaleine dyes in solution phase. This methodology could also be applied to other dyes and could be served as a basis for the construction of more advanced theoretical models to study the interactions of (sulfonphthaleine) dyes in a solution environment. So, it is expected in the real and experimental conditions that ∆Ga values would be smaller or they could even be negative. ∆Ga increases with isotopic change of the constituent atoms of the indicator.

The increase in ∆Ga values with isotopic change of the constituent atoms of the indicator can be interpreted by the following statistical thermodynamic relationships.

$$K_{{\text{C}}} = \mathop \prod \limits_{i} \left( {\frac{{q_{i} }}{V}} \right)^{{\nu_{i} }}$$
(4)
$$q_{i} = q_{{{\text{ele}}}} \times q_{{{\text{trans}}}} \times q_{{{\text{rot}}}} \times q_{{{\text{vib}}}} \times q{}_{{{\text{nucl}}}}$$
(5)
$$q_{{{\text{vib}}}} = \prod\limits_{j} {\left( {\frac{{{\text{e}}^{{ - \theta_{{\nu_{j} }} /2T}} }}{{1 - {\text{e}}^{{ - \theta_{{\nu_{j} }} /T}} }}} \right)} ,\quad \theta_{{\nu_{j} }} = \frac{{h\nu_{j} }}{k}\quad \text{and}\quad \nu_{j} = \frac{1}{2\pi }\sqrt {\frac{{k_{j} }}{{\mu {}_{j}}}}$$
(6)

The molecular partition function, qi, is written as the product of electronic, qele, translational, qtrans, vibrational, qvib, rotational, qrot, and nuclear, qnucl, partition functions. The vibrational partition function is given by the product of vibrational functions for each frequency. \(\theta_{{\nu_{j} }}\) is called the characteristic vibrational temperature and the vibrational frequencies are given by νj. kj and μj are spring constant and reduced mass, respectively.

To this end, the molecular partition functions obtained in the frequency calculations are reported in Table 4. The obtained results show that the acidic and base forms differ greatly in the numerical values of the vibrational partition function and their differences in the other partition functions are negligible. This can be attributed to the elimination of a bond between hydrogen and oxygen atom and vibrations as to it in acidic form. When an atom in a molecule is changed to an isotope, the mass number will be changed, so µj will be affected but spring constant, kj, will not (mostly). This change in the reduced mass will affect the vibrational modes of the molecule, which will affect the vibrational partition function. When an atom is replaced by an isotope of larger mass, µj increases leading to smaller νj and \(\theta_{{\nu_{j} }}\). This drop in the vibrational characteristic temperature, \(\theta_{{\nu_{j} }}\), increases the vibrational partition function and thereby increases the total partition function. The ratio of the numerical values of the total partition function of the isotopic state to the natural state for acidic and base forms, \(q_{{{\text{total}}}} \left( {\text{isotopic}} \right)/q_{{{\text{total}}}} \left( {\text{natural}} \right)\), and change of the equilibrium constants with the isotopic variation of the constituent atoms of the indicators, \(K_{{\text{a}}} \text{(isotopic)}/K_{{\text{a}}} \text{(natural)}\), are reported in Table 5. The results presented in Table 5 show that the increase in the value of the total partition function in all cases is greater for the acidic form than the base form, and this results in an equilibrium constant ratio of less than one or an increase in the ∆Ga by changing the constituent isotopes \(\left[ {\Delta G_{a} \text{(isotopic)} - \Delta G_{a} \text{(natural)} = - RT\ln \frac{{K_{a} \text{(isotopic)}}}{{K_{a} \text{(natural)}}}} \right]\). Due to ∆Ga > 0 in all states, Ka values are very small in all conditions. The obtained results indicate that ionization equilibrium constant was larger at high temperature and low pressure conditions and in the solution phase, especially in the polar solvents. The isotopic effect decreased Ka values in all cases.

Table 4 The statistical thermodynamic quantities qvib, qtrans, qrot and qtotal calculated for a) acidic and b) base forms of phenol red, cresol red and bromophenol blue indicators in the natural state and isotopic state (with change of isotopic type of constituent atoms) obtained at the B3LYP/6-31G** level of theory
Table 5 The ratio of qtotal and Ka (dissociation equilibrium constant of the indicators) in the isotopic state to the natural state for a) acidic and b) base forms of phenol red, cresol red and bromophenol blue indicators obtained at the B3LYP/6-31G** level of theory

To investigate the changes in pH range of color change of indicators resulted from different physical factors (temperature, pressure, solvent and isotopic), it is assumed that the concentration ratio of \([{\text{In}}^{ - } ]/[{\text{HIn}}]\) is constant (the ratio of \([{\text{In}}^{ - } ]/[{\text{HIn}}]\) is limit ratio of the required concentrations for observation of color change of indicators.) and [H+] concentration changes in different conditions are proportional to Ka. Regarding the relationship between pH and [H+] concentration, the changes in pH of color change, ∆pH, can be calculated based on the following relationships:

$$K_{\texttt{a1}} = \frac{{[{\texttt{H}}^{ + } ]_{1} [{\texttt{In}}^{ - } ]}}{[{\texttt{HIn}}]}$$
(7)
$$K_{\texttt{a2}} = \frac{{[{\texttt{H}}^{ + } ]_{{^{2} }} [{\texttt{In}}^{ - } ]}}{[{\texttt{HIn}}]}$$
(8)
$$ \frac{{[{\texttt{H}}^{ + } ]_{2} }}{{[{\texttt{H}}^{ + } ]_{1} }} = \frac{{K_{\texttt{a2}} }}{{K_{\texttt{a1}} }}$$
(9)
$$\Delta {\text{pH}} = {\text{pH}}_{{2}} - {\text{pH}}_{{1}} \;\;\;\;\;\;\;\;{\text{pH}}_{2} = - \log [{\text{H}}^{ + } ]_{2} \;\;\;\;\;{\text{and}}\;\;\;\;\;\;{\text{pH}}_{{1}} = - \log [{\text{H}}^{ + } ]_{1}$$
(10)
$$ \Delta {\text{pH}} = - \log \frac{{\left[ {{\texttt{H}}^{ + } } \right]_{2} }}{{\left[ {{\texttt{H}}^{ + } } \right]_{1} }} = - \log \frac{{K_{\texttt{a2}} }}{{K_{\texttt{a1}} }}$$
(11)

To study the effect of temperature on the pH of color change of the indicators, two temperature changes of 273.15 → 298.15 K and 298.15 → 323.15 K (range of each one equal to 50 K) at pressures of 1, 5, and 10 atm, and to study the effect of pressure, two pressures changes of 1 → 5 atm and 5 → 10 atm (range of each one equal to 5 atm) at temperatures of 273.15, 298.15 and 323.15 K are considered and their results are reported in Tables 6 and 7. The obtained results in Table 6 show that increasing the temperature increases the pH of color change of indicators (∆pH > 0). This increase for each indicator is equal in the various pressures and values for phenol red, cresol red, and bromophenol blue indicators with temperature change from 273.15 K → 298.15 K were 25.884, 25.797 and 24.798, respectively, and for temperature change from 298.15 K → 323.15 K were 21.888, 21.802 and 20.976, respectively. Therefore, it can be concluded that this increase nearly is not dependent upon indicator type and pressure applied and the effect of temperature on ∆pH is lower under higher temperatures.

Table 6 The changes in pH of color change of indicators, ∆pH, in the gas phase resulted from change of temperature (in K) obtained at the different pressures (in atm) and the B3LYP/6-31G** level of theory
Table 7 The changes in pH of color change of indicators, ∆pH, in the gas phase resulted from change of pressure (in atm) obtained at the different temperatures (in K) and the B3LYP/6-31G** level of theory

The results reported in Table 7 show that increasing of pressure from 1 to 5 atm for each three types of indicators at temperatures of 273.15, 298.15 and 323.15 K increased the pH of color change to the amount of 0.695, and increasing pressure from 5 to 10 atm increased the pH of color change to the amount of 0.304, and this shows that the effect of pressure on ∆pH is lower under higher pressures and is not dependent on the indicator type and temperature applied.

By considering the solvent model effect (CPCM) on the indicators, the obtained results will find more consistency with experimental samples. The results reported in Table 8 show that by changing of solvent from water to ethanol, pH of color change of the indicators, ∆pH, varies by 3.8–4.00, and by changing the phase from ethanol solvent to vacuum, ∆pH increases to about 134–138.

Table 8 The changes in pH of color change of indicators, ∆pH, resulted from change of phase obtained at the B3LYP/6-31G** level of theory

The isotopic effect on carbon, oxygen, and hydrogen atoms of the indicators has been studied. The results reported in Table 9 show that use of isotopes produced the increase in the pH of color change of the indicators (∆pH > 0) that their values depend on the type of atom and type of the indicator.

Table 9 The changes in pH of color change of indicators, ∆pH, in the gas phase resulted from change of isotopic type of constituent atoms obtained at the B3LYP/6-31G** level of theory

Conclusions

Initially, the structures of three types of sulfonphthaleine indicators including phenol red, cresol red, and bromophenol blue in modes of single anionic (acidic form) and a double anion (base form) were optimized in Gaussian 03 program package using B3LYP/6-31G** level of theory.

Vibrational frequency calculations were performed on optimized structures to ensure the stability of structures and to calculate thermodynamic values. The results from vibrational frequency calculations show that all the studied structures have real vibration frequencies or zero NIMAG.

To elucidate the effect of physical factors on the halochromic behavior of the sulfonphthaleine dyes (or change of pH of the color change of the indicators, ∆pH), acid–base equilibrium of the indicators and its related thermodynamic quantities (enthalpy change, ∆Ha, entropy change, ∆Sa, Gibbs free energy change, ∆Ga, and equilibrium constant of ionization process of indicators, Ka) are studied under different conditions; Then, their obtained values and variations are interpreted by the rules of thermodynamics and statistical thermodynamics. The obtained results indicate that the equilibrium constant of ionization is larger in the conditions of high temperatures, low pressures, polar environment and use of constructive atoms in natural state (non-use of isotopes). Therefore, it is concluded that these conditions are favorable for the reaction.

The results show that ∆pH is positive by increasing temperature at any pressure, increasing pressure at any temperature, decreasing the polarity of the solvent used and using of isotopes of constituent atoms. The effect of temperature and pressure on ∆pH is lower respectively under higher temperature and pressures and is not dependent on the indicator type. The ∆pH values due to the isotopic factor depend on the type of atom and type of the indicator.

The results of this research can help and guide the identification of favorable indicators predicting pH of their color change in different conditions. Also, these results can act as the basis for future research on the interaction of dye molecules and polymers used on fabric base. For example, using halochromic properties in the color of polymers or textiles can produce sensory materials. These textile sensors are used in the production of wound dressing. They maintain all the features of the texture, are flexible, can be used on large surfaces, and can communicate warning messages by a color change at a particular point.