This article discusses the development of a smart, low-cost, and portable gas sensing system using a mid-infrared microspectrometer and machine learning algorithm. The system is able to accurately detect multiple gases, including greenhouse gases and hazardous gases, at low concentrations. This technology has potential applications in environmental and defense-related monitoring, as well as in the Internet of Things (IoT) industry.