Friday, September 21, 2012

Casting the net further

About 3 years ago, whilst working for a central London energy monitor company, a co-worker asked me whether it would be possible to come up with a device which would allow her to switch off electrical equipment in her home remotely using the internet. I thought about the problem for a while and finally cobbled together a solution that used a Microchip  dev.Net board, a repurposed wireless remote socket and a couple of PIC microcontrollers.

It was a real lash up, but it proved the point that the internet could be usefully used to remotely control simple devices - provided that it could extend it's capabilities beyond the router and the CAT 5 cable, using a low power wireless link. With wireless, it is possible to set up a zone of connectivity around the ethernet to wireless gateway, and any wireless compatible device brought into this zone would benefit from 2 way connectivity to the net.

This proved to be a powerful technique, and the advent of affordable open source hardware based around the ATmega328 microcontroller and the RFM12 low power transceiver allowed users to experiment with wireless sensor networks for remote sensing and home automation. The great thing is that this hardware is now available from a variety of sources, and shares RF compatibility - allowing you to mix and match devices from various supplers.

Further experimentation in the Autumn of 2009, led to the desire to produce an affordable internet gateway, and some work was done using hacked about energy monitors and the ethernet equipped Microchip PIC 18F67J60. Our out of hours development work led to "once per second"  power readings being sent up to a web based visualisation system in December 2009. Some of these ideas ultimately went on to be incorporated into the Nanode project during its design phase in March 2011.

This summer, I have spent the last 6 weeks visiting a variety of weekend events, including OggCamp 2012 in Liverpool, EMFCamp in Milton Keynes, the Brighton Mini Makerfaire and just theis last weekend OSHCamp in Hebden Bridge, Yorkshire.  Seldom a weekend at home it has been a good opportunity to catch up with the open hardware scene - and realise that the whole world has gone Raspberry Pi mad.

It was in the open fields of EMFCamp that I decided to do a range check on the RFM12 wireless transceiver. Using a couple of devices fitted with 868MHz  modules, I was able to wander around the campsite with my laptop and prove that the open field range of the RFM12 was better that 250m.  In a built up suburban enviroonment this translates to about half this distance - a similar test done in my street got me 130m from home before packet reception became unreliable.

The emonCMS server has become a central part of the remote control and monitoring system. It allows data  from sensors to be datalogged and visualised, whilst at the same time permitting commands and data to be sent back to control wireless nodes.


If we think of a node as a microcontroller with a RFM12 attached, there could be a standard set-up page on the server  which allows you to define the pin functions and allocate those to various input devices - analogue and pulse sensors, and output devices, such as relays, pwm drives etc.



It is our intention to publish the command structure - we are still looking at the best way to send both commands and data back to individually addressed wireless nodes.

There is also the issue of privacy/security.  It's good to be able to see other people's public feeds, but if my gas boiler is connected to a relay on a wireless node, it would be foolish and unsafe to give everyone access to that device.

One way of handling this is with the use of apikeys that are generated when you first register an account on the server.  

The simplest node could just be an Arduino with RFM12 shield or JeeNode, or even a stripboard Arduino with an RFM12 module mounted. Nathan Chantrell cleverly shows how to do this in his blog post


Nathan has gone on to produce similar designs with the ATtiny - if you want minimalism, and the ATmega1284 - if you want more I/O and much more RAM.  For most people, the ATmega328 is a good compromise, offering 6 analogue inputs and 7 digital I/O, once the RFM12 has been connected to the SPI bus and interrupt line.
The introduction of the new surface mount, ready assembled Nanode RF, this Autumn, will allow easier access to the project for those who don't wish to solder a kit, and with the Sketchgarden remote bootloader and emonCMS server, it should be even easier for people to get up and running quickly.

There is now Nanode compatible hardware from JeeLabs, OpenEnergyMonitor and just recently harizanov.com - with a very small ATtiny based node http://harizanov.com/2012/09/super-funky/

With a lot of people purchasing Raspberry Pi's, it seems logical to use this device as a local server running a version of emonCMS, and already some experimental RFM12 boards have been made that plug into the PI's   I/O connector.


We believe that the combination of simple open source hardware based on 8 bit microcontrollers fitted with a low power wireless link is a powerful tool for extending the internet into the field of remote control and monitoring.  Nanode is committed to continue to produce low cost hardware to develop this further.

Ultimately we should like to see Nanode gateway products priced between £20 and £25, and simple ATtiny based wireless sensing nodes starting at around £10.  Continued use of DIL and through-hole designs suitable for the DIY/home assemby market, will be complemented by ready assembled SMT devices.




No comments: