Chapter 11

Wireless Communication with XBee Radios

Chapter Summary

This chapter covered the following concepts:

  • There are a wide range of available XBee models.
  • You must convert between 5V and 3.3V logic levels to use an XBee with most Arduinos.
  • You can configure XBee using either X-CTU on Windows, or the terminal on Linux and Mac.
  • There are a variety of options for powering your Arduino that do not require you to stay connected to your computer via USB.
  • You can communicate wirelessly between your computer and an Arduino using XBees.
  • You can communicate wirelessly between two Arduinos using XBees.
  • The millis() function can be used with state variables to create “nonblocking”
    code that implements time delays.

Parts List

Useful Links


  • In figure 11-18, the wiring diagram does not show the XBee shield mounted on the Arduino. The correct version is shown in the following colored wiring diagram.

Color Wiring Diagrams


Follow along with this XBee video tutorial:

Watch a demo of the wireless doorbell created in the chapter:


Chapter 11 Code Download

All code is licensed via the GNU GPL v3. Code is maintained and updated on GitHub. The download zip linked above always contains the most recent version of the code examples that have been pushed to the GitHub Code Repository.

Taking it Further

Without wires holding you back, the possibilities are limitless! Here are some project suggestions that you can now complete:

  • Build the SudoGlove control system.
  • Build a wireless multimedia remote for your computer by using Leonardo keyboard emulation on a receiving Arduino.
  • Build a remote-controlled car.
  • Build a remote weather station and monitor it from your computer or from another Arduino with data displayed on an LCD.

References & Credits

  • Figure 11-2: XBee Radio Photo Credit: SparkFun (Photographer Juan Peña), (source)
  • Figure 11-3: XBee Datasheet Excerpt Credit: Digi International, Inc., (source, PDF)
  • Figure 11-4: XBee Shields Credit: Arduino,, SparkFun (Photographer Juan Peña),, Cooking Hacks, (source 1, source 2, source 3)
  • Figure 11-6: SparkFun USB XBee Explorer Photo Credit: SparkFun (Photographer Juan Peña), (source)
  • Figure 11-13: Adafruit USB Wall Adapter Photo Credit: Adafruit Industries, (source)
  • Figure 11-14: Adafruit Barrel Jack 9V Adapter Photo Credit: Adafruit Industries, (source)
  • Figure 11-15: Center-Positive DC Symbol: Credit Public Domain from Wikipedia (source)