This paper presents a probability model of an energy-harvesting wireless sensor node, with the objective of linking quality of sensed data to energy consumption and self-sustainability. The model departs from the common energy discretization framework used in the literature, and instead uses a diffusion process modulated by discrete packet arrival and transmission processes for the detailed representation of renewable energy supply, consumption and storage. An analytical–numerical method is developed to compute the average time until the node experiences an outage, due to lack of energy, for a given workload and ambient energy characteristics, battery capacity and initial charge. The results are illustrated with numerical examples.