Sensor networks have wide applications in areas such as health care, military, environmental monitoring, infrastructure security, manufacturing automation, collecting information in disaster prone areas, and surveillance applications [95, 7, 200, 110, 46]. For many applications, such as national security and health care, sensor networks are the backbone of the structures. In this context, a key problem that ought to be tackled is to design embedded software and hardware architectures that can effectively operate in continuously changing, hard-to-predict conditions [101]. In fact, the vision is that sensor networks will offer ubiquitous interfacing between the physical environment and centralized databases and computing facilities [227, 129, 172]. Efficient interfacing has to be provided over long periods of time and for a variety of environment conditions, like moving objects, temperature, weather, available energy resources, and so on.