In this activity, you will create a simple quiz show buzzer system.
Two wireless nodes will communicate to an application on your Arduino, allowing you to host your own quiz show.
If you get stuck, go to the Troubleshooting links at the end of the example.
2. Add the XBees to XCTU
Ensure that the XBee is seated firmly in the XBee USB adapter.
Plug the XBee USB adapter into your computer using the mini-USB cable provided.
Make sure you are in Configuration working mode.
Click Discover radio modules from the toolbar.
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.
In the Set port parameters window, maintain the default values and click Finish.
As XCTU locates radio modules, they appear in the Discovering radio modules… dialog box. Once the discovery process has finished, click Add selected devices.
- 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.
You will connect the third and final module to the Arduino Leonardo using the XBee Shield. The third XBee module is the host XBee.
It does not matter which XBee modules you choose to be remote and host, all of the modules can function in either role.
- Restore the default settings of all XBees with the Load default firmware settings
Use XCTU to configure the following parameters:
Param 110px|Host XBee 110px|Remote XBee 1 110px|Remote XBee 2 Effect CH C C C Defines the frequency to use to communicate. This must be the same for all radios on your network. ID 2015 2015 2015 Defines the network that a radio will attach to. This must be the same for all radios on your network. DH — 0 0 DH 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. DL — 1234 1234 MY 1234 1235 1236 Defines the XBee's short address. AP API enabled w/PPP  — — Enables API mode with escaping. D1 — DI  DI  Sets the DIO1/AD1 pin as digital intput in the remote XBees. This pin is connected to a button. IC — 02 02 Configures the remote XBees to transmit an I/O sample when pin DIO1/AD1 changes.
00000010 (binary) = 02 (hexadecimal)
— keep the default value.
- Write the settings of all XBees with the Write radio settings button at the top of the Radio Configuration section.
4. Connect the components
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 will ensure that the signals to the XBee are correct.
Click to expand diagram
- Push down firmly on each breadboard adapter board to ensure they are seated properly on the breadboards.
- Insert the remote XBees into the breadboard adapters. Push down firmly on each XBee to ensure they are seated properly on the breadboard adapters.
Double check that the 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
Create the following circuit with the Arduino and XBee Shield, using the remaining breadboard.
The color of the wire leading to each button indicates the recommended color of the button to use. The color of the wires you use does not matter.
Click to expand diagram
5. Put it all together
- Place the host XBee module on the XBee Shield that is connected to the Arduino Leonardo.
- Apply power to the remote XBee modules using the 9V battery clips and batteries.
- Use the micro USB cable to connect the Arduino Leonardo to the computer.
- Download and extract the latest zip archive from the XBee/Arduino Compatible Coding Platform release page.
- Open the Arduino IDE.
- From the File menu select Open.
- Browse to the
quizshowfolder in the extracted zip archive, and select the
quizshow.inofile. Click Open.
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 on the Arduino (if they differ from the diagram).
Click Upload to upload the sketch to the Arduino Leonardo and run it.
6. Play the game
In this game, the host controls the board connected to the Arduino and is responsible for reading questions and keeping score. Players or teams are the participants using the "remote XBee" boards, and they will be answering the questions.
- The yellow status LED pulses on and off while the game host reads a question.
- The host presses the second (green) button to tell the Arduino Leonardo that the question has been read and players can buzz in. The yellow status LED stays solid.
- Players/teams using the remote XBees "buzz in" by pressing their button. The first team to buzz in is indicated when the status LED flashes several times, as well as the LED corresponding to that team (for example, the first LED for team 1, and so forth). Their LED then stays solid.
- If that team's answer is incorrect, the host presses the third (red) button. This prevents that team from buzzing in again until this round is over.
- Or, if the answer is correct, the host presses the second (green) button. This ends the round.
- If no team gets the right answer, the host can reset/end the round by pressing the first (blue) button.
If you are encountering problems, these suggestions may help:
For more information about the hardware and software you use in this activity, see: