Self-Care IoT Platform for Diabetic Mellitus

: Diabetes mellitus is a severe chronic disease, and the number of patients has increased. To manage blood glucose levels, patients should frequently measure their blood glucose and analyze which lifestyle habits affect blood glucose levels. However, it is hard to record and analyze the relationship between their blood glucose levels and lifestyle. The internet of things (IoT) is useful to interconnect, monitor, obtain, and process data between various devices used in everyday life to fulﬁll a common objective. This paper proposes an intelligent self-care platform using IoT technology that helps patients with chronic diabetes manage their blood glucose levels in their target range. In particular, we developed various devices called the self-care IoT pack. It consists of ﬁve different types of devices to obtain blood glucose levels, physical activities, food intake, medication, sleeping, and so on. They can collect blood glucose levels with lifestyles that automatically impact the patient’s blood glucose level. We also devised a self-care application to display and analyze the data obtained from the IoT pack. Consequently, the proposed self-care IoT platform collects the blood glucose levels and the lifestyles without any burden of record. By reviewing the accumulated information, the patients can ﬁnd bad habits in blood glucose management and improve their lifestyle.


Introduction
Diabetes mellitus is a serious and prevalent chronic disease [1,2]. The number of diabetes mellitus patients has increased. There are two primary types of diabetes, type 1 and type 2. Both affect every system of the body, mainly due to metabolic disturbances caused by hyperglycemia. In particular, type 2 diabetes mellitus (T2DM) accounts for 90% to 95% of all diabetic patients [3]. A combination of life habits and genetic factors cause T2DM. A lifestyle is crucial to the development of T2DM, including obesity, lack of physical activity, unbalanced diet, and stress [4,5].
Diabetes can damage different organs, such as the eyes, kidneys, heart, nerves, and blood vessels. These diabetic complications lower the quality of a patient's life and lead to enormous economic and social burdens [6]. The blood glucose (BG) level for the patient must be carefully controlled to prevent the progression of complications. Thus, the blood of the patient should be inspected several times a day using a glucometer. Some studies have reported that strict metabolic control can delay or prevent the progression of complications associated with diabetes [7,8]. In diabetes diagnosis and monitoring, there are two primary tests, the hemoglobin A1c (HbA1c) test in the hospital and self-monitoring of blood glucose at home. Both of them are commonly performed for the evaluation of glycemic control. HbA1c is a weighted average of BG levels during the preceding 120 days. HbA1c provides a longer-term trend, similar to an average BG level. It is crucial to know that the higher HbA1c increases the risk of developing diabetes-related complications. However, it cannot provide information about BG levels at the moment of measurement.

1.
The platform should obtain the information needed for blood glucose management automatically.

2.
The platform should suggest the patient guidelines for proper lifestyles based on the information. 3.
The platform tracks the patient's life patterns in real-time.
When the platform determines hypoglycemia or hyperglycemia, it should recommend the appropriate lifestyles to keep their BG levels within the target range. To develop such a system, we first need to define lifestyles that affect BG levels. Then, we determine the kind of information to be obtained and how to collect it automatically. These processes should be implemented in the self-care platform. Finally, the platform should be verified. This paper presents a self-care platform based on SMBG for patients. In particular, the proposed platform can automatically record the measured glucose levels of the patients and their daily lifestyles, including physical activity, food intake, medication, wake-up time, and bedtime. It consists of five internet of things (IoT) devices. These devices are called self-care IoT packs in this paper. All of them are linked to the smartphone of the patient and web server. Our proposed platform can associate the life patterns with measured glucose levels in the time domain. Consequently, the proposed platform helps diabetic patients understand the relationship between each life pattern and BG level changes and eventually helps them maintain better conditions by suggesting a guideline.

The Proposed Self-Care IoT Platform for Diabetics
This paper presents a self-care IoT platform. It consists of three major parts, as shown in Figure 1. The main characteristic of the proposed platform is to track and record the patient's activities of daily living that affect glucose levels automatically. In the proposed platform, we apply IoT technology to several articles in daily use to collect those data, including BG measurement, exercise, meals, and medications. Then the data is transferred to a web-server via a smartphone. A web-server is to store and calculate the received data to analyze the relationship between the patient's lifestyle and glucose measurements. The self-care application is responsible for showing the information to the patient clearly.
Appl. Sci. 2021, 11, 2006 3 of 19 determine the kind of information to be obtained and how to collect it automatically. These processes should be implemented in the self-care platform. Finally, the platform should be verified. This paper presents a self-care platform based on SMBG for patients. In particular, the proposed platform can automatically record the measured glucose levels of the patients and their daily lifestyles, including physical activity, food intake, medication, wake-up time, and bedtime. It consists of five internet of things (IoT) devices. These devices are called self-care IoT packs in this paper. All of them are linked to the smartphone of the patient and web server. Our proposed platform can associate the life patterns with measured glucose levels in the time domain. Consequently, the proposed platform helps diabetic patients understand the relationship between each life pattern and BG level changes and eventually helps them maintain better conditions by suggesting a guideline.

The Proposed Self-care IoT Platform for Diabetics
This paper presents a self-care IoT platform. It consists of three major parts, as shown in Figure 1. The main characteristic of the proposed platform is to track and record the patient's activities of daily living that affect glucose levels automatically. In the proposed platform, we apply IoT technology to several articles in daily use to collect those data, including BG measurement, exercise, meals, and medications. Then the data is transferred to a web-server via a smartphone. A web-server is to store and calculate the received data to analyze the relationship between the patient's lifestyle and glucose measurements. The self-care application is responsible for showing the information to the patient clearly. The most crucial part is a self-care IoT pack that consists of various pieces of equipment. First, we made a food tray and a medication monitor to obtain meal and medication information. Second, we added a data acquisition board to commercial aerobic exercise equipment to get the exercise information. Finally, we used commercial products such as a glucometer and wearable band to get the other information. The proposed selfcare IoT pack automatically collects precise details on BG measurement, exercise, eating, The most crucial part is a self-care IoT pack that consists of various pieces of equipment. First, we made a food tray and a medication monitor to obtain meal and medication information. Second, we added a data acquisition board to commercial aerobic exercise equipment to get the exercise information. Finally, we used commercial products such as a glucometer and wearable band to get the other information. The proposed self-care IoT pack automatically collects precise details on BG measurement, exercise, eating, and doses whenever the patient uses them. The patient can acquire all life patterns that affect their BG level using the proposed self-care IoT pack, summarized in Table 1. Each IoT device in the proposed self-care IoT pack has three common characteristics. First, IoT devices incorporate one or more sensors to obtain that information whenever a patient performs a specific action using these devices. Second, each device includes a microcontroller and memory to process and store the information obtained from these sensors. Third, they enable everything to communicate by themselves over the internet through the devices.
The web-server is responsible for user authentication and database management. It builds a database of information received from the smartphone application for each patient. Then, it accumulates the records to help construct personalized big-data. The patient can find the harmful lifestyles using their long-term collected data using the proposed self-care platform. It should also be possible to correlate BG levels and the patients' life patterns for a long time.
The self-care application is responsible for storing and analyzing data obtained from each IoT device in the proposed self-care IoT pack. The collected data is stored in a database separated by each type. The application shows that all events are generated throughout the day in chronological order. It also displays charts and illustrations that make it easier for patients to understand the relationship between BG levels and the corresponding lifestyle. Consequently, it helps the patient know how a specific lifestyle affects their BG level instantly. It also helps the patient know which lifestyles to fix.
Consequently, the proposed self-care IoT platform automatically receives and records relevant information whenever a person with diabetes measures blood glucose, exercise, meals, and medication and sends it to a smartphone application. The rest of this section introduces how each IoT device configuration is designed to acquire accurate life pattern information when patients perform the corresponding operation for blood glucose management.

Automatic Recording of Blood Glucose with Patient's Status
A diabetic patient requires regular monitoring of their BG levels to help them achieve as close to normal BG levels as possible for as much time as possible. Patients measure their blood glucose on an empty stomach, before and after meals, and before bedtime. Additionally, the patients measure when they feel hypoglycemia or hyperglycemia. The patient then records the BG levels and the patient's condition at measurement, as shown in Table 2. It helps the patients to understand the relationship between the BG level and their life patterns. Most commercial glucometers automatically record the date, time, and BG readings in the internal memory and display them on screen. Then, they transmit the data to a computer or smartphone. However, the patients should record their condition at measurement by themselves. Unlike conventional glucometers, the proposed self-care IoT platform shares data with other IoT devices, and it automatically records a patient's status when the patient measures BG levels. In this paper, we divide patient status into six categories, as shown in Table 3. The proposed platform also supports manual recording by the patient for exceptional cases. Table 3. Classification of patient's condition for self-monitoring blood glucose (SMBG).

Devices
Classification of Patient's Condition

Wearable band
Empty stomach Pre-bedtime Pre-exercise Post-exercise

Food tray
Pre-meal Post-meal Exercise apparatus Pre-exercise Post-exercise The detailed explanation of how devices in the proposed self-care IoT platform automatically distinguish status is as follows. First, the wearable band is responsible for automatically determining whether the patient measures blood glucose on an empty stomach, before bedtime, before exercise, or after exercise. This band incorporates an acceleration sensor and a 3-axis sensor. These sensors identify the user's wake-up and sleep times. It also obtains the number of steps of the user over time. It helps to calculate the pre-and post-exercise time.
Second, the proposed food tray shares the patient's mealtime information with a glucometer. Whenever the patients eat a meal using the food tray, they should press the start and stop button on the food tray to inform the meal's exact beginning and ending time. Then, the food tray calculates the weight difference for each food as the intake. Therefore, BG measurement before and after mealtime should be matched as pre-meal and post-meal, respectively.
Third, a wearable band or the exercise data acquisition (DAQ) in aerobic equipment distinguishes pre-exercise or post-exercise BG levels. They obtain the start time and end time automatically using the gyro and 3-axis acceleration sensors integrated. For example, BG readings within 1 h of exercise should be recorded as pre-exercise blood glucose level and blood glucose measurements within 1 h and 30 min after exercise BG level.

Automatic Recording of Exercise Information
Exercise is crucial to prevent diabetes and has a vital role in our treatment. Exercise keeps the body in tone and is good for reducing blood glucose levels and keeps it low for several hours. As diabetes grows more severe, the patient quickly copes with a wide variation and rapid changes in BG levels. In particular, hypoglycemia is a hazardous and painful condition. It is essential to maintain BG levels as close as possible to normal conditions. If diabetic patients have a deep understanding of the relationship between their exercise and BG level, they will exercise as an aid to maintain BG levels. To understand the relationship between BG level and activity is inevitable to obtain detailed exercise records to cope with BG measurement. This paper proposed DAQ for exercise that can automatically acquire the exercise type, exercise time, and exercise intensity performed by the patient for each aerobic exercise. Then, it accumulates the result in memory. By analyzing the collected BG measurements and exercise information, the patients can understand their unique blood glucose patterns to cope with their exercises. Furthermore, it helps patients develop a specific exercise plan appropriate to their current BG level.
The proposed system has two DAQs. One is a commercial wearable band such as the Xiaomi MI band, the Polar heart rate monitor. The other DAQ was devised by ourselves, and it was integrated into commercial aerobic exercise equipment such as a treadmill and indoor bicycle, as shown in Figure 2. Both of them obtain the precise exercise information, monitor the heart rate, and then transfer them into other devices within the proposed IoT pack. In particular, the built-in DAQ for aerobic exercise equipment obtains precise exercise information such as the date and time, exercise amount, and exercise intensity whenever a patient exercises using them. Besides, the equipment can show the information to the patient in real-time.
pack. In particular, the built-in DAQ for aerobic exercise equipment obtains precise exercise information such as the date and time, exercise amount, and exercise intensity whenever a patient exercises using them. Besides, the equipment can show the information to the patient in real-time. The proposed exercise DAQ aims to acquire detailed and precise exercise information during exercise. It consists of three parts, as shown in Figure 3. A sensor unit is integrated into aerobic equipment to obtain the amount of training, and a wearable device is to monitor the patient's heart rates during exercise. An MCU (microcontroller unit) unit calculates the data obtained from the sensor unit, and it generates useful information. Then, it transfers the data to share it with other IoT devices. The sensor unit is connected to the treadmill's motor shaft or the ergometer's pedal shaft to count the disk's rotating numbers. As shown in Figure 3, two types of sensors, the photosensor or the hall sensor, are attached to the rotating disk. The detector is integrated into a fixed axis associated with the disk. Each time the disk spins, the sensor generates a pulse. Then, the detector counts the number of pulses, and it transmits the numbers to the MCU unit. The wearable unit incorporates an RFID (radio-frequency identification) tag for patient identification and a heart rate sensor for periodically acquiring heart rate information while the patient is exercising. Before the patients start exercising, they tag their ID (identification) cards to the exercise equipment so that the machine identifies the user. While a patient is exercising, the heart rate sensor monitors the heart rate of the patient. Then, it transmits the data to the MCU unit in real-time. The most basic information for aerobic exercise equipment is distance. In the ergometer, the distance is calculated from the number of rotations of the pedal. Also, the distance in a treadmill is obtained from the number of motor revolutions moving the scaffold. In general, treadmills The proposed exercise DAQ aims to acquire detailed and precise exercise information during exercise. It consists of three parts, as shown in Figure 3. A sensor unit is integrated into aerobic equipment to obtain the amount of training, and a wearable device is to monitor the patient's heart rates during exercise. An MCU (microcontroller unit) unit calculates the data obtained from the sensor unit, and it generates useful information. Then, it transfers the data to share it with other IoT devices. The sensor unit is connected to the treadmill's motor shaft or the ergometer's pedal shaft to count the disk's rotating numbers. As shown in Figure 3, two types of sensors, the photosensor or the hall sensor, are attached to the rotating disk. The detector is integrated into a fixed axis associated with the disk. Each time the disk spins, the sensor generates a pulse. Then, the detector counts the number of pulses, and it transmits the numbers to the MCU unit.
pack. In particular, the built-in DAQ for aerobic exercise equipment obtains precise exercise information such as the date and time, exercise amount, and exercise intensity whenever a patient exercises using them. Besides, the equipment can show the information to the patient in real-time. The proposed exercise DAQ aims to acquire detailed and precise exercise information during exercise. It consists of three parts, as shown in Figure 3. A sensor unit is integrated into aerobic equipment to obtain the amount of training, and a wearable device is to monitor the patient's heart rates during exercise. An MCU (microcontroller unit) unit calculates the data obtained from the sensor unit, and it generates useful information. Then, it transfers the data to share it with other IoT devices. The sensor unit is connected to the treadmill's motor shaft or the ergometer's pedal shaft to count the disk's rotating numbers. As shown in Figure 3, two types of sensors, the photosensor or the hall sensor, are attached to the rotating disk. The detector is integrated into a fixed axis associated with the disk. Each time the disk spins, the sensor generates a pulse. Then, the detector counts the number of pulses, and it transmits the numbers to the MCU unit. The wearable unit incorporates an RFID (radio-frequency identification) tag for patient identification and a heart rate sensor for periodically acquiring heart rate information while the patient is exercising. Before the patients start exercising, they tag their ID (identification) cards to the exercise equipment so that the machine identifies the user. While a patient is exercising, the heart rate sensor monitors the heart rate of the patient. Then, it transmits the data to the MCU unit in real-time. The most basic information for aerobic exercise equipment is distance. In the ergometer, the distance is calculated from the number of rotations of the pedal. Also, the distance in a treadmill is obtained from the number of motor revolutions moving the scaffold. In general, treadmills The wearable unit incorporates an RFID (radio-frequency identification) tag for patient identification and a heart rate sensor for periodically acquiring heart rate information while the patient is exercising. Before the patients start exercising, they tag their ID (identification) cards to the exercise equipment so that the machine identifies the user. While a patient is exercising, the heart rate sensor monitors the heart rate of the patient. Then, it transmits the data to the MCU unit in real-time. The most basic information for aerobic exercise equipment is distance. In the ergometer, the distance is calculated from the number of rotations of the pedal. Also, the distance in a treadmill is obtained from the number of motor revolutions moving the scaffold. In general, treadmills and ergometers have a disk connected to a motor or pedal, and their rotational speed is to calculate the distance during exercise.
An MCU unit is responsible for generating the detailed exercise information shown in Table 4 using the transferred pulse from the sensor unit and heart-rate data from the wearable one. It includes various peripherals such as the I/O (input/output) interface for exchanging data with the outside, flash, and SD (secure digital) cards for storing data, an RTC (real-time clock) for providing timely information. Detailed operation descriptions are as follows. When the patients start to exercise, the sensor unit transmits the pulse output to the MCU, indicating the number of rotations. When the first pulse is input, the MCU recognizes the start of the exercise and obtains patient ID information from the wearable unit's RFID and the current date and time information from the RTC. The MCU then causes the timer to generate a periodic signal every second and every minute. Every second, the MCU counts the number of pulses received and multiplies it by the distance constant to get the movement distance per second. This data is used to calculate cumulative exercise time, cumulative exercise distance, cumulative calorie consumption, and instantaneous exercise speed. The results are displayed in real-time on the exercise equipment display. Every minute, the MCU calculates the distance per minute, average speed, and average heart rate, and then it stores the data in internal memory. When the user finishes the workout, the total workout time, total workout distance, total calorie consumption, and average workout speed are also calculated and stored in the internal memory, as shown in Table 4. Finally, it shares information with other IoT devices.

Automatic Recording of Food Taken Information
Everyone has a glucose level rise after they eat. Then, the glucose level gradually drops to the normal range as time passes. However, people with diabetes change their glucose levels out of the normal range and maintain a high level over time. For example, when a diabetic patient overeats, the BG level rises significantly, and the level does not fall easily and stays at a high-level. Adherence to dietary recommendations is the most critical part of diabetes self-management. Having a healthy and balanced diet helps in BG levels within the target range. Thus, it is essential to know what the patients eat, how much they eat, and adequately control the glucose level. Nonetheless, most patients fail to comply because of the lack of motivation, difficulty in changing dietary habits, and poor understanding of the direct impact nutritional choices have on glycemic control [24][25][26].
Each person has a different favorite food and eating habits. Also, the effect of diets on blood glucose is different for each patient. Thus, it is to accurately analyze the impact of meals on glucose level for each individual. First of all, patients should accumulate individual pre-and post-meal BG levels with associated meal information. This record can then be used to analyze personal eating habits and their effects on blood glucose.
The conventional method to record the meal information is to self-report approaches, such as electronic questionnaires, databases, and diaries [24]. The data is transferred to a mobile device. It provides real-time feedback concerning dietary patterns, caloric intake, and nutrient distribution [27,28]. However, this self-reporting places the patient's burden to remember the contents and portions of the food consumed. Therefore, it has the fundamental disadvantage that it is less accurate.
We implemented a smart food tray, shown in Figure 4, to ensure that patients obtain the type and amount of food they eat each time they eat automatically. The plate and blood glucose meter automatically record pre-and post-meal BG levels and accurate meal information, as shown in Table 5. By analyzing cumulative meals and blood glucose readings, patients can quickly determine which foods help blood glucose and vice versa. Furthermore, this lets the patient know what foods to eat and how much to eat according to the pre-meal BG level. and nutrient distribution [27,28]. However, this self-reporting places the patient's burden to remember the contents and portions of the food consumed. Therefore, it has the fundamental disadvantage that it is less accurate.
We implemented a smart food tray, shown in Figure 4, to ensure that patients obtain the type and amount of food they eat each time they eat automatically. The plate and blood glucose meter automatically record pre-and post-meal BG levels and accurate meal information, as shown in Table 5. By analyzing cumulative meals and blood glucose readings, patients can quickly determine which foods help blood glucose and vice versa. Furthermore, this lets the patient know what foods to eat and how much to eat according to the pre-meal BG level.  The configuration and operation of the proposed food plate are as follows. As shown in Figure 4a, the presented food tray consists of a controller incorporating various peripheral devices and a load cell that can be weighed. We use strain gauge load cells that convert the load acting on them into electrical signals. As the force applied to the load cell increases, the electrical signal changes proportionally. The load cell's output is to a microcontroller via a 24-bit analog-to-digital converter (ADC) for weighing scales. The proposed food tray includes six load cells to weigh the six different food intakes, as shown in Figure 4b. Detailed operation descriptions are as follows.
The patient performs the following operations at the time of eating to record meal information. First, the patient presses the start button in the food tray to indicate the meal's start. The controller recognizing a meal start acquires a meal start time obtained from the RTC. It also measures the weight of food in six different dishes in order and stores them in memory with visual information. When the patient finishes the meal and presses the end button, the controller measures the visual information from the RTC and the weight of the plates from the six load cells in the same order as when it started. Each load cell calculates the food intake by the difference in weight between the start and end of the meal. Then, it stores the data in memory. Then a smartphone app is launched with the chatbot function, saying the food names in the six dishes' order, matching the food name and intake, and displaying the meal information correctly, as shown in Table 5.  The configuration and operation of the proposed food plate are as follows. As shown in Figure 4a, the presented food tray consists of a controller incorporating various peripheral devices and a load cell that can be weighed. We use strain gauge load cells that convert the load acting on them into electrical signals. As the force applied to the load cell increases, the electrical signal changes proportionally. The load cell's output is to a micro-controller via a 24-bit analog-to-digital converter (ADC) for weighing scales. The proposed food tray includes six load cells to weigh the six different food intakes, as shown in Figure 4b. Detailed operation descriptions are as follows.

Dosage Information Recorder
The patient performs the following operations at the time of eating to record meal information. First, the patient presses the start button in the food tray to indicate the meal's start. The controller recognizing a meal start acquires a meal start time obtained from the RTC. It also measures the weight of food in six different dishes in order and stores them in memory with visual information. When the patient finishes the meal and presses the end button, the controller measures the visual information from the RTC and the weight of the plates from the six load cells in the same order as when it started. Each load cell calculates the food intake by the difference in weight between the start and end of the meal. Then, it stores the data in memory. Then a smartphone app is launched with the chatbot function, saying the food names in the six dishes' order, matching the food name and intake, and displaying the meal information correctly, as shown in Table 5.

Dosage Information Recorder
There are many studies that have shown that normal levels of tight glycemic control can prevent microvascular complications caused by diabetes. In most patients, it is chal-lenging to manage BG levels by merely improving lifestyles. Therefore, diabetic patients must take accurate medications based on medical treatment and diagnosis by medical staff.
The duration of exposure to hyperglycemia should be reduced to reduce the incidence of diabetes complications. For hyperglycemic patients, aggressive treatment with medication or insulin is appropriate. Insulin should be used in patients with type 1 diabetes, but in patients with type 2 diabetes, insulin, or oral hypoglycemic agents may be used alone or in combination. In particular, type 2 diabetic patients have glycemic glycation targets of less than 6.5%. If lifestyle modifications do not reach this goal, lifestyle improvements are combined with oral hypoglycemic agents (OHA). If the patients have poor self-management and severe hyperglycemia symptoms, they are told to take insulin and oral medication at the same time.
There is a study that has shown that patients with diabetes faithfully take medication. Medications are divided into oral hypoglycemic drugs in the form of pills and insulin, which is an injection. Patients with type 1 diabetes use insulin injections and are trained to adjust their insulin doses by taking into account carbohydrate counts, activity levels, and current BG levels. Also, type 2 diabetic patients use oral hypoglycemic agents and sometimes inject insulin. All people with diabetes should understand how their blood sugar changes with their lifestyle. To do this, patients take medications or record insulin every time they are injecting, and lifestyle and BG levels are helpful to understand the changes in blood sugar according to lifestyle. Thus, patients can adjust their insulin dose when there is a change in exercise or eating habits to maintain an appropriate blood glucose interval without the risk of hypoglycemia.
This paper presents an automatic recording device that automatically records the information when a patient takes medication or injects insulin, as shown in Table 6. This device was implemented by dividing into a smart medicine container for oral hypoglycemic agents and a needle container for insulin injection. The patient inputs the type and time of the medicine to be taken in advance in a smartphone application. Then, the proposed device exchanges information with a smartphone to record more accurate medication information.  Figure 5 shows the composition of the proposed dosage DAQ, which consists of the sensor unit and the data acquisition unit. The sensor unit comprises a load cell as a weight sensor and a sensor as an optical sensor. Each time a pill or pen needle is removed for oral medication and insulin injection, the dispenser's weight decreases, and the IR (infrared) sensor value at the dispenser's inlet changes. The load cell detects a difference in the dispenser's weight, and the IR sensor detects that the medicine or needle passes through the dispenser and then combines the same to determine whether the patient is dosed. Using the proposed device, patients automatically record the time and type of medication whenever they take or inject the medicine. If the drug is not administered at the scheduled time, it includes an alarm function to instruct the patient through the smartphone app and wearable band.

Wearable Band to Check Activities of Daily Life
The final IoT platform component for diabetic blood glucose management is the wearable band. The wearable band contains an acceleration sensor and a gyro sensor and communicates with the outside through BLE (Bluetooth low energy). In this study, the wearable band performs three main functions. First, life pattern information is obtained from the wake-up and bedtime of people with diabetes. Second, when a patient performs the aerobic exercise, such as running or walking outdoors, rather than an exercise device with a built-in exercise device, additional exercise information such as steps, exercise time, and heart rate during exercise is acquired. Third, in conjunction with each device in the proposed IoT platform, time-related information is refined.
The processor part uses Dialog DA14681 microprocessor (Dialog Semiconductor, Reading, UK) [29], a wearable type, and meets low power and high-performance conditions. It is based on the ARM Cortex-M0 (ARM Developer, San Jose, CA, USA) [30] and is a low-power Bluetooth processor. The sensor unit plays a crucial role in acquiring physical activity parameters and consists of a three-axis acceleration sensor and a heart rate sensor. The three-axis acceleration sensor receives the number of steps, sleep start/end time, meal start/end time information. The heart rate is acquired at regular time intervals through the heart rate sensor when the exercise start is detected. The display unit displays the current time and living parameter information, and physical activity information is repeatedly stored at a predetermined time interval in the memory unit.

The Proposed Self-Care Application to Track the Life-Log with Glucose Measurement
SMBG-based blood glucose management has inherent limitations. Even if the patient measures blood glucose frequently, it is difficult for the patient to find a sinful lifestyle or to know how to improve. In other words, since the SMBG results are instantaneous BG levels, it helps to roughly analyze the effect of life patterns on patient blood glucose. It is difficult to know whether a patient has adhered to the correct target blood glucose range during the day, and the detection of hyperglycemia and hypoglycemia is also challenging. To overcome this limitation, we propose a self-care IoT pack that can help patients automatically acquire BG measurements and lifelong that can affect BG levels. The information received from the proposed IoT pack is shown in the proposed self-care program, as shown in Figure 6 in real-time.

Wearable Band to Check Activities of Daily Life
The final IoT platform component for diabetic blood glucose management is the wearable band. The wearable band contains an acceleration sensor and a gyro sensor and communicates with the outside through BLE (Bluetooth low energy). In this study, the wearable band performs three main functions. First, life pattern information is obtained from the wake-up and bedtime of people with diabetes. Second, when a patient performs the aerobic exercise, such as running or walking outdoors, rather than an exercise device with a built-in exercise device, additional exercise information such as steps, exercise time, and heart rate during exercise is acquired. Third, in conjunction with each device in the proposed IoT platform, time-related information is refined.
The processor part uses Dialog DA14681 microprocessor (Dialog Semiconductor, Reading, UK) [29], a wearable type, and meets low power and high-performance conditions. It is based on the ARM Cortex-M0 (ARM Developer, San Jose, CA, USA) [30] and is a low-power Bluetooth processor. The sensor unit plays a crucial role in acquiring physical activity parameters and consists of a three-axis acceleration sensor and a heart rate sensor. The three-axis acceleration sensor receives the number of steps, sleep start/end time, meal start/end time information. The heart rate is acquired at regular time intervals through the heart rate sensor when the exercise start is detected. The display unit displays the current time and living parameter information, and physical activity information is repeatedly stored at a predetermined time interval in the memory unit.

The Proposed Self-Care Application to Track the Life-Log with Glucose Measurement
SMBG-based blood glucose management has inherent limitations. Even if the patient measures blood glucose frequently, it is difficult for the patient to find a sinful lifestyle or to know how to improve. In other words, since the SMBG results are instantaneous BG levels, it helps to roughly analyze the effect of life patterns on patient blood glucose. It is difficult to know whether a patient has adhered to the correct target blood glucose range during the day, and the detection of hyperglycemia and hypoglycemia is also challenging. To overcome this limitation, we propose a self-care IoT pack that can help patients automatically acquire BG measurements and lifelong that can affect BG levels. The information received from the proposed IoT pack is shown in the proposed self-care program, as shown in Figure 6 in real-time.
The information for self-care is mainly divided into five categories, as shown in Figure 6. First, sleep information is obtained from the wearable band, and the proposed platform displays wake up time and bedtime. Secondly, BG measurements are obtained from the glucose meter, indicating the patient's condition at BG measurement time. The conditions field is expressed as pre-and post-prandial blood glucose, fasting and bedtime blood glucose, and pre-and post-exercise blood glucose according to the patient's lifestyle. Third, the exercise is divided into indoor activity using a treadmill or indoor bicycle and aerobic exercise from the outside. Also, the exercise time, distance, and intensity for each exercise are displayed. Fourth, medication indicates the type and amount of drugs taken. Finally, the information about meals is divided into breakfast, lunch, dinner, and snack types. The type and amount of food eaten at each meal are obtained and marked. The information for self-care is mainly divided into five categories, as shown in Figure 6. First, sleep information is obtained from the wearable band, and the proposed platform displays wake up time and bedtime. Secondly, BG measurements are obtained from the glucose meter, indicating the patient's condition at BG measurement time. The conditions field is expressed as pre-and post-prandial blood glucose, fasting and bedtime blood glucose, and pre-and post-exercise blood glucose according to the patient's lifestyle. Third, the exercise is divided into indoor activity using a treadmill or indoor bicycle and aerobic exercise from the outside. Also, the exercise time, distance, and intensity for each exercise are displayed. Fourth, medication indicates the type and amount of drugs taken. Finally, the information about meals is divided into breakfast, lunch, dinner, and snack types. The type and amount of food eaten at each meal are obtained and marked.
The proposed platform records in detail all the life patterns that affect a patient's BG levels all day. In particular, the information obtained from each category is correlated to reduce the manual record of the patient. Therefore, the patient may record daily life patterns using the proposed self-care IoT pack automatically. The information is presented to the user in chronological order. Patients can view vital information that affects BG levels, such as sleep, meals, exercise, and metabolism.
By providing both BG levels and lifestyle patterns together, it is easy for the patient to understand how life patterns affect blood glucose control throughout the day. Besides, the patient can easily find a good or bad lifestyle for self-management by providing each life pattern with a BG measurement for a specific period, such as one week, one month, or three months.
The proposed self-care platform's application program consists of three major parts: initialization, life-log database, and dashboard, as shown in Figure 7. The proposed platform records in detail all the life patterns that affect a patient's BG levels all day. In particular, the information obtained from each category is correlated to reduce the manual record of the patient. Therefore, the patient may record daily life patterns using the proposed self-care IoT pack automatically. The information is presented to the user in chronological order. Patients can view vital information that affects BG levels, such as sleep, meals, exercise, and metabolism.
By providing both BG levels and lifestyle patterns together, it is easy for the patient to understand how life patterns affect blood glucose control throughout the day. Besides, the patient can easily find a good or bad lifestyle for self-management by providing each life pattern with a BG measurement for a specific period, such as one week, one month, or three months.
The proposed self-care platform's application program consists of three major parts: initialization, life-log database, and dashboard, as shown in Figure 7.
First, the initialization part is responsible for registering the patient information and the proposed self-care IoT devices. Then, it links the application to the web-server and all IoT devices as a unified self-care platform. Second, the life-log database is to collect the patient's activities of daily living from various IoT devices. The database is organized separately according to the predefined activities of daily living. This database is based on Google Firebase that provides a real-time database and backend as a service, thereby reducing data management costs. Third, the proposed application offers an intuitive and straightforward dashboard. Patients can obtain their glucose readings visualized in a simple format, see medication adherence levels, exercise, meal progress, and view unusual activities' effects on BG levels. When sending in their measurements, patients receive personalized coaching and tailored responses from the system to track their selfmanagement progress. It also supports a chatbot for voice clips and notes when the patient inputs manually to improve the recordability. It also provides a function to exchange ideas between users through social networks. It includes a cloud messaging service to alert if the patients miss any actions for managing their BG levels. First, the initialization part is responsible for registering the patient information and the proposed self-care IoT devices. Then, it links the application to the web-server and all IoT devices as a unified self-care platform. Second, the life-log database is to collect the patient's activities of daily living from various IoT devices. The database is organized separately according to the predefined activities of daily living. This database is based on Google Firebase that provides a real-time database and backend as a service, thereby reducing data management costs. Third, the proposed application offers an intuitive and straightforward dashboard. Patients can obtain their glucose readings visualized in a simple format, see medication adherence levels, exercise, meal progress, and view unusual activities' effects on BG levels. When sending in their measurements, patients receive personalized coaching and tailored responses from the system to track their selfmanagement progress. It also supports a chatbot for voice clips and notes when the patient inputs manually to improve the recordability. It also provides a function to exchange ideas between users through social networks. It includes a cloud messaging service to alert if the patients miss any actions for managing their BG levels.

Implementation
This paper proposes a self-care IoT pack that can automatically acquire various life patterns related to blood glucose management for diabetic patients. The proposed IoT pack has six configurations, and it connects to mobile applications and web servers. The proposed system development environment is summarized in Figure 8.

Implementation
This paper proposes a self-care IoT pack that can automatically acquire various life patterns related to blood glucose management for diabetic patients. The proposed IoT pack has six configurations, and it connects to mobile applications and web servers. The proposed system development environment is summarized in Figure 8. The implementation of exercise DAQ is shown in Figure 9. The DAQ modules attached to treadmills or indoor bicycles. Figure 9 shows a screen for registering an exercise device on a smartphone application. When the motion starts, the encoder transmits a pulse signal whose width varies according to the rotation speed to the motion information acquisition device. The implementation of exercise DAQ is shown in Figure 9. The DAQ modules attached to treadmills or indoor bicycles. Figure 9 shows a screen for registering an exercise device on a smartphone application. When the motion starts, the encoder transmits a pulse signal whose width varies according to the rotation speed to the motion information acquisition device. The implementation of exercise DAQ is shown in Figure 9. The DAQ modules attached to treadmills or indoor bicycles. Figure 9 shows a screen for registering an exercise device on a smartphone application. When the motion starts, the encoder transmits a pulse signal whose width varies according to the rotation speed to the motion information acquisition device. The proposed self-care application can be implemented as shown in Figure 10. It consists of the initial screen, entered user information, devices in IoT pack registration and management, synchronization between server and database, various life-log screens The proposed self-care application can be implemented as shown in Figure 10. It consists of the initial screen, entered user information, devices in IoT pack registration and management, synchronization between server and database, various life-log screens including medication, exercise, food intake, and activities with SMBG results. While most conventional self-care applications are software-centric, the proposed self-care platform introduces IoT devices to collect various life logs that affect a patient's BG level. It even informs the patients in real-time, as well as acquiring data in a state of insensitivity.
First of all, the proposed self-care application provides a log-in screen that runs once, as shown in Figure 10a, when the application is installed for the first time. The patients initially record their personal information and register their IoT devices in the proposed self-care IoT pack. Next, the IoT devices begin to collect the information required in the proposed self-care platform, such as BG reading, medication, food intake, exercise, and activities whenever the patients use the devices. The detailed description of the self-care application with various life-log as follows.
First, dosage and automatic injection information acquisition of the proposed self-care IoT pack are shown in Figure 10c. The patients initially record prescribed medicine and injections with name and dosage in the application. They also register their IoT devices such as a smart pill reminder and a smart pen reminder in the proposed self-care IoT pack. Every time a patient takes a pill out of the smart pill reminder, or whenever the patient injects insulin from the smart pen reminder, the proposed self-care platform obtains dosing information from these devices. Next, the data is automatically saved after user confirmation and monitored. If the information is different from the previously stored information, the patients can manually modify it using the drop-down button as shown in Figure 10c.
Second, the monitoring results of dietary intake DAQ is shown in Figure 10d. Meal information is the amount of each food on the plate, measured by the weight sensor included in the container. The patient's intake for each food is calculated. Then, each food's name is matched through the smartphone app, to obtain accurate meal information. After that, the user is finally informed of precisely what they ingested each day. Figure 10d shows meal information acquisition and daily meal information summary information.
including medication, exercise, food intake, and activities with SMBG results. While most conventional self-care applications are software-centric, the proposed self-care platform introduces IoT devices to collect various life logs that affect a patient's BG level. It even informs the patients in real-time, as well as acquiring data in a state of insensitivity. First of all, the proposed self-care application provides a log-in screen that runs once, as shown in Figure 10a, when the application is installed for the first time. The patients initially record their personal information and register their IoT devices in the proposed self-care IoT pack. Next, the IoT devices begin to collect the information required in the proposed self-care platform, such as BG reading, medication, food intake, exercise, and activities whenever the patients use the devices. The detailed description of the self-care application with various life-log as follows.
First, dosage and automatic injection information acquisition of the proposed selfcare IoT pack are shown in Figure 10c. The patients initially record prescribed medicine and injections with name and dosage in the application. They also register their IoT devices such as a smart pill reminder and a smart pen reminder in the proposed self-care Third, the monitoring results of exercise DAQ saves the exercise information every minute and keeps it in the user database, and the final summary after the patient finishes the exercise. The aerobic exercise device, including exercise information DAQ, is automatically selected when a user exercises, and it collects exercise information in real-time. It transmits the data to the proposed self-care application. The user checks the amount of exercise suitable for themselves through the exercise load test in advance and records it in the proposed self-care application. During training, the proposed application compares the exercise load stored in advance with the amount of the exercise currently being performed. Then, it informs the patient whether the exercise now being conducted is appropriate or not, as shown in Figure 10e.
Finally, the wearable band used Xiaomi's MiBand product (Xiaomi, Beijing, China) [31]. The proposed application is used after registering the product first, as shown in Figure 10b. After MiBand is connected, the user's number of steps is calculated every minute by using the acceleration and gyro sensor embedded in the wearable band. Then the user is displayed with the total steps. Also, the wearable band calculates the patient's sleep time and knows when they began to sleep and awake, as shown in Figure 10f.
After using the proposed self-care IoT pack, the patient automatically acquires the patient's life pattern information in the insensitive state. The smartphone application col-lects this information and informs the patient of the monitoring result shown in Figure 10. Finally, the proposed self-care platform can provide an analysis of blood glucose change overtime over a while.
A closed beta service has been performed since 2017 using the proposed IoT platform. We surveyed users who used it for more than three months in 2020, and results are summarized in Table 7. Overall, the patients expressed high satisfaction with ease of use. Other additional opinions are as follows. First, it is necessary to update diabetes education and blood glucose management information. Second, the goal of blood glucose management was continuously confirmed, and the number of blood glucose measurements increased compared to before use. Third, if the function to share experiences with other users is added, motivation will be better. Fourth, it is necessary to provide the exercise coaching function for a moderate level of exercise. Finally, the food DB (database) is mainly Korean food, and it should add information about foods from other countries.  Table 8 shows the comparison results between the proposed self-care platform and other counterparts. The significant feature is that the proposed platform is linked with various IoT devices in the proposed self-care IoT pack. The platform gathers both BG measurement and the related life pattern information simultaneously. In particular, by incorporating IoT technology, each time a patient uses this device, it automatically acquires data in a stateless state. The proposed method helps to continuously collect data necessary for patient blood sugar management, thereby enabling big data analysis in the future. The proposed self-care IoT platform uses various devices to obtain life patterns related to blood glucose levels. Accordingly, various and complex hardware configurations are used to obtain blood glucose, meals, exercise, medication, and lifestyle patterns. It is simplified by configuring the MCU, sensor, and memory used in each hardware device in common. Software parts such as smartphone applications and web servers were also developed through a long scale-up process. In the case of the meal information database, it contains about 10,000 pieces of food information centering on Korean food. To make it easier, it was evaluated based on public API (application programming interface) provided by the government.

Conclusions
This study proposes an intelligent self-care system that helps patients with chronic diabetes manage their blood glucose levels well. Whereas conventional self-care systems are software-centric, the proposed self-care system integrates IoT technology to devices frequently used by diabetic patients to automatically acquire life patterns necessary for blood glucose management. As a result, blood glucose measurement values and life patterns that affect blood glucose changes such as exercise, medication, and meals are automatically collected. By reviewing these records, people with diabetes easily find bad habits that lead them out of their targeted blood glucose management range and improve their lifestyle.
The proposed self-care IoT platform consists of three major parts: the self-care IoT pack; web-server; and self-care application on a smartphone. The self-care IoT pack consists of various devices daily to care for the patient's blood glucose level. We newly devised each device to collect the lifelog related to the changes in glucose level. For example, we added the IoT techniques to a food tray, pill and insulin pen dispenser, and aerobic exercise equipment. We also connected the commercial glucometer and wearable band to the proposed self-care IoT pack. It is responsible for collecting the various lifestyle factors with the patient's blood glucose level automatically. A web-server is accountable for user authentication and database management. It builds a database of information received from the smartphone application for each patient. Finally, the self-care application is responsible for storing and analyzing data obtained from each IoT device in the proposed self-care IoT pack. Then, it presents the result to the patient in real-time.
The proposed self-care IoT platform's actual implementation results show that it can automatically acquire and transmit the data with each device in the IoT pack is connected to a smartphone. The patients perform the day's routine without burdening the records, but they can confirm the automatically recorded information to find the adverse lifestyle factors which raise the blood glucose. Finally, we compared the proposed platform to other counterparts, including commercial applications. The proposed method is the only system that automatically records all life patterns that affect blood glucose management. In the future, it is necessary to study and develop a plan that recommends the blood glucose level prediction and the life pattern of each patient by using all the information automatically obtained as a result of this study.
There are plans to supplement this study soon. First, we plan to analyze whether a user exercises appropriately for blood glucose management by using the acquired exercise information by reflecting different physical abilities for each individual and the relationship between exercise and blood glucose levels. Second, we plan to study how the proposed platform can include not only Korean food but also food information from other countries. Finally, it is expected that real-time blood glucose prediction according to the user's life pattern will be possible using the proposed platform.