Pin pairing

All XBee modules have a set of pins which can be used to connect sensors or actuators and configure them for specific behavior. Each XBee radio has the capability to directly gather sensor data and transmit it without the use of an external microcontroller. The Legacy 802.15.4 modules provided in this kit have nine input/output pins, six of which can read analog values, the S2C 802.15.4 modules have four pins that can read analog values.

With these pins you can, for example, turn on a light by sending information to an XBee connected to an actuator, or measure the outside temperature by obtaining data from a temperature sensor attached to your XBee.

The term pin pairing (also known as I/O line passing) refers to direct input/output communication between two XBees. Pin pairing virtually links the pins of one XBee directly to the pins of another XBee. Imagine a wireless doorbell: press the button (input) and the doorbell rings (output).

The main advantage of pin pairing is that—because output is directly linked to input—you can change the value of the output without using a computer or microcontroller.

To make a pin pairing, set a pin on one XBee as input and set the matching pin on the other XBee as output. For example, to make a pin pairing with pin 11 (DIO4/AD4), perform these steps:

  1. Set the DIO4 to digital input by changing the value of the D4 parameter to DI [3].

  2. Configure the module to send automatic notifications when the state of the DIO4 changes. To do so, change the value of the DIO Change Detect (IC) parameter to 10 (see How XBee devices get sensor data).
  3. Set the destination address (DH + DL) to match the MAC address (SH + SL) of XBee B.
  1. Set the same DIO as digital output. To do so, change the value of the D4 parameter to DO Low [4] or DO High [5].
  2. Set the address of the transmitting module. The I/O Input Address (IA) parameter tells which XBee to listen to, this effectively binds the outputs to a particular module's inputs. Assuming that the MAC address (SH + SL) of ‘XBee A’ is 0013A20040D2A82E, set the IA parameter as follows to connect XBee B outputs to XBee A inputs:

Congratulations! You have just completed the section, so you are ready to do the Example: Pin pairing.