# Star Type Wireless Sensor Network for Future Distributed Structural Health Monitoring Applications
## 2 Materials and Methods
### System Description  
A system capable of accurate rotational angle measurements of bell wheels and wireless streaming of time-stamped angle data is presented in this work, and the design choices for its implementation are detailed in Section 2.1. The schematic block diagram including data flow directions can be seen in Figure 3, only one sensor is shown to avoid clutter. In reality, five nodes were included in the star configuration as seen in Figure 4. A sensor node, pictured in Figure 5, comprised of an Arduino MKR1000 board for wireless communication and an InvenSense MPU-9250 MotionTracking(tm) device for measuring angular rotation. The Digital Motion Processor(tm) (DMP) within the MPU-9250 sampled data from the embedded accelerometer and gyroscope. The data was calibrated using factory trim values and a temperature compensated sensitivity scale factor from an embedded temperature sensor. The accelerometer and gyroscope used low-pass filters at an appropriate frequency to avoid aliasing. The DMP then calculated quaternions that were capable of describing three-axis rotation and translation in three-dimensional space and wrote them to the inter-integrated circuit (I2C) bus at a rate of 100 Hz. The Arduino MKR1000 read the I2C bus, time-stamped each quaternion, and then converted the quaternions to the Euler angle roll using the equation from [34]. The roll angle was selected to measure the rotation of the bell because its drift was an order of magnitude less than that of yaw. The time-stamped angles were then sent wirelessly to a computer via a router in data packets. The packets were filtered at the receiving computer using a unique identification number for each board. The MPU-9250 was controlled using the Open-source MPU-9250 DMP library downloaded from SparkFun [35].  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Chip Price (\(\ell\))** & **Breakout Price (\(\ell\))** & **Quaternion Calculation** & **Part Status** \\ \hline Requirements & – & – & Yes & Active \\ \hline MPU-9250 & 7.48 & 14.95 & Yes & Active \\ \hline MPU-6050 & 5.84 & 34.03 & Yes & Not active \\ \hline LSM9 DS1 & 4.46 & 9.20 & No & Active \\ \hline \hline \end{tabular}
\end{table}
Table 4: Comparison of inertial measurement units [28; 29; 30; 31; 32; 33].  
Figure 3: Block diagram of the data flow for one sensor through the system; solid arrows represent electrical connections and dashed arrows represent wireless links.  
The computer that receives the packets runs Java code in the Processing integrated development environment (IDE). A flow diagram describing the function of the Arduino and Java codes can be seen in Figure 6. The system also sent x-, y- and z-axis accelerometer data which were not used in this experiment, and were left out of the initial description for clarity. There were two interrupt processes in the Java code, one to enable sampling to continue whilst writing to files and another to allow sampling to be stopped at any time. Connecting more sensors was as simple as uploading the Arduino code to a new sensor and giving it a unique identification number. The unique identification number allowed the Java code to determine from which sensor a data packet came when it arrived at the computer. The system was designed such that there were no hard-coded internet protocol (IP) addresses, therefore allowing it to work on any IEEE 802.11 (Wi-Fi) network. The Java program saved the data in a comma separated value (CSV) files each containing 10,000 samples which could be read into MATLAB for analysis.  
Figure 4: Block diagram of the star network; dashed arrows represent wireless links.  
Figure 5: View of sensor in clear acrylic case. The sensor was placed on top of a standard-sized ID card to give an idea of scale.