## 2 Materials and Methods
### Questionnaire Discovery  
This phase of the methodology consists on a questionnaire that aims to get actual information about people's sleep habits and quality. We asked the group 8 questions to start with and gain insights to compare. These questions are developed to provide feedback to the proposed algorithm and focus the sensor alerts on the person's needs. These are the following questions:  
* **Do you enjoy sleeping? Why?**: This is dichotomous (Y/N) and open question that helped the experiment get insights into people's opinion about their sleep.
* **Do you think sleeping is important? Why?**: This is dichotomous (Y/N) and open question that helped the experiment get insights into people's opinion about their sleep.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Sensor** & **Features** \\ \hline Motion & DC 4.5–20 V, 50 \(\mu\)A delay: 5–200 S(adjustable) the range is (0.xx second to tens of second), Operation Temp.: \(-\)15–470 degrees, Detection Range: 3 m to 7 m. \\ \hline Pressure, temperature and humidity & Combines thermometer, barometer and hygrometer. Temperature range from \(-\)40 to +85 \({}^{\circ}\)C with an accuracy of \(\pm\)1 \({}^{\circ}\)C and resolution of 0.01 \({}^{\circ}\)C, and for pressure 300–1100 hPa, accuracy of \(\pm\)1 Pa, and resolution of 0.18 Pa. Due to its behavior as a hygrometer, the BME280 has a relative humidity measurement range of 0 to 100\%, with an accuracy of \(\pm\)3% Pa and a resolution of 0.008\%. Supply voltage range: 1.71 V to 3.6 V. Accuracy tolerance \(\pm\)3% relative humidity. \\ \hline Noise & ULTRASONIC SENSOR HRXL-MAXSONAR. MAX4466 with adjustable gain. 20–20 KHz electric microphone. 2.4–5 VDC. 3.7 W. Frequency: 42 kHz. Type: Transmitter, Receiver. Maximum detection distance: 765 cm. Consumption: 2.1 mA. Operating temperature: \(-\)40 \({}^{\circ}\)C 65 \({}^{\circ}\)C. \\ \hline Light & LDR photoresistor sensor module. Main chip: LM393. Minimum supply voltage: 3.3 V. Maximum supply voltage: 5 V. Output Type: Digital. \\ \hline Gyroscope & 7A994. Axis Type: Single. Typical Angular Velocity (\({}^{\circ}\)/s): \(\pm\)300. Typical Operating Supply Voltage (V): 3.3 15. Minimum Operating Temperature (\({}^{\circ}\)C): \(-\)40. Maximum Operating Temperature (\({}^{\circ}\)C): 105. Linearity: No. \\ \hline Air quality & ZPHS01C Multi-in-One Air quality monitoring Sensor Module. Target Gas:PM2.5, CO2, CH2O, TVOC, Temperature and Humidity. Applications: Gas detector, Air conditioner, Air quality monitoring, Air purifier, HVAC system, Smart home. \\ \hline \hline \end{tabular}
\end{table}
Table 2: In-Room System Sensor Specifications.  
Figure 3: Example of noise sensor value request with MAC address DD23.  
* **Do you know what sleep cycles are?:** This is a dichotomous (Y/N) question that helped the experiment know how familiar is the person with sleep.
* **If you know what sleep cycles are, please explain.**: This is an open and dependent question from the last one, which helped the experiment know how deep the person is familiar with sleep.
* **How many hours do you normally sleep?:** This is a multi-choice question that helped the experiment know the habits of the person. The choices were: Less than 5 h, 5-7 h, 8-9 h, More than 9 h.
* **Do you regularly sleep with exposure to light?:** This is a dichotomous (Y/N) question that helped the experiment know how familiar is the person with sleep.
* **Which position do you normally sleep in?:** This is a multi-choice question that helped the experiment know the habits of the person. The choices were: I sleep on my left side, I sleep on my right side, I sleep on my back and I sleep on my stomach.
* **How well do you sleep regularly?:** This is a scale question that helped the experiment know the feelings of the person on their sleep. The scale was 1 to 10.