A Wireless Sensor Network is a collection of sensors that communicate or follow a certain physical or chemical phenomena and then wirelessly transmit data about it to a data processing center. Therefore, one of the most important challenges facing this type of network is extending its lifespan and making efficient use of energy. The main objective of LEACH protocol is to extend the life of wireless sensor networks by improving energy use. The aims of this paper to do this by maintaining the continuity of the network's working time for the longest possible period. The simulation was carried out with Matlab, which included a number of comparisons with other algorithms, as well as working with the LEACH protocol. The results showed a significant improvement in extending the life and optimal use of energy compared to the rest of the algorithms.