## 4 Experiments
### Experimental Testbed  
The prototype of wearable sensor network used for the experiments was built of four sensor nodes. Each node contains an ARM microcontroller (STM32F103C8T6) and communication module based on ZigBee technology (xBee S2C). Three of them are additionally equipped with the accelerometer (MPU-9250) and the light sensor (ALS-PT19). These sensor nodes are used as the wearable devices attached to a person, as shown in Figure 3. The fourth node acts as the sink and collects the information about recognized activities of the monitored person. Selection of the sensors for the experimental prototype was based on literature review. The accelerometers were used to enable recognition of human activities, such as sitting and walking. This type of accelerometer application is popular in the literature [40; 41; 42]. Additionally, the light sensors were included in the wearable nodes to enable coarse localization of the person and detection of active computer monitors. Results reported in previous works have confirmed that the light sensors can be useful for indoor localization [43; 44]. In order to measure energy consumption, the LTC4150 Coulomb counter was connected to each sensor node. The Coulomb counter enables estimation of residual battery energy in wireless devices. Its operation is based on differential measurement over a shunt, i.e., a small resistance connected in series. The Coulomb counter measures voltage drop across the resistor and evaluates current flow in the circuit using [PERSON]'s law. The smallest amount of energy, which can be measured equals 26 uAh. This energy results from the parameters of the internal resistor and the maximum energy consumption of the sensor node. The LTC4150 module provides a signal on an output each time the energy of 0.1707 mAh is consumed by the sensor node. These signals were counted during experiments by microcontroller of the sink node to determine the energy consumption over a long period of time. Figure 3: Placement of sensor nodes. It was assumed that all sensor nodes have the same battery capacity of 700 mAh. A balance between energy consumption of individual sensor nodes was achieved by implementing the cluster head rotation algorithm presented in [45]. Death of sensor node was detected each time the sensor node has consumed the predetermined amount of energy. The network lifetime can be determined with the different assumptions described in the previous section. The network lifetime was determined in this study as the time from the start of sensor network operation to the discharge of one of sensor nodes. This is due to the significant drop in recognition accuracy after any of the wearable nodes is discharged. The prototype of single wireless sensor node with connected Coulomb counter is presented in Figure 4. Block diagram of the testbed used in experiments with wireless wearable sensor network was shown on Figure 5. At the training stage, all data readings of accelerometers and light sensors were preprocessed by the sensor nodes (as explained later in this section), collected by the sink, and transferred to a workstation. In this way the sample data set was gathered for training the classification and recognition models. The models were trained on the workstation with use of Waikato Environment for Knowledge Analysis (WEKA package) and Konstanz Information Miner (KNIME) software [46]. The KNIME allows us to use both KNIME machine learning implementations and the WEKA repository that gives over 100 various methods and their variants. It proved to be useful in data exploration and finding machine learning solutions in previous works. For a small number of sensor nodes, the experiments could be conducted in a reasonable time using KNIME. For larger networks, Python or MATLAB would be more useful.