## 4 Methodology
the facemask is equipped with an electronic board designed using AutoDesk Eagle and an NTC thermistor to measure the temperature variations, which are useful to record when the facemask is in contact with the child's forehead. The physical manufacturing of the board was outsourced to the company PCB Way, while the component soldering was subsequently performed in-house at the Santa Chiara Fab Lab, University of Siena. Sensor data and time stamps are stored on non-volatile F-RAM memory, which allows low power consumption and high endurance during write/read cycles. The ATSAMD21G18 microcontroller includes a real-time counter circuit that checks the status of the board from the sleep mode every 15 min, optimising energy efficiency. A power subsystem is used to ensure stable power supply to the system, maintaining the 3.3 V required for reliable system operation. The board and lithium battery are enclosed in a housing situated above the forehead pad, while the thermistor sensor is positioned between the protective pad and the inner surface of the pad. * A docking station serves as both a charging hub for the mask's battery and for receiving data recorded by the mask, which are transmitted to the game server. The shell of the docking station is designed and produced using FDM 3D printing technology. This includes a Raspberry Pi 4 operating on a GNU/Linux(r) system. When the mask is connected to the docking station via a USB cable, its battery is recharged. This guarantees the frequency of data acquisition. By pressing a designated button located on the mask's shell, the data recorded are downloaded and stored in an SQLite database. The docking station is also connected to the patient's home Wi-Fi network to automatically send the downloaded files to a central server. Every day at 3 pm CET, a rcon job starts: a Phyton script checks if an internet connection is available, extracts data that the server has not received yet, and sends these to the central server in the form of a JSON payload, then data are stored in a dedicated table of the MySQL database. If the internet connection is not available, the data are saved in the F-RAM memory and transmitted as soon as the internet connection becomes accessible again. Patients and their parents are instructed on the use of the system, and how to connect the facemask to the docking station and activate a button to ensure that the data are sent to the server. An illustrated user manual describing the system and how to use it is enclosed in the docking station. The manual also highlights that the system does not use a Bluetooth connection directly in the facemask, to avoid any risk associated with the proximity of the radio-frequency device to the child's head. * Downloaded data are used to feed the dynamics of a video game designed to engage the child in various adventures all along the prescribed therapeutic period. In this way, patients become consumers [26] of their own data, as they can have tangible evidence and reward for the correct wear time of the facemask. The technology infrastructure of the video game is a responsive web app built on the LAMP (Linux, Apache, Mysql, PHP) stack. The PHP Laravel framework was used to develop the game's back- end, while Vanilla JS, Bootstrap, and custom CSS were implemented for the front- end. * The fourth component of the system is a web app through which data on the wear time are shared with the orthodontist, who can choose different data visualisations, monitor the progress of the treatment, and adjust the therapeutic plan based on reliable and accurate data.