A tunable optical cavity can be tuned by relative movement between two
reflection surfaces, such as by deforming elastomer spacers connected
between mirrors or other light-reflective components that include the
reflection surfaces. The optical cavity structure includes an analyte
region in its light-transmissive region, and presence of analyte in the
analyte region affects output light when the optical cavity is tuned to a
set of positions. Electrodes that cause deformation of the spacers can
also be used to capacitively sense the distance between them. Control
circuitry that provides tuning signals can cause continuous movement
across a range of positions, allowing continuous photosensing of
analyte-affected output light by a detector.