In energy harvesting wireless sensor networks, the sensors are able to harvest energy from the environment to recharge their batteries and thus prolong indefinitely their activities. Widely used energy harvesting systems are based on solar cells, which are predictable (i.e., their energy production can be predicted in advance). However, since the energy production of solar cells is not constant during the day, and it is null at night time, these systems require algorithms able to balance the energy consumption and production of the sensors. In this framework, we approach the design of a scheduling algorithm for the sensors that selects among a set of available tasks for the sensors (each assigned with a given quality of service), in order to keeping the sensors energy neutral, i.e., the energy produced during a day exceeds the energy consumed in the same time frame, while improving the overall quality of service. The algorithm solves an optimization problem by using a greedy approach that can be easily implemented on low-power sensors. The simulation results demonstrate that our approach is able to improve the quality of the overall scheduling plan of all networked sensors and that it actually maintains them energy neutral