picture home | pixelblog | qt_tools

omino code blog

We need code. Lots of code.
David Van Brink // Mon 2008.09.15 19:16 // {wbl weird blinking lights}

Fun With XBee

About a year ago, I was vaguely wondering if there were any low cost 802.11-ish WiFi modules, to easily add a net-presence to my dinky electronics doodles. There wasn’t; WiFi modules seem to run around $150 or more. (Which is the same price as a WiFi Kodak picture frame, but that’s parts for ya.) But I came across these $19 “XBee” modules and was intrigued…

XBee modules, from www.digi.com (not digikey), implement an RF protocol called ZigBee, 802.15.4. It can run at various power levels, up to about a mile. At 1mW, you get a few rooms coverage. An XBee transmitting at 1mW consumes around 50mA when either receiving or transmitting.

Just recently, on a whim, I got their starter kit which includes two modules mounted on boards, $99.

I have to say, it gave great Out Of Box experience! Just plug one into the USB port, and plug a serial loopback into the other, and fire up their little terminal program, and they’re talking!

So here’s what their $19 module can do:

  • Automatically form a repeater mesh
  • Default mode is a transparent 9600 baud serial party line
  • Can enter “command mode” by sending +++ onto the serial port
  • Can configure the module into different modes with AT-commands (snicker)
  • Can configure a module’s address, take it off the “party line”, and such
  • Has a half-dozen available I/O pins, which can be AT-configured to act as “virtual wires” between modules
  • Use ATWR to save the configuration… powers up identically next time.
  • Requires 3 volts.


The starter kit comes with two boards. The first uses USB for the serial comm port and for power. The second uses a DB-9 with official RS-232 on it, and a 12v adapter. The general purpose I/O lines are just sitting there, without even a header.

Some necessary modifications were in order. I added headers to access the I/O lines. (Pesky wave-solder on the PC board filled in all the holes; clearing them out with a soldering iron, melt-and-slam, works except for the pesky GND, I guess the four layer board’s ground plane is sucking away all my heat.) I contrived a 9v battery to power the remote board. I added some female headers to an LED and a microswitch.

Look, new toys! Some Panavise holders to replace the stupid “Helping Hands Magnifier” from Radio Shack. Sheesh I remember when that looked sooo useful. Also a new soldering iron, with digital readout. ($90 on eBay, search for “tmc soldering iron”, came with two irons and 6 tips, happy with it so far.)

Back To Work

I configured the two boards with a variation of the example in the datasheet:

Module with button:
ATDL 1234 their address
ATMY 5678 my address
ATD0 3 i/o 0 is an input
ATIR 14 sample rate
ATWR save
Module with LED:
ATDL 5678 their address
ATMY 1234 my address
ATD0 4 i/o 0 is an output
ATIU 1 i/o enabled
ATIA 5678 receive i/o commands from
ATWR save

And ho ho! They can talk.

Good clean fun.

oh, i dont know. what do you think?

(c) 2003-2011 omino.com / contact poly@omino.com