A strategy for energy saving in wireless sensor networks is to manage the duty cycle of sensors, by dynamically selecting a different set of nodes to be active in every moment. We propose a strategy for node selection in multihop sensor networks that prioritizes nodes with larger residual energy and relevance for the application. The proposed scheme is based on an implementation of the knapsack algorithm and it seeks to maximize the network lifetime, while assuring the application QoS. An environmental monitoring application was simulated and huge energy savings were achieved with the proposed scheduling algorithm.