ABSTRACT The development of industrial and urban places caused air pollution, which has resulted in a variety of effects on individuals and the atmosphere over the years. The measurement of the air quality index (AQI) depends on various environmental situations, such as emissions, dispersions, and chemical reactions. This paper developed the Internet of Things (IoT)-based Deep Learning (DL) technique for predicting air quality. Initially, the IoT simulation is performed, where the nodes receive input data. The routing technique is used to identify the best route toward the Base station (BS). The proposed Tangent Two-Stage Algorithm (TTSA) is used in the routing mechanism. For AQI prediction, the time series data is transmitted to the BS. The Z-score normalisation is employed to neglect the unessential data. Furthermore, feature indicator extraction is employed to extract the relevant feature indicators. The Deep Feedforward Neural Network (DFNN) is used to predict air quality. Furthermore, the proposed Fractional Tangent Two-Stage Optimisation (FTTSA) is employed for the training process of DFNN. Moreover, metrics such as energy, time, and distance are used to evaluate the routing process, and superior results such as 0.979J, 0.025s and 0.196 m are obtained. Furthermore, the AQI is predicted by metrics like root mean square error (RMSE), R-squared (R2), mean square error (MSE), and mean absolute percentage error (MAPE), whereas the superior values such as 0.602, 0.598, 0.362, and 0.456 are attained.