Modeling and constructing energy-efficient routing solutions to maximize the total network lifetime has become one of the most important techniques in wireless sensor networks (WSNs) due to the sensor nodes' limited hardware resources. In a distributed sensor network, cluster-based heterogeneous routing protocols, a common aspect of routing technology, have shown success in managing topology, energy consumption, data collection or fusion, reliability, or stability. This paper shows a new variation of Distributed Energy-Efficient Clustering (DEEC) protocol for WSNs, an energy-efficient three-level heterogeneous clustering method based on the DEEC protocol named Internet of Things DEEC (IoT-DEEC) protocol, is proposed. Unlike most other research, this considers the influence of the balanced thresholded sample in the energy consumption model. The current DEEC clustering protocol is enhanced by adding a threshold limit for cluster head selection and switching the power level across the nodes simultaneously. Our model is compared to Improved Distributed Energy Efficient Clustering (IDEEC) Protocol using MATLAB as a scenario based on quality metrics to measure network efficiencies such as the number of packets received by the base station (BS), overhead, packet delivery ratio, and throughput. After that, simulation results show that the suggested model is more efficient than the other protocol and substantially extends the sensor network lifetime.