This tutorial explains how to control an I/O pin of a remote XBEE by sending API frames from a base XBEE.
Materials required :
2 nos XBEE S1 modules
1 USB XBEE Explorer board
1 XBEE breakout board
Jumper wires & LED.
One of the radios works as a Base & the other one as Remote.
The Base Radio is mounted on USB explorer and connected to a PC.This Radio is enabled for API so that frames including AT commands can be transmitted.
The Base XBEE used here has a 64 bit MAC address of 0013A200 40914B71
The remote XBEE has a MAC address of 0013A200 40A5C495
This is a unique number to every XBEE and is seen printed to the back of the radio.
Also you can see below the address a serial like
This represents S1 type of Radios. XB24 – ZB represents S2 type of Radios
We make use of the new generation XCTU software to configure the Radios.
Download link :
First we shall configure the Remote XBEE . The pin 19 (DIO 1) is enabled low and ensured that the radio is in operating on same Channel,PANID & Baud rate as the Base radio.
We shall use the same USB explorer to configure both the XBEEs.After configuration the remote XBEE is removed and mounted on to the XBEE breakout board & the Base XBEE is used with the USB explorer which is connected to a PC.
Plug on the remote XBEE to the USB explorer & fire up the new XCTU software.
On the welcome window click on the second icon to start Searching for the connected XBEEs.
The USB ports are displayed .In our case XBEE is connected to serial port COM128.Select it & click on NEXT.
Port Parameter window opens. Ensure that the selection is Baud Rate – 9600 , Data bits – 8 , Parity – None, Stop bits – 1 & Flow control – None.
Click on Finish.
Now the Device connected to the serial port is detected , which is our Remote XBEE.
Click ADD SELECTED DEVICES
The remote XBEE Radio module appears with MAC address.
Select the Radio to load the parameters.
Each S1 radio can be assigned a 16bit Source address( MY address) & a 16 bit Destination address (DL).This is user assigned.
Provide a MY address of 0011 for this Remote XBEE. The DL address entered here is 0010 ( which is the MY address of Base radio).
Assign a channel say, C & PAN ID as 3100 .This is also user defined. Ensure that the Base Radio also is configured for the same channel & PANID.
Scroll down the list to select D1 DIO1 configuration.Change it to 4 (LOW).This makes the physical pin 19 LOW initially.
Click on the WRITE button to save the changes made.
The configuration for Remote XBEE is done. Close the XCTU.
Remove the XBEE from the USB explorer & plug it to the XBEE breakout board. An LED is connected to pin 20 of this breakout board.The short lead of LED is connected to GND. As we’re using a blue LED (3v ) there is no need of a limiting resistor .
Pin 1 of the breakout board is connected to a +5v supply & pin 10 to GND. As the breakout board has on board 3.3v regulator , we can safely use a 5v supply.
Fig : Remote XBEE plugged on a breakout board .Pin 19 connected to an LED.
Now plug the Base Radio on to the USB explorer & start the XCTU software.
As we did for the previous XBEE ,click the Search icon & then select the Serial port where the USB explorer is connected.On the next screen ensure that the port parameters like Baud rate is same as we selected for the previous XBEE.
Click on Finish & then ADD Selected Devices.
Click on the selected Radio to load the parameters.
The DL Destination Address is set as the MY address of remote radio.The operating channel & PANID should be same as that of remote.
Scroll down further to set the API mode Enable.
Click on the WRITE button to save the changes made.
Now if you switch on the power for the remote XBEE , you can see the ASSOC LED on the breakout board blinking. This indicates that both the Base & Remote XBEEs are paired.
From the XCTU window Switch to Console working mode by clicking on the Terminal icon next to Settings icon.
At the right side corner you can see the “API CONSOLE , Status :Disconnected” message.
To open the serial connection with the radio click on the first icon on the left.
Now the API CONSOLE Status is Connected.
Click on the green + symbol seen at the bottom to get the Frames Generator window.
Provide a Frame name , say , High & then click on the Generator icon below.
Now the XBEE API FRAME GENERATOR window opens.
Select the protocol as 802.15.4
The Frame type is 0x17 which is REMOTE AT COMMAND REQUEST.
Sending commands over the wireless network to configure a Remote radio can be achieved only in API mode.The AT command can be sent wirelessly to change the state of a Digital output.
After selecting 0x17 as the Frame type , enter the 64 bit Destination address of the Remote Xbee.
For Broadcast mode you can use the address 0x00 00 00 00 00 00 FF FF
Next one is the 16 bit Destination Network address.Set this to 16bit address of Destination device,if known.Set to 0xFFFE if the address is unknown , or if sending a Broadcast.
Next one is Remote command options which is a Bit field to enable various remote command options. 0x02 is to Apply changes on remote.A value of 0x01 disables ACK.
Next is the actual AT command. Click on the ASCII tab and enter D1 ,as we need to toggle the state of DIO 1.
The next one is the Parameter value.If no characters provided here , the state of DIO 1 is queried.
Set this to HEX value 0x05 to send a HIGH value & set to 0x04 to send a LOW value.
Final value is the checksum.
Select the HIGH frame & then click on the “Send single frame “ green arrow button.The LED at pin 19 of Remote XBEE glows.
Select the LOW frame we’ve created & click the Send button.The LED at remote end goes Off.
Watch this support video :