A system for analyzing a content of a sample material is presented. The system includes a fiber sensitized to a first substance, and at least one electrode configured to expose the fiber to an electric field. The system includes an optical sensor configured to detect a displacement of the fiber when the fiber is exposed to the electric field, and a processor configured to use the displacement of the fiber to characterize a content of the sample material.