## 3 Materials and Methods
### Methodology of the Experiment  
Regarding the implementation and comparison of the system to evaluate energy consumption with and without the proposed algorithm, we performed tests with 30 people during a period of four weeks. We analyzed the system in the first two weeks without implementing the energy-saving algorithm in the nodes. In this case, the nodes were working without reactivity based on parameter changes. For the next two weeks, we implemented reactivity in the nodes to observe the savings in energy consumption. In this way, we could test the algorithm's performance complemented with energy savings. It should be noted that the tests on the 30 people to analyze their vital signs and the impact on sleep were carried out with the complete algorithm, that is, with the proposed energy savings. The work presented here advances the state of the art in proposing a sensor system for monitoring people at home and providing personalized recommendations for improving sleep quality based on anomalous levels of measurements. This system leverages sensor technology and data analysis to offer solutions to enhance sleep patterns. The development of a sensor system tailored for home monitoring is a significant step forward. This system likely consists of various types of sensors strategically placed within the living spaces to capture relevant data related to sleep patterns. These sensors could include ambient light sensors, temperature sensors, motion sensors, heart rate monitors, and even advanced devices like sleep-specific wearable technology. The work proposes a data analysis framework to process the data collected by the sensor system effectively. By analyzing and interpreting the data, the system can identify anomalous levels or patterns in a person's sleep-related measurements. Anomalies could include irregular sleep duration, abnormal heart rate variations during sleep, or disturbances in sleep cycles. The key innovation lies in the system's ability to provide personalized recommendations based on the anomalous measurements. These recommendations could range from changes in sleep habits, lifestyle adjustments, relaxation techniques, or even suggestions to consult a medical professional, depending on the severity of the anomaly detected. The energy-saving algorithm integrated into the sensor system is another crucial advancement. By utilizing the programming nature of the sensors (proactive and reactive), the system can efficiently manage power consumption and extend the overall lifespan of the sensors. This algorithm likely employs techniques like dynamic sampling, adaptive data transmission, or intelligent sleep/wake-up modes for the sensors, ensuring that they are only active when necessary. This study is based on monitoring people's sleep through a smartwatch device. The experiment is carried out for two weeks without the sensor system and two other weeks with a sensor network installed in the main areas of the house of 30 elderly adults. Once the averaged metrics of the older adults for the two weeks without the use of the sensor network and with the use of the system are known, we proceed to the analysis of the information. The age of the people ranges between 50 and 70 years. There are 16 women and 14 men. People are relatively healthy concerning their health. They do not have heart or respiratory diseases (because this could alter the results a bit). The collected data will likely provide valuable insights into sleep patterns and overall well-being for this demographic. A consent form to approve the use of the system and its installation in their home is signed. The nodes adapt according to the layout of each person's house. There must be at least two nodes in the room where the person sleeps, and in the main areas of the house (kitchen, living room, and dining room), at least one node. The nodes are easy to install near a power outlet. The nodes' adaptability based on the layout of each person's home is crucial.