An improved optical sensor and methods for measuring the presence of
various materials or constituents in a fluid sample uses one or more
reactive materials in a fluid environment. The reactive materials have
optical properties that change in the presence of one or more target
materials that may be present in the environment. One or more optical
emitters generate light that is directed to the reactive material(s), and
one or more optical detectors receive light from the reactive
material(s), and the presence or absence of the target material is
determined based on the light received at the optical detector(s). The
reactive material(s), emitter(s), and detector(s) are selected based on
the desired target material to be sensed.