Aiming at the problems in farmland wireless sensor networks such as uneven nodes distribution, strict energy constraint, etc., a topology based routing algorithm TBCS-EA was proposed. Cluster heads were selected by considering the residual node energy and the node topology parameters, such as node position and density. This strategy made the nodes in an intensive area or close to the sink has a higher possibility to become a cluster-head, which could improve the network power efficiency. Existing clustering algorithms elect cluster head frequently, which will bring extra power consumption. An energy approximation scheme was also included in the algorithm. A node kept as cluster head until its residual energy reached the energy approximation target, then another node was selected as the new cluster head by using the topology based scheme. By doing this, the protocol cost could be significantly reduced. The simulation and experiment results showed that the network life span of TBCS-EA was more than 2200 rounds, which was about 1.5 times of CHCS and 2.2 times of LEACH. According to the node energy curve, the node energy balance of TBCS-EA was much better than that of LEACH, and it was almost like CHCS. The overall performance of TBCS-EA was better than that of the existing methods of LEACH and CHCS. ©, 2015, Chinese Society of Agricultural Machinery. All right reserved.