Nesnelerin interneti tabanlı hava kalitesi ölçüm sistemi
IoT based air quality measurement system
Yazar: BERRİN CENGİZ
Danışman: PROF. DR. CÜNEYT BAYILMIŞ
Sakarya Üniversitesi / Fen Bilimleri Enstitüsü / Mekatronik Mühendisliği Ana Bilim Dalı / Mekatronik Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2023
Konu: Bilim ve Teknoloji = Science and Technology ; Mekatronik Mühendisliği = Mechatronics Engineering ; Mühendislik Bilimleri = Engineering Sciences

Özet:
Günümüzde internet teknolojisinin gelişmesi ile birlikte Nesnelerin İnterneti tabanlı uygulamalar çok fazla kullanılır olmuştur. Hava kalitesi de artan sanayileşme sonucunda günlük problemimiz haline gelmiştir. Bireyler artık sadece günlük hava durumunu değil hava kalitesi indeksini de takip etmeye başlamıştır. Bunun sonucunda da hava kalitesinden etkilenme ihtimali olan solunum yolu vb. rahatsızlıklara sahip bireyler tedbir almaya başlamışlardır. 
Bu tez çalışması kapsamında hava kalitesini etkileyen gazların ölçümü için elektronik devre oluşturulmuştur. Devrede sensörler ve geliştirici kartı kullanılmıştır. Hava kalitesi indeksi için önemli olan O3 ve CO gibi gazların ölçümlerini yapabilecek MQ-7, MQ-131, MQ-135 sensörleri kullanılmıştır. Bu sensörleri yönetmek, veri toplamak ve toplanan veriyi Wi-Fi ile bilgisayar ortamına göndermek için NodeMCU geliştirme kartı kullanılmıştır.
MQ-131 sensöründen toplanan O3 verisi ile EPA denklemi kullanılarak hava kalitesi indeksi hesaplanmıştır. Ayrıca diğer sensörlerden toplanan CO verisi ile de hava kalitesi indeksi hesaplanmıştır. EPA tabloları kullanılarak son hava kalitesi indeksine karar veren program yazılmıştır.
Ölçümler Zonguldak merkezde ve Çatalağzı ilçesinde yapılmıştır. Çatalağzı ilçesinin seçilmesinin nedeni Eren Enerji Çatalağzı Termik Santrali'nin burada bulunmasıdır. Türkiye'de sera gazı salınımının %2 gibi büyük bir bölümü sadece bu termik santralden yayıldığı tahmin edildiğine göre bu bölgenin deney çalışması için uygun olduğuna karar verilmiştir.
Ölçüm sonuçları Wi-Fi ile bilgisayara aktarılmış ve Firebase gerçek zamanlı veri tabanına kaydedilmiştir. Android cihazlar için de App Inventor uygulaması ile ölçüm sonuçlarının takip edildiği mobil arayüz tasarlanmıştır.
Veri tabanına kayıt edilen veriler ile veri analizi yapılmıştır. Veri analizi yapılırken RapidMiner ile Lojistik Regresyon, Doğrusal Ayırma Analizi (LDA), Karar Ağaçları algoritması, Naive Bayes (NB) ve Destek Vektör Makineleri (SVM) algoritmasının ROC analizi yapılmıştır. ROC analizinde daha başarılı sonuç üreten LDA ve Karar Ağaçları algoritması tezin eğitim ve tahmin aşamalarında kullanılmıştır.
Tasarlanan bu hava kalitesi ölçüm sistemi sayesinde bireyler ortamdaki anlık kirletici madde değişimi takip edilebilir ve günlük olarak hava kalitesi indeksini takip edilebilirler. Özellikle Zonguldak ilinde yaygın olan Koah hastalığı için hava kalitesinin takip edilmesi önemlidir. Koah gibi rahatsızlığı olan bireyler hava kalitesinin düşük olduğu zamanlarda gerekli tedbirleri alabilirler.

Abstract:
The Internet first came into our lives in 1969. After this date, it has reached the present day by going through different processes. This process, which first started as wired internet, continues today as wireless and mobile internet.
With the development of Internet technology, Internet of Things-based applications have been used a lot. When it comes to the Internet of Things, it comes to mind that all kinds of electronic devices can be connected to the internet. When electronic devices are connected to the internet, the data collected from these devices started to be kept on the Internet.
Today, both the number of devices connected to the Internet is very high and the amount of data collected from these devices is very high. This huge amount of data is called Big data. Machine learning is used to analyze Big data.
Air pollution has been a big problem for people from past to present. When people first started to use fire, air pollution was also in question. However, thanks to the nature's ability to tolerate it, there was no great pollution. With the start of the Industrial Revolution, pollution that nature cannot tolerate has begun to occur. With the Industrial Revolution, machines were invented, factories were established, automobiles were invented, and power plants were established. In addition to these, fossil fuels were burned to meet the heating needs. Forest fires, which have increased recently, also contribute to the increase in air pollution.
From the Industrial Revolution to the present, the number of machines, factories, automobiles, and power plants have increased. Large cities have also developed around industrial zones. Especially considering that the majority of the population in the country lives in city centers, air pollution affects a large number of people. In this case, air pollution has become our daily problem.
To measure air pollution, it is necessary to measure the amount of ozone, carbon monoxide, sulfur dioxide, nitrogen dioxide and particulate matter in the air. These 5 substances are called pollutants. After measuring the amount of pollutant in the air, the air quality index is calculated. Air quality index is divided into 6 classes as good, moderate, unhealthy for sensitive groups, unhealthy, very unhealthy and dangerous for people to understand more easily. And each class is expressed in 6 different colors as green, yellow, orange, red, purple and brown.
Considering the harmful effects of air pollution, the air quality index should be kept between certain values. Critical changes in air quality need to be reported to vulnerable groups. Or, when there is a dangerous situation affecting the society in general, warning systems should be developed. The big stations of the Ministry share the data on their websites, but when individuals do not follow it, they cannot be aware of the air quality. Individuals who are especially sensitive to some pollutants should be aware of the air quality instantly.
An internet connection is also required to use sensors to measure the amount of pollutants in the air and to keep the data collected from these sensors in a remote database. In this thesis study, ozone and carbon monoxide gas, which are pollutants, will be measured.
Although ozone gas is normally found in the upper levels of the atmosphere, its excess near the earth's surface causes harmful effects. When individuals breathe ozone gas, their lungs can be damaged. The decrease in ozone gas in the atmosphere also causes the harmful rays of the sun to reach the earth without being filtered.
Since carbon monoxide gas is colorless and odorless, it is very difficult to be noticed by humans. Carbon monoxide usually affects individuals in indoor environments. As a result of the inhalation of carbon monoxide by individuals, the amount of oxygen in the blood decreases. This leads to various inconveniences.
Within the scope of this thesis, the measurement of ozone and carbon monoxide gases affecting air quality was carried out. An electronic circuit has been set up to make the measurement. Sensors and developer board are used in the circuit. MQ-7, MQ-131, MQ-135 sensors were used to measure gases such as O3 and CO, which are important for the air quality index. NodeMCU development board was used to manage these sensors, collect data and send the collected data to the computer environment via Wi-Fi.
The air quality index was calculated using the O3 data collected from the MQ-131 sensor and the EPA equation. In addition, the air quality index was calculated with the CO data collected from other sensors. If a single pollutant is measured while calculating the air quality index, the amount of this pollutant in the air is used in the EPA equation. However, if measurements were made with more than one pollutant; The air quality index is calculated with each item measured. The highest value is accepted as the air quality index. In this study, since there are more than one pollutant as ozone and carbon monoxide, the air quality index was taken as the highest value obtained as a result of the calculation. In order for the sensors to send data via NodeMCU, the microcontroller code has been written in the Arduino IDE program.
The measurement results were transferred to the computer with the ESP8266 Wi-Fi module on the NodeMCU development board and recorded in the Firebase real-time database. Firebase is a platform developed by Google. In this thesis, the real-time database feature of Firebase was used.
A mobile interface where measurement results can be followed with the App Inventor application has also been designed for Android devices. App Inventor is an application developed by MIT where we can do block-based coding. Thanks to its block-based nature, Android applications can be developed easily. Again, in this thesis, a real-time database connection was established with the mobile application and Firebase. The data recorded from the sensors to the database were followed and the mobile application user was informed about the air quality index.
The data collected in the Firebase database was also used for machine learning. Firebase database connection was established with Python programming language in Visual Studio Code environment. Machine learning was carried out with the sample data set. Then, the air quality index was made classifiable for the data coming from the database. LDA and Decision Tree , which are classification algorithms, were used for machine learning.
PM2.5, PM10, SO2 values, which are important for the air quality index, were taken from the website of the Ministry of Environment, Urbanization and Climate Change. The air quality index calculated with the data physically read from the sensors and the air quality index on the website of the Ministry were compared.
Measurements were made in Zonguldak center and Çatalağzı district. The reason why Çatalağzı district was chosen is that Eren Energy Çatalağzı Thermal Power Plant is located here. Since 2% of the greenhouse gas emissions in Turkey are estimated to be emitted only from this thermal power plant, it has been decided that this region is suitable for the test study.
Thanks to this designed air quality measurement system, the instantaneous pollutant change in the environment can be followed, and the air quality index can be monitored daily. Individuals can take the necessary measures according to the air quality index. Especially common in Zonguldak region. It is important to monitor air quality for COPD. Individuals with diseases such as COPD can take the necessary precautions when the air quality is low. It is important for individuals who may be affected by low air quality to monitor the air quality index instantly from the mobile application and to send notifications for instantaneous developing situations. Thanks to machine learning, the big data collected from the sensors could be analyzed and the air quality index could be classified. Thanks to machine learning, the feature of predicting the air quality index has been added to the program.