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:
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 readingPhysical 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:
Arduino pro mini (3.3V version), xbee series 2.5, used wii nunchuck, lipo battery, old off-brand mint tin.
9V battery, Xbee, ATmega168, SN754410 H-Bridge motor IC, lego motors
| 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.