Edge Computing-Based Self-Organized Device Network for Awareness Activities of Daily Living in the Home

: Activities of daily living (ADL) are important indicators for awareness of brain health in the elderly, and hospitals use ADL as a standard test for diagnosing chronic brain diseases such as dementia. However, since it is di ﬃ cult to judge real-life ADL in hospitals, doctors typically predict ADL ability through interviews with patients or accompanying caregivers. Recently, many studies have attempted to diagnose accurate brain health by collecting and analyzing the real-life ADL of patients in their living environments. However, most of these were conducted by constructing and implementing expensive smart homes with the concept of centralized computing, and ADL data were collected from simple data about patients’ home appliance usage and the surrounding environment. Despite the high cost of building a smart home, the collected ADL data are inadequate for predicting accurate brain health. In this study, we developed and used three types of portable devices (wearable, tag, and stationary) that can be easily installed and operated in typical existing houses. We propose a self-organized device network structure based on edge computing that can perform user perception, location perception, and behavioral perception simultaneously. This approach enables us to collect user activity data, analyze ADL in real-time to determine if the user’s behavior was successful or abnormal, and record the physical ability of the user to move between ﬁxed spaces. The characteristics of this proposed system enable us to distinguish patients from other family members and provide real-time notiﬁcations after a forgetful or mistaken action. We implemented devices that constitute the edge network of the smart home scenario and evaluated the performance of this system to verify its usefulness.


Introduction
Activities of daily living (ADL) are the basic tasks of daily life, such as eating, bathing, dressing, toileting, and transferring [1].How well someone performs ADL is essential for determining an individual's signs of dementia, living skills, and independence [2].Hospital doctors mostly depend on interviews and questionnaires of patients to predict patients' life abilities.However, to accurately determine the mental health and behavioral ability of a patient, it is necessary to measure his or her ADL in daily life.Accordingly, Internet of Things (IoT)-based smart home studies measure ADL automatically in users' living spaces.However, current ADL measurement systems are limited to measuring user activity, the use of home appliances, and environmental data at home.They do not recognize which family members are using specific appliances, consider users' abnormal or faulty activities, or provide the convenience of being seamlessly applied in a general space.
A typical smart home system uses a centralized cloud computing method that transmits data measured at end devices to a cloud.Cloud computing has the advantage that organizations can avoid the capital expenditure of creating a data center because cloud computing consumes computing resources over the Internet from a large service provider [3].In contrast, edge computing-a new paradigm compared to cloud computing-enables technologies that allow computation to be performed at the network edge, so that computing happens near data sources [4].Massive raw data from end devices can be reduced at the network edge and sent to the cloud for a shorter response time [5].The device network proposed in this study adopts the decentralized topology of edge computing, which simplifies the implementation of unit space-based indoor localization services.Each indoor unit space in the proposed system has one edge network, from which generated data can be recognized along with specific location information.We determined the user's forgetfulness, the adequacy of activities, and physical moving ability by collecting the user's activity and location data from each indoor unit space.We also found that a smart home solution based on edge computing is suitable for identifying a user's behavioral features, frequency, and tendency based on the user's indoor location information.
A typical existing house is challenging to upgrade to a smart home that measures the user's ADL because of the need to replace existing home appliances with new smart devices and subscribe to mobile service providers' IoT services.Transforming an ordinary home into a smart home environment at minimal cost requires that the system enables the seamless installation of devices, autonomous collaboration, and a scalable network.
The ADL measurement system needs to collect ADL data and recognize the user, location, and whether activities were finished successfully or abnormally.Moreover, based on measured activities and environmental data, the system must inform the user possible dangers and record the forgetfulness of leaving a specific space without completing the work they were doing.Furthermore, these processes in the system should be performed without user intervention.Many studies on smart home solutions are being conducted [6], but most of these have yet to address these problems accurately.
Accordingly, to address these problems, we propose a self-organized device network structure based on edge computing that can recognize the user and location in real-time and determine whether the user has performed activities successfully or abnormally.Furthermore, the proposed system can notify the user when he or she is in a dangerous situation or forgets to do something.We developed three types of smart devices (wearable, tag, and stationary) that can be quickly equipped by users and home appliances, such that these devices have the advantage of being seamlessly applicable to typical existing houses.All devices in this system use a Bluetooth Low Energy (BLE) protocol, which enables the expansion of the wireless sensor network (WSN).Although other useful communication technologies for building IoT systems exist, such as ZigBee and LoRa, we used BLE because of its high data rate and transmission distance covering one indoor space.
Furthermore, BLE has the advantage of high accessibility because most smartphones support BLE communication.The smart devices developed in this study can be configured through the smartphone BLE app according to the user's requirements.For example, a user can quickly set the appliance type of a tag device using a smartphone.By exploiting edge computing, it is possible to quickly analyze user activities by unit space and determine whether the activities were finished successfully or abnormally.
The remainder of this paper is organized as follows.In Section 2, we review previous related studies.In Section 3, we propose a conceptual model for the proposed device network.In Section 4, we present the design details, and, in Section 5, we present a service scenario.In Section 6, we evaluate the implementation and performance for the validity and use of the system.Finally, in Section 7, we offer concluding remarks and explain the direction of future work.

Smart Home Research
A smart home is a house equipped with smart objects [6].Initially, smart home technology focused on the control of home appliances such as lights, air conditioners, and TVs.Today, the interactions between all electronic components included in the home system enable users not only to control them but also to monitor the environment and activities in the home.Moreover, it enables the elderly and patients to live in a comfortable home instead of expensive and limited medical facilities by continually monitoring their health information and providing real-time feedback [7].Systems that measure the use of goods and environmental data occurring at home [8][9][10][11][12][13] use sensor devices installed in home spaces and WSNs based on radio frequency (RF), Zigbee, and other technologies.
These systems can also transfer data measured at home through the gateway to the Internet if needed [8,11].Studies on indoor locations [14] continuously monitor users' locations to identify activity patterns and prevent them from moving into dangerous areas.Studies on collecting the activity or biometric data of a user with a wearable device [15,16] aim to monitor and manage the user's health in real-time by measuring walking, gesture, and posture information.Several studies [17][18][19] provide appropriate services to users by analyzing and predicting activities based on measured data in the residential environment.As a more specific study, the SPHERE Project deals with smart home environmental sensors, wearable devices, and sensor gateways [20].The SPHERE Project collects data for more than a year in an environment installed in the applicant's home.The project defines a general purpose data collection platform and deals with the robustness, reliability, and predictability required for real-time data collection.In the entire network of the SPHERE Project, implemented in the 6LoWPAN network, data is collected through the SPHERE home gateway and transmitted to the external SPHERE Data Hub.In addition, the SPHERE Project uses BLE as a sub-network.Both the device configuration and network environment of the SPHERE Project have similarities with the system proposed in this paper.

Indoor Localization System
This subsection presents several existing indoor localization methods.Although there are many studies for indoor localization, BLE is the most commonly used wireless communication technology because of its low-power properties and high accessibility (most smartphones support BLE communication).A model-based localization method using BLE beacons was proposed in [21], which tracked the position of a moving sensor by integrating highly unreliable and noisy BLE observations streaming from multiple locations.A positioning algorithm using a particle filter was proposed in [22], which used accelerometer and geomagnetic sensors with a floor map-based particle filter that used the proximity of Bluetooth beacons.
The problem with these approaches is in non-line-of-sight (NLoS) situations-where a wall or an obstacle exists between communication nodes-because the permeability through an obstacle is relatively low in ultra-high-frequency bands.Thus, BLE received signal strength indicator (RSSI) values can be inaccurate and unpredictable.To solve this problem, several studies used an excessive number of devices in a small room to improve positioning accuracy [21][22][23]; such a solution is inadequate because when the number of communication nodes increases, the wireless communication environment can be crowded and cause mutual interference in wireless communications.
A hybrid situation-aware indoor localization (SAIL) system [24], described in our previous study, uses a combination of low frequency (LF) and BLE to detect the indoor location of multiple mobile nodes in real-time.The system can detect whether a mobile node is inside or outside, based on the door where an anchor node is installed, and identify whether the mobile node enters or exits the space.The anchor node includes two LF antennae inside and outside the door and periodically transmits both LF signals (125 kHz) containing position information.The mobile node near the door receives the two LF signals and compares each signal's strength to determine the user's indoor location.Anchor nodes interact with adjacent anchor nodes to form a WSN that extends throughout the building, which enables indoor location awareness of the mobile node.To exploit the LF's obstacle permeability and BLE's low-power characteristics, we adopted this method for indoor location recognition and collected the user's indoor location data by implementing the user's wearable device as a mobile node.

Edge Computing-Based Solutions
A design method for a smart building (where various subsystems must be integrated to develop intelligent facilities), comprised of a two-level architecture (edge and fog layers) and embedded devices in edge or fog nodes, was proposed and implemented in [25].A resource preservation net (RPN) framework for emergency department (ED) systems was proposed in [26].The proposed framework was designed to model non-consumable resources and was simulated, highlighting significant improvements in length of stay (LoS), resource utilization, and patient waiting time.A video analytics-based intelligent indoor positioning system that provides centimeter-level positioning accuracy was implemented in [27].The system modularized a video analytics process that improves its efficiency, demonstrating a lower response delay than a traditional cloud computing model.A knowledge-sharing framework based on edge computing was proposed in [28], which enables an IoT device to share its knowledge with other devices at the edge in the vicinity.The authors found that the proposed framework reduces the response time for intelligent IoT devices and the power consumption for computation.The study in [29] proposed the use of an IoT edge platform and a social computing framework to build an energy efficient system in a public building scenario.The system has advantages such as reduced data transfer from the IoT edge to the cloud and reduced computing and network resource costs.

ADL Measurement
A study to detect dementia symptoms in elderly adults living alone using a machine-to-machine (M2M) and IoT platform was proposed in [30].The authors collected user behavior data by installing sensor devices in the home.Furthermore, they conducted questionnaires about user habits and personalities.The platform analyzed both sets of data to determine the presence of dementia.However, since the installed sensors and wires discomforted the patients, this platform may be challenging to apply to a real house.A watch-type device was proposed in [31] to provide activity-monitoring and healthcare for dementia patients.The device, which includes a GPS, accelerometer, and illumination sensor, measures the patient's activities and steps but does not analyze the flow of the activities to detect whether those activities were appropriate.An integrated system was presented in [32] to collect, record, and transmit data from multiple sensors placed in the homes of dementia patients using cloud applications.This system can identify the patient's forgetfulness and dangerous situations in real-time.However, this system did not consider inter-device interaction, collaboration, and system scalability.A context-aware reminder system for daily activities was proposed in [33].This system helps elderly adults with dementia complete several ADL without the help of a caregiver.This system can obtain elderly adults' tool usage information using a wireless sensor node.An automated functional and behavioral health assessment of elderly adults with dementia was proposed in [34].The authors used signal processing on wearable sensor data streams and machine learning algorithms to assess cognitive impairment and its correlation with functional health decline.Currently, B-ADL/I-ADL tests used in hospitals are conducted only through questionnaires, and this paper aims to measure these ADL tests more realistically.The system of this paper is designed based on B-ADL/I-ADL test elements [35].

Design Considerations
The following requirements are essential for producing a system for real-life ADL.

•
User identification: If a patient does not live alone, the measured activities in the house may be caused by other family members.Therefore, to collect the ADL of a particular user, it is necessary to identify whose ADL were measured.In this study, each wearable device worn by a user includes a unique ID, which is shared with adjacent devices as the user moves between indoor unit spaces.Consequently, the collected data in some areas can be assumed to represent activities performed by the user with that ID; • Unit space-based location awareness: It is necessary to distinguish where the measured ADL occurred.In this study, using the wireless communication between the wearable device worn by a user and a stationary device installed in each unit space, it is possible to track the user's indoor location in real-time and determine where the measurement of ADL occurs; • Abnormal activity awareness: The ADL measurement system should be able to determine and record whether the user's activities were finished successfully or abnormally and alert the user of abnormal or dangerous situations; • Privacy protection: The data generated at home are mostly personal, so users are not likely to want to expose such data.Therefore, each device in the system is required to protect user privacy by processing collected user activity and ADL data appropriately before transmitting a message to other devices; • Low-power consumption: The wearable and tag devices of the proposed system operate on batteries, so it is essential to consider a low-power implementation.We suggest how these devices can minimize power consumption and wake up wirelessly from a standby state.

Self-Organized Device Network
Figure 1 illustrates the concept of a self-organized device network in an indoor unit space.This collaborative network includes three types of devices (wearable, tag, and stationary).The tag device is easily attached to home appliances and can measure their usage states (e.g., opening and closing a refrigerator door, opening and locking a faucet, and turning on and off a gas stove).The tag device normally disables its internal sensors for low-power consumption.The stationary device in each unit space maintains connections with multiple tag devices and can activate the tag devices when a user enters that space.By using indoor localization as described in our previous study [24], a user's wearable device can recognize its current indoor location and whether it enters or exits a unit space wherever a stationary device is installed.When the wearable device passes through the door, it notifies the stationary device by sending a user entry packet that includes its ID information.Then, the stationary device detects which family member has entered the zone and sends activation messages to the connected tag devices.When the user enters, the tag device (which was in low-power mode) enables its internal sensors and prepares to measure appliance usage.Thereafter, the state changes of home appliances are measured by the tag devices, collected by the stationary device, and recorded in the wearable device.This autonomous process for measuring a user's ADL data is performed through inter-device collaboration without any user intervention.
the stationary device detects which family member has entered the zone and sends activation messages to the connected tag devices.When the user enters, the tag device (which was in low-power mode) enables its internal sensors and prepares to measure appliance usage.Thereafter, the state changes of home appliances are measured by the tag devices, collected by the stationary device, and recorded in the wearable device.This autonomous process for measuring a user's ADL data is performed through inter-device collaboration without any user intervention.

Inter-Device Communication Process
Figure 2 illustrates the communication sequence of wearable, tag, and stationary devices during self-organized cooperation in a unit space.Figure 3 illustrates the communication protocols that are defined to enable the wearable, tag, and stationary devices to transmit messages to each other.The stationary device acts as a network coordinator in that space, receives activity messages from multiple tag devices, and transmits ADL data to the wearable device.
A stationary device continually attempts to update its connection network by periodically scanning for nearby tag devices.A tag device has a service ID for the home item to which it is attached and a location ID for the indoor space in which it is installed.The service ID and location ID are included in a BLE advertising packet of the tag device and can be set through a smartphone BLE application.When the stationary device receives an advertising packet from an adjacent tag device that contains the location ID that it represents, it attempts to connect with that tag device through BLE and maintains the established connection.Thus, the stationary device connects only with tag devices in the same room, ignoring packets sent by tag devices in other rooms.
The stationary device can detect whether a family member with a wearable device passes through the door, using the indoor location recognition method from our previous study [24].The wearable device can determine whether it is inside or outside the door by receiving LF signals from the stationary device and comparing the RSSI values of the signals.When the wearable device detects a position change from the outside to the inside of the door, it initiates BLE advertising by including the wearable device ID.
After entry of the wearable device, the stationary device identifies the user by referring to the ID information included in the advertising packet of the wearable device and initiates a BLE connection with the wearable device.Then, the stationary device sends activation messages to all connected tag devices.The tag device receiving the activation message enables built-in sensors to measure the usage information of the home appliance to which it is attached.The wearable device is now ready to record the user's ADL in its internal memory.When the tag device detects a status change event as the user uses an item, it sends an activity message including its ID, type of appliance, and status information to the stationary device.The stationary device processes the received activity message, if necessary (for privacy or to reduce the amount of data), and sends it to the connected user's wearable device; then, the wearable device writes the user's ADL data to flash memory.The stationary device continues executing this process until it receives a BLE advertising packet that signifies the user's exit and terminates the BLE connection with the wearable device.After the user exits the space, the stationary device sends deactivation messages to the tag devices in its network, which disable internal sensors of the tag devices.
Using the proposed device network alone, it is not possible to distinguish who used home appliances when two or more users enter the same space.For ease of implementation, we usually use the predetermined wearable device ID of an individual for recording activities occurring in a unit space.The tag devices in each unit space are activated or deactivated according to the entry or exit of the wearable device with this ID.However, in the case where specific individuals must be distinguished from other family members, we recognize a user using the proximity-based neighbor-identification protocol (PNIP) [36], which is an LF and BLE hybrid protocol.

Abnormal Activity Awareness
The wearable device in this study can distinguish whether a user has acted inappropriately by referring to the collected ADL data.We have defined several criteria for determining a user's abnormal activity that may occur in a living space.First, if any appliances are not turned off when a user leaves a space, this may indicate the user is frequently forgetful.For example, when a user leaves a bathroom without flushing the toilet or moves from the kitchen to another room without turning off the gas stove, the wearable device recognizes a behavioral fault.Second is the case where a user forgets what to do in a space.If a user enters a bathroom and exits without doing anything, he or she has likely forgotten what to do.The final case is where a user remains in a space for too long a duration.Since this situation can be dangerous to the user, the wearable device alerts the user by vibrating and displaying notifications.
Algorithm 1 illustrates the pseudocode for the abnormal activity awareness of the wearable device.The wearable device operates as an event-driven method-the execution process occurs in response to specific events and not in a fixed order.This includes position change events as it passes through doors with stationary devices installed and time events generated from the internal real-time clock (RTC) chip.The wearable device saves user activity data to activity and appliance lists and checks these lists when leaving a space to identify unfinished work.Furthermore, it counts stay time (a user stayed in a space), using the event generated as an interrupt, every minute from the RTC.Accordingly, the activity data and the number of abnormal activities of a user can be continuously recorded in the flash memory of the wearable device.Over time, the daily activity data and abnormal activity count recorded in the flash memory of the wearable device can be used to check an individual's living ability and frequency of forgetfulness.
In addition to abnormal behavior, many activities occurring in real life can be recognized in the same way as above.The activity recognition in this paper collects single actions through home appliance operation and sensor values.It is possible to analyze various activities by analyzing the sequence and timing between these single activities.For example, the act of washing the face can be expressed as a combination of various activities, from entering the bathroom, turning on the faucet, and washing the face using a towel.In order to analyze the user's normal behavior, it is necessary to analyze the sequence, timing and time required between these series of activities.This comprehensive behavior analysis is an important factor in an ADL Test.

Walking Speed Measurement
The proposed system automatically records a user's indoor location data and time in the wearable device's internal memory if a user only performs his or her daily activities in a residential space.Furthermore, the proposed system can record a user's indoor location and evaluate the user's walking speed between fixed spaces based on the location change event.Figure 4 illustrates the walking time measurement while a user moves between two indoor spaces.Spaces A and B are entry-detection spaces; each door is equipped with a stationary device, including two LF antennae (inside and outside).The user who was initially in Space A left that space and is trying to enter Space B. The moment the user enters Space B, the user's wearable device obtains and records the walking time by calculating the difference between the exit time from Space A and the entry time into Space B. Consequently, the walking speed (based on walking time) can be continuously calculated and recorded.Over time, improvement or deterioration in walking speed may be observed by checking the change in time required by the user to move between indoor living spaces.and outside).The user who was initially in Space A left that space and is trying to enter Space B. The moment the user enters Space B, the user's wearable device obtains and records the walking time by calculating the difference between the exit time from Space A and the entry time into Space B. Consequently, the walking speed (based on walking time) can be continuously calculated and recorded.Over time, improvement or deterioration in walking speed may be observed by checking the change in time required by the user to move between indoor living spaces.

Low-Power Consumption
The proposed smart home solution continuously measures user ADL, so the low-power consumption of wearable and tag devices should be considered.In this study, the stationary device is powered by a 12V/2A adapter, so it does not have battery restrictions.Therefore, we did not consider the low-power consumption of the stationary device.The following describes how to reduce the standby power of the wearable and tag devices.

•
Wearable device: The LF signal was used for indoor location recognition in this study because of its low-power characteristics and excellent permeability to obstacles [36].The wearable device containing an LF receiver is normally in sleep mode.If it receives an LF signal that matches the receiver's predefined pattern ID, it wakes up.Therefore, the wearable device can remain in sleep mode and facilitate low power consumption.The payload of the LF signal includes door information and position data.After the wearable device wakes up, it starts the process of indoor location recognition; • Tag device: To consume minimal power for a battery-powered tag device, it is not appropriate that the internal sensors in the tag device are always enabled.Instead, the tag device should only be activated for detecting appliance usage when there is a user in the space where it is installed [37].In the proposed device network, the stationary device transmits activation messages to all connected tag devices when a user with the wearable device enters the zone of ADL measurement.A tag device that receives this message enables its internal sensors so that it is ready to detect the usage event of an appliance to which it is attached.Similarly, when the user exits the space, the stationary device sends deactivation messages to the connected tag devices.Thus, a tag device usually disables built-in sensors and enables them only when a user is in that space.
The sleep-wake up method using LF not only lowers power, but also reduces the interference caused by multiple users.A typical BLE communication method generates an advertising beacon for each peripheral device, and when multiple devices are operated, this method causes communication

Low-Power Consumption
The proposed smart home solution continuously measures user ADL, so the low-power consumption of wearable and tag devices should be considered.In this study, the stationary device is powered by a 12V/2A adapter, so it does not have battery restrictions.Therefore, we did not consider the low-power consumption of the stationary device.The following describes how to reduce the standby power of the wearable and tag devices.

•
Wearable device: The LF signal was used for indoor location recognition in this study because of its low-power characteristics and excellent permeability to obstacles [36].The wearable device containing an LF receiver is normally in sleep mode.If it receives an LF signal that matches the receiver's predefined pattern ID, it wakes up.Therefore, the wearable device can remain in sleep mode and facilitate low power consumption.The payload of the LF signal includes door information and position data.After the wearable device wakes up, it starts the process of indoor location recognition; • Tag device: To consume minimal power for a battery-powered tag device, it is not appropriate that the internal sensors in the tag device are always enabled.Instead, the tag device should only be activated for detecting appliance usage when there is a user in the space where it is installed [37].In the proposed device network, the stationary device transmits activation messages to all connected tag devices when a user with the wearable device enters the zone of ADL measurement.A tag device that receives this message enables its internal sensors so that it is ready to detect the usage event of an appliance to which it is attached.Similarly, when the user exits the space, the stationary device sends deactivation messages to the connected tag devices.Thus, a tag device usually disables built-in sensors and enables them only when a user is in that space.
The sleep-wake up method using LF not only lowers power, but also reduces the interference caused by multiple users.A typical BLE communication method generates an advertising beacon for each peripheral device, and when multiple devices are operated, this method causes communication interference.The LF-BLE mixed communication method, including the concept of opportunistic computing, reduces the BLE beacon noise by recognizing the user's Activity Trigger Event.In addition, even when transmitting activity information through BLE, the activity collection devices record the execution time of the corresponding data when a communication failure occurs due to interference, and retransmits to ensure activity data collection and data accuracy.

Service Scenario
Figure 5 illustrates the scenario in which services are provided to users in daily life using the self-organized device network in this study.We experimented in a test environment with three rooms prepared for patients with mental illness in a hospital.However, since the smart devices (tag and stationary) in the proposed system can be seamlessly installed and extended, a test environment consisting of many rooms (as depicted in Figure 5) would also be applicable.Each indoor unit space is equipped with one stationary device and multiple tag devices for measuring the usage of home appliances.A family member who wants to measure ADL wears a wearable device that includes a unique ID to identify the individual.
The wearable device records the information of a user entering and leaving a specific zone in its internal memory and the usage information of home appliances in each space.Consider a family member with a wearable device who performs the following activities in a bathroom: enter the bathroom, flush the toilet, turn on the faucet, turn off the faucet, and leave the bathroom.The wearable device can receive this series of actions from the stationary device and record these activities with time data in its internal memory.This measurement and recording procedure can be performed without any user intervention.
The proposed system can collect the user's ADL data and determine whether the user's activities were successful or abnormal, providing the user with a notification and risk warning service based on the measured location and activity data.For example, if a user turned on a gas stove in the kitchen and stayed in another room for a long time, the user's wearable device can alert him or her to a dangerous situation.Moreover, when the user tries to exit the space where he or she stayed, the wearable and stationary devices search for appliances that have not been turned off and notifies the user.For example, if a user washes his or her hands in the bathroom and tries to leave without turning off the faucet, the stationary device announces that something needs to be turned off by ringing its buzzer.This is possible because the stationary device collects all activities occurring in that space in real-time.The wearable device can identify abnormal behaviors and the forgetfulness of the user during daily living over a long duration.
The recorded data (simple ADL, abnormal behavior, forgetfulness, and moving ability) in the user's wearable device can be transmitted to a smartphone through BLE communication and delivered to a PC or other network.A doctor may predict the mental health and physical ability of the patient more accurately by referring to his or her ADL and faulty activities in daily life than through an interview with the patient or guardian.

Implementation of Each Device
Figure 6 illustrates the smart devices used in the proposed device network, and Figure 7 illustrates the hardware and communication block diagrams.We developed the tag device for sensor data in this study.The stationary and wearable devices were developed for our previous research

Implementation of Each Device
Figure 6 illustrates the smart devices used in the proposed device network, and Figure 7 illustrates the hardware and communication block diagrams.We developed the tag device for sensor data in this study.The stationary and wearable devices were developed for our previous research and have been customized for this study.The stationary device-containing a passive infrared (PIR) sensor and an LF transmitter-is connected to two LF antennae to emit LF signals containing indoor position information.The wearable device includes an LCD, flash memory, and an LF receiver.The wearable device is in sleep mode and wakes up when it receives an LF signal emitted by the stationary device installed in the door of the detection zone; it then starts preparing the ADL recording.The tag device includes sensors for ambient light, acceleration, gyro, flame detection, and temperature and can be attached to household items to measure their usage.The use of an appliance that has an opening or closing operation such as a refrigerator, rice cooker, washing machine, or faucet is detected by the tag device using an accelerometer and gyro sensors.The flame detection sensor and temperature sensor are used to check the use of a gas stove, and the ambient light sensor and temperature sensor can determine the state of a lamp.All devices (wearable, tag, and stationary) have a BLE module to communicate with each other wirelessly.The stationary device operates centrally in BLE communication, whereas the tag and wearable devices operate peripherally.The stationary device drives one-to-many connections with multiple tag devices and configures and manages the edge network of a unit space.It also recognizes a specific family member's entrance into the space by transmitting LF signals and receiving a BLE advertising message from the wearable device.

Implementation of Each Device
Figure 6 illustrates the smart devices used in the proposed device network, and Figure 7 illustrates the hardware and communication block diagrams.We developed the tag device for sensor data in this study.The stationary and wearable devices were developed for our previous research and have been customized for this study.The stationary device-containing a passive infrared (PIR) sensor and an LF transmitter-is connected to two LF antennae to emit LF signals containing indoor position information.The wearable device includes an LCD, flash memory, and an LF receiver.The wearable device is in sleep mode and wakes up when it receives an LF signal emitted by the stationary device installed in the door of the detection zone; it then starts preparing the ADL recording.The tag device includes sensors for ambient light, acceleration, gyro, flame detection, and temperature and can be attached to household items to measure their usage.The use of an appliance that has an opening or closing operation such as a refrigerator, rice cooker, washing machine, or faucet is detected by the tag device using an accelerometer and gyro sensors.The flame detection sensor and temperature sensor are used to check the use of a gas stove, and the ambient light sensor and temperature sensor can determine the state of a lamp.All devices (wearable, tag, and stationary) have a BLE module to communicate with each other wirelessly.The stationary device operates centrally in BLE communication, whereas the tag and wearable devices operate peripherally.The stationary device drives one-to-many connections with multiple tag devices and configures and manages the edge network of a unit space.It also recognizes a specific family member's entrance into the space by transmitting LF signals and receiving a BLE advertising message from the wearable device.

Preparation Time for ADL Measurement
In the proposed device network, tag devices that measure the use of household goods are not always active.Instead, the tag device activates its internal sensors only when someone is in the location where the tag device is installed.Therefore, the tag device has the advantage of reducing standby power consumption when no one is in a room.Due to this tag device activation process, the

Preparation Time for ADL Measurement
In the proposed device network, tag devices that measure the use of household goods are not always active.Instead, the tag device activates its internal sensors only when someone is in the location where the tag device is installed.Therefore, the tag device has the advantage of reducing standby power consumption when no one is in a room.Due to this tag device activation process, the preparation time from when a user enters a specific room to when the tag device can measure the state of an appliance should be considered.We measured the time for all tag devices to be activated for ADL measurement when the user with a wearable device enters the space where the stationary device is installed.Figure 8 illustrates the results.The stationary device is wirelessly connected with multiple tag devices using BLE communication and can connect with up to seven tag devices.As the number of tag devices connected to the stationary device increases, the preparation time for ADL measurement tends to increase.However, even if the stationary device is connected to the maximum number of tag devices in a unit space, the preparation time of the tag devices is less than 1700 ms.The results demonstrate that the devices in the network are sufficient to track a user's activities after entering the space.In the proposed device network, tag devices that measure the use of household goods are not 416 always active.Instead, the tag device activates its internal sensors only when someone is in the 417 location where the tag device is installed.Therefore, the tag device has the advantage of reducing 418 standby power consumption when no one is in a room.Due to this tag device activation process, the 419 preparation time from when a user enters a specific room to when the tag device can measure the 420 state of an appliance should be considered.We measured the time for all tag devices to be activated 421 for ADL measurement when the user with a wearable device enters the space where the stationary 422 device is installed.Figure 8 illustrates the results.The stationary device is wirelessly connected with 423 multiple tag devices using BLE communication and can connect with up to seven tag devices.As the 424 number of tag devices connected to the stationary device increases, the preparation time for ADL 425 measurement tends to increase.However, even if the stationary device is connected to the maximum 426 number of tag devices in a unit space, the preparation time of the tag devices is less than 1700 ms.

427
The results demonstrate that the devices in the network are sufficient to track a user's activities after

Power Consumption of Tag Device
Since the tag device of the proposed device network is battery-powered, its power consumption should be considered.It is normally in a standby state and is activated when a user enters a unit space where a stationary device is installed.Figure 9 illustrates the power-consumption waveform according to the state of the tag device (BLE advertising, standby, or active), and Table 1 lists the amount of current consumed by the tag device in each state.In the BLE advertising state, the tag device emits advertising packets to continuously connect it to the stationary device.In the standby state, the tag device is connected to the stationary device, but there is no user in the unit space.When a user with a wearable device enters the unit space, the tag device enters the active state by enabling its built-in sensors to measure the usage of home appliances.The tag device consumes 1.751 mA in the active state and 0.895 mA in the standby state, on average.We tested 10 tag devices with a 500 mAh LiPo battery, and the tag device remained in the standby state for approximately 20 days.When an average user performed his or her daily activities, the lifetime of the tag device was 15 days on average; the duration depends on the frequency of use of an item to which the tag device is attached.The tag device is not always active for measuring the usage information of the attached appliance.Instead, it usually disables its internal sensors to consume less power in the standby state and only enables sensors upon receipt of an activation message from the connected stationary device.The stationary device in a unit space detects the user's entry and controls the state (standby or active) of tag devices in its space.We effectively reduced the standby power of the tag device by disabling its internal sensors when the user was not in the space.
mAh LiPo battery, and the tag device remained in the standby state for approximately 20 days.When an average user performed his or her daily activities, the lifetime of the tag device was 15 days on average; the duration depends on the frequency of use of an item to which the tag device is attached.The tag device is not always active for measuring the usage information of the attached appliance.Instead, it usually disables its internal sensors to consume less power in the standby state and only enables sensors upon receipt of an activation message from the connected stationary device.The stationary device in a unit space detects the user's entry and controls the state (standby or active) of tag devices in its space.We effectively reduced the standby power of the tag device by disabling its internal sensors when the user was not in the space.

Accuracy of ADL Measurement
Table 2 presents the accuracy of activity measurements using the proposed system.In this evaluation, we considered the following activities: passage through a door and usage of home appliances (faucet, gas stove, refrigerator, microwave, and rice cooker).The calculation of accuracy was made in comparison with user actions.Activity measurements for using a faucet, refrigerator, microwave, and rice cooker are accomplished by the tag device's BMI160 inertial measurement unit (IMU) that includes a three-axis accelerometer and a three-axis gyroscope.According to the tag

Accuracy of ADL Measurement
Table 2 presents the accuracy of activity measurements using the proposed system.In this evaluation, we considered the following activities: passage through a door and usage of home appliances (faucet, gas stove, refrigerator, microwave, and rice cooker).The calculation of accuracy was made in comparison with user actions.Activity measurements for using a faucet, refrigerator, microwave, and rice cooker are accomplished by the tag device's BMI160 inertial measurement unit (IMU) that includes a three-axis accelerometer and a three-axis gyroscope.According to the tag device's implementation, the faucet should be the up-down type, and the direction of opening an item such as a faucet, refrigerator door, microwave door, or rice cooker should be aligned with the y-axis of the BMI160, a restriction we maintained.Most measurements are more than 95% accurate, except for the low accuracy of turning off the faucet, which, based on our analysis, may be caused by the physical vibration from the water flowing out when the faucet is turned on, due to which the MCU of the tag device is continuously interrupted by its accelerometer.To solve this, we hypothesized that it is appropriate to read the acceleration value at regular intervals to detect the faucet being turned off.For the detection of turning on the faucet, the method using an acceleration interrupt seems suitable as initially designed.

Conclusions
In this paper, we proposed an edge computing-based self-organized device network and developed three types of smart devices (wearable, tag, and stationary) to collect a user's ADL in his or her living space.We adopted the edge computing method to categorize and analyze the activities that a user performs in each indoor unit space.The wearable device can be easily equipped by the user, and the tag and stationary devices can be installed by attaching sensors to home appliances or doors; consequently, these devices are also applicable to a typical existing house.The ADL measurement system can collect a user's daily activities and determine who acted, where the activities were performed, and whether the activities were finished successfully or abnormally.It is also possible to record the physical ability of the user to move between indoor fixed spaces.Data on the daily activities, forgetfulness history, and walking speed of a user can be recorded in his or her wearable device; these data can be used by a doctor or guardian to diagnose the mental and physical health of a patient more accurately compared to interviews with the patient in a hospital.
We described a service scenario in daily home life using the proposed self-organized device network and evaluated the power consumption of the tag device and the preparation time based on the user's position.We also measured several activities that could be measured in a home environment using the tag device, and we calculated the accuracy of the measurements.
The proposed system determines whether a user's behavior was successful or abnormal using installed smart devices to collect the user's activities at home.Our approach is different from directly measuring the brain signals of patients with mental disorders using Brain-Computer Interface (BCI) devices.A patient with a brain injury may be able to perform basic activities well in daily life.It is also possible to identify changes in THE ADL performance of these patients using the proposed system.However, in the future, we plan to test our system with real patients who have a mental illness.The examination of patients' ADL ability based on the severity of their mental disorder can confirm the medical validity of the proposed system.Furthermore, we seek to recognize specific individuals by adopting a user-recognition method that uses foot pressure characteristics measured while a user steps on a footpad [38].Moreover, we plan to improve the accuracy of appliance-usage measurements using a tag device and add a wide variety of home items to the system.Finally, we expect to obtain the long-term history of activities, forgetfulness, and moving ability of the patients and analyze the physical and mental health of patients using a machine-learning algorithm.
Author Contributions: S.S.K. designed and performed experiments, evaluated the data, and wrote the paper; Y.J.P. partially designed and performed experiments; S.J.K. supervised the research project related to this paper and edited the manuscript.All authors have read and agreed to the published version of the manuscript.

Figure 1 .
Figure 1.Concept of self-organized device network structure.Figure 1. Concept of self-organized device network structure.

Figure 1 .
Figure 1.Concept of self-organized device network structure.Figure 1. Concept of self-organized device network structure.

18 Figure 2 .
Figure 2. Communication sequence of self-organized device network structure.Figure 2. Communication sequence of self-organized device network structure.

Figure 2 .
Figure 2. Communication sequence of self-organized device network structure.Figure 2. Communication sequence of self-organized device network structure.

Figure 2 .
Figure 2. Communication sequence of self-organized device network structure.

Figure 3 .
Figure 3. Communication protocol between the wearable, tag, and stationary devices.

Figure 3 .
Figure 3. Communication protocol between the wearable, tag, and stationary devices.

18 Figure 5 .
Figure 5. Self-organized activities of daily living (ADL) collection service scenario using three types of portable devices.

Figure 5 .
Figure 5. Self-organized activities of daily living (ADL) collection service scenario using three types of portable devices.

Figure 5 .
Figure 5. Self-organized activities of daily living (ADL) collection service scenario using three types of portable devices.

Figure 6 .
Figure 6.Implementation of the three types of portable devices.

18 Figure 6 .
Figure 6.Implementation of the three types of portable devices.

Figure 8 .
Figure 8. Preparation time of tag devices when user enters a specific indoor unit space.

432 6 . 3 .Figure 8 .
Figure 8. Preparation time of tag devices when user enters a specific indoor unit space.

Figure 9 .
Figure 9. Power-consumption waveform of the tag device.

Figure 9 .
Figure 9. Power-consumption waveform of the tag device.

Algorithm 1 .
Pseudo code for abnormal activity awareness.event = position change event and time event o f wearable device

Table 1 .
Power consumption of tag device according to its state.

Table 1 .
Power consumption of tag device according to its state.

Table 2 .
Accuracy of activity measurement.