

![0_image_0.png](0_image_0.png)

nodes at each time step. Note that all three measures are scaled to [0, 1]. At this point we would like the interested reader to understand the following two aspects. First, self-synchronized duty-cycling is indicated by the repetitive appearance of activity peaks over time (see solid line). Second, the adaptation to changing energy conditions is indicated by the changing height of the activity peaks. At times of lower battery levels, activity peaks are lower as well. This is the mechanism used by the sensor nodes to adapt to varying energy conditions.

Contribution of this Work. The first contribution of this work is the design of a protocol that captures the essential aspects of the swarm intelligence system previously proposed in [8, 7, 6]. The second contribution consists in the implementation of this protocol in Wiselib [1], a library of generic algorithms for wireless sensor networks. Finally, we experimentally test our duty-cycling protocol in a real scenario, simulating iSense sensor nodes from Coalesenses GmbH [3] with the network simulator Shawn [12].

The organization of the paper is as follows. In Section 2 the extension of Wiselib for dutycycling algorithms is introduced, followed by the description of the protocol for self-synchronized duty-cycling in Section 3. Finally, experimental results are presented in Section 4, and conclusions and an outlook are given in Section 5.

## 2 Wiselib: Duty-Cycling Concept

The Wiselib [1, 16] is a generic algorithm library for heterogeneous wireless sensor networks. The main objective concerns the implementation of algorithms that may be applied on different hardware and software platforms. Not only real sensor hardware such as MicaZ or TelosB nodes are supported by Wiselib, but also simulation environments such as Shawn and TOSSIM. The algorithms included in the Wiselib are organized in topics according to their functionality. In order to abstract the algorithms from the hardware and the operating system, a set of connectors specifies interfaces for interacting with them. A connector is also defined to interact with wireless sensor network simulators such as Shawn [12]. Those connectors are defined such that the same algorithm can be run on a physical platform or on a simulator.

The design of a new algorithm class in Wiselib requires the definition of a concept, that is, a specification of how an algorithm looks and behaves. In this paper we provide a generic concept for energy-aware duty-cycling algorithms, and provide one model for this concept (see Section 3).

In particular, a duty-cycling algorithm must assist sensor nodes in their decision of being active or