# Building Wireless Control Applications with XBee and LabVIEW
## 4 Experimental Tests
### Comparing Offset and Message Dropout at Different Distances  
The second experiment was aimed at investigating the influence of--(1) the sample period and (2) the distance between the computer and the sensor/actuator, in wireless connections. In particular, the dropout rate and the difference between the wired and the wireless measured values were analyzed. In this test an Arduino Uno was connected in series to an XBee module, so that the Arduino Uno acquired the value from the sensor, serialized it to the XBee module, which then sent it to the LabVIEW application.  
For this purpose, several experiments were carried out in which both characteristics (sample period and distance) were modified. More specifically, sample periods of 30, 50, and 100 milliseconds were considered. Regarding distance, since this work was aimed at evaluating the introduction of XBee modules in machinery of up to 5 m, the distances ranged from 0 (very short distance), 0.5, 2, and 5 m. The tests consisted of periodically sending sensor values at different frequencies (namely, 30, 50, and 100 milliseconds) and varying the distance between computer and nodes, at either 0 m (very  
Figure 3: Comparison of the Wireless (XBee) and Wired connections (NI myDAQ USB-6008). Left Top: XBee ADC (white) versus the NI myDAQ (red) signals. Left Bottom: Difference between both signals. Right Top: Comparison XBee + Arduino Uno (white) versus NI myDAQ (red). Right Bottom: Difference between both signals. (Tests at 0.5 m and sampling at 100 ms).  
close), 0.5 m, 2m, and up to 5 m. The duration of the test was always 30 s. The following data were analyzed for this test: (1) the message dropout rate, which was obtained from the frame checksum failures, as well as bad sequence numbers, see Figure 2; (2) the average difference between the wired and wireless values received for every value of frequency and distance; and (3) the standard deviation of the difference between the wired and wireless signals. Table 1 summarizes the results obtained from the tests carried out. For example, Figure 4 shows the test for a sampling rate of 30 milliseconds, at a distance of 0.5 m. The duration of the test was 30 s.  
The first thing to notice in Table 1 is that the message dropout measured averages below 2%. Additionally, no correlation was found between message dropout and distance (at least for the considered distances) and the sampling periods. The authors assumed that the high values at the standard deviation were mostly due to the effect of spurious interferences during the tests, as they were performed in a University Laboratory that experienced intensive Wi-Fi traffic (in a subsequent subsection, the effect of Wi-Fi interferences is confirmed). The most remarkable outliers occurred at five meters, where the effect of the interferences was expected to be more noticeable.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Test**} & **Distance (m)** & \multicolumn{3}{c}{**5**} & \multicolumn{3}{c}{**2**} & \multicolumn{3}{c}{**0.5**} & \multicolumn{3}{c}{**0**} \\ \cline{2-13}  & **Sampling Period (ms)** & **30** & **50** & **100** & **30** & **50** & **100** & **30** & **50** & **100** & **30** & **50** & **100** \\ \hline Message dropout (\%) & 1.3 & 1.2 & 1.3 & 1.8 & 2.1 & 2.2 & 0.9 & 2.3 & 1.7 & 1.6 & 2.2 & 2.3 \\ \hline Average Diff. total (mV) & –9.9 & –32 & –40 & –14 & –13 & –18 & –14 & –13 & –13 & –14 & –16 & –12 \\ \hline Standard deviation (mV) & 16 & 31 & 40 & 19 & 19 & 25 & 16 & 14 & 14 & 17 & 19 & 16 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of the experiment results at different frequencies and distances.  
Figure 4: Comparison between XBee + Arduino Uno (white) and NI myDAQ (red) signals. (Test at 0.5 m and sampling at 30 milliseconds).