Implementation of MQTT Broker and Gemini API in an Internet of Things Based Indoor Air Pollution Monitoring System

Authors

  • I Putu Tude Rama Prasatya Universitas Pendidikan Ganesha
  • Ketut Agus Seputra Universitas Pendidikan Ganesha
  • Kadek Yota Ernanda Aryanto Universitas Pendidikan Ganesha

DOI:

https://doi.org/10.31004/riggs.v5i2.10874

Keywords:

Internet of Things, MQTT, Gemini API, Indoor Air Pollution, Carbon Monoxide, Particulate Matter 2.5

Abstract

Indoor air pollution from pollutants such as Carbon Monoxide (CO) and Particulate Matter (PM2.5) poses significant health risks to room occupants, particularly in enclosed spaces with poor ventilation where pollutants can accumulate to hazardous concentrations. To address this challenge, this study designed and implemented an IoT-based indoor air quality monitoring system integrating an MQTT broker for real-time data transmission and the Gemini API for intelligent data interpretation. The system adopts a three-layer architecture spanning hardware, backend, and application layers. The hardware layer utilizes an ESP32 as a wireless gateway and an Arduino Nano for sensor acquisition, employing the Sharp GP2Y1010AU0F sensor for particulate matter and the MQ-7 sensor for carbon monoxide. The backend, built with Laravel, manages data through a dual-database approach, where MySQL handles structured user data and InfluxDB stores continuous sensor readings. A Flutter mobile application, built with the MVVM pattern, serves as the user interface, delivering real-time air quality information. The Gemini API further enhances the system by automatically generating air quality classifications and actionable health recommendations. Calibration testing demonstrated an average error of 6.45% for the MQ-7 sensor and a notably low 0.44% error for the Sharp GP2Y1010AU0F sensor, indicating high measurement accuracy. A 24-hour continuous stress test revealed a system uptime of 83.3%, confirming reasonable operational reliability. Finally, a usability evaluation using the SUS method involving 30 respondents yielded an average score of 70.67, placing the system in Grade B with a "Good" interpretation, confirming the system is functional and easy to use.

Downloads

Download data is not yet available.

References

1. B. P. Pratiwi et al., "Air Quality and Its Impact on Urban Health," Journal of Environmental Health, vol. 12, no. 3, pp. 45–52, 2020, doi: https://doi.org/10.26877/jiu.v6i2.6552

2. S. Laksono and N. Afiyani, "Air Pollution Sources and Health Impacts: A Review," Indonesian Journal of Public Health, vol. 18, no. 1, pp. 10–19, 2023, doi: https://doi.org/10.31869/mm.v6i1.4696

3. V. Tran et al., "Indoor Air Pollution and Health Risk Assessment," Journal of Indoor Environment, vol. 9, no. 2, pp. 100–110, 2020, doi: https://doi.org/10.3390/ijerph17082927

4. I. W. R. Aryanta and S. E. Maharani, "Health Impacts of Air Pollution on Vulnerable Populations," Bali Medical Journal, vol. 12, no. 4, pp. 310–318, 2023, doi: https://doi.org/10.36733/jeco.v3i2.7035

5. R. A. Mouha, "Internet of Things (IoT): Overview and Future Directions," Journal of Data Analysis and Information Processing, vol. 9, no. 2, pp. 77–101, 2021, doi: https://doi.org/10.4236/jdaip.2021.92006.

6. F. Saraya, G. S. Santyadiputra, and I. M. D. Maysanjaya, "SIMOD: Sistem Monitoring Konsumsi Daya Peralatan Listrik Rumah Berbasis Internet of Things," INSERT: Information System and Emerging Technology Journal, vol. 3, no. 2, pp. 62–74, Dec. 2022, doi: https://doi.org/10.23887/insert.v3i2.50910.

7. I. K. Y. Muliawan, I. G. B. Subawa, and I. B. N. Pascima, "SIMOBI: Sistem Monitoring Solar Hydroponic Berbasis Internet of Things (IoT) Studi Kasus: PT. Dago Engineering," KARMAPATI (Kumpulan Artikel Mahasiswa Pendidikan Teknik Informatika), vol. 14, no. 1, pp. 56–64, 2025, doi: https://doi.org/10.23887/karmapati.v14i1.93382.

8. I. G. L. A. R. Putra, I. G. L. Wiratma, and I. M. E. Listartha, "Implementasi Teknologi Tepat Guna Berbasis Internet of Things: V-Growz Sebagai Upaya Meningkatkan Hasil Panen Petani Vanili Desa Ambengan," Proceeding Senadimas Undiksha, vol. 9, pp. 2039–2046, Nov. 2024, doi: https://eproceeding.undiksha.ac.id/index.php/SENADIMAS/article/view/730/336.

9. K. U. Ariawan, "Penerapan IoT Untuk Sistem Kendali Jarak Jauh Peralatan Listrik Rumah Tangga Berbasis Raspberry PI," JANAPATI (Jurnal Nasional Pendidikan Teknik Informatika), vol. 9, no. 3, pp. 292–303, Dec. 2020, doi: https://doi.org/10.23887/janapati.v9i3.23264.

10. T. Akbar, G. Suweken, G. Indrawan, and K. Y. E. Aryanto, "Kotak-Kontak Pintar Pada Rumah Cerdas Berbasis Teknologi Internet of Things," Jurnal Pendidikan Teknologi dan Kejuruan, vol. 16, no. 2, pp. 278–286, Jul. 2019, doi: https://ejournal.undiksha.ac.id/index.php/JPTK/article/view/18937.

11. I. M. A. Wirawan et al., "Heartbeats measurement prototype development based on internet of things," J. Phys.: Conf. Ser., vol. 1165, p. 012001, 2019, doi: https://iopscience.iop.org/article/10.1088/1742-6596/1165/1/012001.

12. F. F. Setiadi, M. W. A. Kesiman, and K. Y. E. Aryanto, "Detection of dos attacks using naive bayes method based on internet of things (iot)," J. Phys.: Conf. Ser., vol. 1810, p. 012013, 2021, doi: https://iopscience.iop.org/article/10.1088/1742-6596/1810/1/012013.

13. S. Gitakarma and L. P. A. S. Tjahyanti, “Peranan Internet of Things dan Kecerdasan Buatan dalam Teknologi Saat Ini,” Jurnal Komputer dan Teknologi Sains (KOMTEKS), vol. 1, no. 1, 2022, doi: https://doi.org/10.37637/komteks.v1i1.1060

14. G. Adamkiewicz et al., World Health Organization Regional Office for Europe: Selected Pollutants. Copenhagen: WHO Regional Office for Europe, 2010. Available: https://www.who.int/publications/i/item/9789289002134

15. V. Van Tran, D. Park, and Y. C. Lee, "Indoor air pollution, related human diseases, and recent trends in the control and improvement of indoor air quality," International Journal of Environmental Research and Public Health, vol. 17, no. 8, 2020, doi: 10.3390/ijerph17082927

16. Kementerian Kesehatan Republik Indonesia, "Peraturan Menteri Kesehatan Republik Indonesia Nomor 7 Tahun 2019," 2019, Available: https://peraturan.bpk.go.id/Details/111721/permenkes-no-7-tahun-2019

17. ASHRAE, "ANSI/ASHRAE Addendum e to ANSI/ASHRAE Standard 62.1-2016," Atlanta, GA: American Society of Heating, Refrigerating and Air-Conditioning Engineers, 2018,. Available: https://www.ashrae.org/File%20Library/Technical%20Resources/Standards%20and%20Guidelines/Standards%20Addenda/62.1-2016/62_1_2016_e_20180126.pdf

18. R. A. Mouha, "Internet of Things (IoT): Overview and Future Directions," Journal of Data Analysis and Information Processing, vol. 9, no. 2, pp. 77–101, 2021, doi: https://doi.org/10.4236/jdaip.2021.92006.

19. H. J. Jara Ochoa, R. Peña, Y. Ledo Mezquita, E. Gonzalez, and S. Camacho-Leon, "Comparative analysis of power consumption between MQTT and HTTP protocols in an IoT platform designed and implemented for remote real-time monitoring of long-term cold chain transport operations," Sensors, vol. 23, no. 10, 2023, doi: https://doi.org/10.3390/s23104896.

20. I. R. Nugraha, W. H. N. Putra, and E. Setiawan, "A comparative study of HTTP and MQTT for IoT applications in hydroponics," Jurnal RESTI, vol. 8, no. 1, pp. 119–126, 2024, doi: https://doi.org/10.29207/resti.v8i1.5561.

21. N. Rachmat and D. P. Kesuma, "Implementasi large language models Gemini pada pengembangan aplikasi chatbot berbasis Android," Jurnal Universitas Islam Ogan Komering Ilir, vol. 4, no. 1, 2024, doi http://dx.doi.org/10.31314/juik.v4i1.2831.

22. IBM, "Apa itu large language models (LLM)?," IBM, 2023, Available: https://www.ibm.com/id-id/think/topics/large-language-models

23. B. Klug, "An overview of the system usability scale in library website and system usability testing," Weave: Journal of Library User Experience, vol. 1, no. 6, 2017, doi: https://doi.org/10.3998/weave.12535642.0001.602.

24. ATMO Team, "Indoor Air Quality Index (IAQI): Standards and Metrics," Atmotube, Sep. 5, 2024. [Online]. Available: https://atmotube.com/blog/indoor-air-quality-index-iaqi.

Downloads

Published

14-07-2026

How to Cite

[1]
I. P. T. R. Prasatya, K. A. Seputra, and K. Y. E. Aryanto, “Implementation of MQTT Broker and Gemini API in an Internet of Things Based Indoor Air Pollution Monitoring System”, RIGGS, vol. 5, no. 2, pp. 15044–15062, Jul. 2026.

Issue

Section

Articles