## 3 Materials and Methods
#### Wireless Sensor Network Installed  
The proposed system features sensors across 14 nodes, designed to monitor key areas in a house and provide user alerts via email or SMS. The sensors include the following:  
* Motion sensor: Operates at 4.5-20 V with an adjustable delay (5-200 s), a temperature range of \(-\)15 to +70 \({}^{\circ}\)C, and a detection range of 3 to 7 m.
* Pressure, temperature, and humidity sensor: Measures temperature (\(-\)40 to +85 \({}^{\circ}\)C, \(\pm\)1 \({}^{\circ}\)C accuracy), pressure (300-1100 hPa, \(\pm\)1 Pa accuracy), and relative humidity (\(\pm\)3% tolerance), with a supply voltage of 1.71 to 3.6 V.
* Noise sensor: Uses an ultrasonic sensor with a frequency range of 20-20 kHz, an operating voltage of 2.4-5 VDC, and a maximum detection distance of 765 cm. * Light sensor: An LDR photoresistor with a supply voltage range of 3.3-5 V and a maximum rating of 38 V.
* Gyroscope: A single-axis sensor with a typical angular velocity of \(\pm\)300\({}^{\circ}\)/s, an operating voltage of 3.3-5 V, and a temperature range of \(-\)40 to 105 \({}^{\circ}\)C.
* Air quality sensor: Monitors PM2.5, CO\({}_{2}\), CH\({}_{2}\)O, TVOC, temperature, and humidity, applicable to various air quality monitoring and HVAC systems. Figure 3 presents a Development Kit for the Wireless Self-organizing Network, featuring RF nodes that provide real-time data using a proprietary IEEE 802.15.4 protocol. The network structure includes a coordinator, routers, and sensors. Testing is done through Python scripts for route queries and sensor readings. The hardware supports 2.4 GHz, RS-485, USB connections, and can manage up to 100 nodes with an SMA connector and a 2.37 dBi antenna. Power supply options include a 12 V DC battery, solar power (10 W, 12 V DC), and an AC adapter (110-220 V AC to 12 V DC), offering flexibility for different setups. Figure 4 presents actual photographs of the devices installed as part of the monitoring system. The distributed sensor network includes a hub node, which connects to the computer via USB and is responsible for receiving and managing all transmitted data. This network features three router nodes, each with sensors attached to its communication ports, monitoring parameters such as temperature, pressure, humidity, light, sound, and other variables based on additional activated sensors. The gathered data are sent via radio frequency to the network, ultimately reaching the concentrator node, which can also function as a repeater. The power supply operates in two modes: (1) Input Voltage 1 (BAT): Lead-Acid Battery (12 V DC at 3.3 Ah); (2) Input Voltage 2 (CS): Solar Cell (12 V DC, 10 W, 0.5 A). The network's graphic software displays the logical neighbors of each node, showing their relationships based on the RSSI (Received Signal Strength Indicator) and LQI (Link Quality Indicator) signals. Figure 2: Informed consent form for elderly participants in home sensor network research. The sensor network is designed to learn a person's habits and keeps certain sensors active in the locations where they spend the most time. It also recognizes routine behaviors, such as opening and closing windows or doors, to prevent unnecessary alerts. The system tracks various environmental factors like noise, movement, air quality, light levels, door usage, and lighting conditions. It sends notifications with suggestions for improving sleep quality, which is also monitored through a conventional smartwatch. The alert algorithm is tailored to enhance the user's sleep. For example, it might recommend adjusting fluid intake if the person frequently wakes up to use the bathroom, reducing light in the sleeping area, or modifying the positions of doors and windows to manage noise levels. Daily recommendations are delivered via email or SMS, helping the person gradually improve their sleep habits. The system is non-intrusive and does not require constant user adjustments. It also includes an energy-efficient algorithm that adapts based on how the sensors are used in different parts of the home.