A sensor assembly includes a light source, a modulation layer, and at least one detector. The modulation layer includes a plurality of micropillars each having a fixed end and a free end. The fixed ends are each adjacent to the light source. The at least one detector is adjacent to the free ends of the plurality of micropillars. The detector is configured to detect light emitted from the light source.