Hardware Reference
In-Depth Information
A
A. Serial Switch set to Micro (to the left)
Arduino Wireless Shield
Several companies now make wireless shields for Arduino that
can work for this project. The original Arduino shield for XBees
used in the first edition of this topic has been substantially
redesigned. Now called the Arduino wireless shield (because
other radio devices with the same footprint can also work on
this shield), it has a few nice features, such as a prototyping
area, an optional microSD card slot (you'll see an SD card
example later in the topic), and a serial select switch to allow
you to change the XBee's serial pin connections.
When you're programming the Arduino, it's a good idea to
remove the XBee so that the radio's serial communications
don't interfere with the program upload.
To configure the XBee radio on the shield using your Arduino
board as a USB-to-Serial converter, program the Arduino
with a blank sketch, just like this:
void setup() {
}
void loop() {
}
When the wireless shield's serial select switch is set to
“Micro,” the XBee will be connected to communicate with
the ATMega328 microcontroller on the Arduino. When
switched to “USB,” it will be connected to communicate
directly through the USB-to-Serial processor on the Arduino,
bypassing the microcontroller. In this position, you can use
the Arduino's USB-to-Serial connection to configure your
XBees.
Then switch the serial select switch to USB. Open a serial
terminal connection to the Arduino board's serial port, and
send commands as shown in “Step 1: Configuring the XBee
Modules Serially.” Once you've configured the radio, unplug
the XBee from the shield, set the serial select switch back to
“Micro,” and program your Arduino as usual.
Search WWH ::




Custom Search