Arduino/XBee/Pachube Sensor Network


A "Minimal" Arduino/XBee/Pachube Sensor Network


A remote sensor unit which transmits a single reading from a photocell once per minute to a base unit which connects to the internet and forwards the data on to Pachube.

Bill of materials -- Base unit:
(1) Arduino Uno, Through-hole or SMD edition
(1) XBee ZB low power Zigbee Module, Digi Product ID XB24-Z7CIT-004, XB24-Z7WIT-004, XB24-Z7SIT-004, or XB24-Z7UIT-004 (these differ only in the antenna, they are functionally equivalent)
(1) LED for heartbeat (optional)
(1) 330-ohm resistor for heartbeat LED (optional)

XBee configuration:
  • Load the Zigbee Coordinator API firmware (I'm using Version 2170).
  • Set the PAN ID as desired, to match that of the sensor unit(s).
  • Set API mode 2 (AP=2).
  • Set baud rate to 9600.

Bill of materials -- Remote unit:
(1) Arduino Uno or similar (Through-hole, SMD edition, Boarduino, etc.)
(1) XBee ZB low power Zigbee Module, Digi Product ID XB24-Z7CIT-004, XB24-Z7WIT-004, XB24-Z7SIT-004, or XB24-Z7UIT-004.
(1) 10K resistor

XBee configuration is same as above, except:
  • Load the Zigbee Router API firmware ( Version 2370).

Here are the sketches. Unzip into the Arduino Sketchbook folder. Before uploading, be sure to disconnect the XBee from Arduino pin 0. Also be sure to enter your MAC, IP, and Pachube API key in the base station main module, and your Pachube feed number and the address of your network coordinator XBee in the main module for the remote unit.

Example Pachube feed. Boring, but at least you can see that it works. I'm not sure how long I'll be running.

Note that in the following wiring diagrams, the XBees plug into the Adafruit adapter, which in turn plugs into the breadboard. The XBee pins do not (in fact, cannot, spacing is different) connect to the breadboard. The adapter plugs into the breadboard, this is represented by the 10-pin header below the XBee.

Wiring the base unit




Wiring the remote unit

Base unit

Remote unit (using a Boarduino)