  The aim of this paper is to show how simple interaction mechanisms, inspired
by chemical systems, can provide the basic tools to design and analyze a
mathematical model for achieving consensus in wireless sensor networks,
characterized by balanced directed graphs. The convergence and stability of the
model are first proven by using new mathematical tools, which are borrowed
directly from chemical theory, and then validated by means of simulation
results, for different network topologies and number of sensors. The underlying
chemical theory is also used to derive simple interaction rules that may
account for practical issues, such as the estimation of the number of neighbors
and the robustness against perturbations. Finally, the proposed chemical
solution is validated under real-world conditions by means of a four-node
hardware implementation where the exchange of information among nodes takes
place in a distributed manner (with no need for any admission control and
synchronism procedure), simply relying on the transmission of a pulse whose
rate is proportional to the state of each sensor.
