The use of smart devices (IOT) to monitor the air quality: a case study at the Faculty of Natural Sciences Ilma Lili 1, Anxhela Kosta 1 and Endri Xhina 1 1 University of Tirana, Faculty of Natural Sciences, Bulevardi Zogu I, Tirana, 1001, Albania Abstract A city is "smart" if it uses different types of sensors and devices to collect data and provide information that is used to efficiently manage resources. The data can be processed and analyzed in order to monitor and manage traffic and transportation systems, waste recycling, water supply networks, air pollution, and other public services. The use of sensors would enable the collection of these data and their transfer in real time to the users. Based on the information provided online by a Swiss company called IQAir, it appears that Tirana has significant air pollution. Through a web application we could enable the possibility to receive and display data from the sensors and send them to a database so we can use them in different situations. In this paper we will show the use of the Internet of Things (IOT) to monitor pollution levels, especially levels in many positions in the Faculty of Natural Science where the number of students can be considered high. The aim of this paper has a correlation with people heath especially for this case study is students’ health. It serves for more detailed studies or evaluate whose are the element causing the greatest air pollution and a prediction of what measures should be taken to prevent it. Creating a suitable environment to make this information to be detailed in real-time of course will affect other fields and aspects of researchers in the future. Keywords 1 Air pollution, IOT and Smart devices, IQAir, Particular Matter, Arduino 1. Introduction World Health Organization (WHO) estimated that, in the year 2012, ambient air pollution was responsible for nearly seven million deaths, Air pollution is the greatest representing more than 10% of all-cause deaths environmental threat to public health globally and and more than doubling previous estimates accounts for an estimated 7 million premature [2]. Based on this information we thought about deaths every year. In 2019, 99% of the world what to do to identify air pollution sources— population was living in places where the WHO’s where it’s coming from and who’s responsible. strictest 2021 air quality guideline levels were not Since we are in the age of technology we can met. Air pollution is the presence of extra improve and can monitor air quality using smart unwanted biological molecules, particulates or devices called IOT. other harmful things into the earth's atmosphere. It is a major cause of infections, Advanced technological tools such as artificial allergies, and eventually reasons of death to some intelligence (AI), machine learning, blockchain people [1]. technology, IoT, and geographic information The air problem is something that should systems are some of the powerful tools that help not be neglected but more thought should be given humanity to effectively address climate goals and to ensure a healthy future for the population. The Proceedings of RTA-CSIT 2023, April 26–27, 2023 Tirana, Albania EMAIL: ilma.lili@fshn.edu.al (A. 1); anxhela.kosta@fshn.edu.al (A. 2); endri.xhina@fshn.edu.al (A. 3) ORCID: 0000-0001-9389-6894 (A. 1); 0000-0003-3751-5641 (A. 2); ©️ 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) have a better picture of the actual air quality In this paper we will show the use of the situation [3]. Internet of Things (IOT) to monitor pollution levels, especially at different points inside the It is important to analyze the relationship buildings accompanied by different volumes of between student activities and PM2.5 in the students at the Faculty of Natural Science. The classroom to provide guidance for air quality aim of this paper is directly related to the health of improvement. However, modeling and predicting the students. It serves for more detailed studies of PM2.5 in classrooms remains a challenging which elements causes the greatest air pollution problem. Previous studies have mainly and a prediction of what measures should be taken concentrated on residential or uninhabited rooms to prevent it. Also, we will show a comparison without large-scale crowd conditions and between IQ Air devices with Arduino which is the analyzed issues such as temperature, humidity, best for monitoring air quality. This and outdoor PM2.5 concentrations. Limited demonstration creates the suitable environment studies have focused on quantifying the effect of for this information to be detailed and used in student activities on PM2.5 in classrooms.[4] other fields and aspects of research in the future. Below, two graphs show the level of the PM2.5 parameter in outdoor environments near 2. Air pollution challenges the Faculty of Natural Sciences. These results belong to three consecutive days of March 2023 Air pollution is one of the main environmental respectively by hours and days. The data is problems in major Albanian cities, especially in obtained from the website IQair [5] via the Tirana. The pollution has come as a result of the published station with longitude 41° north and increase in cars, the reduction of urban greenery, latitude 19° east at 150 m distance from the the burning of garbage, the economic activities of buildings of the Faculty of Natural Sciences. enterprises, the use of low-quality fuels, etc. The concentration of PM10 and NO2 particles in Tirana exceeds the national standards and those of the World Health Organization [6]. Air pollution has a direct impact on human health and has long- term consequences. Technology has an important role in shaping the world, countries, society, economy and also the environment. All the organizations are working on how to reduce pollution, and scientists are thinking about using technology to reduce pollution. Figure 1: Air quality AQI hourly 3. Methodologies and technologies The methodology used is mainly based on the initial study of the environment where the measurements were made. The two important moments were the location of the points where the measurements would be made and their frequency. Subsequently, other helpful attributes were determined, for example, for the location of the building, the area, the floors, etc. and for the frequency, it includes the weather forecast, Figure 2: Air quality index (AQI) daily measurements at different times of the day, halls filled with students. All these analyzes are Previous studies have indicated that indoor PM presented with the schematic coded below 2.5 concentrations are strongly correlated with outdoor PM2.5 concentrations. Figure 3: Schematic analyses of the environment at different times of the day. Air quality index is a parameter calculated Figure 4: Process workflow based on other values gathered during data collection. Our tools include USA AQI. The built-in air quality Arduino tool used to Air quality in the classroom is crucial to the measure air quality included the assessment of student's health. PM 2.5, PM 1.0, PM 10 and AQI (air quality In the beginning data were obtained by two index). The constituent elements part of this built- sources. The first was the perception of the air in tool is: quality by the students and the second was the Grove - Laser PM2.5 Dust Sensor - concrete evaluation for air quality through Arduino Compatible - HM3301 which is a sensor estimating the level of CO2, humidity and for measuring the level of PM 2.5 particles temperature. classified as dangerous particles for human health The methodology used helps clarify the when they exceed the limit of normality. correlation between human perception and real Grove Base Shield V2.0 for Arduino measurement. serving as a base that connects Arduino Uno Air quality perception data was collected through devices and other versions such as Arduino an online questionnaire fulfilled by students. The Leonardo and Mega. 4-pin connectors ensure questionnaire included not only the students' simple and quick connections. opinion on the current air quality but also a Seeeduino V4.2(ATMega328P) The general framework of their health situation. Arduino board that comes with the development After analyzing the environment, the workflow environment continued with two parallel processes. 1. Grove - Universal 4 Pin Buckled 20cm Assessment of air perception by students by Cable Connections between Base Shield, Arduino completing an online questionnaire. 2. Concrete and sensor 2.5 air quality measurement using two devices, one Lipo Rider Plus (Charger/Booster) - built-in Arduino tool and the other standardized 5V/2.4A USB Type C Connecting part between device for measuring air quality the board and the lithium battery. The following components and their relationship is presented through figure below Figure 7: Library included on Arduino IDE Figure 5: DIY Air Quality monitor components and their relationship. Figure 8: Execution results on Arduino IDE The second equipment used was a standardized one. AirVisual is a device that measures pollution to PM1.0 (μg/m3), PM2.5 (μg/m3), PM10 (μg/m3) particles and derives the AQI (Air Quality Index) result from them. Additionally, the device measures temperature Figure 6: DIY Air Quality monitor (˚C), humidity (%) and air pressure (mbar). It is designed to be used for particle pollution up to The environment where Arduino code is 1,000 µg/m3. AirVisual performs these developed is divided into two important groups: measurements through two already installed • void Setup, • void Loop sensors. One serves for the initialization of the functionalities while the other for the execution of these functions depending on the situations. The results of code execution can be displayed in the Serial Monitor using the basic command for example: Serial.println("Message"). The main part that helped display some test metrics is: aqi_pm = mapPMAQIValues(&pmReadings); Serial.println(aqi_pm); Where the variable that is taken as a parameter Figure 9: Commercial Air Visual Device pmReadings reads the information from the sensor, and by means of the mapping Certificate used FCC, IC, UL, ROHS, CE. The function mapPMAQIValues connects the value in AirVisual Outdoor is manufactured in IQAir’s mg of PM and converts it to AQI. state-of-the-art manufacturing location in There are some libraries that need to be Southern Germany. AirVisual provides three included at Arduino IDE as described by the Internet connection options. Ethernet, Wi-Fi and picture below. USB 4G. Results collected by air visual device are displayed by the application installed on phones: Table 1 Comparison between devices DIY Air Commercial quality Air Visual monitor Device Cost Low High Implementation Yes No Simplicity in No Yes usage Application Arduino IDE Air Visual App Standards No Yes Results Complicated Simpler Figure 10: Results displayed by the Air Visual interface Application Connectivity No (add WIFI-direct components) access 4. Comparison between Air Quality devices. 5. Advantages and disadvantages In the market there are so many air quality sensors with different features and functions. It is between air quality devices hard to pick which air quality sensor will fit the best. For this reason, we have done a comparison Based on the data collected from the between the Arduino air quality built-in device questionnaire on the perception of air quality and and Air Visual Device that we bought. The IoT the concrete measured results performed by the air devices are divided into three execution types: quality standardized devices, a direct correlation • Processing time (the system is working) was noticed between them. It means that what is • Sending processing time (the system perceived by people for the quality of air is in the activated the GPS/GPRS sensor and sends data right way with the results of the equipment. to the Edge). As a sum up the advantages and disadvantages for using smart devices to monitor air quality are • Resting time (the system is in sleep mode, summarized in the table below [8]. saving battery). : Table 2 We must consider this specification when choosing the smart device. Smart devices pros and cons. • Operating Voltage Pros Cons • Operating Temperature It detects many An air quality • Operating Humidity different air monitor does not • Particle Size 3 channels pollutants clean the air During the working process which includes the Shows exactly It does not show the two devices, several changes were identified, how your air is source of the starting from the moment of configuration until doing pollutants receiving the results. Those changes are summarized in the table below. Allows you to The average take action consumer grade based on data monitor costs up to and knowledge $100 Helps create the Helps create the most healthy most healthy and and comfortable comfortable home class 6. Data flow process Figure 13: Table air_cities The real-time measurement results were After creating the database, it was necessary to included on a website created by us[9] , by which develop a script which receives the data students will identify air pollution sources in the automatically from the device and stores it on the school environment, analyze air pollution data database. The device has an API key (provided by collected in real-time and think about ways to the commercial). By sending a request to reduce exposure to air pollution on their journey POSTMAN using API Key: 4a28fd8e-1d3d-4aec- to school and use them for further analysis and a0b4-8b98d416e532 we could get the necessary projects. Using the API key from the commercial data to save on our database device a JavaScript code was involved on The technology used to send the device request www.airqualityfshn.info website. is the Php programming language. We build the AirQuanity class which sets the device's API key and the get methods for receiving data. API key sends the data showing the air quality in JSON format. With a function save(data) we read data from the smart device in real time and insert it into the database as soon as we have a new request from the API key, that is, when a new measurement is encountered. When the database is populated with real-time air quality data, we Figure 11: Website view present this data on a website by using a Php script. The figure below shows the request to the In order to monitor the air quality in real- time Air Quality Database to read the air quality data and to have a history for each measurement that is and present them on the website. The general made, we built a database whose main purpose architecture used during these activities is was to feed our website with the data obtained presented in a schematic way below. from the devices. The database we used was MySQL and it has two tables (devices, air_cities). The table device saves all data that identifies in a unique way the air quality commercial equipment with their location. The table air_cities hold the necessary information sent to us by the air quality device with the elements that identify the air quality. Figure 14: MYSQL connection-Schematically Figure 12: Table devices Figure 15: Airquality.php function • Volatile organic compounds (VOCs) • Carbon dioxide (CO2) The results after executing the code are • Radon gas displayed according to the table below as a data collection. The development of an online platform which currently presents some air quality elements, in a standardized format by IQAir, will be an important impetus to build an online real-time application using webservices. This study shows measurements of carbon dioxide (CO2), particulate matter (PM2.5) and volatile organic compounds (VOCs) on indoor Figure 16: Data collection environment at Faculty of Natural Science and discusses the concentration levels of these 7. Recommendation parameters on indoor air quality. The data is made actionable by performing advanced analytics. The The work process cannot be called complete, sensor-based systems are low-cost, compact, and considering that the work consists of continuous easy to install compared to conventional analyzer- measurements, and by means of them, the based systems, making them an ideal system for difference in the accuracy of the measurements scalable monitoring. Levels of carbon dioxide and using the two devices can be clearly distinguished volatile organic compounds in some points we and of course analyzed in a convenient way. measure in faculty were not too polluted. There Normally, the addition of commercial and DIY are some future improvements that could be made Arduino devices in other points of the faculty will to this project including monitoring the air quality bring parallel evaluation of the measurements, not only at faculty but also in other areas that are including the effect of other external factors. more popular and in we look forward to In the future, there will also be the construction implementing cameras and robust ML analysis to of a platform with alpha numerical and both improve the obtained results and test the geographical data to create an image as user maximum number of allowed sensors friendly as possible for every user of the airqualityfshn.info website. 8. Conclusions 9. References The main purpose of this paper is to convey the [1] UN environment programme, Pollution work done during the development of a project for Action Note – Data you need to know, 2022. air quality monitoring system by using smart URL: https://www.unep.org/interactive/air- devices. Retrieve data from IOT devices (air pollution-note/ quality monitoring device and Air Visual [2] Pier Mannuccio Mannuci, Massimo monitor) handle for further analysis and Franchini: Health Effects of Ambient Air correlation between air pollution factors and the Pollution in Developing Countries, 2017. impact it has on different fields, but also serves as URL:https://www.mdpi.com/1660- a source for the development of an online 4601/14/9/1048 application that apprises in real time air quality for [3] Shankar S. Naveenkumar R., Abbas G., the internal and external environments at the Nithyaprakash r. , Maheswari Ch. Chander P. Faculty of Natural Sciences. An important role is Alokesh P. Animesh B. Saurav D. Artificial played by the creation of an air quality device Intelligence Technologies for Forecasting based on Arduino at an acceptable cost and which Air Pollution and Human Health: A also empowers the management of the application Narrative Review. 2022. URL: created in C language. No comprehensive air https://www.mdpi.com/2071- quality legislation exists in Albania. The most 1050/14/16/9951 commonly measured compounds for air pollution [4] Zhou Y, Yang G. Li X. Indoor Pm2.5 are: concentrations and students’ behavior in • Particulate matter (PM2.5-PM10) primary school classrooms 2021. URL: https://www.sciencedirect.com/science/artic le/abs/pii/S095965262102672X [5] IQAir, Air quality in Albanian, 2023. URL: https://www.iqair.com/albania [6] The Clean Air Act: Solving Air Pollution Problems with Science and Technology, 2023. URL:https://www.epa.gov/clean-air- act-overview/clean-air-act-solving-air- pollution-problems-science-and-technology [7] The James Dyson Foundation: Engineering solutions: Air Pollution-Teacher pack. Pg 48. 2021. URL: https://www.jamesdysonfoundation.com/res ources/engineering-soluytions-air- pollution.html. [8] Cartieaux, E., Rzepka, M.A. and Cunny, D. Indoor Air Quality in Schools. Archives de Pediatrie. Pg 791-792. 2011. [9] Air quality Faculty of Natural Science. http://airqualityfshn.info