# Pattern Recognition in Older Adults' Activities of Daily Living
## 3 Materials and Methods
### Data Gathering  
This work combines BLE beacons with pattern detection algorithms to analyze individual patterns and detect anomalies in daily activities. Beacons are used as IoT devices, emitting periodic BLE signals at 2.4 GHz, containing Universal Unique Identifiers (UUIDs). Garmin smartwatches are also employed, with functionalities such as external communication, BLE device scanning, and Beats Per Minute (BPM). The smartwatch sends collected data to an API and gathers beacon signals via BLE scanning. BPM data are included as additional information to help identify moments of concern, though it is not used as a standalone indicator. This allows for an individual setup of each user through the smartwatch. To ensure the system is both scalable and user-friendly, it is designed to require minimal human intervention, limited to installing and configuring devices in users' homes. A mobile application facilitates the connection between monitoring daily activities and setting up the devices (beacons and smartwatches).  
The solution determines the user's proximity to a beacon using the Received Signal Strength Indicator (RSSI) and transmission power (\(Tx\)) values. RSSI measures the signal strength received by the smartwatch, ranging from \(-50\) (strong) to \(-100\) (weak), while \(Tx\) represents the beacon's transmission power, typically between \(-40\) dBm and \(+4\) dBm. Higher \(Tx\) values increase signal range but consume more battery power, reducing durability. These factors define beacon placement to ensure reliable and efficient operation.  
To minimize interference, beacons are installed in the center of ceilings, avoiding corners where signal strength might weaken due to walls or obstacles. They are spaced approximately every 5 m, providing reliable coverage for about 25 m\({}^{2}\) areas each, as presented in Figure 2. Although beacons can transmit signals over longer distances, this configuration prioritized accuracy and consistency.  
Figure 2: Configuration and placement of BLE beacons in each room of a house. Six beacons were used to setup the system in a house of five compartments.  
In this process, BLE beacons function as devices that periodically transmit data. The smartwatch application operates in the background, capturing and storing the received data in the format depicted in Figure 3. Additionally, the application records the BPM obtained from the smartwatch, as shown in Figure 4. Subsequently, the data are temporarily stored within the smartwatch's storage until it establishes a Bluetooth connection with a mobile phone. Once connected, the data are transmitted via Wi-Fi to communicate with an Application Programming Interface (API). The application manages these data, removing them upon successful communication with the API.  
Figure 3 shows that data are recorded every five minutes, including the date of the reading, the RSSI value, and the UUID of the associated beacon. This information is organized into a list and prepared for transmission to the API. Figure 4 shows how the reading of BPM data is stored locally, where the date and heart rate values are stored in each data point.  
In conclusion, this comprehensive process of collecting, storing, and transmitting data allows for the acquisition of valuable insights. By leveraging the resources of BLE beacons and a smartwatch, this solution paves the way for future analyses related to collected data regarding monitoring activities of daily living in older adults.