Wireless Sensor Networks (WSNs) play an important role in underground mining applications. In particular, they help to collect information using sensors and provide monitoring of complex mine environments to avoid potential risks and manage operations. Despite the importance of WSNs, they face the problem of energy consumption and the difficulty of replacing the batteries of the sensor nodes. The distributed energy efficient aggregation protocol (DEECP) helps to reduce the power consumption of the WSN. This protocol enables an increase in the lifetime of a WSN. The DEECP algorithm uses the clustering concept and selects cluster heads (CHs) according to the election probability based on the ratio between the residual energy and network average energy of each node. However, this method does not provide an optimum solution because it does not take into account the different sensor energy levels. In addition, the algorithm does not consider the effect of the distance between the base station and sensor node likely be chosen to become a CH. This can significantly affect the performance of the WSN. This paper proposes an optimization threshold for CH selection based on three energy levels of a sensor, namely, low, high, and super as well as the measurement of the distances between base stations and possible nodes be selected as CHs to optimize the CH selection method. The proposed approach is evaluated and compared with DEECP in terms of dead nodes, alive nodes, and network throughput. The results show that the proposed approach outperforms DEECPs in terms of network stability and lifetime.