December 23, 2009

Wireless Wii Robot

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.
Posted under: projects, youtube, xbee, embedded