How to solve their automatic control of constant temperature and humidity gradually becomes a research hotspot as the continuous upgrading of air conditioning systems. This study aims to optimize the traditional proportional-integral-differential controller for improvement to solve the time-delay instability phenomenon in temperature and humidity control. The objective of this study is to optimize existing proportional-integral-differential controllers to improve the time-delay instability problem that is common in temperature and humidity control. Firstly, it treats the controlled object as a first-order and second-order system with time-delay characteristics. Next, the Smith predictor controller is generalized equivalent to ensure that the equivalent system does not contain time-delay. Finally, an analysis of the first-order and second-order closed-loop control system is conducted by combining Smith predictive controller and proportional-integral-differential controller. The system achieves the goal of automatic control of constant temperature and humidity by adjusting the control parameters. The experiment showcased that the temperature control time of the proposed control scheme under first-order and second-order time-delays was 16 s and 3 s, respectively. Meanwhile, the humidity control time was 14 s and 13 s, respectively. In practical applications, the proposed control scheme achieved good control effects in all four seasons. This indicates that the controller designed in this study possesses good control performance. It also can achieve the goal of constant temperature and humidity control. This can provide technical support for the automation control of air conditioning systems.