IoT or Internet of Things can improve the possibility of interaction between various smart components in real time. In the infrastructure of IoT, wireless sensors can be used in order to reduce communication costs. Despite having positive effects, using wireless nodes add some challenges to the system. Limited resources, such as energy, CPU power and memory, are the main concerns in this technology. Energy consumption is the most challenging one. Designing an optimized routing pattern through heuristic algorithms is a common way to tackle this problem. Therefore, in the proposed algorithm, a WOA-based method has been proposed to expand the life span of the system. Also, a novel fitness function is defined for reducing the energy consumption of the network, load balancing and node coverage. Clustering is done unequally; it means that cluster heads (CHs) nearer to the base station (BS) have more energy for data relay. In this paper, for reducing the number of messages, a clustering stage is added at the beginning of each metaround. The number of rounds in a metaround is variable. The status of each node is analyzed by BS before each round. Low energy level causes a new metaround. Moreover, the CH–BS interaction is implemented through multi-hop pattern. Results suggest that there is an enhancement instability, energy-saving, throughput and lifespan. © 2021, The Author(s), under exclusive licence to Springer-Verlag GmbH, DE part of Springer Nature.