Indoor and Outdoor Air Quality Detection using Programmable Microprocessor and Sensor Technologies

Most living forms of life need clean water, air and nutrient resources to maintain a healthy life. The increased population and industrial and technological development have caused more energy needs. This affects air quality (AQ) and hence human health negatively. Because AQ is critical for human health, various measurement and analysis methods are developed and the amount and variety of airborne pollutants are examined by today's methods such as passive and active samplers, automatic analyzers and remote sensors. In this study, AQ measurement is aimed to create an alternative to ready remote sensing systems by designing low cost and programmable microprocessor system which allows in place and instant data collection. Arduino, an electronic prototype platform, is used to collect, transfer and process sensor data. An interface was coded using the Visual Studio to make the data instantaneously analyzed by any program on the computer. The BEUHavaKalite device is a handheld AQ measurement device providing a wide range of measurements, gas diversity, calibrated according to the internal and external environment, high sensitivity and low cost. The other unit of this system is HavaKaliteSoft, the user interface for transferring and processing the sensor measurement results to the computer. This system tests have been carried out in Tatvan and Merkez districts of Bitlis province and the measurements confirm the accuracy of the device. The device is especially important because it allows scientists working in this field to collect data related to the field of AQ and carry out detailed studies.


I. INTRODUCTION
Air pollution has increased with the increasing population, industry and motor vehicles [1]. Global, regional and even local air pollution are emerging day by day. Especially in the urban areas, air pollution is riskier in winter due to reasons such as poor-quality fuel usage, meteorological conditions, increasing number of motor vehicles on the traffic, low-quality fuel used in vehicles, irregular industrialization, intense urbanization, topographic and unplanned settlement of cities [2].
After the first air pollution occurring due to intense inversion took place in Ankara in 1960 for the control of air pollution, regulations and legislation have gained great importance in Turkey [3]. Thus, on November 2, 1986, the "Regulation on The Protection of Air Quality" was published. With the provisions of the environmental law, it was aimed to control the aerosol, smoke, dust, steam and gaseous pollutants left to the atmosphere as a result of all activities and protect the human and environment from the Published on December 4, 2018. Authors are with Bitlis Eren University, Bitlis, Turkey hazards arising from air pollution in order to ensure that these effects do not occur repeatedly [4]. Particularly when the pollution occurring outside is the focus, there is a large amount of particulate matter (PM), nitrogen oxide (NO), carbon dioxide (CO2), Organic Flying Ashes (OFA), smoke and carbon monoxide (CO) mixture in the mentioned pollution [5]. In addition to the outside air pollution, depending on the source of the pollution in the internal air; methane (CH4), liquefied petroleum gas (LPG), polycyclic aromatic hydrocarbons (PAH), and radon (Rn) can be mixed into the air [6], [7]. According to the World Health Organization (WHO) and the International Agency for Research on Cancer (IARC), above mentioned gases are shown to cause many serious health problems such as cancer, asthma, lung stiffening, bronchitis, frequent respiratory tract infection, heart attack, insufficiency and arrhythmia, Alzheimer's, pregnancy diabetes, and chronic obstructive pulmonary disease (COPD) [6], [9], [10]. Regular monitoring of indoor and outdoor air quality is important in terms of community health, taking the necessary precautions before the occurrence of the health problems mentioned above. Measuring the air quality in a region is of great importance in terms of knowing what kind of air people living in that area inhale. Several different systems are currently used in the measurement of air quality [8]. Starting from simple systems like simple passive samplers to the much more complex and often more expensive systems like remote sensing systems can be given examples to the current systems. Fundamentally, current measurement systems are classified under four groups such as passive samplers, active samplers, automatic analyzers, and remote sensing systems [8].
Passive Samplers; are generally cylindrical tube or discshaped devices. The pollutants collected from the environment by the absorption method are brought to the laboratory after the appropriate exposure period are quantitatively determined. Although it has advantages such as low cost and simple installation for a sampler, it has two big disadvantage such as the long time required obtaining the result and the limited parameters, which can be examined by these devices [8].
Active Samplers; the daily average results are obtained by passing the air sample via a pump through a physical or chemical environment. It is easier to operate and the reliability of the results is the most important advantage of the device, while its high cost and complex structure are disadvantageous [8].
Automatic Analyzers; using the physical and chemical properties of the measured gas allows continuous detection. The air reacts directly to the optical property of the gas by producing chemical radiation or fluorescent light, and the Indoor and Outdoor Air Quality Detection using Programmable Microprocessor and Sensor Technologies Sabir Rustemli, Cigdem P. Dautov, and Leyla Gazigil amount of contaminant is determined by the electrical signal generated when passing through the light detector. For the process to be carried out in a healthy manner, it requires experienced technical personnel, detailed and high-quality security methods, computer-aided telemetric systems and allows only one parameter to be measured at one point. These devices bring complex, expensive and high operating costs [8].
Remote Sensors; allow multi-component measurements using mobile systems to perform concentration maps. Thanks to these systems, vertical measurements can be done in the immediate vicinity of the sources and in the atmosphere, but today's remote sensors can reach high prices starting from a minimum of 200 thousand dollars. However, there may be serious problems in quality assurance, validity, and calibration of data. In addition, a very careful quality control program and experienced professionals are needed to successfully operate the device and obtain reliable data from the device [8].
Although today's devices and methods obtain good quality data, high installation and maintenance costs and complex installation requirements have led to the search for more economical, fast resulting systems. In this study, an alternative system design is aimed to provide a fast, reliable, easy to install and use, low-cost system. The newly designed system combines both hardware and software units coming with functionalities such as gas detection sensors, data collection from these sensors, transferring and processing the data. The currently available devices with similar features are sold at prices of 200 thousand dollars or more. By designing the device called BEUHavaKalitesi, we show that it is possible to produce devices with similar characteristics in the market at much lower costs.

A. Device Components
When designing an air quality measurement device, the production cost and the regular air pollutant gases that supposed to be analyzed are the most important parameters to consider. Considering these two parameters, we limited the electronic component used in order to eliminate high expenses while checking only fundamental pollutant gases. The list of components is given below: • MQ sensors (MQ2, MQ4, MQ9, MQ135, and DHT11) that allow the monitoring of gases such as LPG, CO, CO2, Smoke, CH4 and the temperature and humidity known to influence these gases, • 100-pin and circuit diagram with the ATmega2560 microprocessor on the Arduino Mega prototype component is given in Fig. 2, • The Arduino Mega compatible pin multiplexer, • The Passive buzzer module that provides device warning, • The keypad that allows the user to log in, • The Nokia 5110 LCD display, where the user can view the device menu, and process results, • Communication cable with a computer using serial port, • Battery integrated for portable use. All basic components of the device are connected to the circuit diagram and the design is completed. The external design of the device is performed with AutoCAD program as in Fig. 3 and produced with certain changes. The box design of the device is completed, and the final prototype is given in Figures 4 and 5 in all respects. As shown in the figure, the front surface of the device and the keypad and short side surfaces are placed in such a way that the sensors can be taken from outside. The microcontroller internal unit is integrated into the box.
Step 1 Step 2 Step 3 Step 4 (Concentration of the gas) = log ( 2   1 ), log ( 2 1 ) Note that Eq. 1-4. are used to calculate the calibration curve while Eq. 5-6. are used to calculate the gas concentration based on the plotted calibration curve. According to the aforementioned formulas, gas concentration is calculated and calibration is computed in the environment designed in a way there is none or minimum amount of the sensor gases exist. The Arduino program steps, which are also the representations of each menu item are given below: 1. Nitrogen introduced environment is used as a default setup in order to calibrate the sensors for the first time.

These calculated calibration values are inserted into the code (Ro values), 3. The sensors can be calibrated by the user (if required)
by using Menu 1, 4. Next, calibration values are automatically written into the previously given formulas, 5. The user starts the measurement using Menu 2 or Menu 3 options depending on the duration he/she wants to take a measurement for, 6. By using Menu 4, the average air quality can be computed. This menu item gives results not in ppm values instead air quality classification such as ideal, good, healthy, unhealthy, and very healthy, 7. Each process in steps 1 and 6 is automatically transferred to the computer via serial port.

A. User Interface (HavaKalitesiSoft)
A serial port transfer interface named HavaKalitesiSoft has been created in the Visual Studio environment by coding in C# language so that the data such as sensor calibration, gas concentration, air quality can be processed in the computer environment by the user and can be understood with instant graphics (Figure 6). The algorithmic processing steps of this program are as follows (Figure 7): 1. Make sure that the serial port cable of the device is connected to the computer, 2. Select the COM port from the connection settings on the Connection tab and click the on button, 3. A file is created with the date and time of that moment by clicking the create button in the file settings to create the corresponding file in txt format, 4. Instant sensor data can be observed in the data transfer section of the screen, 5. In the real time graphics tab, you can see the data of LPG, CO, Smoke, CH4, CO2, humidity and temperature in real-time graphically by clicking the show button. 6. When the data transfer is finished, the serial port connection is closed again by 2 steps, 7. The saved file is located in the documents directory and can be processed by transferring it to the Matter if desired. Fig. 7. Geneal view of the application.

III. FINDINGS AND DISCUSSION
The accuracy and sensitivity of the sensors and the device have been investigated after the design of our device being completed. It was not preferred to compare it with handheld air measuring devices of similar characteristics used for the same purposes. The reasons for this are the differences in the sensor measurement range of the BEUHavaKalitesi with other devices, the changes in the calibration settings that are needed before and the warm-up times they need to allow the sensors to reach the ideal measuring position. Due to the above-mentioned reasons, it was found appropriate to make accuracy and precision research by comparing the measurements of the device in different environments. These comparisons were performed in 30 minute periods in the form of outdoor air quality (Bitlis, Tatvan), indoor air quality (restaurant environment, Bitlis, Tatvan), indoor air quality (office environment, Bitlis Eren University) and comparative finding results are shown in Table I and Table  II.

IV. CONCLUSION
Air quality measuring devices can be evaluated by looking at parameters such as the measuring range, the gases measured, and the environment where it is suitable for operation, sensor sensitivity and cost. According to this, BEUHavaKalitesi device is available in the range of 0ppm to 10000ppm, LPG, CO, CO2, CH4, smoke can also be used to look at humidity and temperature, to be calibrated both internally and externally, with adjustable sensor sensitivity and cost less than £ 100 it is advantageous from both professional and handheld devices. According to the results of the calibration tests held in the nitrogenous environment, the measurements of gas concentrations are found as zero or near zero value (0-2ppm). The results of the indoor air quality measurements confirmed the correct measurement of the device. When the LPG, CO and smoke concentration values given in Figures 8, 9 and 10 are examined, it is seen that especially the consumption of cigarettes and the high average value reached in the cafe environment where the food production is intense. On the other hand, the concentration of CO, Smoke-like gases released to the outside air as a result of warming with natural gas was found to be about 50% lower than the cafe environment.  In addition to these measurements, the average air quality of these gases was measured by considering the average air quality. Although the values of the device are consistent, it is not possible to compare with the official figures because the parameters provided by the Ministry of Environment and Urbanization are different. Adding the official parameters to the system, searching same parameters that the device provides from different sources and comparison of these parameters to the ones that the device provides are among possible improvements. It should be also noted that the device is easily upgradable. For example, it is possible to increase the scope of the device by adding SO2, nitrous oxide compounds (NOx), particulate matter (PM), volatile organic ashes (VOC) from the parameters frequently used in air quality measurement and it is also possible to provide instant measurement follow-up on the internet using Internet of Things (IoT) technology. These are planned to be accomplished in the continuation of the study.