Detection of harmful chemicals used in industrial complexes is crucial in order to create a safer environment for the workers. Presently, most chemical detectors used in workplaces are expensive, inefficient, and cumbersome. In order to address these deficiencies, a novel sensor was fabricated to produce a unique spectroscopic fingerprint for various toxic chemicals. The sensor was fabricated by depositing several layers of silica spheres (diameter ~250 nm) on a glass substrate using evaporation-based self assembly. As the spheres assemble to form a photonic crystal, they also create void (i.e., air) spaces in between them. Once the spheres assemble as a photonic crystal, a spectrometer was used to monitor the reflectivity. The spectrum had a high reflectivity at a specific wavelength, which is governed by the average index of refraction between the spheres and the void spaces. As a foreign chemical infiltrates into the photonic crystal, it occupies the void space, which results in an increase of the average index of refraction of the structure. Consequently, the peak wavelength of the reflectivity spectrum red-shifts, which then confirms the presence of a foreign substance. While the as-grown photonic crystal is able to detect chemicals, it is unable to differentiate between chemicals that have similar indices of refraction, such as ethanol and methanol. In order to detect chemicals with similar indices of refraction, five pieces of a single photonic crystal (i.e. five pixel device) were exposed to different silanes, which changed the surface chemistry of the silica spheres in the photonic crystal. In turn, the five pixel device was able to produce a unique chemical fingerprint for several chemicals, which can be calibrated to detect toxins in the workplace.