IoT-based Weather Station With Air Quality Measure
IoT-based Weather Station With Air Quality Measure
net/publication/354597278
IoT-based weather station with air quality measurement using ESP32 for
environmental aerial condition study
CITATIONS READS
39 8,192
4 authors, including:
5 PUBLICATIONS 48 CITATIONS
Kyoto University
61 PUBLICATIONS 882 CITATIONS
SEE PROFILE
SEE PROFILE
Vigneshwaran Pandi
Acharya University Karakul Uzbekistan
48 PUBLICATIONS 270 CITATIONS
SEE PROFILE
All content following this page was uploaded by Vigneshwaran Pandi on 24 August 2021.
Corresponding Author:
Prisma Megantoro
Faculty of Advanced Technology and Multidiscipline
Universitas Airlangga
Surabaya, Indonesia
Email: [email protected]
1. INTRODUCTION
Knowing the air condition in the open environment is important thing to determine the effect of
pollution in an area. Especially during a pandemic of airborne diseases, such as COVID-19, everyone needs to
pay attention to the surrounding air quality. Whereas, the concentration of various gases contained in the air is
a determining factor for the value of air quality [1]. The more pollutant gases, the air in the area can be said to
be more polluting.
Weather is a factor that also affects the quality of air condition [2]. The weather itself is an air
conditioner that includes temperature, humidity, and air pressure which are included as main parameters [3].
Changes in weather conditions can be measured and observed with a device commonly called a weather
station [4]. The implementation of this weather station has also been very wide in various kind of research for
agriculture [5], analysis of photovoltaic power forecasting [6] and [7], measurement of weather and light
intensity [8], measurement of weather and relative altitude [9], redundancy data on the internet of things (IoT)
based systems [10], and analysis of the potential for wind energy [11]. On the other hand, research on the use
of backscatter sensors for remote measurements was also carried out by Darsena et al. [12] and [13]. The
weather station device designed in this article is used to measure weather conditions and air quality in an open
area. With an IoT-based topology, this device can be used telemetry and also for remote observation [14], [15],
and [16]. With this IoT technology, devices in the field can connect with other electronic devices wherever
they are [17]-[22]. With this also, an environmental observer does not need to come directly to the field and
measure all parameters for his study needs. Observations can be made from in front of a computer screen and
as long as it is connected to the internet network [23]-[25].
Weather station application device on this research featured with air quality measurement. It was
because the important need to measure the air pollutant gasses. The core of this device is a microcontroller
board specifically used for internet network applications. The ESP32 can act s a complete standalone system
or a slave device to hosting an MCU, decreasing communication stack overhead on the main application
processor [26]-[28]. Unlike its sibling ESP8266 [29]-[34], the ESP32 board has more features, especially pins
that can be used for reading analog signals or analog to digital converter (ADC). This of course will be very
beneficial for applications that use many analog sensors. This board is used to read all-weather and gas sensors
and then send the data to the server in real-time. On the user side, an application software based on visual basic
programming is designed for the purposes of observation, processing, and data storage. Visual basic
programming is currently the most popular language [35] and [36]. This weather station application software
is made in an informative and practical way which is suitable for both laptops and computers. It is hoped that
from good interface design, the process of observing or studying weather and air conditions can proceed with
focus.
2. METHOD
This research consists of several parts, such as; sensor technology, microcontroller, internet of things
(IoT), and user interface (UI). Sensor technology is used to read the parameters which can be measured. The
embedded system using is a microcontroller used in specific control applications. IoT is used as a means of
data communication between instruments and users. Visual basic-based programming is used for user
operation, data display, data process, data storage.
IoT-based weather ststion with air quality measurement using ESP32… (Peisma Megantoro)
1318 ISSN: 1693-6930
(a)
(b)
Figure 2. ESP32 hardware design: (a) firmware work flow, (b) hardware schematic diagram
TELKOMNIKA Telecommun Comput El Control, Vol. 19, No. 4, August 2021: 1316 - 1325
TELKOMNIKA Telecommun Comput El Control 1319
The second test is to measure the precision that shows how consistent a measuring instrument gives a certain
scale value at many times. This can be calculated from the standard deviation obtained from each
measurement. Standard deviation can be calculated by the following formula.
√∑𝑛
𝑖=1(𝑥𝑖 −𝑥)
𝜎𝑥 = (2)
(𝑛−1)
In this study, the third characterization was only carried out on gas sensors. This characterization
process refers to the sensor data from each of the MQ-135, MQ-131, MQ-8, MQ-4, MQ-9, and MQ-811
sensors. This process is used to convert the 12 bit ADC value received by the ESP32 analog input pins to the
gas concentration value in ppm units. The first thing to calculate is the sensor module output resistance (𝑅𝑠 ).
𝑉𝑅𝐿 𝑥 𝑅𝐿 𝑥 𝐴𝐷𝐶𝑟
𝑅𝑠 = ( ) − 𝑅𝐿 (3)
𝐴𝐷𝐶 𝑥 𝑉𝐶
𝑉𝑅𝐿 is the maximum output voltage from sensor which is 3.3V, 𝑅𝐿 is the resistance in the sensor which
is 1000Ω, 𝐴𝐷𝐶𝑟 is the maximum value that can be read by by the analog input pin which is 4096, 𝐴𝐷𝐶 is
integer given by the analog pin, 𝑉𝐶 is the board circuit voltage which is 5V. Then the comparison value of
𝑅𝑠 dan 𝑅𝑜 This is entered into each of the regression formulas from each sensor to calculate the value of the
gas content in the air (ppm). On the other hand, the R_oini value is the sensor output resistance obtained in the
standard test condition (STC) measurement which has a gas content in the air of 100 ppm.
3. IMPLEMENTATION.
3.1. Field station
The field station consists of sensors and an ESP32 microcontroller board which is used to read the
sensors, process the data, then send them to the server simultaneously in a row of strings. Measurement of
weather conditions uses a set of weather station equipment consisting of a vertical axis anemometer, wind
direction arrows with a rotary encoder, rain gauge, barometric sensors, and DHT 11. The barometric sensor
uses shield BMP280, while DHT11 is used to measure ambient temperature and humidity.The anemometer,
wind vane, and rain gauge devices as shown in Figure 4 (a) are placed on the roof of the building that is free
from everything around it. The weather controller shown in Figure 2 (b) is used to process the initial data from
IoT-based weather ststion with air quality measurement using ESP32… (Peisma Megantoro)
1320 ISSN: 1693-6930
the anemometer, wind vane, and rain gauge. Coupled with data from the DHT11 and BMP280 sensors, the
data is processed and then sent via serial communication as output to the main microcontroller or the ESP32
board. Measurement of air quality parameters is carried out by reading gas sensors such as; MQ-135 for
ammonia, MQ-131 for ozone, MQ-4 for methane, MQ-131 for ozone, MQ-9 for carbon monoxide, MQ-8 for
hydrogen, and MQ-811 for carbon dioxide. Apart from the gas sensor, this device also measures UV ray index.
As shown in Figure 5, all gas sensors are placed in one board which is integrated with the ESP32
board and the power supply. Given that there are 8 gas sensor modules used, of course, 2 DC power supplies
will be very capable of meeting the power needs of each component. This is done so that there is no reading
error on the sensors.
(a) (b)
Figure 4. These figures are: (a) a set of weather station, Figure 5. A set wiring of the
(b) weather station shield electrical device
TELKOMNIKA Telecommun Comput El Control, Vol. 19, No. 4, August 2021: 1316 - 1325
TELKOMNIKA Telecommun Comput El Control 1321
𝑅 −2.189
𝑝𝑝𝑚𝑀𝑄−135 = 101.37 ( 𝑠 ) , for 𝑅𝑜 = 721Ω (4)
𝑅𝑜
𝑅 −2.445
𝑝𝑝𝑚𝑀𝑄−131 = 20.34 ( 𝑠 ) , for 𝑅𝑜 = 12.7 Ω (5)
𝑅𝑜
𝑅 −0.681
𝑝𝑝𝑚𝑀𝑄−8 = 995.95 ( 𝑠 ) , for 𝑅𝑜 = 3.4 Ω (6)
𝑅𝑜
𝑅 −4.293
𝑝𝑝𝑚𝑀𝑄−4 = 479.77 ( 𝑠 ) , for 𝑅𝑜 = 22.3k Ω (7)
𝑅𝑜
𝑅 −2.056
𝑝𝑝𝑚𝑀𝑄−9 = 603.59 ( 𝑠 ) , for 𝑅𝑜 = 790Ω (8)
𝑅𝑜
For calculation of concentration value of CO2 using MG-811, it more aplicable if uses polynomial equation.
𝑉𝑐 𝑥 4096
𝑉𝑜 = (9)
𝐴𝐷𝐶
𝑅 2 𝑅
𝑝𝑝𝑚𝑀𝑄−811 = 8820 ( 𝑠 ) − 36219 ( 𝑠 ) + 26742 (10)
𝑅𝑜 𝑅𝑜
𝑉𝑜 is output voltage of the sensor which ranged from 0V to 3.3V. With these equations, each ADC value can
be converted into units of ppm.
IoT-based weather ststion with air quality measurement using ESP32… (Peisma Megantoro)
1322 ISSN: 1693-6930
Figure 5 shows that 62.5% percent of 32 respondents stated that the display of this UI software was
informative. A quarter said it was not very informative. This is because the background color and placement
of windrose charts and charts are much larger with other parameter displays. From this survey, it was also
found that 75% of respondents stated that the application design was rigid, not too elegant.
ppm
time
TELKOMNIKA Telecommun Comput El Control, Vol. 19, No. 4, August 2021: 1316 - 1325
TELKOMNIKA Telecommun Comput El Control 1323
Figure 10. Data of temperature measurement taken Figure 11. Data of humidity measurement taken
from excel file from excel file
Figure 12. Data of barometric pressure measurement taken from excel file
5. CONCLUSION
The conclusion from the research in this article shows that the design of a weather station device that
is integrated with measuring gas levels in the air has been successfully carried out using IoT technology. All
sensors for weather measurement have an accuracy of more than 90%, and only wind direction measurements
have a precision of less than 90%. Likewise, all gas sensors that can only be tested for precision, have a
precision level of more than 80%. With the characteristics of these sensors, a capable telemetry network, and
a desktop application UI with high informativeness, it is hoped that it can help observe weather and air
conditions properly. On the other hand, a designed weather station device can also be used as a medium for
research and education in related fields.
ACKNOWLEDGEMENTS
We are grateful to the Lembaga Penelitian dan Inovasi (LPI), Universitas Airlangga for providing this
internal research grant program in 2020. We also thank all colleagues and students of Electrical Engineering
and Industrial Engineering from the Faculty of Advance Technology and Multidiscipline, Airlangga University
for their support for this research.
REFERENCES
[1] J. Brodny and M. Tutak, “The analysis of similarities between the European Union countries in terms of the level and
structure of the emissions of selected gases and air pollutants into the atmosphere,” J. Clean. Prod., vol. 279, Jan.
2021, doi: 10.1016/j.jclepro.2020.123641.
[2] V. R. Mutha, N. Kumar, and P. Pareek, “Real time standalone data acquisition system for environmental data,” 1st
IEEE Int. Conf. Power Electron. Intell. Control Energy Syst. ICPEICES, Jul. 2017, pp. 1-4, doi:
10.1109/ICPEICES.2016.7853337.
[3] A. Munandar, H. Fakhrurroja, M. I. Rizqyawan, R. P. Pratama, J. W. Wibowo, and I. A. F. Anto, “Design of real-
time weather monitoring system based on mobile application using automatic weather station,” 2017 2nd Int. Conf.
Autom. Cogn. Sci. Opt. Micro Electro-Mechanical Syst. Inf. Technol., Oct. 2017, pp. 44–47, doi:
10.1109/ICACOMIT.2017.8253384.
[4] G. Solano, F. Lama, J. Terrazos, and J. Tarrillo, “Weather station for educational purposes based on Atmega8L,”
Proceedings of the 2017 IEEE 24th International Congress on Electronics, Electrical Engineering and Computing,
INTERCON, 2017, doi: 10.1109/INTERCON.2017.8079728.
[5] S. Navulur, A. S. C. S. Sastry, and M. N. Giri Prasad, “Agricultural management through wireless sensors and internet
of things,” International Journal Electrical Computer Engineering, vol. 7, no. 6, pp. 3492–3499, Dec 2017, doi:
10.11591/ijece.v7i6.pp3492-3499.
[6] M. H. Alomari, J. Adeeb, and O. Younis, “PVPF tool: An automated web application for real-time photovoltaic
power forecasting,” International Journal of Electrical and Computer Engineering, vol. 9, no. 1, pp. 34-41, Feb.
2019, doi: 10.11591/ijece.v9i1.pp34-41.
[7] M. H. Alomari, J. Adeeb, and O. Younis, “Solar photovoltaic power forecasting in Jordan using artificial neural
networks,” International Journal of Electrical and Computer Engineering, vol. 8, no. 1, pp. 497-504, Feb. 2018, doi:
10.11591/ijece.v8i1.pp497-504.
IoT-based weather ststion with air quality measurement using ESP32… (Peisma Megantoro)
1324 ISSN: 1693-6930
[8] R. K. Kodali and S. Mandal, “IoT Based Weather Station,” Int. Conf. Control. Instrumentation, Commun. Comput.
Technol., pp. 680-683, Dec. 2016, doi: 10.1109/ICCICCT.2016.7988038.
[9] T. Savic and M. Radonjic, “One approach to weather station design based on Raspberry Pi platform,” 2015 23rd
Telecommun. Forum, TELFOR 2015, pp. 623-626, Nov. 2016, doi: 10. 1109/TELFOR.2015.7377544.
[10] K. Praveen, K. Rajalakshmi, M. Malathi, and R. Dhanagopal, “Data redundancy reduction in IoT weather station,”
Int. J. Control Autom., vol. 13, no. 2, pp. 534-545, 2020.
[11] S. AL-Yahyai, Y. Charabi, A. Gastli, and S. Al-Alawi, “Assessment of wind energy potential locations in Oman
using data from existing weather stations,” Renew. Sustain. Energy Rev., vol. 14, no. 5, pp. 1428-1436, Jun. 2010,
doi: 10.1016/j.rser.2010.01.008.
[12] D. Darsena, G. Gelli, and F. Verde, “Cloud-aided cognitive ambient backscatter wireless sensor networks,” IEEE
Access, vol. 7, pp. 57399-57414, Jan. 2019, doi: 10.1109/ACCESS.2019.2914001.
[13] D. Darsena, G. Gelli, and F. Verde, “Modeling and performance analysis of wireless networks with ambient
backscatter devices,” IEEE Trans. Commun., vol. 65, no. 4, pp. 1797-1814, Apr. 2017,
doi: 10.1109/TCOMM.2017.2654448.
[14] I. Ahmad, M. S. Niazy, R. A. Ziar, and S. Khan, “Survey on IoT : Security Threats and Applications,” J. Robot.
Control, vol. 2, no. 1, pp. 42-46, Sep. 2021.
[15] D. J. Suroso, M. Arifin, and P. Cherntanomwong, “Distance-based Indoor Localization using Empirical Path Loss
Model and RSSI in Wireless Sensor Networks,” J. Robot. Control, vol. 1, no. 6, pp. 199-207, Jan. 2020.
[16] P. Megantoro and H. A. Winarno, “EKA v1: Emergency Call Auto-register, an Emergency Warning System based
on Internet of Things for Intensive Care Patient at Hospital,” IOP Conf. Ser. Mater. Sci. Eng., vol. 835, no. 1, May
2020, doi: 10.1088/1757-899X/835/1/012033.
[17] D. N. C. Loong, S. Isaak, and Y. Yusof, “Machine vision based smart parking system using Internet of Things,”
TELKOMNIKA Telecommunication Computing Electronics and Control, vol. 17, no. 4, pp. 2098-2106, Aug. 2019,
doi: 10.12928/telkomnika.v17i4.12772.
[18] V. Kanakaris, G. A. Papakostas, and D. V. Bandekas, “Power consumption analysis on an IoT network based on
wemos: A case study,” TELKOMNIKA Telecommunication Computing Electronics and Control, vol. 17, no. 5,
pp. 2505-2511, Oct. 2019.
[19] Periyadi, G. I. Hapsari, Z. Wakid, and S. Mudopar, “IoT-based guppy fish farming monitoring and controlling
system,” TELKOMNIKA Telecommunication Computing Electronics and Control, vol. 18, no. 3, pp. 1538-1545, Jun.
2020, doi: 10.12928/telkomnika.v18i3.14850.
[20] K. Sekaran, M. N. Meqdad, P. Kumar, S. Rajan, and S. Kadry, “Smart agriculture management system using internet
of things,” TELKOMNIKA Telecommunication Computing Electronics and Control, vol. 18, no. 3, pp. 1275-1284,
Jun. 2020, doi: 10.12928/TELKOMNIKA.v18i3.14029.
[21] G. A. Rathy, P. Sivasankar, and T. Z. Fadhil, “An efficient IoT based biomedical health monitoring and diagnosing
system using myRIO,” TELKOMNIKA Telecommunication Computing Electronics and Control, vol. 18, no. 6, pp.
3050-3057, Dec. 2020, doi: 10.12928/telkomnika.v18i6.14375.
[22] A. Bhawiyuga, D. P. Kartikasari, K. Amron, O. B. Pratama, and M. W. Habibi, “Architectural design of IoT-cloud
computing integration platform,” TELKOMNIKA Telecommunication Computing Electronics and Control, vol. 17,
no. 3, pp. 1399-1408, Jun. 2019, doi: 10.12928/telkomnika.v17i3.11786.
[23] K. Bhagchandani and D. Peter Augustine, “IoT based heart monitoring and alerting system with cloud computing
and managing the traffic for an ambulance in India,” International Journal of Electrical and Computer Engineering,
vol. 9, no. 6, pp. 5068-5074, Dec. 2019, doi: 10.11591/ijece.v9i6.pp5068-5074.
[24] S. G. Priyadharshini, C. Subramani, and J. Preetha Roselyn, “An IOT based smart metering development for energy
management system,” International Journal of Electrical and Computer Engineering, vol. 9, no. 4, pp. 3041-3050,
Aug. 2019, doi: 10.11591/ijece.v9i4.pp3041-3050.
[25] A. H. Ali, A. H. Duhis, N. A. Lafta Alzurfi, and M. J. Mnati, “Smart monitoring system for pressure regulator based
on IOT,” Int. J. Electr. Comput. Eng., vol. 9, no. 5, pp. 3450-3456, Oct. 2019, doi: 10.11591/ijece.v9i5.pp3450-3456.
[26] K. Luechaphonthara and A. Vijayalakshmi, “IOT based application for monitoring electricity power consumption in
home appliances,” International Journal of Electrical and Computer Engineering, vol. 9, no. 6, pp. 4988-4992, Dec.
2019, doi: 10.11591/ijece.v9i6.pp4988-4992.
[27] S. Murti, P. Megantoro, G. D. B. Silva, and A. Maseleno, “Design and Analysis of DC Electrical Voltage- Current
Data Logger Device Implemented on Wind Turbine Control System,” J. Robot. Control, vol. 15, no. 1, pp. 75-80,
Apr. 2020.
[28] Iswanto, P. Megantoro, and D. V. Senzas, “Calibrator for temperature measurement device with raspberry pi-based
interface,” Int. J. Innov. Technol. Explor. Eng., vol. 8, no. 12, pp. 4862-4866, Oct. 2019,
doi: 10.35940/ijitee.L3719.1081219.
[29] P. Sihombing, M. Zarlis, Heriyance, and N. Alkarina, “Tools for Detecting and Control of Hydroponic Nutrition
Flows with Esp8266 Circuit Module,” J. Phys. Conf. Ser., vol. 1230, pp. 012032, Jul. 2019, doi: 10.1088/1742-
6596/1230/1/012032.
[30] S. Rezwan, W. Ahmed, M. A. Mahia, and M. R. Islam, “IoT Based Smart Inventory Management System for Kitchen
Using Weight Sensors, LDR, LED, Arduino Mega and NodeMCU (ESP8266) Wi-Fi Module with Website and App,”
Proc.-2018 4th Int. Conf. Adv. Comput. Commun. Autom. ICACCA, 2018, pp. 1–6,
doi: 10.1109/ICACCAF.2018.8776761.
[31] S. Barai, D. Biswas, and B. Sau, “Estimate distance measurement using NodeMCU ESP8266 based on RSSI
technique,” 2017 IEEE Conf. Antenna Meas. Appl. CAMA 2017, Dec. 2017, doi: 10.1109/CAMA.2017.8273392.
TELKOMNIKA Telecommun Comput El Control, Vol. 19, No. 4, August 2021: 1316 - 1325
TELKOMNIKA Telecommun Comput El Control 1325
[32] Z. Wan, Y. Song, and Z. Cao, “Environment dynamic monitoring and remote control of greenhouse with ESP8266
NodeMCU,” Proc. 2019 IEEE 3rd Inf. Technol. Networking, Electron. Autom. Control Conf. ITNEC, 2019,
pp. 377-382, Mar. 2019, doi: 10.1109/ITNEC.2019.8729519.
[33] G. Suprianto and Wirawan, “Implementation of Distributed Consensus Algorithms for Wireless Sensor Network
Using NodeMCU ESP8266,” 2018 Electr. Power, Electron. Commun. Control. Informatics Semin. EECCIS, no. 3,
pp. 192-196, Oct. 2018, doi: 10.1109/EECCIS.2018.8692952.
[34] T. A. Abdulrahman, O. H. Isiwekpeni, N. T. Surajudeen-Bakinde, and A. O. Otuoze, “Design, Specification and
Implementation of a Distributed Home Automation System,” Procedia Comput. Sci., vol. 94, pp. 473-478, 2016,
doi: 10.1016/j.procs.2016.08.073.
[35] Iswanto, P. Megantoro, and D. V. Senzas, “Calibrator for temperature measurement device with raspberry pi-based
interface,” Int. J. Innov. Technol. Explor. Eng., vol. 8, no. 12, pp. 4862-4866, Oct. 2019,
doi: 10.35940/ijitee.L3719.1081219.
[36] H. Permana, D. Muliyati, and D. Nurachman, “Data Logger Temperature Sensor DS18B20 Using Arduino Uno
Microcontroller with Visual Basic Interface on Temperature and Heat Learning,” Phys. Natl. Semin., 2016.
BIOGRAPHIES OF AUTHORS
Prisma Megantoro is a lecturer in Electrical Engineering, School of Advanced Technology,
and Multidiscipline, Universitas Airlangga since 2020. He received a bachelor's degree and
master's degree from Universitas Gadjah Mada, Yogyakarta, Indonesia in 2014 and 2018. His
current research is focused on solar photovoltaic technology, embedded system, and the
internet of things.
P. Vigneshwaran has obtained his Doctoral Degree in Anna University Chennai during 2016
and Master of Engineering under Anna University Chennai during June 2005. He is having
18.4 years of experience and specialization in Cybersecurity. Presently, He is working as
Associate Professor in SRM Institute of Science and Technology, Chennai. His area of interest
includes Security, Routing, and Intelligent Data Analysis.
IoT-based weather ststion with air quality measurement using ESP32… (Peisma Megantoro)