# Design and Performance of a XBee 900 MHz Acquisition System Aimed at Industrial Applications
## 3 Design of a Wireless Monitoring System
### Logical TDMA Protocol over XBee  
XBee modules implement the CSMA/CA as medium-access control (MAC) mechanism. Unfortunately, this method is not suitable for deterministic applications since it is difficult to schedule the network traffic. In addition, WiFi, as well as most wireless sensor networks, operates at the 2.4 GHz band, which may generate uncoordinated traffic, which may create additional problems to ensure determinism. For these reasons, XBee 2.4 GHz modules are not frequently used in critical applications. In industrial scenarios, this problem may be circumvented by avoiding the 2.4 GHz band, so that critical applications may use less crowded spectrum bands so that wireless traffic may be more easily scheduled. This approach could improve the behavior of deterministic applications. For this work, XBee modules able to work in the 900 MHz band were selected, but this approach is also valid for other spectrum bands such as the 868 MHz band. In addition, the authors designed a new protocol aimed at providing higher determinism while improving the QoS of the wireless applications. This new protocol implements, at a logical level, the time-slotted TDMA medium-access control approach. Thus, the schedulability of the applications may be achieved, assuming that uncoordinated traffic is going to be reduced due to the use of the less crowded 900 MHz band. This approach guarantees a certain degree of QoS, even though technologies not specifically designed for critical applications, such as XBee, are used. It is assumed that time is centralized in one node, the Coordinator Node. The proposed protocol allows the following operations:  
* _Broadcast measurement command_: The Coordinator Node sends broadcast messages to all available Smart Measuring Nodes. These messages are received by all devices at the same time to read the values of the configured sensors. * _Unicast measurement command_: The Coordinator Node sends one unicast message to a specific Smart Measuring Node. These kinds of messages may expand the use of the protocol and make it more flexible. * _Distributed values collection command_: Smart Measuring Nodes send the values of the connected sensors to the Coordinator Node, which is responsible for collecting the data. * _Remote configuration_: The configuration of the system is centralized at the Coordinator Node which is responsible for sending the configuration messages to the Smart Measuring Nodes before the operation. Thus, by keeping the configuration centralized, the system may be more easily reconfigured for different scenarios. Figure 2 illustrates the behavior of the protocol for the distributed acquisition. The Coordinator Node delivers broadcast measurement orders in a timely manner, according to the scheduled plan. These messages are received at the same time at all Smart Measuring Nodes with very low jitter, as proven later. On the reception of the messages, they sample the values of the connected sensors, according to the selected configuration. The use of different time offsets at every device for sending the messages improves the determinism of the protocol since only one device is able to access the medium in a specific time instant. In this way, the medium access is scheduled at a logical level from the applications, bypassing the behavior of the XBee modules. These offsets are issued separately to every smart device node at the configuration stage, by means of specific messages. Figure 2 shows the processing at the nodes and the messages (arrows) among them at distributed measuring operation. Remote configuration messages are also used for specifying other issues such as the identification of the nodes, the number of connected sensors, the number of samples taken at every measurement command and the sampling time among them. XBee modules can be programmed in two operation modes, AT and API, but only the second mode is flexible enough to implement the proposed protocol aimed at monitoring applications. API mode allows for a deeper manipulation of the frames.