In this paper, a HVAC (heating, ventilating and air-conditioning) system has two different zones was designed and fan motor speed to minimize energy consumption of the HVAC system was controlled by a conventional (proportional-integral-derivative) PID controller. The desired temperatures were realized by variable flow-rate by considering the ambient temperature for each zone. The control algorithm was transformed for a programmable logic controller (PLC). The realized system has been controlled by PLC used PID control algorithm. The input-output data set of the HVAC system were first stored and than these data sets were used to predict the fan motor speed based on adaptive network based fuzzy inference system (ANFIS). In simulations, root-mean-square (RMS) and the coefficient of multiple determinations (R2) as two performance measures were obtained to compare the predicted and actual values for model validation. All simulations have shown that the proposed method is more effective and controls the systems quite well. © 2008 Elsevier Ltd. All rights reserved.