This paper explores the design and optimization of all-dielectric metasurfaces, consisting of silicon meta-atoms on calcium fluoride (CaF2) and silicon nitride (Si3N4) substrates, to enhance infrared absorption. This optimization results in intense light-matter interactions in the spectral bands of molecular vibrations, thereby improving detection accuracy for gases and liquids across various settings, including biological, environmental, and industrial scenarios. The proposed devices are engineered for broadband operation and designed for sensing applications in the mid-infrared spectrum, within the 4 to 8 μm wavelength range. The analysis presented in this work highlights the potential of metamaterial-inspired sensors based on gratings to support real-time monitoring and safety applications, contributing directly to better air quality assessment, improved health diagnostics, and enhanced safety protocols.