This figure shows how the sensor works. Light comes into the sensor at a particular angle. Part of the light is then reflected out (R), while part of it is diffracted into the porous silicon "waveguide," where it interacts with the material and is then diffracted out at a different angle (I-1), due to the periodicity of the gratings bumps. When molecules (shown in green) are infiltrated inside the porous material's holes, they interact with the diffracted light. At the lower right of the figure, an optical signal shows peaks that represent the particular angle for the diffracted beam. Shifts in these peaks can be monitored to reveal how many molecules have infiltrated into the sensor.