In consideration of the characteristics of energy heterogeneous in wireless sensor networks, this paper focuses on performance analyses of classical low-energy adaptive clustering hierarchy routing algorithm (LEACH). Especially, we investigate the limitations of the LEACH in terms of energy balance and networks scalability. On this basis, a new distributed energy-efficient clustering algorithm (DEEC) is proposed. The main idea is that the cluster-heads are elected by a probability based on the ratio between residual energy of each node and the average energy of the network. The nodes with high initial and residual energy will be assigned more chances to be the cluster-heads than the nodes with low energy. The simulation results show that DEEC efficiently decreases energy consumption, balances energy consumption in the whole networks and achieves longer lifetime. We hope that this work could contribute in study and design of energy efficient and QoS aware routing protocols for wireless sensor networks.