picture home | pixelblog | qt_tools

omino code blog

We need code. Lots of code.
David Van Brink // Wed 2008.09.24 23:02 // {wbl weird blinking lights}

XBee Untethered

The XBee module has an odd connector. It’s 20 pins in two widely-space rows, with 2mm spacing. Nice and efficient, but doesn’t fit into my gridlike 10th inch world view.

I mean, it’s fine, if you’re spinning a board…

But if you’re just dinking around, it’s nice to have it fit into that 10th inch protoboard world.

Thankfully, Sparkfun Electronics sells little adapter boards and the exotic 2mm-spacing female headers. A breakout board and all the connectors runs about $5.50 from them. (From Digikey, just the 2mm female headers are, like, $4.00 each. Sometimes their pricing confuses me.)

Here’s an XBee module connected to 3v, and a resistor, and an LED, and nothing else. Boots into receive-mode, and the led blinks in response to a button on a second module.

Also, bonus points to Sparkfun for shipping my whole order in a single heatsealed baggie in a very small cardboard box by US mail. Valuable service!

oh, i dont know. what do you think?


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.

Interlude

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
ATIT 5
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.

theLedBlinks.mov

click for
http://dvb.omino.com/blog/content/2008/wblXBee/theLedBlinks.mov

Good clean fun.

oh, i dont know. what do you think?



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