I live on a rural property, and a few years ago I thought it would be useful to build a prototype solar-powered camera that transmitted still images as fast as possible from various spots around the property. It didn’t need to be video, which would have bigger bandwidth and power demands, but just a still image that was maybe triggered by movement or time. I thought it would be fun to see what the chooks are doing during the day, for example, or more seriously whether wild dogs were coming on to the property at night. It had to be low power, small, cheap, and be able to form a robust radio network for getting data back to the house.

I did build an Arduino-based prototype that worked. I chose Wi-Fi for the radio, which was certainly fast enough, but consumed too much power to be powered by a small solar panel, couldn’t easily be configured as a mesh network, and was really expensive. I shelved the project for a while, and filled my spare hours building iPhone apps instead.

A few weeks ago I finished reading Makers by Chris Anderson and Building Wireless Sensor Networks by Robert Faludi (both excellent reads, by the way), and I was inspired to have another try at my solar-powered, mesh-networked camera node. This time I’m trying ZigBee radios (XBee Pro 50mW modules), which have a decent bit rate, consume very little power, can easily be configured to form a mesh network, and are certainly cheap. This choice also presents a nice opportunity to get my hands dirty with ZigBee, which plays a key part in the products DiUS has built for the Smart Meter utility space.

I thought it would be interesting to document my journey, and that will be in the form of a series of posts here on the DiUS web site.

I kicked things off by ordering some parts from Sparkfun.com. It’s a very useful and well-stocked site for building gadgets. Here’s what I needed to get started:

  • 1 – $29.95 – DEV-11021 – Arduino Uno – R3
  • 2 – $81.90 – WRL-10421 – XBee Pro 63mW Wire Antenna – Series 2B (ZigBee Mesh)  ($40.95 ea.)
  • 1 – $24.95 – WRL-08687 – XBee Explorer USB
  • 1 – $3.95 – CAB-11301 – SparkFun USB Mini-B Cable – 6 Foot
  • 1 – $1.50 – PRT-10007 – Arduino Stackable Header Kit
  • 1 – $24.95 – WRL-10854 – XBee Shield

I already had an Arduino Duemilanove on hand, which was the latest thing in 2010. Now the latest version is the Uno R3, so I ordered one of those. It’s interesting to see them side-by-side; the updated design of the Uno is a lot cleaner.

The Arduino Uno R3 (right) PCB is a lot cleaner-looking than the circa-2010 Duemilanove (left). One of the nice things about the Uno is it uses a ATMega16U2 for USB, which means my Mac's OS X recognises it without extra drivers.
The Arduino Uno R3 (right) PCB is a lot cleaner-looking than the circa-2010 Duemilanove (left). One of the nice things about the Uno is it uses a ATMega16U2 for USB, which means my Mac’s OS X recognises it without extra drivers.

The Arduino IDE is now at version 1.0, and after a quick glance the software development environment is more mature and the libraries are richer.

There are heaps of different XBee modules from Digi to choose from, but I settled on the XBee Pro 50mW Series 2B with a wire antenna (the 63mW version is switched to the 50mW version for non-US markets). I wanted ZigBee for the ability to set up a mesh network, so that the radio network will have resilience in the case of node failure, and so that each node doesn’t need to be within range of the “home” node. It’s supposed to have a range of 1.5 kms line-of-sight, which should be enough to hop between nodes. The maximum data rate of 250 kbps is faster than previous version of the XBee modules, and I figure it should be enough to send small images if I’m not fussed how quickly they all come in.

The XBee Pro 63mW module with wire antenna - Series 2B (ZigBee Mesh)
The XBee Pro 63mW module with wire antenna – Series 2B (ZigBee Mesh)

The XBee Explorer is really just a USB dongle that takes an XBee module and lets you talk to it over a USB port.

The XBee Explorer
The XBee Explorer

The XBee Shield is for connecting an XBee module to an Arduino board. It takes the analog (PWM) and digital pins through, and the power line as well. It doesn’t come with stackable headers on the board; they need to be ordered separately and soldered in.

The XBee Shield with stackable headers soldered in. The trick for newbies is to get the headers sitting straight, which I almost managed to do.

The XBee Shield with stackable headers soldered in. The trick for newbies is to get the headers sitting straight, which I almost managed to do.

The first part of the project will be to configure the XBee modules and just get them talking to each other. That’s what the next post will cover.