An appliance using water including an incoming water valve is provided.
The appliance includes a sensor disposed in-line to an incoming flow of
water received from the incoming water valve and is configured to sense a
degree of hardness in the incoming flow of water. The sensor includes a
sensing element disposed on a substrate. The sensing element includes a
sensing matrix, an indicator for one or more chemical species in flow of
water, and a selectivity component that reacts reversibly with one or
more chemical species in the water. The sensor also includes a light
source configured to direct light through the substrate and the sensing
matrix. The sensor further includes a light detector configured to
receive transmitted light from the substrate and the sensing matrix and
to generate a signal representative of selective wavelengths of the light
indicative of one or more chemical species in flow of water.