IoT-Based Classroom Temperature Monitoring and Missing Data Prediction Using Raspberry Pi and ESP32

Authors

  • M. A. Navarrete-Sanchez Universidad Autónoma de Zacatecas
  • Re. Olivera-Reyna Universidad Autónoma de Zacatecas
  • Ro. Olivera-Reyna Universidad Autónoma de Zacatecas
  • R. J. Perez-Chimal Universidad Autónoma de Zacatecas
  • J. U. Munoz-Minjares Universidad Autónoma de Zacatecas https://orcid.org/0000-0001-8097-9551

DOI:

https://doi.org/10.18196/jrc.v6i1.24345

Keywords:

Internet of Things, Temperature, Prediction, I-UFIR, Node-RED

Abstract

This study focuses on accurate temperature monitoring to optimize classroom conditions, enhancing student comfort and performance by providing precise data on temperature dynamics and ensuring reliability through advanced algorithms for handling missing data. Currently, advances in the Internet of Things (IoT) have enabled the development of simple, scalable, and intuitive systems for real-time environmental monitoring. This work presents a novel architecture for monitoring temperature dynamics in an electronic laboratory, leveraging a system of interconnected IoT devices with Wireless Fidelity (WiFi) communication. The system employs an ESP32 microcontroller and DS18B20 temperature sensors placed strategically around the classroom, including near windows and doors, to provide comprehensive data on heat distribution. The ESP32 is a small, low-cost, and powerful electronic chip that acts as the central processor for IoT systems, capable of handling data and connecting to a Wireless Network trough WiFi. While the DS18B20 can be defined as a digital sensor that accurately measures temperature and transmits the data electronically to a connected device. Therefore, the ESP32 microcontroller acts as the central processor, receiving temperature data from the DS18B20 sensors, which are configured to detect and transmit measurements. So, this data is then sent over a secure local WiFi network for real-time monitoring and analysis. The proposed system offers several advantages over existing solutions, including cost effective deployment, ease of integration, and real time monitoring. By using a secure local network for communication, it ensures reliable and uninterrupted data transmission. Furthermore, the I-UFIR algorithm was implemented to estimate missing temperature data points, significantly improving the accuracy of temperature readings and providing smoother, more reliable estimations. This system not only demonstrates the feasibility of IoT-based temperature monitoring in educational settings, but also highlights its potential to improve learning environments by optimizing classroom conditions.

References

G. Guevara, G. Soriano, and I. M. Rodriguez, “Thermal comfort in university classrooms: An experimental study in the tropics,” Building and Environment, vol. 187, 2021, doi: 10.1016/j.buildenv.2020.107430.

R. J. Park, J. Goodman, M. Hurwitz, and J. Smith, “Heat and learning,” American Economic Journal: Economic Policy, vol. 12, no. 2, pp. 306–39, 2020, doi: 10.1257/pol.20180612.

S. Dominguez–Amarillo, J. Fernandez-Aguera, M.M. Gonzalez, and T. Cuerdo–Vilches, “Overheating in schools: Factors determining children’s perceptions of overall comfort indoors,” Sustainability, vol. 12, no. 14, pp. 5772, 2020, doi: 10.3390/su12145772.

A. C. Hurlimann, S. Moosavi, and G. R. Browne, “Climate change transformation: A definition and typology to guide decision making in urban environments,” Sustainable Cities and Society, vol. 70, 2021, doi: 10.1016/j.scs.2021.102890.

J. R. Short, and A. Farmer, “Cities and climate change,” Earth, vol. 2, no. 4, pp. 1038–1045, 2021, doi: 10.3390/earth2040061.

H. S. Khan, R. Paolini, P. Caccetta, and M. Santamouris, “On the combined impact of local, regional, and global climatic changes on the urban energy performance and indoor thermal comfort—The energy potential of adaptation measures,” Energy and Buildings, vol. 267, 2022, doi: 10.1016/j.enbuild.2022.112152.

W. Hernandez and N. Canas, “Sensing Classroom Temperature, Relative ˜ Humidity, Illuminance, CO2, and Noise: An Integral Solution Based on an IoT Device for Dense Deployments,” Sensors, vol. 24, no. 16, 2024, doi: 10.3390/s24165129.

M. Jowkar, H. B. Rijal, J. Brusey, A. Montazami, S. Carlucci, and T. C. Lansdown, “Comfort temperature and preferred adaptive behaviour in various classroom types in the UK higher learning environments,” Energy and Buildings, vol. 211, 2020, doi: 10.1016/j.enbuild.2020.109814.

S. Lin, E. Lipton, Y. Lu and C. Kielb, “Are classroom thermal conditions, lighting, and acoustics related to teacher health symptoms?,” Indoor Air, vol. 30, no. 3, pp. 544–552, 2020, doi: 10.1111/ina.12640.

R. Ahmed, D. Mumovic, E. Bagkeris, and M. Ucci, “Combined effects of ventilation rates and indoor temperatures on cognitive performance of female higher education students in a hot climate,” Indoor Air, 2022, doi:10.1111/ina.13004.

Y. Xiao, H. Li, C. Wang, S. Pan, J. He, A. Liu, and G. Lu, “Room temperature wearable gas sensors for fabrication and applications,” Advanced Sensor Research, vol. 3, no. 3, 2024, doi: 10.1002/adsr.202300035.

A. Estevez, J. J. F. Sokoudjou, J. I. Sancho, D. Valderas, I. Ochoa, and ´ N. Perez, “Chipless wireless sensor coupled with machine learning for ´ oil temperature monitoring,” IEEE Sensors Journal, vol. 23, no. 18, pp. 21234–21245, 2023, doi: 10.1109/JSEN.2023.3301668.

P. Kumari, S. Kapur, V. Garg, and K. Kumar, “Effect of surface temperature on energy consumption in a calibrated building: A case study of Delhi,” Climate, vol. 8, no. 6, 2020, doi: 10.3390/cli8060071.

I. G. M. N. Desnanjaya, and I. N. A. Arsana, “Home security monitoring system with IoT–based Raspberry Pi,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 22, no. 3, 2021, doi: 10.11591/ijeecs.v22.i3.pp1295-1302.

A. Khanna, and S. Kaur, “Internet of things (IoT), applications and challenges: a comprehensive review,” Wireless Personal Communications, vol. 114, pp. 1687–1762, 2020, doi: 10.1007/s11277-020-07446-4.

R. P. Singh, M. Javaid, A. Haleem, and R. Suman, “Internet of things (IoT) applications to fight against COVID–19 pandemic,” Diabetes & Metabolic Syndrome: Clinical Research & Reviews, vol. 14, no. 4, pp. 521–524, 2020, doi: 10.1016/j.dsx.2020.04.041.

T. Alam, “Cloud-based IoT applications and their roles in smart cities,” Smart Cities, vol. 4, no. 3, pp. 1196–1219, 2021, doi: 10.3390/smartcities4030064.

A. Abdelmaboud, A. I. A. Ahmed, M. Abaker, T. A. E. Eisa, H. Albasheer, S. A. Ghorashi, and F. K. Karim, “Blockchain for IoT applications: taxonomy, platforms, recent advances, challenges and future research directions,” Electronics, vol. 11, no. 4, 2022, doi: 10.3390/electronics11040630.

H. Sequeiros, T. Oliveira, and M. A. Thomas, “The impact of IoT smart home services on psychological well-being,” Information Systems Frontiers, pp. 1–18, 2022, doi: 10.1007/s10796-021-10118-8.

W. T. Sung, and S. J. Hsiao, “The application of thermal comfort control based on Smart House System of IoT,” Measurement, vol. 149, 2020, doi: 10.1016/j.measurement.2019.106997.

F. J. Dian, R. Vahidnia, and A. Rahmati, “Wearables and the Internet of Things (IoT), applications, opportunities, and challenges: A Survey,” IEEE access, vol. 8, pp. 69200–69211, 2020, doi: 10.1109/ACCESS.2020.2986329.

S. Thapa, and S. C. KC, Raspberry Pi and ESP32-Based Smart Sensor Network for IoT Platform Integration and Real-Time Environmental Data Monitoring, Bachelor’s Thesis, Metropolia University of Applied Sciences, 2023.

A. Zare, and M. T. Iqbal, “Low-cost ESP32, Raspberry Pi, Node-RED, and MQTT protocol based SCADA system,” in 2020 IEEE International IOT, Electronics and Mechatronics Conference (IEMTRONICS), pp. 1–5, 2020, doi: 10.1109/IEMTRONICS51293.2020.9216412.

K. E. Y. Laurel et al., “An Intelligent Humidity and Temperature Monitoring System using Long Short-Term Memory Neural Network and Raspberry Pi,” 2023 IEEE 15th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), pp. 1-6, 2023, doi: 10.1109/HNICEM60674.2023.10589111.

Sunardi, A. Yudhana and Furizal, “Tsukamoto Fuzzy Inference System on Internet of Things-Based for Room Temperature and Humidity Control,” in IEEE Access, vol. 11, pp. 6209-6227, 2023, doi: 10.1109/ACCESS.2023.3236183.

I. Memon, R. A. Shaikh, M. K. Hasan, R. Hassan, A. U Haq, and K. A. Zainol, “Protect mobile travelers information in sensitive region based on fuzzy logic in IoT technology,” Security and Communication Networks, vol. 2020, no. 1, 2020, doi: 10.1155/2020/8897098.

A. Asif, and M. Zeeshan, “Indoor temperature, relative humidity and CO2 monitoring and air exchange rates simulation utilizing system dynamics tools for naturally ventilated classrooms.” Building and Environment, vol. 180, 2020, doi: 10.1016/j.buildenv.2020.106980.

N. Hutabarat, R. S. Siraita, J. Junaidi, and M. Pardede, “Implementation of a Wireless Sensor Network with Mesh Topology with XBee for Centralized Building Room Monitoring,” Journal of Computer Science, Information Technology and Telecommunication Engineering, vol. 5, no. 2, pp. 581-588, 2024, doi: 10.30596/jcositte.v5i2.20002.

S. Katsoulis, G. Koulouras and I. Christakis, “Energy-Efficient Data Acquisition and Control System using both LoRaWAN and Wi-Fi Communication for Smart Classrooms,” 2024 13th International Conference on Modern Circuits and Systems Technologies (MOCAST), pp. 1-4, 2024, doi: 10.1109/MOCAST61810.2024.10615862.

M. Yaganoglu, F. Bozkurt, F.B. Gunay, S. Kul, E. Simsek, G. Ozturk, and S. Karaman, “Design and validation of IoT based smart classroom,” Multimedia Tools and Applications, vol. 83, no. 22, pp. 62019–62043, 2024, doi: 10.1007/s11042-023-15872-2.

K. Mohan, and J. Pearl, “Graphical models for processing missing data,” Journal of the American Statistical Association, vol. 116, no. 534, pp. 1023–1037, 2021, doi: 10.1080/01621459.2021.1874961.

E. M. D. van Rijn et al., “PELP: accounting for missing data in neural time series by Periodic Estimation of Lost Packets,” Frontiers in Human Neuroscience, vol. 16, 2022, doi: 10.3389/fnhum.2022.934063.

N. Berjab, H. H. Le, and H. Yokota, “Recovering missing data via top-k repeated patterns for fuzzy-based abnormal node detection in sensor networks,” IEEE Access, vol. 10, pp. 61046–61064, 2022, doi: 10.1109/ACCESS.2022.3181742.

R. Krishnamurthi, A. Kumar, D. Gopinathan, A. Nayyar, and B. Qureshi, “An overview of IoT sensor data processing, fusion, and analysis techniques,” Sensors, vol. 20, no. 21, 2020, doi: 10.3390/s20216076.

A. G. Rameshrao, E. Koley, and S. Ghosh, “A packet-loss resilient protection scheme for hybrid microgrids based on Markov chain model and spline interpolation,” Sustainable Energy, Grids and Networks, vol. 35, 2023, doi: 10.1016/j.segan.2023.101121.

D.M. Larson et al., “Reconstructing missing data by comparing interpolation techniques: Applications for long-term water quality data,” Limnology and Oceanography: Methods, vol. 7, no. 21, pp.435–449, 2023, doi: 10.1002/lom3.10556.

A. A. Attar, F. Schirle, and M. Hofmann, “Noise added on Interpolation as a Simple Novel Method for Imputing Missing Data from Household’s Electricity Consumption,” Procedia Computer Science, vol. 207, pp. 2253–2262, 2022, doi: 10.1016/j.procs.2022.09.284.

M. V. Olguin et al., “Object tracking over distributed WSNs with consensus on estimates and missing data,” IEEE Access, vol. 7, pp. 39448–39458, 2019, doi: 10.1109/ACCESS.2019.2905514.

L. Padilla, B. L. Alvarez, J. Mateu, and E. Porcu, “Space-time autoregressive estimation and prediction with missing data based on Kalman filtering,” Environmetrics, vol. 31, no. 7, 2020, doi: 10.1002/env.2627.

J. You, X. Ma, Y. Ding, M. J. Kochenderfer, and J. Leskovec, “Handling missing data with graph representation learning,” Advances in Neural Information Processing Systems, vol. 33, pp. 19075–19087, 2020, doi:/10.48550/arXiv.2010.16418.

C. Gu, M. Zhu, Y. Wu, B. Chen, F. Zhou, and W. Chen, “Multioutput displacement health monitoring model for concrete gravity dam in severely cold region based on clustering of measured dam temperature field,” Structural Health Monitoring, vol. 22, no. 5, pp. 3416-3436, 2023, doi: 10.1177/14759217221142006.

R. J. Little, J. R. Carpenter, and K. J. Lee, “A comparison of three popular methods for handling missing data: complete-case analysis, inverse probability weighting, and multiple imputation,” Sociological Methods & Research, vol. 53, no. 3, pp. 1105–1135, 2024, doi: 10.1177/00491241221113873.

R. C. Pereira, M. S. Santos, P. P. Rodrigues, and P. H. Abreu, “Reviewing autoencoders for missing data imputation: Technical trends, applications and outcomes,” Journal of Artificial Intelligence Research, vol. 69, pp. 1255–1285, 2020, doi: 10.1613/jair.1.12312.

M. Pereira, and B. Glisic, “Detection and quantification of temperature sensor drift using probabilistic neural networks,” Expert Systems with Applications, vol. 213, 2023, doi: 10.1016/j.eswa.2022.118884.

T. Emmanuel, T. Maupong, D. Mpoeleng, T. Semong, B. Mphago, and O. Tabona, “A survey on missing data in machine learning,” Journal of Big data, vol. 8, pp. 1–37, 2021, doi: 10.1186/s40537-021-00516-9.

J. Josse, J. M. Chen, N. Prost, G. Varoquaux, and E. Scornet, “On the consistency of supervised learning with missing values,” Statistical Papers, pp. 1–33, 2024, doi: 10.1007/s00362-024-01550-4.

Raspberry Pi Ltd, Raspberry Pi hardware documentation, [Online]. Available: https://www. raspberrypi.com/documentation/computers/raspberrypi.html. Accessed: 2022.

H. D. Ghael, L. Solanki, and G. Sahu, “A review paper on raspberry pi and its applications,” International Journal of Advances in Engineering and Management (IJAEM), vol. 2, no. 12, 2020, doi: 10.35629/5252-0212225227.

S. Monk, Raspberry pi cookbook, O’Reilly Media, Inc, 2022.

K. Rzepka, P. Szary, K. Cabaj, and W. Mazurczyk, “Performance evaluation of Raspberry Pi 4 and STM32 Nucleo boards for security-related operations in IoT environments,” Computer Networks, vol. 2024, no. 242, 2024, doi: 10.1016/j.comnet.2024.110252.

BCM2711, Quad-core Cortex-A72 (ARM v8) 64-bit SoC, BCM2711 Processor Datasheet. [Online]. Available: https://datasheets.raspberrypi.com/bcm2711/bcm2711-peripherals.pdf. [Accessed: Dec. 8, 2024].

Raspberry Pi, “Install Raspberry Pi OS using Raspberry Pi Imager”, [Online]. Available: https://www.raspberrypi.com/software/. Accessed: 2022.

Node-RED, “Running Node-RED locally,” [Online]. Available: https://nodered.org/docs/get. Accessed: 2022.

D. Hercog, T. Lerher, M. Truntic, and O. Tezak, “Design and implementation of ESP32-based IoT devices,” Sensors, vol. 23, no. 15, pp. 6739, 2023, doi: 10.3390/s23156739.

R. B. Salikhov, V. K. Abdrakhmanov, and I.N. Safargalin, “Internet of things (IoT) security alarms on ESP32-CAM,” In Journal of Physics: Conference Series, vol. 2096, no. 1, 2021, doi: 10.1088/1742- 6596/2096/1/012109.

G. P. Pereira, M. Z. Chaari, and F. Daroge, “IoT-enabled smart drip irrigation system using ESP32,” IoT, vol. 4, no. 3, pp. 221–243, 2023, doi: 10.3390/iot4030012.

A. Zare, and M. T. Iqbal, “Low-cost ESP32, Raspberry Pi, Node-RED, and MQTT protocol based SCADA system,” In 2020 IEEE International IOT, Electronics and Mechatronics Conference (IEMTRONICS), IEEE, pp. 1–5, 2020, doi: 10.1109/IEMTRONICS51293.2020.9216412.

D. Witczak, and S. Szymoniak, “Review of Monitoring and Control Systems Based on Internet of Things,” Applied Sciences, vol. 14, no. 19, 2024 doi: 10.3390/app14198943.

M. J. A. Baig, M. T. Iqbal, M. Jamil, and J. Khan, “Design and implementation of an open-Source IoT and blockchain-based peer-to-peer energy trading platform using ESP32-S2, Node-RED and, MQTT protocol,” Energy reports, vol. 7, pp. 5733–5746, 2021, doi: 10.1016/j.egyr.2021.08.190.

D. A. T. Le et al., “Patient Remote Monitoring System Using MQTT Protocol for ECG Signals,” In 2024 9th International Conference on Integrated Circuits, Design, and Verification (ICDV), pp. 114–118, 2024, doi: 10.1109/ICDV61346.2024.10617252.

Espressif Systems, ESP32 Series Datasheet, version 3.9. [Online]. ´ Available: https://www.espressif.com/sites/default/files/documentation- /esp32 datasheet en.pdf. [Accessed: 18-sep-2024].

A. Elyounsi, and A. N. Kalashnikov, “Evaluating suitability of a DS18B20 temperature sensor for use in an accurate air temperature distribution measurement network,” Engineering Proceedings, vol. 10, no. 1, pp. 56, 2021, doi: 10.3390/ecsa-8-11277.

T. Hagino, Practical Node-RED Programming: Learn powerful visual programming techniques and best practices for the web and IoT, Packt Publishing Ltd, 2021.

I. U. Onwuegbuzie, A. O. Olowojebutu, and K. K. Akomolede, “Node–RED and IoT Analytics: A Real-Time Data Processing and Visualization Platform,” Tech–Sphere Journal of Pure and Applied Sciences (TSJPAS), vol. 1, no. 1, pp. 1–12, 2020, doi: 10.5281/zenodo.13856859.

I. V. Nit,ulescu, and A. Korodi, “Supervisory control and data acquisition approach in Node–RED: Application and discussions,” IoT, vol. 1, no. 1, pp. 5, 2020, doi: 10.3390/iot1010005.

Node-RED, A visual tool for wiring the Internet of Things, [Online]. Available: https://nodered.org. [Accessed: September 26 2024].

MQTT, An open standard messaging protocol for IoT, [Online]. Available: https://mqtt.org. [Accessed: Sep. 26, 2024].

A. J. Hintaw, S. Manickam, M. F. Aboalmaaly, and S. Karuppayah, “MQTT vulnerabilities, attack vectors and solutions in the internet of things (IoT),” IETE Journal of Research, vol. 69, no. 6, pp. 3368–3397, 2023, doi: 10.1080/03772063.2021.1912651.

J. U. M. Minjares et al., “Navigation Path Estimation using UFIR Filter over G28U7FTTL GPS Receiver Data,” In 2020 24th International Conference on Circuits, Systems, Communications and Computers (CSCC), pp. 169–173, 2020, doi: 10.1109/CSCC49995.2020.00038.

Y. Xu, Y. S. Shmaliy, S. Bi, X. Chen, and Y. Zhuang, “Extended Kalman/UFIR filters for UWB-based indoor robot localization under time-varying colored measurement noise,” IEEE Internet of Things Journal, vol. 10, no. 17, pp. 15632–15641, 2023, doi: 10.1109/JIOT.2023.3264980.

M. V. Olgu´ın, Y. S. Shmaliy, O. I. Manzano, and S. M. Figueroa, “Distributed UFIR filtering with applications to environmental monitoring,” International Journal of Circuits, Systems and Signal Processing, vol. 5, pp. 349–355, 2021, doi: 10.46300/9106.2021.15.38.

Y. S. Shmaliy, and S. Zhao, Optimal and robust state estimation: Finite Impulse Response (FIR) and Kalman approaches, John Wiley & Sons, 2022, doi: 10.1002/9781119863106.

W. Xue, X. Luan, S. Zhao, and F. Liu, “A fusion Kalman filter and UFIR estimator using the influence function method,” IEEE/CAA Journal of Automatica Sinica, vol. 9, no. 4, pp. 709-718, 2021, doi:10.1109/JAS.2021.1004389.

D. Mishra, A. Kumar and V. S. Rathor, “Performance of Interpolation Techniques for Compression of Crop Image: A Comparative Study,” 2023 International Conference on Computer, Electronics & Electrical Engineering & their Applications (IC2E3), pp. 1-7, 2023, doi: 10.1109/IC2E357697.2023.10262677.

F. Furizal, S. Sunardi, and A. Yudhana, “Temperature and humidity control system with air conditioner based on fuzzy logic and internet of things,” Journal of Robotics and Control (JRC), vol. 4, no. 3, pp. 308–322, 2023, doi: 10.18196/jrc.v4i3.18327.

R. Chataut, A. Phoummalayvane, and R. Akl, “Unleashing the power of IoT: A comprehensive review of IoT applications and future prospects in healthcare, agriculture, smart homes, smart cities, and industry 4.0,” Sensors, vol. 23, no. 16, pp. 7194, 2023. doi:10.3390/s23167194.

B. Mobaraki, S. Komarizadehasl, F. J. Castilla Pascual, and J. A. LozanoGalant, “Application of low-cost sensors for accurate ambient temperature monitoring,” Buildings, vol. 12, no. 9, 2022, doi: 10.3390/buildings12091411.

N. U. Okafor, Y. Alghorani, and D. T. Delaney, “Improving data quality of low-cost IoT sensors in environmental monitoring networks using data fusion and machine learning approach,” ICT Express, vol. 6, no. 3, pp. 220–228, 2020, doi: 10.1016/j.icte.2020.06.004.

Y. Hajjaji, W. Boulila, I. R. Farah, I. Romdhani, and A. Hussain, “Big data and IoT-based applications in smart environments: A systematic review,” Computer Science Review, vol. 39, 2021, doi: 10.1016/j.cosrev.2020.100318.

P. Paudel, S. Kim, S. Park, and K. H. Choi, “A context-aware IoT and deep-learning-based smart classroom for controlling demand and supply of power load,” Electronics, vol. 9, no. 6, 2020, doi: 10.3390/electronics9061039.

Downloads

Published

2025-01-16

Issue

Section

Articles