Fast 2-way XBEE series 2 data

March 18, 2010 projects, xbee, embedded

Say that title out loud. It’s a mouthful– any yet it’s not enough. There are so many names for these modules and a better title would be Fast two way Xbee ZigBee Series 2 Znet 2.5 Serial AT Communication. In my trials and tribulations building my quadcopter remote (soon I’ll post about it) I’ve run across problems getting two way, full speed, and reliable communication between my modules. Here’s what I discovered after a lot of manual reading:

Fast two way Xbee ZigBee Series 2 Znet 2.5 Serial AT

The heart of the issue is that Xbee 2.5 modules are not designed (spesificlly) to be point-to-point direct communicators. Whereas Series 1 modules can communicate directly with zero configuration, these series 2 ZNET modules need some work. Here’s a great article on the difference. There’s a few great articles on how to setup these znet modules, however they’re really hard to find. (I can’t even find which ones I’ve already manged to run across). Here’s the basic setup:

continue reading

Wireless Wii Robot

December 23, 2009 projects, youtube, xbee, embedded

Physical computing -> wireless two-way data -> physical control. This is a intuitive, durable, and fun way to control almost anything. Here I’ve built a transmitter which reads data from the Wii nunchuck and sends it over xbee. The rover receives the xbee broadcast, decodes it, maps it to drive the tank-like dual motor setup, and controls the motor driver IC. To achieve my goal of a small mint-tin fitted remote I used a lithium polymer (LiPo) battery, and to make them safer I included a voltage monitoring subroutine. The result is modular, easily incorporated into future projects, or disassembled for different use. Here are more details:

Transmitter

Arduino pro mini (3.3V version), xbee series 2.5, used wii nunchuck, lipo battery, old off-brand mint tin.

Receiver

9V battery, Xbee, ATmega168, SN754410 H-Bridge motor IC, lego motors

Pictures!

Source Files

View and download on GitHub

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
int ledPin =  13;

void setup(){
  Serial.begin(115200);
  nunchuck_init();
  pinMode(ledPin, OUTPUT);
  //print inital battery charge
  Serial.print("b=");
  Serial.print(update_batt_status());
  Serial.println("%");
}

void loop() {
  nunchuck_get_data();
  if (((nunchuck_buf[5] >> 0) & 1) ? 0 : 1){
    digitalWrite(ledPin, HIGH);
    send_packet();
  }
  else digitalWrite(ledPin, LOW);

These are provided under the same licence as my photos: Creative Commons Attribution-Noncommercial-Share Alike 3.0. Click on either image to download the one of the sketches.

Software Requirements

  • Arduino IDE 017 or later (for the new Wire library)
  • That’s it.

Helpful links/Resources

Future Directions:

  • Packetized data transfer
  • Bigger bot: (I have a wheelchair I can’t wait to get running..)
  • Put in an on/off switch and status leds.
  • Miniaturize the receiver into it’s own mint tin once I have a more permanent (not lego) rover.
  • Force feedback by measuring of current draw on the motors, rumbling the nunchuck (or something).
  • Generally more two-way communication.
continue reading