LIST OF ABBREVIATIONSAout: Analog OutputAPI: Application Programming Interface AQI: Air Quality Index CO: Carbon Monoxide Dout: Data/Digital Output GND: Ground IoT: Internet of Things LS
Trang 1VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY
UNIVERSITY OF INFORMATION TECHNOLOGY
ADVANCED PROGRAM IN INFORMATION SYSTEMS
Trang 2First and foremost, I’d like to deeply express my gratitude and grateful to my supervisor
Ms Cao Thi Nhan for all of her valuable support and revision with my final thesis In theearly stage when I started working on my graduation project, I encountered manyproblems, concerns, and even fears of not being able to complete it However, thanks toher encouragement, inspiration, suggestion, and help, I was able to complete mygraduation thesis
Next, I am extremely appreciative that the Department of Information Systems andOEP has provided me with an excellent opportunity to put all of my education, perceptionand experience to solve a massive problem as well as applying them to hands-on a realapplication Without the need for hesitation, this experience has provided me with a strongfoundation in my career path
Finally, I would like to express my sincere appreciation and respect towards my familymembers for encouraging me throughout the process of conducting my graduation thesis
In addition, I would like to thank my younger cousin, Mr Bui Quang Phu for assisting me
in researching the basic knowledge and foundations of data mining
Thanks to them, I am inspired to persevere in the face of challenges and create theproduct of the best quality
Trang 3Table of Contents
ABSTRACTION 1 1(0;ì0i2000810949)9)0 0919) 2
1.1 MOIVAtIOT SH HTHHn HH H HH T HH 2
1.3 The importance of monitoring air Quality -s<+<<ss++se+seeeesess 6
1.3.1 Effects of mainly indoor air pollutants on human health 7
Chapter 2 INDOOR AIR QUALÏ T”Y - 2 0 c3 99H HH HH it 13
„VAN on ,Ô 14
2.3 AQI Scale for Different PollufanfS c5 2+2 *‡++vxsseeexsssexss 17
"NV 0)06 00 ion a 182.5 General problem solving apprOach - - ssss si ererrree 192.6 Related acc cố 202.7 Required technology for developing appÌication -« -s«++<+ 22
2.7.1 Reason for building SySf€T 5 SH nhiệt 25
Trang 42.7.2 Reason user will choose this appÌiCafiOT 5 +«c<< << se 25
Chapter 3 loT-BASED AIR QUALITY MONITORING SYSTEM 27
3.1 A synopsis of the proposed SVSf€T SG Q19 v SH ri, 273.2 ToT hardware and €VIC©S Gv TH HH nh ng 27
3.2.1 ATUITO Ăn nh HH nh in 273.2.2 Wi-Fi Module ESPS26G6 - -G- G n nHnHgngn niệt 27
3.2.4 Sharp dust sensor GỚP2Y 1010AUOE - 55-5 + +sesssesesre 31
3.2.5 CCS811 TVOC CO2 S€TSOI Ghi, 333.3 Proposed SySf€I G1111 HT HH HH 33
3.3.1 System architecture - G113 3991113 111 11181111 11 1g ng vrg 34
3.3.1.1 Backend -s.c + SS St k*n* HT TH TH HH niệt 34
3.3.1.2 IoLA@N.mmrs .vựmn | / 403.3.1.3 Sensor COnÍIBUTAfIOH - Gà nh nh ng rư 413.4 System WOTKÍ[OW cọ TH HH HH Hi, 423.5 20026 ốc 433.6 Virtual Private S€TV€T - Ác SH TT HH TH HH HH ni kt 44
3.6.1 Google Cloud Compute Engine - - «+ ss*+sskxsseeesseesesers 443.6.2 Vultr Cloud PTOVI€T - o6 S3 ng ng ng nến 453.7 Docker monitor by POTAIT€T 5 S5 + E938 E911 11 9x vn 45
3.8.1 EXD€TIHTm€I( SG Ăn ệt 46
3.8.1.1 Work with ToT devices - Gv ng ke 46
3.8.1.2 Learn from đafa 331311111111 EEEkkkkkEkkkreeerree 47
Trang 53.8.1.4 Deployment 48
3.8.2 ReSUIt 1 49Chapter 4 PREDICTION MO EÌL, - 5 6 1231191115119 119111 ng nền 50
` " 504.2 Data preprocessing SH TH TH HH He 54
4.2.1 Replace OUtÏI€TS - SH HH Hư 55
4.2.2 Apply MinMax SCaÌT SG Ăn rưn 57
4.2.3 Transform to window size (Ì4fa - - Gà HH HH 574.2.4 Split to train, test and validation S€K - «sec ssc<sessessers 584.3 EXD€TIITIS Ăn TH HH TH kh 59
4.3.1 Experiment ConditIOI - <5 5 + ret 59
4.3.3 Model EvaluatIOn - - Ăn HH nh re 62
4.4 Experiment on self-measurement dafaS€L - - 555555 s+++s<++svesssexs 66
"“"ÐốŒt::aiađiaiiitftẩầỶẢỶ 664.4.2 Dafa DF€DTOC€SSINE Ăn HH HH Hy 674.4.3 Train, test afAS© - LG cv 67
““ a.ốốh 68
` ÖŒ 68Chapter 5 DIEÌMO - G1 1 TH TH HH nh re 69
Non 695.2 Connect the device to a DOW€T SOUITC€ Gv ng re, 695.3 Connect device With WI-ÏEFI - - - - cc ccc 1E SS SH SSSSnS S555 51 1k kvkkkkrer 70
Trang 65.4 Monitor air quality through w€©bSI{€ - s1 k*n*HHg Hry 72
5.5 Dashboard page - - «5 HH TH TT HH HH HH 77
Chapter 6 CONCLUSION ĐÁ HH T HH TH TH TH TH HH kg krry 83
"` na Ả 836.2 Future WOTĂK - Q1 Tnhh Tu HH Ti HH nh vn 83REFERENCES 1 85
Trang 7LIST OF FIGURES
Figure 1 1: Smog covers Ho Chi Minh CÍIfy ceeeseceeeseeeeeeeeeeees 2
Figure 1 2: PM particles size comparisons with human haIr - - 4 Figure 1 3: Arduino Uno micro-confTỌÏ€T 5 «+ + £++*£+se++eeesxx 12
Figure 2 1: AQI Category and Levels of Concern - -« -«++ss<++s+ 15
Figure 2 2: AQI color formulas in RGB (red, green, blue) and CMYK (cyan,
magenta, yellow, bIack) - s11 TH TH TH nh gi 17
Figure 2 3: CO AQT Scale [29] - + <1 1x21 1 2111118211111 1g ng ng ve 17
Figure 2 4: O3 AQT Scale [29] + +c 111211123 11811 1E rerrerrrrkre 17
Figure 2 5: TVOC AQT SCaÌ6 LG À1 11+ 1 1S 18
Figure 2 6: PM2.5 AQI Scale [249)] - 5-1 + k + E+EESeEeeerseeeseeerre 18
Figure 2 7: Interface of US AMQP Project in Hanoi, Vietnam 21
Figure 3 1: WeMos NodeMCu DI-EÌ - .- 55+ £+s£+seesseeesseeeske 28
Figure 3 2: Additional boards manager URLLS - - =«=+<-<+++ss++ 29
Figure 3 3: MQ gas sensors mOdỤe 5 + + ***kE+sv+eeeeerseeeseke 30
Figure 3 4: MQ Series Se€nSOT DITOUI 56 + SE VESsvEsseEeeeersrkerske 31
Figure 3 5: Structure and function of Sharp GP2Y1010AUOE 32
Figure 3 6: Connection Diagram CCS811 and ESPS§266 - 33
Figure 3 7: Backend ArchIf€CfUTC - <1 x1 HH ng re 35 Figure 3 8: RabbitMQ between Email service and API service 37
Figure 3 9: RabbitMQ managermein( «+ + +svEssveeeersseerske 37
Figure 3 10: best_model h5 file and best_scaler pkl file - 38
Trang 811: Loading model and sCaÏer - -. «+ «++s£++++eexss+ssxs 38
12: Getting predict data by using Postman - « -««+<s+ 39
13: MQTT broker between IoT and API service -‹ - 40
14: MOTT X Inf€rface ccccccsesssssceeceeceeessssceeeeeeeesesssseeeees 41
15: System WOTKÍÏOW - «nh TH Hư 42
16: Cloned repository on VPS «cv ng ng ke 43
17: Start all services by running docker compose .- 43
18: Deployment model using Docker - «- ««+5s«++<++e+ 44
19: Google Cloud $300 credit pròram - «+ s++s++s+++ 45
20: Vultr dashboard 5 + x3 vn ng ng 45
21: Portainer user ITI€TÍAC€ 5c 1E 3 1 191 ch 46
22: AirChecker project Github repOSitOTy ««+<s«++sx<+ 48
23: IOT devices in reality - - s5 xxx seeeeeeskre 49
1: Dataset CỌUIm1s - - <5 + E19 1119 3119911 1 vườn 50
2: Dataset TOWS HH TH TH TH TH TH HH tre 50
3: Check missing value in đafas€t - «5s «+ <++s++ss+ 55
4: IQR method for identifying OufÏI€TS - . -««<+<<<<++<<ss+ 56
5: Replace outliers with threshold -«-++<<<=++<eex+sesss 56
6: Before and after replacing OutÏI€TS - -««+5s«=+ss++ss+ 56 7: Value of dataset after applying scaler . -«+-s«++ 57
8: Transform scaled data to window size đafa -« -«<- 58
9: Split dataset and reshape to LSTM layer input shape 58
Trang 912: Experiment 2 confiØUTAfIOI - «+ + ++s *+s£sseEseeeeeeeese 61
13: Experiment 3 configuraf1ON - - -++- «+ +++sx++eeeeeseereeesrs 61
14: Experiment 4 confiØUTAfIOI - s- «+ + + +sseEsseesseeesee 62
15: Relationship of first 100 samples on train set - 64
16: Relationship of first 100 samples on validation set 64
17: Relationship of first 100 samples on test set - 65
18: Air Quality Index (AQT) prediction pÏot - ‹- -«< 66
19: Select feature and index coÏumn « «s5 «£+++ 67
20: LSTM modeÌ - 6 + 1131 931 E91 931 1 91 1v 9 re 68
1: Device CORTI€CfOTS G5 G2123 1 193 9 9911191 1n êm 70
2 + Figure 5 3: Setup Wi-Fi for ESP8266 -cs- << 71
“0200000400001 72
5: Install for desktop app - 5 + 1k sesrerrerserseee 72
6: Mobile application 1TIf€TÍACG - s5 + + ssveveeeesseereees 73
7: Composite AQT ̀afUTGS - - n1 HH re 74
8: 01 v8iiia ¡1 33 74
9 + Figure 5 10: Predict feature and user guidebook feature 75
11: Individual pollutant concentrafIOH -««-s «<< <<+£<ec<+ 76
2900001 - 76
13: Propose solution for high pollutanfS -‹ <-<<><<<<s+ 77
Trang 10Statistic DOATA 0 311 80
Air quality report (page Ï) - + -s sgk 81
Air quality report (Page 2) - - - vn rưkt 82
Trang 11LIST OF TABLES
Table 2 1: oT device name list eee eeesseceseeeseeeseceeceeeeeseeesseeseseneeenaeees 20
Table 2 2: Backend Technologies :.cessceeesseeeseeeeneeeeeneeeeseeesseeessneessaes 23
Table 2 3: Frontend Technologies cecccesccessesseeececeneceseeeseeceaeeeeeeneeeneeees 24 Table 3 1: WeMos NodeMCU DI RI technical specIfications 29 Table 3 2: 3-layer model and hands-on 1ÌÏustraflon -«<>+ 36
Table 3 3: Prediction service API endpOInIfS - - s55 £>ssssx 39
Table 3 4: Response structure from predicted APPI -« 55s << s<++s+ 40
Table 3 5: Sensor cOnfiØUTAfIOT - -.- 5 <5 + < 33+ 1E + ESkEeseerererrrere 42
Table 3 6: Docker compose commands -‹- «+ +£+s£++e+seeesseessxs 43
Table 3 7: Portainer account InfOrmafioII 5s +++<s+++se++eeex+zsss 46
Table 4 1: Dataset column mmeanInØ - - - 5< + + +++£+++eeEseeeeeseeeeeeeers 51
Table 4 2: PM2.5 Annual Summaty - <5 + +<s*+++<++seeesseerezeeers 52 Table 4 3: PM10 Annual Summary 5 55 + ++v+seeeeerseeeeeee 52
Table 4 4: SO2 Annual Summary s5 13 E+*VE+#vEEeeeEseeeeseeeee 52
Table 4 5: NO2 Annual Summary - - - 5 5 <5 + + sskEEeseerseeeeeeseers 53
Table 4 6: CO Annual SummarV c5 + 3E E+*vE+veeEeeerseeeeeeerse 53 Table 4 7: O3 Annual SUMMary c5 3c E3 E+kESEeeEeeerseeeseeerre 54 Table 4 8: The first ten rows data in the dataset 5555 c+sccse+ 54
Table 4 9: Google Colab RÑ@SOUTC€S - 5 5 1 ng ng ng rưưt 59
Table 4 10: Experiment results 00.0.0 cee eesceseceseeeseeeeseceseceeeeseeeeseeeaeeeeeeneees 62
Table 4 11: Experiment RMSE results 20.0.0 cee ceeceeeceeeeeceneceseeeseeeeneesseeeaeeess 63
Trang 12Table 4 12: Model evaluation using MAPE 5c csscsssssseereeersreers 63
Table 4 13: The own dataset Structure - Ă HS He 67
Table 4 14: RMSE result of own_data traiming - ««+<s«++s<<s+ 68
Table 5 1: Application features ÏIS( .- 56c vn rưkt 69
Table 5 2: Devices requireMent ZV:aađađa - 70
Trang 13LIST OF ABBREVIATIONS
Aout: Analog OutputAPI: Application Programming Interface
AQI: Air Quality Index
CO: Carbon Monoxide
Dout: Data/Digital Output
GND: Ground
IoT: Internet of Things
LSTM: Long Short-Term Memory
Щ œ m Ơ YH FY DY PF O3: Ground level ozone
© PM: Particulate Matter
— — PM 2.5: Particulate Matter with aerodynamic diameter < 2.5 um
— N PPM: Parts per millions
PPB: Parts per billion
TVOC: Total Volatile Organic Compounds
¬ ¬ osnN BB Ww Vcc: Voltage Common Collector
—¬ Sa VOC: Volatile Organic Compounds
— ~ VPS: Virtual Private Server
Wi-Fi: Wireless Fidelity
¬ œ
Trang 14LIST OF FORMULAS
Formula 2 1: AQI formula for each pollutant
Formula 2 2: Composite AQI formula
Trang 15With the increasingly negative climate change, people are gradually exposed totoxic substances, some of which have a direct impact but also some that have a long-term impact Nowadays, people get sick more often and diseases have increasinglyunpredictable variations Surely no one does not remember that the Covid-19epidemic caused loss of both life and property With technology gradually playing animportant role in most aspects of life, I realized an opportunity to apply technology
to partially solve the air problem This is the reason I want to build an air qualitymonitoring and prediction system based on IoT The system includes sensors tomeasure pollutants such as CO, O3, PM2.5, TVOC, thereby providing warnings tothe user's device through notifications The system also includes a website that can
be used on phones and is implemented with Progressive Web Apps (PWA)
technology so users can download and use it like software Regarding the air quality
forecast feature, I apply the LSTM algorithm model to forecast air quality for the next
7 days
Trang 16has issued a red alert for severely high levels of air pollution in the Chinese capital,running for five days from Friday evening, the environmental protection bureau said
Figure 1 1: Smog covers Ho Chi Minh City
(source: “HCMC smog made up of condensed pollutants: environment dept”, H N.
P Anh, VnExpress, Sep 26, 2019)
Trang 17With the development of information technology in general and the development
of Internet of Things technology in particular, it is not difficult for us to create anapplication or monitoring system to measure air quality to prevent, research andanalysis In addition, in the area where I live, it is a small alley about 3 meters widewhere, when a motorbike turns around, a lot of dust and smoke is discharged directlyinto the house With an understanding of technology, IoT, and the above situation, Iwas prompted to create an application that can measure air indicators and providewarnings and solutions to family members
The idea of the application is to measure pollutants using sensors and display theconcentration of substances on the website in real time while building a backendsystem and database to save measurement results every hour
1.2 Air pollution
This section aims to learn about air pollution, air pollutants and their sources, etc
At the same time, briefly introduce how to check air quality using the air quality index
(AQD.
Air pollution refers to the introduction of chemical, physical, contamination, or
biological substances into the internal or external environment, resulting in alterations
to the inherent properties of the atmosphere The main pollutants that impact publichealth that need to be considered first include particulate matter, carbon monoxide,ozone, nitrogen dioxide, and sulfur dioxide [5] In fact, indoor air quality can beaffected by substances from the outside environment, especially fine dust particlesfound indoors that enter through windows and main doors, etc
PM is an acronym for particulate matter, a term that refers to a mixture of solidparticles or liquid droplets found in the air They have different sizes and depending
on their size, the impact on humans and the path of entry will be different However,there are 2 main types:
Trang 181 PM10: Particles with a diameter usually less than 10 micrometers and can be
Combustion particles, organic
HUMAN HAIR compounds, metals, etc.
_90-70um < 2.5m (microns) in diameter
(microns) in diameter
© PM+o
Dust, pollen, mold, etc.
<10 âm (microns) in diameter
90 Lm (microns) in diameter FINE BEACH SAND
Figure 1 2: PM particles size comparisons with human hair
(source: “Carbon monoxide’s impact on indoor air quality”, US EPA, Sep 25,
2023)
Carbon monoxide (CO) is an odorless, colorless, and harmful gas Carbonmonoxide is extremely dangerous in closed environments with little air convection,and because it cannot be seen, tasted, or smelled, it can kill you before you evenrealize it is there Depending on each person, age, overall health as well asconcentration, and exposure time, the danger will vary CO is released through some
following sources: [6]
- Unvented kerosene and gas space heaters
Trang 19- Gas stoves.
- Tobacco smoke
- Generators and other gasoline powered equipment
Ozone (O3) is a triatomic substance composed of three atoms of oxygen Ozoneexists both in the Earth's atmosphere and on the ground The concept of good and badozone is given depending on where it is found Good ozone appears naturally in theupper atmosphere, also known as stratospheric ozone, where everyone knows thatthanks to its presence, it forms a protective layer, shielding the Earth Soil fromharmful ultraviolet rays from the sun On the contrary, ground-level ozone is badozone, a harmful substance that pollutes the air and is the main ingredient that creates
"smog".
A class of substances found in emissions or ambient air is referred to as volatileorganic compounds, or VOCs In other phrases, these compounds exhibit lowpropensity for self-binding (volatility) and limited solubility in aqueous environments
(organicity) Volatile organic compounds (VOCs) are released into the atmosphere inthe form of gases, originating from items that are frequently utilized such as
construction materials, maintenance machinery, and cleaning agents Several volatileorganic compounds (VOCs) have been recognized as posing possible hazards tohuman well-being, particularly when exposed to them over a prolonged amount oftime Comparable to particle matter, the concept of "Volatile Organic Compounds"(VOCs) does not pertain to one material, but rather encompasses a collection ofchemicals that have comparable chemical characteristics There exists a multitude ofthese compounds, with some instances frequently encountered inside architectural
structures, such as:
e Benzene can be found in several sources such as cigarettes, paint thinner,
deodorizers, air fresheners, and furniture polish
e Formaldehyde is a type of chemical that may be often found in various
merchandise, including disinfectants, furniture upholstery, carpets, and plywood
Trang 20e Ethylene glycol is a chemical compound that may be frequently discovered in
many cleaning agents, products for personal care, and fragrances
e Methylene chloride is an organic substance that may be often found in many
consumer products such as spot removers, dry cleaned garments, fabric cleaners,commercial solvents, and air conditioner refrigerants
e Toluene is a chemical compound that finds widespread application in several
industries, including paint manufacturing, metal cleaning, and glue production
Due to the immense amount of volatile organic compounds (VOCs) present,continuous monitoring of all VOCs is unfeasible Consequently, the adoption of ameasurement called Total Volatile Organic Compounds (TVOC) was put in place tomeasure the whole quantity of VOCs present inside of a certain area The definition
of "Total Volatile Organic Compounds (TVOC)" is utilized to refer to a collection ofvarious Volatile Organic Compounds (VOCs) to provide a comprehensiverepresentation of the whole range of contaminants When utilizing an air qualitysensor capable of detecting volatile organic compounds (VOCs), the recorded
measurements will be reported as total volatile organic compounds (TVOC)
expressed as a singular value denoted in parts per billion (ppb) or milligrams percubic meter (mg/m3)
1.3 The importance of monitoring air quality
After the first two parts, we have had an overview of air pollution, as well as thegases and substances that pollute the air In this section, we will learn the importance
of measuring air quality and the effects of pollutants on human health Measuring air
indicators, including measuring the concentration of each substance alone or
measuring based on a certain index, helps people be more proactive in taking timelypreventive measures such as wearing protective clothing, masks with highantibacterial activity, or if indoors, you can turn on air conditioning, air purifiers, etc
In addition, measuring air indices also helps climate and environmental experts
Trang 21analyze and predict whether air trends are good or bad over a determined period inthe future.
1.3.1 Effects of mainly indoor air pollutants on human health
1.3.1.1 PM2.5
Individuals with cardiovascular disorders, pulmonary diseases, respiratorydiseases, advanced age, and children are classified as high-risk individuals who
exhibit heightened vulnerability to the impacts of fine particulate matter, particularly
during physical exertion or strenuous activities Engaging in exercise or physicalactivities leads to an elevation in heart rate, necessitating an increase in breathing tofacilitate the metabolism of additional oxygen required to support the heart.Therefore, the fraction of inhaled fine dust particles will also increase
Individuals suffering from cardiovascular or respiratory ailments, such as coronaryartery disease, atherosclerosis, congestive heart failure, asthma, or chronicobstructive pulmonary disease, have a heightened vulnerability to the exacerbating
effects of fine particulate matter on their health Should be more unfavorable
Moreover, individuals with diabetes are susceptible to the impact of these tiny dustparticles due to their heightened likelihood of having pre-existing cardiovascularconditions Multiple studies indicate a direct relationship between higher levels ofparticulate matter and an increase in hospitalization rates among elderly individuals.1.3.1.2 CO
Carbon monoxide (chemical symbol: CO) is an invisible gas that lacks color, scent,and flavor The gas in question possesses a lower density than that of air, around 0.97.The combustion of organic substances is the primary origin of carbon monoxide gas.Citing research by the author group Hiroshi Kinoshita, Hilya Tiirkan, SlavicaVucinic, Shahab Naqvi, Rafik Bedair, Ramin Rezae, Aristides Tsatsakis in the articletitled "Carbon monoxide poisoning" [9]: Every year there are about 2000-5000 deathsbecause of CO poisoning in Japan Even in Vietnam, there have been tragic cases
Trang 22such as: "Family of 6 killed by carbon monoxide from generator" (from VNExpress)[10] This is evidence that CO poisoning cannot be taken lightly.
e Dangers of CO:
Carbon monoxide is harmful to human health because it binds to red blood cells inthe blood, reducing their ability to carry oxygen in the blood The most commonsymptoms of exposure to CO include fatigue and dizziness due to insufficient oxygensupply to the brain
It is noteworthy that indoor carbon monoxide (CO) levels can be significantlyhigher than those found outside Common sources of carbon monoxide (CO) inresidential settings include gas stoves, fireplaces, and cigarette smoke, particularlywhen Vietnamese families have smoking relatives within Additionally, vehicleemissions may also contribute to indoor CO levels, which may not meet quality
standards
1.3.1.3 CO2
Carbon dioxide is a naturally existing gas inside the Earth's atmosphere [25].Nevertheless, human activities have resulted in the release of excessive amounts of
greenhouse gases into many habitats, including the natural environment, residential
spaces, and industries The overabundance of demand for petroleum, diesel, andnatural gas engenders a significant emission of carbon dioxide (CO2), henceexacerbating air pollution while contributing to the observed trend of climate change.The rate at which humans are generating waste exceeds the earth's capacity toefficiently remove and process it Consequently, scholarly investigations havediscovered a correlation between elevated levels of carbon dioxide (CO2) andrespiratory ailments such as asthma
The feeling of lethargy, fatigue, and depletion that one may experience during atwo o'clock meeting does not necessarily indicate the beginning of tiredness Theelevated levels of carbon dioxide (CO2) within the workplace may be a contributingelement to the problem at hand In 2012, a study revealed a strong correlation between
Trang 23the existence of crowded and overwhelmed meeting rooms and the cognitiveperformance and decision-making abilities of individuals High levels of carbon
dioxide (CO2), commonly seen in enclosed workplace conference rooms, can cause
drowsiness, nausea, and headaches in people The primary factor often attributed toinadequate ventilation is usually cited Carbon dioxide (CO2) concentrations in anormal outdoor setting typically vary from 350 to 400 parts per million (ppm) In a
normal office setting, carbon dioxide (CO2) levels between 350 to 1,000 parts per
million (ppm) are considered acceptable However, it is common for carbon dioxide(CO2) levels to exceed these limitations within the boundaries of a conference room
Heightened levels of carbon dioxide (CO2) have been observed to have adverseimpacts on both cognitive function and general well-being People have diversereactions to increased levels of the gas People may have experienced situationswhere their cognitive functions were compromised, leading to a condition of mentaldisorientation or an inability to focus on a certain task The occurrence of elevated
carbon dioxide levels may initially be present as headaches, reduced cognitive
concentration, and fatigue The individual's decision-making ability and cognitivefunctions may also be adversely affected For instance, a study conducted in aworkplace found that persons who were exposed to carbon dioxide (CO2) levels of2,500 parts per million (ppm) encountered difficulties in doing tasks such as basicproofreading or answering simple mathematics problems The existence of carbondioxide (CO2) in the surroundings can also lead to decreased efficiency and increasedrates of absenteeism in both professional and educational environments
1.3.1.4 VOCs
Certain volatile organic compounds (VOCs) possess significant potential forharm, whereas others exhibit a lesser degree of hazard Typically, there are severalsigns that should be monitored [23]:
e - Ocular, nasal, and pharyngeal irritation
e Headaches and nausea
Trang 24e Impaired movement
e = Fatigue
e Dizziness
e = Allergic skin reactions
Every single one of these indicators are symptomatic of exposure to volatileorganic compounds (VOCs), so being able detect these indications can serve as anearly warning system for the presence of them Prolonged or substantial exposure tovolatile organic compounds (VOCs) has a tendency to adversely impact human health
by inflicting harm on vital organs such as the kidneys, liver, and the nervous system,and by possibly contributing to the development of cancer
Additionally, a further ambiguous issue related to indoor volatile organic
compounds (VOCs) is the phenomenon known as sick building syndrome (SBS).Sick Building Syndrome, also referred to as SBS [24], is a recently recognizedmedical syndrome that encompasses a range of non-specific symptoms experienced
by individuals within a building It is strongly associated with indoor levels of Total
Volatile Organic Compounds (TVOCs) SBS patients exhibit a spectrum of severity,ranging from moderate to severe, and the precise etiology of this condition remainsuncertain
1.3.1.5 O3
The indoor sources of ozone include:
e Photocopiers
e Home electrical appliances: A lot of home products, like fridges, air
conditioners, dish washers, veggie washers, and more, have ozonegenerators, which are also called ionizers, built right in
Ozone at ground level has an impact on human health Since ground-level ozone(or tropospheric ozone) is a chemical reaction between oxides of nitrogen (NOx) andvolatile organic compounds (VOC) under sunlight The chemical reaction chain is asfollows (Fishmann and Crutzen, 1978) [7]:
10
Trang 25CO + OH — CO2 +HH+0O2+M—HO2+M
HO2 + NO — NO2 + OH
NO? + hy — NO + OO0+0.+M—03+M
CO + 202 — CO2 + 03Depending on the level and concentration of exposure, ozone can: [8]
e Causes cough and sore or itchy throat
e Impede the ability to inhale deeply and forcefully, resulting in discomfort
during deep breathing
e Inflammation and damage to the respiratory tract.
These effects are also found in healthy people but will be more serious in peoplewho have/are suffering from respiratory diseases This leads to us being able to missmore school, increase the frequency of taking medication, and go to the doctor moreoften, and in more serious cases, it can lead to medical emergencies
1.4 Objectives and scope
After studying air pollution, gases that have negative impacts on human health,and their harmful effects, this chapter presents the purpose, approaches, orientation,and scope of the thesis
1.4.1 Objectives
Build an application to monitor air quality indicators (AQID and pollutant
concentrations At the same time, the application is a website, ensuring ease of use,
easy access The interface does not need to be too complicated and does not require
registration or login However, it must ensure that air indicators are displayed in real
time and can be notified to the user's device (mobile, PC, laptop, etc.) It is also
11
Trang 26necessary to ensure that the backend is built with a connection to the database to storeair measurement indicators Because this is a personal product, the budget will also
be limited, so it is necessary to ensure the cost factors of the products The product iscombined with IoT devices such as Arduino Uno chip [11], MQ sensors, SharpGP2Y1010AUOE PM2.5 measuring sensor [12], CO2 measuring sensor, the TVOC
CJMCU-811 CCS811, etc Regarding the application, both the UI part and the
backend part must be deployed in the production environment In addition, factorssuch as domain name and SSL certificate should also be considered
Figure 1 3: Arduino Uno micro-controller
(source: Arduino Official Store)1.4.2 Scope
Application used to measure indoor air index Pollutant gases considered for
measurement include CO, 03, TVOC, CO2, PM2.5 Gases used to calculate AQIindex: CO, O3, TVOC, PM2.5 In addition, the application measures temperature andhumidity as well
12
Trang 27Chapter 2 INDOOR AIR QUALITY
2.1 Introduction
The term "indoor air quality" ([AQ) describes the state of the air inside and around
structures such as buildings [19] It is the index that focuses on health effects thatresidents or occupants might experience soon after exposure or years later
The harmful effects of indoor air pollution can have immediate effects or leave
long-term sequelae if not promptly warned and treated
e In terms of immediate impact:
Certain health impacts may manifest rapidly following either a singular exposure
or repeated exposures to a pollutant The symptoms include ocular, nasal, andpharyngeal discomfort, cephalalgia, vertigo, and lethargy Typically, these acutesymptoms are of a transient nature and amenable to treatment In certain cases, thetherapeutic approach involves the implementation of a strategy that entails theremoval of an individual's contact with the origin of the contamination, providing that
it can be discerned Following exposure to some indoor air pollutants, individualsmay experience the onset, exacerbation, or deterioration of symptoms associated with
certain illnesses, such as asthma
The body's ability to react to toxic gases depends on a number of factors such asthe affected person's existing underlying medical conditions, age, gender, weight, etc.The response of individuals to pollutants might be contingent upon their individual
sensitivity, which exhibits significant variation across different individuals Certain
individuals may develop sensitization to biological or chemical contaminantsfollowing repeated or prolonged exposure
e In terms of long-term impact:
Some negative health effects will not show symptoms immediately but willgradually affect the internal organs in the body, at some point when the body isweakened or the organs in the body are damaged When destroyed enough, those
13
Trang 28diseases begin to develop and pose a danger to humans, with symptoms that may notappear until years after exposure Those symptoms can encompass respiratorydisorders, cardiovascular diseases and even cancer In terms of severity, thesediseases can cause weakness in the patient's body, or leave behind underlying diseasesthat are difficult to completely treat such as asthma, etc., causing the patient to have
to be re-examined many times It is advised to make efforts towards enhancing the
indoor air quality within one's residence, even in the absence of apparent symptoms
exposure.
This index is distributed on a scale based on values ranging from 0-500 As the
Air Quality Index (AOI) value increases, there is a corresponding increase in thequantity of air pollution, which in turn raises concerns about public health Forinstance, an Air Quality Index (AQI) reading of 50 signifies favorable air quality
conditions with minimal or negligible implications for public health Conversely, an
AQI reading of 300 indicates exceedingly perilous air quality, posing the risk ofsevere health consequences for all individuals The primary objective of the Airpollution Index (AOD) is to facilitate comprehension of the implications of local airpollution on public health
Depending on the value range, AQI is divided into 6 categories of levels ofconcern For each category, we can conclude the description of air quality andpropose prevention Figure 2.1 shows levels of concern related to AQI values and can
be explained as following:
14
Trang 29Daily AQI Color Levels of Concern Values of Index Description of Air Quality
Unhealthy for 101 to 150 Members of sensitive groups may
Sensitive Groups experience health effects The general public
is less likely to be affected.
Very Unhealthy 201 to 300 Health alert: The risk of health effects is
increased for everyone.
Hazardous 301 and higher | Health warning of emergency conditions:
everyone is more likely to be affected.
Figure 2 1: AQI Category and Levels of Concern(source: https://www.airnow gov/agi/aqi-basics/ )
Good:
e Green: Color code: RGB (0, 228, 0)
e AQI value ranges from 0 to 50 Air quality is satisfactory and does not affect
health
Moderate:
e Yellow: Color code: RGB (255, 255, 0)
e The value of the Air Quality Index (AQI) spans from 51 to 100 The air quality
is deemed satisfactory, although pollution within this range can result inmoderate health issues for a limited portion of the population Individuals withheightened susceptibility to ozone or particulate pollution may encounterrespiratory complications
Unhealthy for Sensitive Groups:
e Orange: Color code: RGB (255, 126, 0)
15
Trang 30When the Air Quality Index (AQI) falls between the range of 101 to 150,individuals belonging to sensitive groups may encounter health consequences,but the impact on the broader population is expected to be minimal.
Unhealthy:
Red: Color code: RGB (255, 0, 0)
Health impacts might potentially manifest in individuals when Air Quality
Index (AQD levels range from 151 to 200 Individuals belonging to vulnerable
populations may potentially encounter more severe health consequences
Very Unhealthy:
Purple: Color code: RGB (143, 63, 151)
It is necessary to issue a health warning whenever the Air Quality Index (AQD
falls within the range of 201 to 300, as this indicates that humans may be
exposed to more severe health risks
Hazardous:
Maroon: Color code: RGB (126, 0, 35)
When the Air Quality Index (AQDD) surpasses the threshold of 300, it prompts
the issue of health advisories cautioning citizens about the emergence ofhazardous circumstances The likelihood of significant health consequences isheightened for the whole population
Color R G B Cc M Y K
Maroon
16
Trang 31Figure 2 2: AQI color formulas in RGB (red, green, blue) and CMYK (cyan,
magenta, yellow, black)(source: “Technical Assistance Document for the Reporting of Daily Air Quality —
the Air Quality Index (AOl)”, US EPA, September 2018)
2.3 AQI Scale for Different Pollutants
Not only is the AQI index measured independently to indicate air quality, but eachgas also has its own AQI scale This scale is used to show the correlation between theconcentration of gases and their level of danger to humans In addition, themeasurement scale for each substance also helps determine the overall AQI, whichwill be presented in the following section
Within the scope and purpose of this project, we are only interested in and lookingfor the measurement scale of CO, O3, TVOC, PM2.5 gases as presented in section
"1.4.2 Scope"
CO AQI scale: Concentration to AQI
95 Mi ng ca) 30.5 40.5 50.5 Conc.0 45
Figure 2 3: CO AQI Scale [29]
Index Values Color coding AQI Category — oom
0-50 m Good 0-62.5 51-100 || Moderate 62.5 - 101.5
101-152 m lor Senate Coops 101.5 - 152.5
Trang 32Index Category Index Value TVOC (ppb)
Figure 2 6: PM2.5 AQI Scale [29]
Conci = Input concentration for a given pollutant.
ConcLo = The concentration breakpoint that is less than or equal to Conci.
ConcHi = The concentration breakpoint that is greater than or equal to Conci.
18
Trang 33AQILo = The AQI value/breakpoint corresponding to ConcLo.
AQIHI = The AQI value/breakpoint corresponding to ConcHi.
AQI = The pollutant AQI value and is rounded to the nearest integer.
The general AQI is a function that take air pollutants as its parameter and require
a minimum of three pollutants must be present, of which one should be either PM10
or PM2.5, AQI ranging from 0-500 has different concentrations for each pollutantand has health effects accordingly [22] The highest of each pollutant AQI value (alsoknown as the worst AQI) is the composite AQI and is also rounded to the nearestwhole number
AQI = max(AQIpm2s, AQIo3, AQIc,, -) (2 2)
2.5 General problem solving approach
To solve the air quality problem, the first approach is to study air quality and airpollutants After searching all information about air quality online, from many papers,and websites, it leads to the concept of Air Quality Index (AQT) and how to calculateAQI based on the formula (2.1) After the first approach, some pollutants that impact
on human health will be studied to select what pollutants need to be measured Thecriteria for choosing which pollutants need to be based on the actual conditions ofIoT devices, the ability to find and purchase existing sensors on the market that canserve to measure the concentration of pollutants It must also be based on theeconomic conditions of the development team Based on the above conditions, IoTdevices are used to measure the substances listed in the following table:
Device name Measured Pollutant
Sharp GP2Y1010AU0F PM2.5
MQ 7 CO
MQ131 03CCS811 TVOC
19
Trang 34Table 2 1: IoT device name list
After buying IoT sensors according to the above list and ready to measurepollutant, we need to calculate the AQI of each pollutant based on the formula (2.1)above Then apply the breakpoint table related to the AQI value to have the Level OfConcern of each pollutant which is mentioned The composite AQI is then can bereferred to as the maximum value of 4 pollutants AQI based on the formula (2.2)
The complete IoT devices then need to be connected to the backend system tosend the measurement value of each pollutant and be stored in our database usingMongoDB The data measured from IoT sensor need to be displayed realtime on theFrontend So, the technology that helps to achieve realtime is Socket IO because it is
compatible to NodeJS techstack
The application also has the ability to predict the future AQI value using it sothat user can prepare in advance for their planning
2.6 Related Work
To deal with the global pollution situation, in which the biggest factor is human
activities, there is currently much research both in theory and in practical applicationthat aimed at providing solutions to limit and resolve the above situation Above all,developed countries with economic potential are constantly developing moreadvanced equipment to measure and warn human beings
According to the research work of the author group S Kaivonen and E C -h.Ngai [13], they built a real-time air quality monitoring system deployed on buses of
a company owned by Gamla Uppsala Buss AB Pollutants used for monitoringinclude CO and NO2 The problem they need to solve is to find bus routes that passthrough the designated area Then data from the aspmote Plug & Sense sensors! sent
to GreenloT cloud via POST HTTP request via 4G network access The data is then
20
Trang 35assembled as JSON and sent to the MQTT Broker The MQTT Broker's task is tocreate a topic for MQTT subscribers to add new data to the MongoDB Database.
As mentioned, developed countries and some organizations have been concernedabout air pollution Notably, the United States established the Air QualityManagement Project (AMQP), a project in which the United States will install airpollution measurement stations in other countries and territories (and the UnitedStates itself) However, for Vietnam projects, the data seem to no longer be updated.One shortcoming of this project is that they only care about detecting PM2.5 gas(while other air indicators should also be concerned) Monitoring current and past air
index is quite difficult for developing countries
(23) AirNow Department of State
pall z L2 vier Name 2
(MA oman 5 NGHI nes
: (wa) te Note: Vaiues above 500 are considered Beyond the AOI Follow
ấn soon Ae h recommendations for the Hazardous category Additional information
ig &® Malay on reducing exposure to extremely high levels of particle pollution is
T P Truong et al [14] propose and design a system which is named
Environmental Monitoring System (EnMoS), an IoT-Based Air Quality Monitoring
System that conducts PM2.5, PM10, CO2, temperature, and humidity forconsideration air quality The system uses LoRa (Long-Range) wirelesscommunication technology to enable the advancement of a data communicationnetwork across a vast geographical expanse Also, the system consists of three
21
Trang 36sensing nodes and using a gateway to validate the viability of a LoRa network Thestrength of this research is that it uses advanced, highly accurate sensors such as
SDS011 for PM2.5 and PM10, MH-Z19 for CO2, CJMCU4541 for CO, NO2
Furthermore, it can be installed and used in a vast area (such as town or alley) byusing LoRa network However, implementing a large system takes a lot of time to
complete and the cost is quite large
G I Drewil et al [15] propose LSTM deep learning method for predicting airquality for the next day and take 4 types of pollutants PM10, PM2.5, CO, and NOxinto consideration
2.7 Required technology for developing application
From the theoretical basis of learning about air pollution and related researchworks on IoT, system building and machine learning, the proposed system isgradually formed This section will provide the most general perspective of the
application to be built
The product for end users will include an lơ device with integrated air quality
sensors, using the MQTT protocol and through the MQTT broker to transmit data to
the Backend
For the Backend side, the system needs to deploy API endpoints to provide data
to the Frontend Besides, word requires users to receive measurement data from
MOTT in real time
From the above basic requirements, frameworks and technologies will be
deployed for the Backend as follows:
Technology Purpose Reason
- Easy to implementNodeJS, ExpressJS | API, backend development | - Taught at university
- Many libraries support
22
Trang 37- Good scalability and
integration
SocketIO Realtime development
- Good integration forNodeJS application
specifically for NodeJS
- Effective for unstructured
data Especially data aboutweather and atmosphere
- Have free plan on usingMongo Atlas Cloud
- Easy to add moredocument’s column
- Define schema forMongoDB collection
- Provide abstraction ways to
work with MongoDB modelfrom various built-in
function such as find,findOne, deleteOne, etc
- Additional features:
Instance or Static method
which allows to create
function of model based onpersonal need
Table 2 2: Backend Technologies
23
Trang 38For the Frontend side, it is required to have a page for customers to view air qualityindicators, in addition, it must show the air quality index of air pollutants including
CO, 03, TVOC and PM2.5 The air quality index is displayed in real time and thereshould be a graph showing this index over time The client page needs to be simple,easy to use and especially does not require registration or login so that users canaccess and use it immediately
Besides, on the user side, it is recommended to develop a dashboard page so thatusers can view details of substances, according to timelines and other settings Fromthe above requirements, we can deduce the necessary technologies to develop clientpages and dashboards as table follows:
Technology Purpose Reason
- Speeds up the Document ObjectModel (DOM) in the applicationprogramming interface (API)
through the use of a virtual DOM
ReactJS Dashboard page
- Large support from enormouscommunity
- Reusability
- Compatible with Javascript
- Using plain Javascript gives
opportunities to custom webHTML, CSS,
; Basic client page component, responsive, animationJavascript
and able to use many otherlibraries
ChartJS HTML library for chart - Beautiful UI
SocketIO HTML library for using | Compatible with SocketIO using
websocket at frontend side | in Backend side
Table 2 3: Frontend Technologies
24
Trang 392.7.1 Reason for building system
- Air pollution is a significant risk factor for a number of health conditions
including respiratory infections, heart disease, and lung cancer This system canprovide real-time data about air quality, helping individuals make informeddecisions about their outdoor activities and overall lifestyle
- Monitoring air quality can help identify sources of pollution and can be used to
enforce environmental regulations It can also provide valuable data for researchand development aimed at reducing air pollution
- Ease of Access: The proposed system does not require registration or login,
making it easily accessible for all users This can encourage more people tomonitor air quality and become more aware of their environment
- Learn about air pollution, research on substances that provide knowledge about
measures to prevent situations that cause air poisoning
- Inaddition to learning about air pollution, implementing system construction also
provides technical knowledge, how to use sensors, how to wire and connect IoTcomponents In addition, the application of machine learning also brings usefullessons on training machine learning models to apply to solving practical
problems
2.7.2 Reason user will choose this application
- Free: IoT devices used to measure air pollution are available for users to use for
free, in addition to the web and dashboard
- | The measuring device is easy to carry anywhere, flexible in use both indoors and
outdoors The compact device can be placed at home or at a desk or in office
buildings
- The data collected from the measurements can be used for research on air
pollution during emergencies Because in Vietnam today, air monitoring stationsare often located in large headquarters, not on small scales such as householdsand residential areas, while these areas are often crowded with people
25
Trang 40- In addition to displaying the air quality index, the product also provides
knowledge about air pollution and preventive measures thanks to support
features such as: Guidebook, Solution Tooltip
26