This paper presents SSP (Sleep Scheduling Protocol), a centralized scheme for extending the lifetime of densely deployed wireless sensor networks by keeping only a necessary set of sensor nodes active. We present an algorithm for finding out which nodes should be put into sleep mode, and the algorithm preserves coverage and connectivity while trying to put as much nodes as possible into sleep mode. The algorithm is executed at the base station periodically. In this way, the network is reconfigured periodically, which also helps to a more even distribution of energy consumption load to sensor nodes. We evaluated our protocol via simulations and observed a significant increase in the lifetime, depending on the node density, while providing good coverage.