In wireless sensor networks, sensor nodes collect local data and transfer to the base station often relayed by other nodes. If deploying sensor nodes evenly, sensor nodes nearer to the base station will consume more energy and use up their energy faster that reduces system lifetime. By analyzing energy consumption, a density formula of deploying nodes is proposed. The ratio of whole energy of sensor nodes to energy consumption speed of sensor nodes in every area can get consistent if deploying nodes by the density formula, therefore system lifetime is prolonged. Analysis and simulation results show that when communication dominates whole energy consumption and the monitored region is big compared with radio range of sensor node, system lifetime under this scheme can be 3R/(2t) times of that under deploying nodes evenly, where R is radius of the monitored region and t is radio range of sensor node.