Hello!
Today we will be covering our first wireless XBee example project. We will be using the following hardware in our design:
For more information on the XBee wireless module please see the linked Datasheet.
In this project we have two separate boards communicating using the XBee wireless modules. The first board is the Sparkfun Explorer USB board. This creates a simple USB to UART bridge and communicating with the wireless module. This board then appears to the user as a COM port in their device manager. We will use the hyperterminal program to read in and send out values over the XBee module. This will be our main hub of our wireless system connected to our PC. Just to note, the Explorer board can be replaced by a Pionner board where the PSoC 5LP device is connected to the Wireless XBee module.
The second board will be the Pioneer board using the Arduino wireless shield board with an XBee wireless module attached. In the image of the example project I’m using the SD card wireless shield. There’s no difference between the Arduino SD wireless card shield and the standard wireless with respect to XBee, only the price of having the ability to write to an SD card.
In this project we will be echoing values between the Pioneer and Explorer kits. This is a simple echo example for testing your XBee module operation. PSoC 4 will listen to the XBee module on the Explorer board and will wait for a specific value "CR" or until the maximum number of characters (16) has been received. At that point the PSoC 4 will echo back the received data with the prefix: "From PSoC 4: "
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- UART
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
The critical aspect of the XBee examples will be the configuration of the two nodes of the wireless system. The configuration will require either the Explorer board or for the PSoC 5LP UART bridge to be connected to the XBee wireless modules. In this example we use the Explorer board to configure both wireless modules. The wireless modules will need to be setup to create a Private Area Network (PAN).
In this example you will set the wireless module on the Explorer board as a “Coordinator” and the module on the Arduino shield as a “Router”. You will configure both of the wireless modules using the Explorer Board. For instructions to complete the configuration please see the following online tutorial:
In this tutorial you will need to download the X-CTU application, located here:
In our example we used the following values to enable the PAN:
Coordinator Settings:
PAND ID: 1777 (Any address from 0 to FFFF works, must match router)
Destination Address High: 0013A200
Destination Address Low: (Unique address printed below the 0013A200 on the Router module).
Router Settings:
PAND ID: 1777 (Any address from 0 to FFFF works, must match router)
Destination Address High: 0013A200
Destination Address Low: (Unique address printed below the 0013A200 on the Coordinator module).
The key point to the above configuration settings are the “Destination Address Low” values. Here you will need to enter in the value from the opposing wireless module. This is because we are creating a point to point system. Each module will need to know the ‘address’ of the other module.
The firmware for the PSoC 4 project is straight forward. The PSoC 4 will loop until either the ‘CR’ character (enter key) is received or if 16 characters are received from the main hub.
Once that condition is met the PSoC 4 will then transmit back the characters sent from the XBee module connected to hyperterminal.
Hardware Connections:
This project requires the user to connect their Pioneer board to the Arduino Shield board and insert the XBee wireless module into the shield board.
The user must also connect their XBee wireless module to the Sparkfun Explorer board and then.
Both the explorer board and the Pioneer kits will be connected to the PC.
Test Your Project:
Once you have configured the wireless modules, program your PSoC 4, and connected to the XBee module on the Explorer board through the COM port, begin sending values over the hyperterminal software to the PSoC 4 device. The followig image is the response from the PSoC 4 after sending the value "hello" and then striking the Enter key.
For more information on XBee, sparkfun has a nice online buyers guide.
You will notice from the images that we are using the Series 2 module with the wire antenna. The modules vary in the range of communication and power consumed.
I hope this example can help you out in your design.
Best,
Matt



