Different types of solvents, aromatic and aliphatic, are used in many industrial sectors, and long-term exposure to these solvents can lead to many occupational diseases. Therefore, it is of great importance to detect volatile organic compounds (VOCs) using economic and ergonomic techniques. In this study, two macromolecules based on pillar[5]arene, named P[5]-1 and P[5]-2, were synthesized and applied to the detection of six different environmentally volatile pollutants in industry and laboratories. The thin films of the synthesized macrocycles were coated by using the spin coating technique on a suitable substrate under optimum conditions. All compounds and the prepared thin film surfaces were characterized by NMR, Fourier transform infrared (FT-IR), elemental analysis, atomic force microscopy (AFM), scanning electron microscopy (SEM), and contact angle measurements. All vapor sensing measurements were performed via the surface plasmon resonance (SPR) optical technique, and the responses of the P[5]-1 and P[5]-2 thin-film sensors were calculated with ΔI/Io × 100. The responses of the P[5]-1 and P[5]-2 thin-film sensors to dichloromethane vapor were determined to be 7.17 and 4.11, respectively, while the responses to chloroform vapor were calculated to be 5.24 and 2.8, respectively. As a result, these thin-film sensors showed a higher response to dichloromethane and chloroform vapors than to other harmful vapors. The SPR kinetic data for vapors validated that a nonlinear autoregressive neural network was performed with exogenous input for the best molecular modeling by using normalized reflected light intensity values. It can be clearly seen from the correlation coefficient values that the nonlinear autoregressive with exogenous input artificial neural network (NARX-ANN) model for dichloromethane converged more successfully to the experimental data compared to other gases. The correlation coefficient values of the dichloromethane modeling results were approximately 0.99 and 0.98 for P[5]-1 and P[5]-2 thin-film sensors, respectively.