Energy conservation is one of the most significant design issues in wireless sensor networks. In this work, we propose an energy efficient routing algorithm which aims to maximize the lifetime of the network by minimizing the energy consumption of the nodes, is proposed. We follow a methodology based on the modification of the Dijkstra algorithm by suggesting new link metric. We use residual energy, distance and the number of neighbor nodes in link weight computation. To show the performance of the proposed approach, we design a set of simulations with different parameter settings such as different numbers of nodes, different network sizes, different sensing ranges and different thresholds. Experimental results show that our algorithm performs better than the early version of the l)ijkstra algorithm in terms of network lifetime.