Wireless sensor networks have become one of the important emerging technologies in the recent years. Ubiquitous sensor nodes can be applied and deployed for various kinds of applications. However, the lifetime of the sensor nodes is limited by the lifetime of the equipped battery. Efficient energy consumption is very important to prolong the operation lifetime and coverage lifetime in sensor networks. Energy spent in routing is a dominant source of energy consumption thus conserving energy in routing is significant to prolong the lifetime as the whole. This thesis first proposes the distributed algorithm for constructing data gathering chain from the minimum cost tree. The power aware mechanism in selecting the leader of the chain to collect data and send back to base station is presented to ensure the uniform energy consumption among sensor nodes. The thesis also presents the scheme for maximizing the coverage lifetime of sensor network using linear programming. The sensor field is divided into grids; one node is active in a cell at the time. By formulating and solving the linear programming problem we can determine the network flow that can provide optimal coverage lifetime of sensor networks. The simulation shows that the first scheme provides longer lifetime and more uniform lifetime among nodes. The second scheme also provides longer coverage lifetime of the network as the whole as verified by simulation result. The thesis also discusses the implementation of the routing protocol on Nano OS platform.