*3.1. Main Components*

Our system is comprised of six main technological components. The first component, the physical activity tracker, is a device that family members use to gather their physical activity data and store it in the database. Activity bracelets attached to the wrist of children during the week provide information about steps, activity time, distance, calories burned, and quality of sleep among other features. Analysis of these data is later used to determine, for example, proper times of notification in conjunction with general information, food habits and anthropometric measurements that are manually collected. Recognition of parameters from activity bracelets can be performed in an automated and transparent. However, since we are using Xiaomi 1S (Xiaomi Inc., Haidian District, Beijing, China) smart wristband this process is semi-automated (i.e., data are synchronized with a smartphone via Bluetooth connection and requires a manual script).

Physical activity data was collected using the activity band during a week. The data obtained was daily activity such as steps, activity time (hh:mm), distance (km), burned calories (cal) by day as well as the breakdown of all the activities carried out during the day. One week later the band was removed, the data was synchronized to the Band App and finally we used a script to transfer the data to our database.

All the gathered data are stored in a central database (2nd component). In this project, we have used a non-structured document database built using MongoDB v3.6. The purpose of this is to take advantage of the flexibility and scalability provided by this technology. Another reason to build this system using MongoDB has been the necessity of adaptability during the development and evaluation of the solution. Depending on the user's characteristics, the available data differs. Therefore, a traditional structured approach is not appropriate.

The third technological component is the notification generator. The conceptual framework applied in the development of this system was conceived to be applied in several contexts. The name notification generator specifies a piece of software that uses the gathered information and environment conditions to generate notifications. However, these notifications do not have to be automatically generated. In the case of our system the notifications that are delivered through the prototypes are generated based on the recommendations of specialists in nutrition and physical activity (i.e., the information and parameters for delivery of each notification are predefined). However, the system could be used to generate automatic notifications based predefined conditions and the information gathered and stored in the central database.

The notification generator, in our system, is a piece of software developed to use the predefined information stored in the central database to create a notification. Moreover, this part of the system includes the parameters for delivery, also predefined, to establish the delivery interval of each notification in accordance with the timing specified by the specialists. Generated notifications are stored in the central database, because the notification dispatcher extracts notifications from this centralized repository to be delivered.

For the specific purposes of the implementations of the framework described in this paper, the notifications are listed and specified by specialists in nutrition and physical activity. This list of notifications is stored in the database and specific parameters are established to determine when the reminder should be delivered. Moreover, all the available information (stored in the database) is used to determine if the notification can be delivered through the predefined device (i.e., fridge magnet, cabinet drawer or other available devices). An example of the use of this information is the use of sleep patterns to determine an appropriate time to display notifications. The use of a non-structured document database allows different types of data to be stored and used in whichever way the

notification requires. A more detailed explanation of the notifications delivered is described in Section 4 (Application Domains).

The fourth component is the notification dispatcher. This is a software component in charge of serving notifications to their final recipient devices. The notification dispatcher functions as a link between the system and each dedicated device. This approach is required to address the problem of standardization in the smart device domain. Each smart device offers different functionalities; therefore, different ways to deliver notifications must be implemented.

The notification dispatcher allows communication between the database and the smart notification devices through the Message Queuing Telemetry Transport (MQTT) protocol. MQTT is a publish-subscribe-based lightweight messaging protocol that runs on top of the TCP/IP protocol. Publish-subscribe is a communication pattern where senders of messages, called publishers (e.g., notification dispatcher), do not route messages to be sent directly to subscribers (e.g., notification devices), but instead characterize messages into topics and publish/post them on a broker. The subscribers then receive the messages from the broker depending on the settings of their connection and the topics they are subscribed on. The broker (5th component) consists of a dedicated server placed between publishers and subscribers to manage message dispatching and to ensure delivery through different quality of service (QoS) strategies that reinforce the delivery mechanisms of the TCP/IP protocol.

The use of a MQTT broker between the notification dispatcher and the notification devices, instead of a direct link, was a deliberate decision. QoS level 1 and QoS level 2 policies ensure that messages (notifications in this case) reach the target device/s. If a target (notification) device is unreachable at a time, for instance, due to an accidental disconnection or because it has no power, the MQTT broker will store undelivered notifications and will serve them, when the device is available again. In addition, advanced QoS strategies play an important role in energy saving enabling the use of power save configurations in the notification devices. Thus, the duty cycle percentage, which is power demanding, may be substantially reduced in the notification devices by entering deep sleep mode periodically. If there are notifications attempts while target devices are sleeping, they will be forwarded by the MQTT broker and received in the upcoming duty cycles.

Finally, the last components are the smart devices used for notification delivery. In the present work, two dedicated devices have been created from scratch. Currently, there are several smart devices available for purchase. However, these devices do not provide the proper functionalities to deliver information and gather responses from users as it is intended with our system. A review of available IoT devices was conducted before deciding to implement the two smart devices described in this paper. Even though we found more than 85 smart devices (with different functionalities) none was sufficiently customizable or provided all the functionalities that the developed prototypes offer. Appendix A shows the list of smart devices studied before deciding to develop the dedicated prototypes.

The two prototypes of notification devices that have been built in the present work are equipped with a low-cost System on a Chip ESP8266-12E (Espressif Systems Inc., Shanghai, China), which integrates a 32-bit RISC Tensilica Xtensa LX106 micro-controller and an 802.11 B/G/N Wi-Fi transceiver to support wireless communication and Internet access through the TCP/IP protocol stack built in the firmware. MQTT client code supporting publications and subscriptions to topics with QoS level 1 has been implemented and compiled to run on top of the TCP/IP protocol. In addition, the ESP8266-12E enables Inter-Integrated Circuit and SPI (Serial Peripheral Interface) serial communications to connect different sets of sensors and actuators.

Both prototypes have been specifically designed to deliver notifications that promote healthy behaviors in children. The most complex consists of a fridge magnet that includes a 0.96-inch monochrome OLED graphic display, which has been connected through the SPI bus to the micro-controller. It has 128 × 64 pixels that can be used to display static or dynamic monochromatic images and text messages. Furthermore, this prototype is equipped with a single InvenSense MPU-6050 6-DOF IMU (InvenSense Inc., San Jose, CA, USA) wired through the I2C interface. It has been included

to support feedback actions in notifications, such as "opened/closed fridge door alarm", among others. This prototype is focused on delivering notifications that promote healthy eating behaviors through the fridge door, as it is a right place to do it. This decision is since kitchen surfaces, particularly fridge doors, are frequently used as reminder systems at home-specific locations [23]. Shopping lists, to-do lists, tailored messages, and paper reminders are often left on the fridge. In this context, emphasis is placed on the importance of fridge magnets as they are seen to contribute to a fluidity and configurability that make fridge surfaces unique to provide contextual cues to the users [24]. Therefore, fridge doors are appropriate places to deliver proactively notifications that support habit formation and behavior changes [25]. Specifically, the magnet prototype is well-suited to provide notifications in the form of visual cues which persuade users to prepare snacks in advance promoting healthy eating. The hardware scheme of this first prototype can be seen in Appendix B. *Sensors* **2018**, *18*, 271 6 of 21 context, emphasis is placed on the importance of fridge magnets as they are seen to contribute to a fluidity and configurability that make fridge surfaces unique to provide contextual cues to the users

On the other hand, the second prototype for notification delivery focuses on promoting physical activity in children, another factor to reduce overweight and obesity levels. It has no display and it relies on a simplest resource for providing notification awareness. In this case, the prototype consists of a five RGB LED array with integrated drivers from Adafruit (Adafruit Industries Inc., New York City, NY, USA). A relevant keyword ("Sports Day") is carved out on the prototype 3D printed plastic case, so that it allows the light to pass through the letter gaps highlighting the keyword. Furthermore, this prototype is equipped with a push button not to turn the notification LED lights off, but to give feedback to the system so that the notification has been attended by the end users. [24]. Therefore, fridge doors are appropriate places to deliver proactively notifications that support habit formation and behavior changes [25]. Specifically, the magnet prototype is well-suited to provide notifications in the form of visual cues which persuade users to prepare snacks in advance promoting healthy eating. The hardware scheme of this first prototype can be seen in Appendix B. On the other hand, the second prototype for notification delivery focuses on promoting physical activity in children, another factor to reduce overweight and obesity levels. It has no display and it relies on a simplest resource for providing notification awareness. In this case, the prototype consists of a five RGB LED array with integrated drivers from Adafruit (Adafruit Industries Inc., New York City, NY, USA). A relevant keyword ("Sports Day") is carved out on the prototype 3D printed plastic case, so that it allows the light to pass through the letter gaps highlighting the keyword. Furthermore,

It has been designed in the form of a cabinet drawer hook, as it is a right place for sportswear reminders. This assertion is supported by two basic arguments. The first is that the cabinet is de facto a usual place to store sportswear so that visual cues on sports days, at proper timing, ensure that the notification has been seen. The second reason is purely technical; since the prototype incorporates a built-in Wi-Fi transceiver intended for its use at home settings. The prototype is designed to remain static in the context of the household. An overview of the system including main actors, software components and technological infrastructure is depicted in Figure 1. this prototype is equipped with a push button not to turn the notification LED lights off, but to give feedback to the system so that the notification has been attended by the end users. It has been designed in the form of a cabinet drawer hook, as it is a right place for sportswear reminders. This assertion is supported by two basic arguments. The first is that the cabinet is de facto a usual place to store sportswear so that visual cues on sports days, at proper timing, ensure that the notification has been seen. The second reason is purely technical; since the prototype incorporates a built-in Wi-Fi transceiver intended for its use at home settings. The prototype is designed to remain static in the context of the household. An overview of the system including main actors, software components and technological infrastructure is depicted in Figure 1.

**Figure 1.** System overview including: main actors, software components, and technological infrastructure. **Figure 1.** System overview including: main actors, software components, and technological infrastructure.

To the best of our knowledge, there are no further studies that attempts to persuade users to not forget their sportswear promoting physical activity through notification reminders in this context. In 2015 Lau, Wong, Luk and Kwok [26], described the problem of forgetting important items depending on the daily school schedule. It was addressed through a reminder system based on near field communication. Particularly, this system was integrated into a school bag and it provided reminders about items such as lunch boxes and sportswear, among others. Nevertheless, the prototype in [26] is considered for mobility beyond the household.

The hardware scheme of our second prototype focuses on promoting physical activity in children through sportswear notification reminders can be seen in Appendix C.

Both prototypes use 3.7 volts lithium polymer batteries and they are complemented by a regulator circuit to provide stable 3.3 volts to the different modules, together with a charge controller that regulates the charge process and avoids the complete discharge of the battery during use. Moreover, both prototypes have 3D printed cases. Table 1 overviews detailed specifications of these two prototypes.


**Table 1.** Dedicated devices hardware characterization.
