One of the major concerns in 5G IoT networks is that most of the sensor nodes are powered through limited lifetime, which seriously affects the performance of the networks. In this article, Compressive sensing (CS) technique is used to decrease transmission cost in 5G IoT networks. Sparse basis is one of the important steps in the CS. However, most of the existing sparse basis-based method such as DCT (Discrete cosine transform) and DFT (Discrete Fourier Transform) basis do not capture data structure characteristics in the networks. They also do not take into consideration multi-resolution representations. In addition, some of sparse basis-driven methods exploit either spatial or temporal features, resulting in performance degradation of CS-based strategies. To address these challenging problems, we propose a novel spatial–temporal correlation basis algorithm (SCBA). Subsequently, an optimal basis algorithm (OBA) is provided considering greedy scoring criteria. To evaluate the efficiency of OBA, orthogonal wavelet basis algorithm (OWBA) by employing NS (Numerical Sparsity) and GI (Gini Index) sparse metrics is also presented. In addition, we discuss the complexity of the above three algorithms, and prove that OBA has low numerical rank. After experimental evaluation, we found that OBA is capable of the sparsest representing original signal compared to spatial, DCT, haar-1, haar-2, and rbio5.5. Furthermore, OBA has the low recovery error and the highest efficiency.