A sensor includes an optical resonator, a trap, and a measurement system.
The trap is positioned to hold captured contaminant within an evanescent
field of the optical resonator. The measurement system can detect the
effect of the captured contaminant on the optical resonator. The sensor
can includes a photonic crystal that contains defects forming the optical
resonator and a waveguide to which the optical resonator is coupled. Yet
another embodiment is a sensing method that exposes a trap that is
adjacent to an optical resonator to an environment that may contain a
contaminant that the trap can capture. Light having a wavelength that
interacts with the contaminant can then be coupled into the optical
resonator, and the effect of any captured contaminant on the optical
resonator can be measured.