Sunday, August 26, 2012

Building an end to end wireless sensor network

Building Wireless Sensing Networks - using Open Hardware.

Over the last couple of days, I have been busy setting up a wireless sensor network as part of the preparations in readiness for a web controlled central heating and energy monitor system.

The various hardware modules are all open source designs - and I chose to use a mix and match approach to the system which was put together using hardware from a variety of vendors.  Compatible devices were used from JeeLabs, Openenergymonitor and Nanode Ltd.

If you haven't looked recently, there are now new offerings of ethernet gateways, wireless sensor nodes and open data services from a number of providers - the smart wireless sensor arena is starting to get interesting.

Here's a brief description of what is needed. A fuller report will appear in a later post.

There are four main parts to the system:

1.   The Wireless Node or WiNode. Supplied by Nanode Ltd.


This is the system's analogue sensor, with 4 channels of 10 bit ADC.  WiNode can interface to a range of analogue inputs, such as thermistors for temperature sensing, current sensors or optoreflective sensors for detecting motion or occupancy  or even reading the dial on the gas meter. Additionally there are 4 channels of high current pwm driver which can be used to control relays, solenoids, dc motors etc. WiNode can be powered from a 5V USB type supply, or from a 9V-12V unregulated dc supply. Typically WiNode reads its analogue inputs every 5 to 10 seconds and sends that data wirelessly to the display and the ethernet gateway.

Whilst WiNodes can be bought from Nanode Ltd - for around £30, there are other compatible sensors such as the JeeNode available from JeeLabs and emonTX - an electricity monitor available from Openenergymonitor.  The JeeNode was the first device to combine the ATmega328 and the RFM12B - and  through Jean-Claude Wippler's RFM12 code library, wireless communication between devices has been made very simple to implement.  The JeeNode is the "barebones" wireless node - and this is reflected in the price - just 18.50 Euros - from the Jeelabs Shop.



Alternativley, if you are feeling keen, the basic microcontroller and RF module used on WiNode can be hand assembled on stripboard for about £10.  Here Nathan Chantrell shows  temperature sensors based on both the ATmega328 and a temperature sensing node based on the ATtiny. 

2. The second part of the system is the Ethernet Gateway. This is supplied by Nanode Ltd - and is known as the Nanode RF.



The gateway combines the microcontroller and wireless transceiver with an ethernet controller - in this case the ENC28J60.  The on board micro runs a simple client, which receives the data packets from the sensor nodes, and pushes them up to the web based server.

As well as pushing data up to the server, the Nanode RF makes the occasional request for server time. Once it receives the packet containing server time - it makes it available to the emonGLCD so that real time can be displayed. The time packet could be sent to all nodes in the system to synchronise their time - as WiNode has an on-board real time clock, which could be occasionally be reset to server time.

The basestation is supplied by openenergymonitor as emonBase, or you can buy it directly from Nanode Ltd as the Nanode RF for about £30.

3. The third part of the system is a local graphic LCD display from openenergymonitor.org.


This display allows you to monitor the wireless data from the sensors, and also can be used as a user interface. It has it's own temperature and light sensors, and two Red/Green LEDS which can be used to indicate physical conditions - such as too hot, too cold - or for energy monitoring applications high load and low load. In addition, the display has 3 user configurable push buttons - which can be used for screen and menu item selection.

Whilst primarily a display module, the emonGLCD also sends regular temperature readings up to the server, and also has it's on screen clock regularly updated by time requests to the server.

This display is obtainable from openenergymonitor.org as a DIY kit, emonGLCD for approximately £50.

4. The final piece of the "end to end" system is the cloud based application software running on a web server.  This program receives the raw data from the Ethernet Gateway, and allows it to be processed and visualised by the remote server. The very nice chaps at Openenergymonitor have written a very comprehensive server, data logger, visualiser, and analysis package called emonCMS.

Here is a screenshot from Nathan Chantrell - who has been using emonCMS for energy and temperature monitoring.

It just takes a few minutes to log in to emonCMS, obtain an api key and start to record and graph data from the sensor network. emonCMS was originally intended for energy monitoring, but it is versatile enough to manage a range of different data feed types and has a wide variety of data manipulation, graphing, visualisation and dashboard controls.










2 comments:

  1. Great work!! I will made this for my home networks. thanks for this wonderful article.

    ReplyDelete