—In this paper we propose a clustering and routing scheme for wireless sensor networks based on a self-organizing approach. The aim of this approach is for nodes to perform an integrated emergent task (data gathering and reporting to the sink) by simply following rules based on their individual local environment. Clusterhead election is also performed in a distributed manner and is based on sensorfs relative residual energy and the relative amount of information that they need to send to the sink. Hence nodes are assumed to possess variable data sizes across the network. In the scheme clusters are formed, and decide on their roles in the data gathering and routing procedure. Clusters at the edge of the network identify themselves and become in charge of initiating the routing of data, whilst intermediate clusters await data from higher clusters from the edge of the network for further aggregation and forwarding towards the sink. Simulation results show that the clustering scheme is a...