In this research, we present a prototype optical system that offers significant advances in detecting hydrochloric acid (HCl) and ammonia (NH3) vapors. The system utilizes a natural pigment sensor based onCurcuma longathat is securely attached to a glass surface support. Through extensive development and testing with HCl (37% aqueous solution) and NH3(29% aqueous solution) solutions, we have successfully demonstrated the effectiveness of our sensor. To facilitate the detection process, we have developed an injection system that exposesC. longapigment films to the targeted vapors. The interaction between the vapors and the pigment films triggers a distinct color change, which is then analyzed by the detection system. By capturing the transmission spectra of the pigment film, our system allows a precise comparison of these spectra at different concentrations of the vapors. Our proposed sensor exhibits remarkable sensitivity, allowing the detection of HCl at a concentration of 0.009 ppm using only 100 µL (2.3 mg) of pigment film. In addition, it can detect NH3at a concentration of 0.03 ppm with a 400 µL (9.2 mg) pigment film. IntegratingC. longaas a natural pigment sensor in an optical system opens up new possibilities for detecting hazardous gases. The simplicity and efficiency of our system, combined with its sensitivity, make it an attractive tool in environmental monitoring and industrial safety applications.