A LIGHTWEIGHT MACHINE LEARNING APPROACH FOR ALCOHOL CONCENTRATION ESTIMATION USING AN ESP32 AND MEMS GAS SENSOR
DOI:
https://doi.org/10.62985/j.huit_ojs.vol26.no2E.420Keywords:
Lightweight machine learning, MEMS, TinyML, alcohol concentration estimationAbstract
This paper presents a low-cost alcohol concentration measurement system based on an ESP32 microcontroller and a GM-302B MEMS alcohol gas sensor. The sensor output is sampled in analog mode to capture the time-domain response to ethanol vapor. From this response, a set of six features is extracted, including peak value, peak time, response slope, area under the curve, ambient temperature, and humidity. Alcohol concentration is estimated using a lightweight regression model implemented as a small fully connected neural network with two hidden layers. The trained model is converted to TensorFlow Lite for Microcontrollers and embedded directly into the ESP32 firmware using a TinyML framework, enabling on-device real-time inference without external computation. Experimental results indicate that the proposed system provides a practical and accessible solution for fermentation monitoring and educational research, offering an effective alternative to conventional alcohol measurement instruments.
References
[1] S. Kamiloglu, “Authenticity and traceability in beverages,” Food Chem., vol. 277, pp. 12-24, 2019, doi: https://doi.org/10.1016/j.foodchem.2018.10.091.
[2] T. Yarita, R. Nakajima, S. Otsuka, T. Ihara, A. Takatsu, and M. Shibukawa, “Determination of ethanol in alcoholic beverages by high-performance liquid chromatography–flame ionization detection using pure water as mobile phase,” J. Chromatogr. A, vol. 976, no. 1-2, pp. 387–391, 2002, doi: https://doi.org/10.1016/S0021-9673(02)00942-1.
[3] G. H. Jain, “MOS Gas Sensors: What Determines Our Choice?,” in Proc. 5th Int. Conf. Sens. Technol. (ICST), Palmerston North, New Zealand, 2011, pp. 66–72, doi: https://doi.org/10.1109/ICSensT.2011.6137067.
[4] N. Barsan and U. Weimar, “Conduction Model of Metal Oxide Gas Sensors,” J. Electroceram., vol. 7, no. 3, pp. 143–167, 2001, doi: https://doi.org/10.1023/A:1014405811371
[5] P. Xu, K. Song, X. Xia, Y. Chen, Q. Wang, and G. Wei, “Temperature and Humidity Compensation for MOS Gas Sensor Based on Random Forests,” in Intelligent Computing, Networked Control, and Their Engineering Applications, D. Yue et al., Eds., vol. 762, Communications in Computer and Information Science. Singapore: Springer, 2017, pp. 135–145, doi: https://doi.org/10.1007/978-981-10-6373-2_14.
[6] R. Gutierrez-Osuna, "Pattern analysis for machine olfaction: A review," IEEE Sens. J., vol. 2, no. 3, pp. 189–202, 2002, doi: https://doi.org/10.1109/JSEN.2002.800688
[7] P. Warden and D. Situnayake, TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers. O'Reilly Media, 2019
[8] P. P. Ray, “A review on TinyML: State-of-the-art and prospects,” J. King Saud Univ. Comput. Inf. Sci., vol. 34, no. 4, pp. 1595-1623, 2022, doi: https://doi.org/10.1016/j.jksuci.2021.11.019.
[9] R. David, J. Duke, T. Jain, V. Janapa Reddi, N. Jeffries, J. Li, N. Kreeger, I. Nappier, M. Natraj, T. Wang, P. Warden, and L. Rocky, "TensorFlow Lite Micro: Embedded Machine Learning on TinyML Systems," in Proc. 3rd Conf. Machine Learning and Systems (MLSys), Austin, TX, USA, 2020.


