Wireless sensor networks have serious energy constrain, since external power sources are typically unavailable. Typical wireless sensor nodes use batteries or fuel cells as the power source. The primary design goal of routing protocols is to efficiently use the energy of sensor nodes and prolong the survival time of the network. This paper analyzes the classical clustering routing protocol LEACH and improved it. The new algorithm balanced energy depletion of node by two methods. One is considering the current energy of nodes when selecting cluster-heads, another is limited number of nodes in each cluster. Simulation results show that the effectiveness of the improved algorithm and prove the improved algorithm is much better than LEACH in energy consumption and lifetime of network.