Showing posts with label nanode. Show all posts
Showing posts with label nanode. Show all posts

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.










Saturday, August 25, 2012

Building Blocks for Wireless Sensor Networks



"Smart wireless sensor networks will bring about improvements to the quality of life, allow greater interaction  with everyday systems and lead to energy savings and better efficiency". Well - that sounds like quite a tall order, but if you care to look back over the last five or six years, and have witnessed the rapid growth in this area of technology, you will surely agree that wireless technology is now thoroughly embedded in many aspects of our daily lives.

What has brought about this quiet revolution has been the availability of low cost wireless hardware and innovative design. Wireless technology has very much become an area of innovation within the open source community, and the availability of low cost open hardware for experimentation has greatly assisted in putting smart sensors into the hands of the amateur enthusiast, hacker or maker.

One of the most innovative proponents of low cost wireless hardware undoubtedly is Jean Claude Wippler of JeeLabs. Over the last 4 years, jcw has blogged tirelessly about wireless networks, physical computing and ultra low power sensor networks. Not only has jcw had new and fresh material almost o a daily basis, but this material has been a living lab-book of all his experimentation and product development. jcw returns to his blog at the start of September after his summer break - and if you haven't got him on your list of "must read" now would be a good time to start.

jcw's main innovation was to come up with the combination of a low cost microcontroller grafter to an equally low cost wireless transceiver module.  By making the microcontroller the same as the one used by the Arduino community and writing a code library to support the wireless operation , this ensured a rapid and large uptake by the DIY market.   However, through the JeeLabs shop, this hardware was made available at less than 20 Euros, putting it well within the budget of the hacker and maker community.

Not only has jcw produced a fine platform on which to base wireless sensor designs, but he also single handedly has developed almost every possible add-on widget to enhance the basic sensor.  The JeeLabs shop is an Aladin's cave of low cost pcbs and kits - both in conventional through hole construction and in size reduced SMT format.

JeeLabs has inspired others to contribute to the community, and there are a number of open hardware designs based around the JeeNode core.  Energy monitors, internet gateways, sensor/actuators, tiny format sensors, graphic displays have all arisen from the original work by jcw.

For all the reasons above, I would like to show my respect and appreciation for all the work done by jcw in furthering the open hardware community.



A Small Success 

For anyone working with open hardware, there is always that great feeling when stuff comes together - and just works.

The latest example, is my recently acquired emonGLCD from openenergymonitor - as it's name suggests, a graphical LCD.  This display however has at it's heart an ATmega328 microcontroller connected to the ubiquitous RFM12B wireless transceiver - so it's an Arduino compatible wireless graphical display. How cool is that?

Well, actually, it's very cool, because the GLCD can provide a big, bold display of wireless sensor data, and it can also communicate with a web connected basestation and display text, data, messages -  even graphs from the internet.

So this evening's task was to build up the GLCD kit and get it to display data from my WiNode wireless sensor.

The build to just under an hour, and about another half hour to gather together all the various code libraries scattered around the web to breathe life into it and get a working display.  Assembly was very easy - assisted with the excellent pictorial and video build guide.

A few modifications to the emonTx (energy monitor) code - so that it worked correctly on the WiNode hardware, was all that it took to get the system up and running.

Tomorrow I will endeavour to get the emonBase  (aka Nanode RF)  to communicate with the system  and get some of the sensor data up to a remote server.

Central Heating  - Revisited

One of the areas in which wireless sensor networks have already made a visible impact, is that of energy monitoring, and there are numerous commercial products available for electricity monitoring, as well as some from the open hardware community.

However, whilst an electricity monitor may help you to shave your electricity bill by a few pounds a year - the area in which smart sensors could really make a difference is in the control of the domestic central heating system.

Here in the UK, where natural gas prices are always on the rise, and we are more reliant on overseas gas, almost every UK gas heated property is using a heating control system that fundamentally has not changed in effectiveness since the 1960s.  Most homes are still reliant on a time clock, a poorly located bi-metal thermostat and a couple of motorised valves - at the helm of controlling their greatest energy consuming appliance - the gas central heating boiler.

There are several key places where wireless sensors - and actuators could make an impact on the average domestic heating system.

Firstly - a better thermostat - one that is actually located in the room you wish to control the temperature of! So many houses had their thermostats located in the hallway - that draughty wasted space between the front door and the stairs. With a wireless thermostat, you have one which can be located in the room you are sitting in, and if the thermostat is a display unit like GLCD - then you can have instant feedback on the room temperature.

Radiators located in unoccupied rooms should be shut off, or at least to a minimum, when the room is not occupied. Clearly we don't want the risk of the room being freezing, but if the radiator is fitted with a thermostatic valve, we have the means of individually controlling when that radiator comes on, and to what temperature it heats the room.

By monitoring one a room by room basis, how the house responds to changes in external temperature it should be possible to construct a model of how much heat is needed to keep the various living areas comfortable.

Now that we are approaching the end of August, and with the "heating season" only about a month away, the aim is to put in place and prove, the main elements of an end to end web based smart heating control system.  By better informing the occupants, and finer control of the boiler and radiators, a saving of energy should be possible.

The WiNodes will be used for room temperature and water temperature sensing - and the high current pwm outputs can be used to drive power resistors - used to close down thermostatic radiator valves when not needed. The GLCD will be the user interface - located in the living room, - easy to get at, simple, intuitive and not buried at the back of some airing cupboard.

Gas Meter Monitoring

If you can measure it - you can control it

Most of us haven't got a clue of how much gas we use in a typical day - and how this can vary wildly with outside temperature.

With simple monitoring it is possible to obtain fine grained reading of the gas meter consumption.  I am fortunate that my meter has a reflective patch in the centre of the end zero digit - so I can use an opto reflective sensor to monitor when a unit of 10 litres of gas has been consumed.

With a better knowledge of when gas is being consumed, and how this relates to central heating, water heating and cooking activities will allow these activities to be better co-ordinated with lifestyles. For example if hot water is needed for a morning shower, then this tank heat up period should be incorporated into the morning heating period - when the boiler is already up to temperature and can take the extra load of the hot water coil, without loss of efficiency.

If a bath is required in the evening - then the heating controller should have a bath button - which heats the tank sufficiently for the bath or baths to be taken - and informs the user of when the bath will be ready.