Mittwoch, 19. Oktober 2011

Presenting 'arduinode', a wireless sensor node library

arduiNode test hardware
Wireless sensor nodes (wsn) are micro controller boards with a communication device permanently hooked up to them. The communication device is usually a radio, but it can also be an infra red optical device or function with acoustics.

If you need only one wireless connection, things are pretty simple: collect the data and send it. But if you plan to use a cloud of devices, all connected and all gathering data which has to go some where, things can get a bit more complicated. For that I wrote arduinode.

Diagram of different network topologies. 
For example imagine you want to monitor the temperature of a big house with garden. Your central data collection point could be in the basement hooked up to a PC. Now if all your wsn needed to communicate directly with the central data collection point, let's call it 'master node', your transmitters would need to be pretty strong and consume a lot of energy. You would have what's called a star topology.

Here, the use of a multi hop mesh network is far more elegant. Each node can communicate with all its neighbors in transmit range. Data flows through the network and you get a pretty big area coverage while using small transmit power devices.

multi hop communication
That is the idea behind arduinode. It is a self organizing, self healing, multi hop routing protocol that handles all protocol logic. It has the ability to allocate id's and retransmits packets if they got lost. It avoids packet collision by listening on the channel before sending and including wait states if the channel is busy. It detects all neighbor nodes in its range and establishes communication with the node which is nearest to the 
master node. At the moment I use an infra red led and a infra red receiver (TSOP31236) as communication channel. This was the easiest way for me to develop the software. Also it is a very cheap option, transmitter and receiver cost under 1€.

To get multi hop to work was tricky... These IR beams find their ways.. So often I was building piles of books on my desk in order to shield the nodes from the master so they would multi hop the data. 
getting multi hop to work
The communication device is integrated in the software with some sort of driver. I plan to migrate to 433MHz transmitters soon, hopefully without too much trouble..

Get the code here  and access the wiki for further information.


  1. Hi

    Can you tell me in what state is your project? I've just found it and it seems very interesting and a bit similar to what I was doing, implementing a mesh network with the RFM12B radio module. I'll be very glad to test your project and to collaborate with you if necessary.

    Best regards


    1. Hello Fernando,
      did you try arduiNode yet? A collaboration is possible, please email to the email included in my source code.

  2. Please come to jeelabs and we will be very happy to test your mesh on the jeenodes!

  3. Hi Jan,

    You have a really cool library brewing here. I work on a lot of home automation and WSN devices and it would be awesome if your library was more generic and modular. This would allow the library to be used by anyone on any wireless media.

    I dare say that even combinations of media might even be possible. If want to collaborate and get the ball rolling in this direction, just ping me.

    1. Sorry, that was not for Jan. The comment was directed at the author.

  4. Hi Jan,
    I'm trying to modify your library for NRF24L01+. I would be happy to collaborate/contribute some how. Do you have any paper or reference for the multi hop mesh networking algorithm that you implemented ?

    Ali Sabri