Saturday, July 19, 2014

MySensors

It's been a while since I started expermenting with wireless networks.
It all started with an attempt to convert the regular doorbell into a connected doorbell which could trigger a sound throughout the whole house. It would be nice if this could be any sound, so why not make it play mp3's? And if it's connected, it can also measure the room temperature & humidity and....
So I started experimenting with Zigbee modules (XBee, Zigbit) and point-to-point modules (CYRF6936, MRF24J40). The Zigbee modules I found too complex and expensive and the point-to-point modules lacked software support. I really wanted some form of mesh-networking that could communicate with home automation software and would cost me less than 10 Euro's per node.

Enter the nRF24

In search for cheap wireless networking modules I came across the Nordic Semiconductor's nRF24L01+. This single chip transceiver operates in the 2.4GHz range at bitrates upto 2MBps, communicates to a host using SPI and has very low power consumption.
Complete modules based on these chips sell for around $1 on eBay!
A few weeks later some modules arrived from China. Meanwhile I did some investigation on networking stacks based on the nRF24, but I could only find an Arduino driver.

Networking stack

I decided to implement a mesh-networking stack, but progress went slowly mainly due to lack of spare time and defects in one of the first modules I received.
After some time, while researching the net for nRF24 info, I stumbled upon the MySensors mesh networking stack. This library provides simple mesh networking for nRF24 based sensors, and uses the Arduino platform to run the stack and the specific sensor code. This was exactly what I was looking for!


Experimental MySensors setup, using Arduino Pro Mini (3V3), nRF24 and some sensors.
All powered from just 2 AA batteries.


MySensors

I still haven't rolled out sensor nodes based on the MySensors library, though. This is mainly because I'm still experimenting with reliability of connections and range of sensors. For some type of sensors (e.g. the doorbell) I want to be absolutely sure that the data gets delivered, for others (e.g. temperature measurement) an occasional delivery-miss isn't a big problem.
MySensors 1.3 is marked stable and a beta release for 1.4 is currently under test. The beta uses an improved nRF24 driver and has automatic acknowledgement and retransmission turned on, which improves connection reliability.


1 comment:

  1. Hi, I read your comments on mySensor website:
    > I built a simple software gateway that routes sensor readings from a mysensors network to an MQTT broker, and routes actuator values from a MQTT broker back to the mysensors nodes.
    > Powerful rules can be created easily, like subscribe to a light sensor and a motion sensor and publish a light-switch-on when it is dark and motion is detected.
    I'm very interesting about this choice, I'd like to use a similar for my project.
    Reading the documentation of my sensor gateway I don't if is necessary the use of the MQTT gateway (used as broker) or if you propose a different architecture.
    Can you explain it?

    tahnks a lot
    Gianluigi

    ReplyDelete