Wireless sensor networks (WSNs) are used in many applications to gather sensitive information which is then forwarded to an analysis center. Resource limitations have to be taken into account when designing a WSN infrastructure. Unbalanced energy consumption is an inherent problem in WSNs, characterized by multihop routing and a many-to-one traffic pattern. This uneven energy dissipation can significantly reduce network lifetime. This paper proposes a new routing method for WSNs to extend network lifetime using a combination of a fuzzy approach and an A-star algorithm. The proposal is to determine an optimal routing path from the source to the destination by favoring the highest remaining battery power, minimum number of hops, and minimum traffic loads. To demonstrate the effectiveness of the proposed method in terms of balancing energy consumption and maximization of network lifetime, we compare our approach with the A-star search algorithm and fuzzy approach using the same routing criteria in two different topographical areas. Simulation results demonstrate that the network lifetime achieved by the proposed method could be increased by nearly 25% more than that obtained by the A-star algorithm and by nearly 20% more than that obtained by the fuzzy approach.