Connect a Memsic 2-axis accelerometer and XBee RF module to the BASIC Stamp HomeWork board and load some code, and you've got a wireless tilt controller. Connect a second XBee RF module to a BASIC Stamp SumoBot board (or Boe-Bot) and load some code into that, and you've got a tilt controlled robot! Since XBee modules can be configured to pair off in different networks, and even on different radio frequencies, you can have multiple pairs of wireless tilt controlled Boe-Bot or SumoBot robots in the same room without any radio interference or crosstalk.
SumoBot wrestling at the 2012 Parallax Robotics & Microcontroller Expo, using XBee + Memsic wireless robot controllers. Photo courtesy: ©2012 Rich Harman.
Want to make a tilt controlled Boe-Bot robot instead? No problem, the SumoBot circuit works great on the Boe-Bot robot too.
For each wireless tilt controller + robot, you will need:
Schematic and Wiring for Tilt Controller
Schematic and Wiring for SumoBot
Note: The current photo shows SumoBot Vdd connected to XBee adapter VDD. It needs to be updated to show SumoBot Vin connected to XBee adapter VDD. Although the Vin = 6 V supply exceeds the XBee adapter's stated input range by 1 V, its voltage regulator can handle it. The benefit is that it adds some headroom to prevent supply voltage fluctuations (like when the motors stall during a SumoBot competition) from causing a brownout condition for the XBee.
Let's make sure your accelerometer is wired correctly first.
If you made two tilt-controlled SumoBot robots, it's battle time. Have fun!
If your robot starts beeping in the middle of tilt control, it might mean either your tilt controller's or robot's batteries are running low.
If you tilt the HomeWork Board forward a little bit, the robot will roll forward slowly. If you tilt it forward a lot, it will roll forward quickly. Tilting and rolling backward works the same way. If you tilt the board to the right or left also, the robot will turn in that direction.
The Memsic 2-axis accelerometer on your HomeWork Board can sense if the board is being held flat, or if it is tilted, how far and in what direction. It reports these tilts on each axis (front-to-back and side-to-side) as pulses that last certain amounts of time. The PBASIC program running in the BASIC Stamp HomeWork Board's onboard BASIC Stamp microcontroller makes it measure these pulses and convert them to numbers. The program also makes the BASIC Stamp send these numbers as serial messages to the XBee transceiver, which in turn broadcasts these serial messages for the XBee on the robot.
The XBee on the robot receives the serial messages and forwards them to the robot's BASIC Stamp. Its program converts the serial messages back to the numbers they represent. Then, it does some math on the values to figure out the speed and direction it should make the servo turn. It then sends a series of pulses to the servos. The amount of time each pulse stays high is what tells the servo what speed and direction to turn.
To learn more about programming your robot for autonomous navigation, try Robotics with the Boe-Bot or the SumoBot Manual along with Applied Robotics with the SumoBot.
Links
[1] https://learn.parallax.com/sites/default/files/content/sic_mini/XBeeTilt/Code-Tilt-XBee-SumoBots-20120503.zip
[2] http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/SICMemsicTut.pdf
[3] https://learn.parallax.com/project/tilt-radio-controller-your-boe-bot