Skip to end of metadata
Go to start of metadata

In this activity, you will build a miniature, XBee-enabled version of the arcade game "Storm Stopper".

If you get stuck, go to the Troubleshooting links at the end of the example.

1. Requirements


Three XBee 802.15.4 modules

One Arduing Leonardo

One XBee Shield

Two XBee breadboard adapters

One XBee USB adapter

to configure the XBees

Three solderness breadboards

Two push-buttons

Thirteen LEDS

Thirteen 330Ω resistors

Jumper wires

Two 9V battery clips


Two 9V batteries

Two breadboard power supplies

One micro USB cable

One min USB cable



If you have not already done so, use the links below to download and install the software:

For further information about XCTU, go to the XCTU walkthrough.

2. Add the XBees to XCTU

  1. Ensure that the XBee is seated firmly in the XBee USB adapter.

  2. Plug the XBee USB adapter into your computer using the mini-USB cable provided.

  3. Open XCTU.

  4. Make sure you are in Configuration working mode.

  5. Click Discover radio modules from the toolbar.

  6. In the Discover radio devices dialog, select the serial port(s) in which you want to look for radio modules. If you do not know the serial ports where your modules are attached, select all ports. Click Next

  7. In the Set port parameters window, maintain the default values and click Finish.

  8. As XCTU locates radio modules, they appear in the Discovering radio modules… dialog box. Once the discovery process has finished, click Add selected devices.

  9. At this point, you should see something like this in the Radio Modules section on the left:

The port number and MAC address do not necessarily have to be equal as shown in the picture.

3. Configure the XBees

Select two of the XBee modules to be the remote modules. The third and final module will be connected to the Arduino, and will be referred to as the local XBee.

  1. Restore the default settings of all XBees with the Load default firmware settings button at the top of the Radio Configuration section.

  2. Use XCTU to configure the following parameters:

    Param110px|Local XBee110px|Remote XBee 1110px|Remote XBee 2Effect
    CHCCCDefines the frequency to use to communicate. This must be the same for all radios on your network.
    ID201520152015Defines the network that a radio will attach to. This must be the same for all radios on your network.
    DH00DH and DL combined form the destination address. This is where the notifications are sent when the button value changes. The address being configured here is known as a short address. A short address is assigned during configuration. An XBee also has a long address (SH and SL combined) which is assigned permanently when the unit is manufactured.
    MY123412351236Defines the XBee's short address.
    APAPI enabled w/PPP [2]Enables API mode with escaping.
    D0DO Low [4]DO Low [4]Sets the DIO0/AD0 pin as digital output low in the remote XBees. This pis is connected to an LED.
    D1DI [3]DI [3]Sets the DIO1/AD1 pin as digital intput in the remote XBees. This pin is connected to a button.
    IC0202Configures the remote XBees to transmit an I/O sample when pin DIO1/AD1 changes.
    00000010 (binary) = 02 (hexadecimal) 

    — keep the default value.

  3. Write the settings of all XBees with the Write radio settings  button at the top of the Radio Configuration section.

4. Connect the components

Remote XBees

  1. Create the following circuit with each of the XBee breadboard adapters.

    Ensure that each wire is connected to the same column on the breadboard as the indicated pin of the XBee breadboard adapter footprint. This ensures that the signals to the XBee are correct.

    LEDs have a polarity and their orientation in the circuit matters. Ensure that the cathode (short leg) of the LED is connected to the same column on the breadboard as the resistor to ground.

    Click to expand diagram

  2. Insert the remote XBees into the breadboard adapters. Push down firmly on each XBee to ensure they are seated properly on the breadboard adapters. Do not be afraid to use a little force.
  3. Insert the adapters into the breadboards. Push down firmly on each adapter board to ensure they are seated properly on the breadboards.
  4. Double check that the breadboard adapters and XBees are positioned in the correct location and oriented the same as the image below. Incorrect placement has the potential to result in damage to components.

    Click to expand diagram


  1. Create the following circuit with the Arduino and XBee Shield, using the remaining breadboard.

    LEDs have a polarity and their orientation in the circuit matters. Ensure that the cathode (short leg) of the LED is connected to the same column on the breadboard as the resistor to ground.


    Click to expand diagram

  2. Continue the circuit you built in the previous step by adding a second row of LEDs to the breadboard, as shown in the diagram below.

    Click to expand diagram

  3. Insert the local XBee into the XBee Shield.

5. Put it all together

  1. Apply power to the remote XBees using the 9V battery clips and batteries.
  2. Connect the Arduino Leonardo to your computer using the micro USB cable.
  3. Download and extract the latest zip archive from the XBee/Arduino Compatible Coding Platform release page.
  4. Open the Arduino IDE.
  5. From the File menu select Open.
  6. Browse to the stopit folder in the extracted zip archive, and select the stopit.ino file. Click Open.

  7. Find the following section at the top of the file and modify it to include the MY values for your remote nodes, and to specify the pins you are using, if they differ from the diagrams.

  8. Click Upload to upload and run the sketch on the Arduino Leonardo.

6. Play the game

  1. The Arduino randomly picks which player will go first. This player's LED illuminates.
  2. Player 1 presses her button to stop the LEDs. Play then moves to the second player.
  3. Player 2 presses his button, attempting to stop the LED at the same point as player 1.
  4. Once both players have gone, both players hold their buttons simultaneously for a moment and then release, to reset the game.

7. Troubleshooting

If you are encountering problems, these suggestions may help:

 How do I find the serial port of my module?

You can remove the XBee Grove Development Board from the USB port and see which port name disappears from your port list. The name that disappears is your XBee board.

Many people figure out which port is right via trial and error, but you can also use XCTU to find it:

  1. Open XCTU and discover the radio modules attached to your computer by clicking  on the top-left corner.
  2. Select all ports to be scanned.
  3. Click Next and then Finish.
  4. Once the discovery process has finished, a new window notifies you how many devices have been found and their details. The serial port and the baud rate are shown in the Port label.
 An error saying that the port is already in use by other applications is displayed.

The serial port where the local XBee module is connected can only be in use by one application. Check that the connection with the module in the XCTU console is closed and there are no other applications using the port.

 The error 'Device driver software was not successfully installed' is displayed.

Sometimes when you connect the XBee Grove Development Board into you computer, the operating system cannot install the driver automatically. If you get that error, try to remove and re-insert the board into your computer. If the OS is still unable to install the driver, remove and re-insert the board into another USB port.

As a last resort, install manually the USB drivers following the instructions that appear in the step 4 of the Downloading and installing XCTU section.

 How can I physically identify the XBee modules?

Once you have added the modules to XCTU, a simple way to identify them is to read the radio settings of each one and check the Rx and Tx LEDs of the XBee Grove Development Boards. These LEDs indicate that the XBee module is receiving (Rx) or transmitting (Tx) information through the serial port.

When you read or write the settings of a module, its Rx and Tx LEDs blink, so you can identify which module is connected to each serial port.

 An error is reported when installing XCTU.

XCTU requires Administrator permissions

Check that you have Administrator access on the machine where you are installing XCTU. On Windows systems, a User Account Control dialog may appear when you install XCTU or try to run the XCTU program. You must answer yes when prompted to allow the program to make changes to your computer, or XCTU will not work correctly. Note that you may also need to talk to your network manager to gain permission to install or run applications as administrator.

 No radios are found when discovery is performed or no serial ports are listed.

Check cables

Double check all cables. The USB cable should be firmly and fully attached to both the computer and the XBee Grove Development Board. When attached correctly, the association LED on the adapter will be lit.

Check that the XBee is fully seated in the XBee Grove Development Board

When the XBee is correctly installed, it should be pushed fully into the board and no air or metal should be visible between the plastic of the adapter socket and the XBee headers. Also, double check that all ten pins on each side of the XBee made it into a matching hole in the socket.

Check the XBee orientation

The angled "nose" of the XBee should match the lines on the silk screening of the board and point away from the USB socket on the XBee Grove Development Board.

Check driver installation

Drivers are installed the first time the XBee Grove Development Board is plugged in. If this process is not complete or has failed, try the following steps:

  1. Remove and re-insert the board into your computer. This may cause driver installation to re-occur.
  2. Remove and re-insert the board into another USB port.
  3. (Windows) Open Computer management, find the failing device in the Device Manager section and remove it.
  4. You can download drivers for all major operating systems from FTDI for manual installation.

Check if the modules are sleeping

The On/Sleep LED of the XBee Grove Development Board indicates if the module is awake (LED on) or asleep (LED off). When a module is sleeping, it cannot be discovered in XCTU, so press the Commissioning button and will wake up for 30 seconds.

 After resetting an XBee to factory defaults, XCTU reports errors for the KY and DD settings.

This is a known issue with the 6.1.2 versions of XCTU or less.

When the Invalid settings dialog appears, it is safe to continue to write settings.

  • AES Encryption Key (KY) is a setting that must be set by the user when encryption is used and does not apply with factory settings.
  • Device Type Identifier (DD) is a diagnostic parameter which is not used in the operation of the radio and can safely be set to any value.
Circuit assembly
 Do I need to match the wire colors used in the diagrams?

No, in many of the diagrams the color of the wires indicates something unique about its role in the circuit such as power, ground, and so forth. However, the color does not matter when assembling the circuit.

My circuit doesn't work
 Things to check first.

Is everything fully inserted?

Make sure that all components are fully inserted into the breadboard, sockets or connectors. When connecting, ensure that the wire or headers are aligned correctly and push firmly and evenly on the part. Header pins on the XBee or breadboard carrier boards should insert fully such that the plastic molding sits flush with the socket or board.

Do wires connect to the correct pins?

Check the diagram against the circuit that you have built. It can be easy to place wires so that they are one row off from the desired location. If you have any questions about which portions of the breadboard are connected, check out How to use a breadboard which describes the anatomy of a breadboard. This will help you to understand component placement in each game.

Are all XBees configured correctly?

Make sure that the configuration of each XBee matches the settings provided in the instructions. Before you configure the XBee, restore each module's default settings using the factory defaults button at the top of the Radio Configuration section.

 An LED does not light when expected.

Check LED polarity

An LED has a correct installation direction. When installed backwards it will not light when expected. The long leg of the LED (anode) must be provided with a higher voltage than the short leg (cathode). In most of the projects, the cathode is connected to ground and the voltage to the anode is controlled by connecting it to a digital output on the XBee or Arduino.

Another way to identify the cathode if you've clipped the wires, or want to check while it is installed is to look at the colored plastic housing. Many LEDs will make the body flat on the cathode side as well.

Check resistor

Resistors are placed in series with each LED to ensure that it does not receive too much current. Compare the stripes on the resistor being used to check that you are using the correct resistor. The resistors in these games are 330Ω and should have stripes that are orange-orange-brown.

 Do you get an error when uploading code to the Arduino?

If the Arduino IDE displays the message "Problem uploading to board." after you click Upload, enable the option "Show verbose output during upload" in the preferences (File menu > Preferences):

Click Upload again, and find the error message that appears above the line Problem uploading to board. See for suggestions.

Does the error message read "avr_dude: ser_send(): write error: sorry no info avail"?

This error appears occasionally on 64-bit versions of Windows. In order to upload code successfully to the Arduino, you must reset the Arduino at a specific time during the upload.

  1. In the Arduino IDE, click Upload.
  2. Press and hold the RESET button on the Arduino board.
  3. Release the RESET button on the Arduino board when messages like the following appear in the Arduino message window:

  4. After the code is uploaded to the Arduino, the following message appears at the bottom of the window:

Learn more

For more information about the hardware and software you use in this activity, see:

  • No labels