Optical pH sensors work by exploiting the light-absorbing or light-emitting properties of certain chemical compounds. These compounds, often referred to as pH indicators, change color or fluorescence intensity in response to changes in pH. The sensor system includes a light source, a detector, and a pH indicator. Light from the source passes through the solution and interacts with the pH indicator. The detector then measures changes in light intensity or wavelength, which correlates to the pH of the solution.