## 2 Materials and Methods
### Software Architecture and Bidirectional Communication  
Software: the prototype is flexible. Smartphone's commands are sent via BLE to activate/deactivate the sensor nodes (Figure 7). Such comprehensive wearable with sensor activation on demand is the first-of-its-kind. Implementing an efficient software is the second part of our work. Therefore, we have  
Figure 5: Layer 5: Physiological sensors. Top view (**right**): LED for measuring skin temperature and heart rate; Bottom view (**left**): temperature sensor and photo diode. Figure 6: Assembled prototype. Top line: top, bottom, and a subject wearing the wrist-worn device views; bottom line: side views of layers: 1-gas sensor, 2-gas sensor driver, 3-hardware interface, 4-main platform, 5-physiological layer. Diameter and height of the prototype are 33 mm and 20 mm, respectively. developed an interactive application. The application has three major parts: parameters and values- data-, interactive buttons to activates the sensors, and the status bar which indicate the status of sensors whether are activated (1) or deactivated (0). Re-pressing an interactive button changes the status (see Figure 8). The application has been developed in Visual studio with C# programming languages. The software shall enable synchronization of data for further analysis and save power consumption. Therefore, communication of device and smartphone is implemented in seven packets:  
* _F1:_ The motion tracking parameters includes gyroscope, magnetometer, and accelerometer. Each of this parameter is three dimensional and thus, nine values are transmitted. Packet F1 starts with one identifying byte followed by the sequence number (one byte). Each dimension of parameter is coded with 12 bits and packets are separated with another 4 bits. Therefore, the total length of F1 is 17 bytes. * _F2:_ Air pressure, temperature, and humidity also are merged in one packet. Again, the first byte is an identifier followed by the sequence number and total of 6 bytes of data (two bytes for each parameter). Hence, 8 bytes per second are transmitted. * F7:_ These packets contain the identifier, sequence number, and 2 bytes of data for UV radiation, sound level, pollutants, skin temperature and heart rate, respectively. The total of 4 bytes is transmitted for each. Sensors as well as data communication consume energy. For instance, the PPG uses an optical sensor that requires high energy. In contrast to other wearable devices, we suggest bidirectional communication to activate/deactivate particular sensors through commands from the smartphone. In our implementation, the user presses buttons to send these commands, but task- or measurement-depending automatic commands can easily be implemented, too. This feature supports an anytime-anywhere-anything-anyone concept in wearable devices. In the manual setting, the wearer can decide at what time and in which location what type of data is collected. In our prototype, we use it for gas, sound level, UV light, and PPG (PPG implementation is tested in debugging mode). This concept targets the applicability of the prototype and the monitoring status. We briefly describe, how the developed software application, the feature, and prototype are acting as the complementary items to support this concept. * Anytime: the smartphone application as an interactive and flexible feature can activate/deactivate the sensors at any time, when the user is willing, by pressing the button. * Anywhere: the compact structure of the prototype with a diameter of 33 mm and a height of 20 mm, is very convenient to be worn at anywhere without user daily routine interference. Figure 7: To activate the sensor(s), user presses the buttons on the smartphone. * Anything: covering a large effective range of parameters from major areas of interest in healthcare, broadband the range of application of this prototype. However, this feature needs to be further developed and extended.