Beyond SMA and EMA: Demonstrating the Strength of the Kalman Filter for Embedded Sensor Smoothing

Beyond SMA and EMA: Demonstrating the Strength of the Kalman Filter for Embedded Sensor Smoothing

Reda ADJAR, Fathallah RERHRHAYE, Ahmed ELAKKARY, Jihane CHTIOUI, Badr RERHRHAYE, Ilyas LAHLOUH, Nacer SEFIANI

Abstract. The study offers an overall comparison between the simple moving average (SMA) algorithm, the exponential moving average (EMA) algorithm, and the Kalman filter algorithm used as a filter to smooth out the temperatures. The overall comparison has been done using the simulated and actual measures taken by the DHT22 sensors when implemented on resource-limited microcontrollers used by the Internet of Things (IoT) environment. The results reveal that the MAE value is 0.3592, the measure of the level of instability is 8.66%, and the value of robustness is 88.19% when the Kalman filter algorithm is used.

Keywords
IoT Sensor Data and Processing, Embedded Systems, Signal Filtering-SMA and EMA, The Kalman Filter, Noise Reduction and How to Handle Outliers, Applications of Microcontrollers, DHT22 Temperature Sensor

Published online 4/25/2026, 8 pages
Copyright © 2026 by the author(s)
Published under license by Materials Research Forum LLC., Millersville PA, USA

Citation: Reda ADJAR, Fathallah RERHRHAYE, Ahmed ELAKKARY, Jihane CHTIOUI, Badr RERHRHAYE, Ilyas LAHLOUH, Nacer SEFIANI, Beyond SMA and EMA: Demonstrating the Strength of the Kalman Filter for Embedded Sensor Smoothing, Materials Research Proceedings, Vol. 64, pp 371-378, 2026

DOI: https://doi.org/10.21741/9781644904091-46

The article was published as article 46 of the book Energy Futures

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 license. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

References
[1] B. Buchetti, F. R. Arduino, and S. Perdichizzi, “A literature review on corporate governance and ESG research: Emerging trends and future directions,” Int. Rev. Financ. Anal., vol. 97, p. 103759, 2025. https://doi.org/10.1016/j.irfa.2024.103759
[2] B. Rerhrhaye et al., “Application of a Solar Conversion Chain Based on a 3-Level NPC Inverter for an Hospital Electrical Network.,” Int. J. Energy Convers., vol. 12, no. 1, 2024, Accessed: Dec. 31, 2025. https://doi.org/10.15866/irecon.v12i1.24365
[3] F. Rerhrhaye et al., “Design and Implementation of a Low Energy Consumption Data Logger for a Nano-Grid Applied to a Solar Smart Greenhouse,” in 2024 3rd International Conference on Embedded Systems and Artificial Intelligence (ESAI), IEEE, 2024, pp. 1-6. Accessed: Dec. 31, 2025. https://doi.org/10.1109/ESAI62891.2024.10913737
[4] F. Rerhrhaye et al., “IoT-Based Data Logger for solar systems applications,” in ITM Web of Conferences, EDP Sciences, 2022, p. 01003. Accessed: Dec. 31, 2025. https://doi.org/10.1051/itmconf/20224601003
[5] S. Rout and S. Das, “A Joint Forgetting Factor based Adaptive Extended Kalman filtering approach to predict the State-of-Charge and Model Parameter of Lithium-ion Battery,” IEEE Access, 2025, Accessed: Dec. 31, 2025. https://doi.org/10.1109/ACCESS.2025.3533137
[6] J. E. Hammond, T. A. Soderstrom, B. A. Korgel, and M. Baldea, “A selective Kalman filtering approach to online neural network updating under system drift,” Sci. Rep., vol. 15, no. 1, p. 43577, 2025. https://doi.org/10.1038/s41598-025-24558-8
[7] G. Rapelli et al., “Applying Ecological Momentary Assessment (EMA) to Understand Overweight and Obesity: A Systematic Review,” J. Pers. Med., vol. 15, no. 11, p. 526, 2025. https://doi.org/10.3390/jpm15110526
[8] J. Song et al., “Beyond recall bias: Integrating ecological momentary assessment (EMA) and GPS to measure mobility-based greenery and short-term happiness across daily activity contexts,” Urban For. Urban Green., p. 128965, 2025. https://doi.org/10.1016/j.ufug.2025.128965
[9] D. Liu, S. Wang, X. Li, Y. Fan, C. Fernandez, and F. Blaabjerg, “A novel extended Kalman filter-guided long short-term memory algorithm for power lithium-ion battery state of charge estimation at multiple temperatures,” Energy, p. 137973, 2025. https://doi.org/10.1016/j.energy.2025.137973
[10] H. D. Hesar and A. D. Hesar, “Adaptive dual augmented extended Kalman filtering of ECG signals,” Measurement, vol. 239, p. 115457, 2025. https://doi.org/10.1016/j.measurement.2024.115457
[11] F. Rerhrhaye et al., “Realization and Supervision of an Intelligent Energy Distribution System with a New Combination Topology of Fuzzy and PID Controllers.,” Int. J. Eng. Appl., vol. 11, no. 3, 2023, Accessed: Dec. 31, 2025. https://doi.org/10.15866/irea.v11i3.22838
[12] S.-S. Ahmadpour et al., “A New Median Filter Circuit Design Based on Atomic Silicon Quantum-Dot for Digital Image Processing and IoT Applications,” IEEE Internet Things J., 2025, Accessed: Dec. 31, 2025. https://ieeexplore.ieee.org/abstract/document/10954981
[13] O. KHLIFATI, B. Khadija, and S. SIMOU, “Object Detection Method for Automated Classification of Distress in Rabat’s Built Heritage,” Mater. Res. Proc., vol. 40, 2024, Accessed: Dec. 31, 2025. Available: https://mrforum.com/product/9781644903117-37/ https://doi.org/10.21741/9781644903117-37
[14] X. Lu, M. Chen, and Y. Tian, “Accurate state-of-charge estimation of LiFePO4 battery: An adaptive extended kalman filter approach using particle swarm optimization,” Energy Rep., vol. 14, pp. 1169-1178, 2025. https://doi.org/10.1016/j.egyr.2025.07.023
[15] L. Zhao, J. Wang, Y. Hu, and L. Li, “Adaptive Unscented Kalman Filter Approach for Accurate Sideslip Angle Estimation via Operating Condition Recognition,” Machines, vol. 13, no. 5, p. 376, 2025. https://doi.org/10.3390/machines13050376
[16] P. Paul, P. J. Colin, F. Musuamba Tshinanu, C. Versantvoort, E. Manolis, and K. Blake, “Current Use of Physiologically Based Pharmacokinetic modeling in New Medicinal Product Approvals at EMA,” Clin. Pharmacol. Ther., vol. 117, no. 3, pp. 808-817, Mar. 2025, https://doi.org/10.1002/cpt.3525
[17] G. Zatini, A. Della Porta, and S. Za, “Deciphering Barriers and Strategies in Environmental Management Accounting ( EMA ) Adoption: A Comprehensive Two‐Decade Analysis,” Corp. Soc. Responsib. Environ. Manag., vol. 32, no. 3, pp. 3355-3370, May 2025, https://doi.org/10.1002/csr.3130
[18] O. Khlifati and K. Baba, “Harnessing the Synergy of Deep Learning and Transfer Learning Approaches,” in Advances in Research in Geosciences, Geotechnical Engineering, and Environmental Science: Proceedings of the Fourth Scientific Conference on Geosciences and Environmental Management (GeoME’4), Morocco 2023, Springer Nature, 2023, p. 346. Accessed: Dec. 31, 2025. https://doi.org/10.1007/978-3-031-49345-4_33
[19] J. C. Braxton, K. Herkenhoff, J. Rothbaum, and L. Schmidt, “Changing Income Risk across the US Skill Distribution: Evidence from a Generalized Kalman Filter,” Am. Econ. Rev., vol. 115, no. 12, pp. 4438-4475, Dec. 2025, https://doi.org/10.1257/aer.20231656
[20] R. Vieira, P. Kollmeyer, L. Pitault, and A. Emadi, “Comprehensive Comparison of Machine Learning and Kalman Filter Battery State of Charge Estimators,” IEEE Access, 2025, Accessed: Dec. 31, 2025. https://doi.org/10.1109/ACCESS.2025.3545380
[21] H. Haeri, B. Soleimani, and K. Jerath, “Optimal Moving Average Estimation of Noisy Random Walks using Allan Variance-informed Window Length,” in 2022 American Control Conference (ACC), Atlanta, GA, USA: IEEE, June 2022, pp. 1646-1651. https://doi.org/10.23919/ACC53348.2022.9867447
[22] P. Taheri, J. Amini, and M. Moallem, “Variable Window Size Moving Average Filter for Phase-Locked-Loop Synchronization,” IEEE Access, vol. 12, pp. 88111-88121, 2024, https://doi.org/10.1109/ACCESS.2024.3417179
[23] Z. Chen, C. Heckman, S. Julier, and N. Ahmed, “Time Dependence in Kalman Filter Tuning,” Aug. 21, 2021, arXiv: arXiv:2108.10712. https://doi.org/10.23919/FUSION49465.2021.9626864