Wireless sensor network routing protocol LEACH improves the energy efficiency with hierarchical topology structure, which exists shortages that less residual energy nodes are elected cluster head and that cluster heads directly communicate with base station. An energy balanced hierarchical routing algorithm (EBHRA) is proposed to improve disadvantages of LEACH. The EBHRA algorithm introduces residual energy of node as weight in the election of cluster head. It makes nodes with more residual energy possess higher probability to become head. Furthermore, a minimum spanning tree is constructed to transmit data between the cluster head which reduces the communication distance. The new algorithm runs with round and cluster nodes alternating rotate to realize energy balanced consumption. Performance analysis and simulation experiment shows that the new algorithm provides higher energy efficiency and longer lifetime.