This paper introduces a novel protocol named the Dual Cluster Heads Routing Protocol (noted DCHRP) designed for the autonomous organization of networks with limited resources within the context of the Internet of Things (IoT). The proposed methodology employs K-MEANS machine learning to partition the wireless network into K clusters and establishes two leaders within each cluster. This strategy aims to minimize energy consumption and evenly distribute the workload across the entire network. It is assumed that the network's nodes possess the capability to harness renewable ambient energy for battery recharging. Two versions of DCHRP are presented: the first one (DCHRP-K5) involves segmenting the network into K clusters, where K is set at 5% of the total node count. The second version (DCHRP-K10) maintains a fixed cluster count at 10%. Experimental evaluations conducted using the NS3 simulator demonstrate the capacity of the proposed approach to extend the operational lifespan of such networks. The outcomes of these experiments substantiate the efficacy of both DCHRP versions and their superiority over alternative methodologies such as LEACH and K-LEACH. Furthermore, DCHRP-K10 exhibits superior performance compared to DCHRP-K5.