SlideShare a Scribd company logo
1 of 83
Download to read offline
0
DAR ES SALAAM INSTITUTE OF TECHNOLOGY
ELECTRONICS AND TELECOMMUNICATIONS DEPARTMENT
BACHELOR OF ENGINEERING IN ELECTRONICS AND TELECOMMUNICATION
ENGINEERING
SENIOR PROJECT II
PROJECT TITLE: WIRELESS SENSOR NETWORK FOR REAL TIME AIR
QUALITY MONITORING AT DIT DAR ES SALAAM CAMPUS
PROJECT TYPE: PROBLEM SOLVING
NAME OF STUDENT: NURU D. KESSY
ADMISSION NO: 160640710788
SUPERVISOR NAME:ASINTA MANYELE, PHD
JULY 2019
i
DECLARATION
I, NURU D. KESSY, student at the Dar es Salaam Institute of Technology (DIT), pursuing
bachelor of Electronics and telecommunications engineering, declare to the best of my
knowledge that the project presented here as a partial fulfillment of bachelor’s degree in
Electronics and telecommunication engineering, is my original work and has not been copied
anywhere or presented elsewhere, except where it has been unequivocally indicated with
reference(s).
CANDIDATE’S NAME SIGNATURE DATE
NURU D. KESSY ............................. ........................
ii
CERTIFICATION
As the candidate’s supervisor, I have approved this project report for submission.
Supervisor’s Name: Asinta Manyele (PHD)
Signature......................................
Date..............................................
iii
ABSTRACT
DIT Dar es Salaam campus environment is located at the centre of Dar es Salaam city.
Moreover it is located at the middle of highly congested roads; Morogoro road, Bibi Titi
Mohamed and Aly Khan Road. This being the case the environment of DIT is likely to be
highly subjected to poor air quality mainly due to the effect of green gases emitted by moving
motor vehicles. Poor air quality at DIT is also contributed by construction activities of the
nearby buildings. Hence, the lives of people at DIT could be vastly exposed to some dangerous
diseases like lung cancer and Tuberculosis by inhaling polluted air.
In this project report, WIRELESS SENSOR NETWORK FOR REAL TIME AIR QUALITY
MONITORING is proposed at DIT Dar es Salaam campus. In this proposed system different
sensing nodes will be placed at different places within DIT campus and there will be a single
network coordinator/gateway. Using this proposed system changes in air will be measured in
real time and the resulting data will be uploaded to a cloud server. By using an android
application individuals will be able to access this real time air quality information mapped into
DIT Google map.
The proposed system has been tested and from the results it has been observed that; during busy
hours there is a higher content of Carbon monoxide (CO) and Nitrogen dioxide (NO2) in the
areas near Morogoro road compared to any other area in the campus. Moreover, during daytime
areas around Block III, Block IV and the football ground have observed to have higher contents
of PM10, PM2.5 and Carbon dioxide (CO2) compared to any other area of the institute’s campus.
Practical implementation of the proposed system will enable individuals at DIT community to
have access of air quality information at their fingertips. Moreover the authority will have a
proper record of air quality data which can be used in further air quality studies and researches.
Furthermore, this system can be extended to a broader network with the purpose of monitoring
air quality in larger areas.
iv
ACKNOWLEDGEMENT
My heart is filled with unexplained joyful cheers just because I have the best parents anyone
could ever wish to have. My parents have always been beside me, to encourage and uplift me,
even at times when school felt like walking on burning charcoal. I have to admit, I have made it
this far because of my mother’s endless prayers.
Sincere love and gratitude all extended to my Godmother, Edith Mbatia. Aunt, your everlasting
prayers, support and scolding altogether have molded this hardworking lady in me. And just so
you know, you are my role model.
My one and only best friend, through thick and thin, one who has always pushed me beyond my
limits, one who made me realize I could always do better than I thought. My friend, advisor and
most definitely a shoulder to cry on, Iku, I am really short of words to express my gratitude, all I
can say is, I am grateful.
Special thanks to my project supervisor, Asinta Manyele, PHD. You have always been there to
assist and support me in each and every step of my project. You actually guided me to find a
project title when it seemed like the most challenging task I ever encountered. I will forever be
grateful and appreciative, because it is through this project title that I will be granted a degree.
Lastly, my extended appreciation goes out to every genuine soul that has been there to support
me and add constructive inputs to my project. I very grateful and your support is highly
acknowledged.
v
TABLE OF CONTENTS
DECLARATION .........................................................................................................................................i
CERTIFICATION....................................................................................................................................... ii
ABSTRACT............................................................................................................................................... iii
ACKNOWLEDGEMENT ......................................................................................................................... iv
LIST OF FIGURES..................................................................................................................................... x
LIST OF ABBREVIATIONS ................................................................................................................... xii
CHAPTER ONE:INTRODUCTION ..........................................................................................................1
1.1 Background In formation ..............................................................................................................1
1.2 Problem Statement ........................................................................................................................2
1.3 Objectives......................................................................................................................................2
1.4 Significance of the project.............................................................................................................2
1.5 Limitation......................................................................................................................................3
1.6 METHODOLOGY........................................................................................................................3
1.6.1 Literature review ........................................................................................................................3
1.6.2 Data Collection...........................................................................................................................3
1.6.3 Data Analysis .............................................................................................................................4
1.6.4 System design.............................................................................................................................4
1.6.5 Circuit Simulation ......................................................................................................................4
1.6.6 System implementation and prototype testing ...........................................................................4
1.6.7 Report writing ............................................................................................................................4
1.7 Chapter Summary..........................................................................................................................5
CHAPTER TWO:LITERATURE REVIEW ..............................................................................................6
2.1 Introduction...................................................................................................................................6
2.2 Background information................................................................................................................6
2.3 International Air Quality Index (AQI) ..........................................................................................7
2.4 How AQI is calculated ..................................................................................................................9
2.5 Existing systems..........................................................................................................................10
2.5.1 HORIBA Air Quality Monitoring System ...............................................................................10
2.5.2 A Wireless Sensor Network for Air Monitoring System in Industrial Areas...........................11
vi
2.6 Existing methods in Tanzania [9]................................................................................................13
2.6.1 Indoor laboratory testing unit...................................................................................................13
2.7 Embedded system for roadside air quality monitoring at DIT BRT station................................14
2.8 Reasons for Proposed System .....................................................................................................16
2.9 Chapter Summary........................................................................................................................16
CHAPTER THREE:THE PROPOSED SYSTEM....................................................................................17
3.1 Introduction.................................................................................................................................17
3.2 Block Diagram of the Proposed System......................................................................................17
3.3 Operation of the Proposed System ..............................................................................................19
3.4 Advantages of the Proposed System ...........................................................................................20
3.5 Drawback of the Proposed System..............................................................................................20
3.6 Chapter Summary........................................................................................................................20
CHAPTER FOUR:DATA COLLECTION...............................................................................................21
4.1 Introduction.................................................................................................................................21
4.2 Deaths and health defects caused by poor air quality..................................................................21
4.3 Data for Air quality monitoring in Tanzania at large..................................................................22
4.4 Data collected from DIT Dar es Salaam campus ........................................................................25
4.5 Data Collected on the Requirements of the Proposed System ....................................................26
4.5.1 DIT campus..............................................................................................................................26
4.5.2 Wireless Sensor Networks in details........................................................................................27
4.5.3 Gas Sensors Available..............................................................................................................27
4.6 Chapter Summary........................................................................................................................28
CHAPTER FIVE:DATA ANALYSIS AND SYSTEM DESIGN............................................................29
5.1 Introduction.................................................................................................................................29
5.2 Sensing node ...............................................................................................................................29
5.2.1 Sensing unit..............................................................................................................................29
5.2.2 Control unit for the sensing node .............................................................................................30
5.2.3 Communication module ...........................................................................................................31
5.3 Gateway / Network coordinator ..................................................................................................32
5.3.1 Control Unit for the gateway / network coordinator ................................................................32
vii
5.4 Software Design ..........................................................................................................................33
5.4.1 Software Design for the sensing node......................................................................................34
5.4.2 Software Design for the gateway / network coordinator..........................................................34
5.4.3 Software Design for android application..................................................................................35
5.4.3.1 Android development............................................................................................................36
5.5 Location and positioning of the system.......................................................................................37
5.6 Overall circuit diagram................................................................................................................38
5.7 Conclusion...................................................................................................................................38
CHAPTER SIX:SIMULATION AND RESULT DISCUSSION .............................................................39
6.1 Introduction.................................................................................................................................39
6.2 Simulation Software....................................................................................................................39
6.3 Simulation Description................................................................................................................40
6.4 Simulation results and discussion................................................................................................41
6.4.1 Simulation of the sensing node ................................................................................................41
6.4.2 Simulation of the gateway/network coordinator ......................................................................42
6.4.3 Simulation of the android application ......................................................................................43
CHAPTER SEVEN:PROTOTYPE IMPLEMENTATION......................................................................46
7.1 Introduction.................................................................................................................................46
7.2 Printed Circuit Board Construction.............................................................................................46
7.3 Components Mounting and Connections ....................................................................................48
7.4 Prototype Performance Test ........................................................................................................49
7.5 Prototype Performance Testing Tools and Procedures................................................................49
7.6 Results and Discussion................................................................................................................49
7.7 Overall Results Discussions ........................................................................................................50
7.8 Chapter summary ........................................................................................................................52
CHAPTER EIGHT:CONCLUSION AND RECOMMENDATION...................................................................53
8.1 Introduction.................................................................................................................................53
8.2 Conclusion...................................................................................................................................53
8.3 Recommendation.........................................................................................................................53
REFERENCES ..............................................................................................................................................54
viii
APPENDIX A ...........................................................................................................................................57
Project time frame .....................................................................................................................................57
APPENDIX B ...........................................................................................................................................58
Project prototype budget ...........................................................................................................................58
APPENDIX C ...........................................................................................................................................59
Code for the control unit of the sensing node ...........................................................................................59
Code for the control unit of the gateway...................................................................................................63
Code for sending data from the gatewy to a cloud server .........................................................................65
ix
LIST OF TABLES
Table 2. 1: AQI in relation to health..............................................................................................8
Table 4. 1: Numbers of deaths and health problems related to poor air quality………………...21
Table 4.2: The six standard pollutants and their health effects……………………….………...22
Table 4. 3: List of interview questions and their corresponding answers from NEMC.............. 23
Table 4. 4: Tanzania national air quality standards..................................................................... 24
Table 4. 5: Communication technologies deployed in WSNs..................................................... 27
Table 4. 6: Different types of gas sensor available in the market and their properties ............... 27
Table 5.1: Comparison of available control units….…………………………………………...30
Table 5.2: Comparison of available communication modules………………………………….35
Table 5.6: Comparison of different control units and specifications required for the
gateway…33
Table 7. 1 Variation of output voltage at the sensing node circuit………………………….......50
x
LIST OF FIGURES
Figure 2. 1 HORIBA Air Quality Monitoring System................................................................ 11
Figure 2. 2 Block diagram of WSN for Air Monitoring System in Industrial Areas.................. 12
Figure 2. 3 Block diagram presenting the existing procedures of air quality measurement ....... 13
Figure 2. 4 Embedded system for roadside air quality monitoring at DIT BRT station............. 15
Figure 3. 1 Block diagram of the proposed system...…………………………………………...17
Figure 4.1 A picture of map showing congestion of roads around surrounding DIT...………...25
Figure 4.2 Satellite map of DIT showing total area of the campus….……………………….…26
Figure 5.1 Flow chart of software design for the sensing node…...……………………………34
Figure 5.2 Flow chart of software design for the gateway / network coordinator...……………35
Figure 5.3 Flow chart of android mobile application..…………………………………………36
Figure 5.4 Location of the sensing node and the gateway at DIT campus..……………………37
Figure 5.5 Overall circuit diagram to be simulated……………………………………………..38
Figure 6.1 Complete simulation circuit for the proposed system…………………………….....40
Figure 6.2 Simulation results of the proposed system………………………………………......41
Figure 6.3 Simulation of the sensing node…………………………………..………………….42
Figure 6.4 Simulation of the gateway / network coordinator………..……………………….....43
Figure 6.5 Simulation of android application displaying amounts of pollutant gases from
specific node………………………………………………………………………………….....44
Figure 6.6 Simulation of android application showing real time data of temperature and
humidity from the internet………………………………………………………………………45
Figure 7.1 PCB layout of the sensing node……………………………………………………..46
Figure 7.2 PCB layout of the gateway………………………………………………………….47
xi
Figure 7.3 3D layout of the sensing node……………………………………………………...47
Figure 7.4 3D layout of the gateway circuit………………………………………………...…48
Figure 7.5 Complete circuit of the sensing node………………………………………………48
Figure 7.6 Complete circuit of the gateway………………………………………………...…49
Figure 7.7 Sensing node prototype fixed at Block A………………………………………….50
Figure 7.8 Average results obtained from sensing node I……………………….………….....51
Figure 7.9 Average results obtained from sensing node II………………………………….....52
xii
LIST OF ABBREVIATIONS
BRT
BLE
Bus Rapid transit
Bluetooth
CH4 Methane
CO Carbon monoxide
CO2 Carbon dioxide
CEM Continuous Emission Monitoring
DIT Dar es salaam Institute of Technology
GSM Global System for Mobile
H2S Hydrogen Sulphide
NO Nitrogen Oxide
NO2 Nitrogen dioxide
PM Particulate Matter
SO2 Sulphur dioxide
UV Ultra Violet
WHO
UART
WSN
SDGs
SOC
PCB
World Health Organization
Universal Asynchronous Receiver Transmitter
Wireless Sensor Network
Sustainable Development Goals
System On Chip
Printed Circuit Board
1
CHAPTER ONE
INTRODUCTION
This chapter highlights the challenge and effects of poor air quality all around the world.
Moreover, this chapter outlines the problem of poor air quality at DIT Dar es Salaam campus.
Furthermore, objectives and significance of this project are also stated in this chapter. This
chapter also gives an overview of step by step procedures which will be taken upon
implementation (Methodology) of wireless sensor network for real time air quality monitoring
at DIT Dar es Salaam campus. Meeting the objectives of this project with accuracy highly
depends upon proper fulfillment of each of the below mentioned methods.
1.1 Background In formation
Air pollution is one of the very challenging issues across the globe. The most recent WHO
report outlines that an average 4.2 million deaths occur every year as a result of exposure to
ambient (outdoor) air pollution. And moreover 91% of the world’s population lives in places
where air quality exceeds the WHO guideline limits [1]. Air pollution in urban cities is mostly
caused by emission from industries and combustion of fossil fuels, like coal and oil for
electricity and road transport.
Being one of the global challenges, maintaining good air quality is one of the global agenda as
stated in goal eleven (11) of the Sustainable Development goals (SDGs), “Make cities and
human settlements inclusive, safe, resilient and sustainable” [2]. On the way to accomplishing
SDG eleven (11), this proposed title plays a part of monitoring air quality for the purpose
posing awareness to DIT community and storing data which will enhance further researches on
air quality.
There are many factors that contribute to air pollution at DIT Dar es Salaam campus including
transportation and construction activities taking place in the nearby buildings. Among these,
burning of fossil fuels in motor vehicles is among the most significant contributors to air
pollution. Transportation is the largest contributor to emissions of carbon monoxide and
nitrogen oxides (NOx) and a major contributor to Volatile Organic Compounds (VOCs).
Transportation also produces particulate matter, a component of smog and a cause of respiratory
and breathing problems. [3].
2
It is with facts that, there is a major need for air quality monitoring at DIT Dar es Salaam
campus in order to obtain proper data for the purpose of community awareness and further
scientific researches with the aim of controlling air pollution.
1.2 Problem Statement
DIT Dar es Salaam campus environment is located at the centre of Dar es Salaam city,
moreover it is located at the middle of highly congested roads, (Morogoro road, Bibi Titi
Mohamed and Aly Khan Road). This being the case the environment of DIT is likely to be
highly subjected to poor air quality mainly due to the effect of green gases emitted by moving
motor vehicles. Poor air quality at DIT is also contributed by construction activities of the
nearby buildings. Hence people at DIT could be at risk of encountering health problems by
inhaling polluted air.
1.3 Objectives
The objectives of this project are divided into two main categories, which are Main Objective
and Specific Objectives.
1.3.1 Main Objectives
The main objective of this project is to design and develop a real time air quality monitoring
system by using wireless sensor network for monitoring air quality at DIT Dar es Salaam
campus.
1.3.2 Specific Objectives
i. To establish design specifications
ii. To design the sensing unit
iii. To interface sensing unit with the control unit of the sensing node
iv. To program control unit and interface it with communication module at the sensing node
v. To program control unit and interface it with communication module at the gateway
vi. To develop an android application interfaced by Google map for the display of the
collected data
1.4 Significance of the project
At the end of this project the following benefits will be achieved;
i. People will have real time access of air quality information from their smart phones.
3
ii. The real time collected data from the system can further be used in researches with the
purpose of air quality control.
iii. This system can be used to monitor air quality in a very large area because it employs a
network of sensor nodes, hence the larger the network, the larger the area covered.
iv. The system is of a simple design and low cost, hence it can easily be implemented in any
other area
1.5 Limitation
The major limitation in this project lies in the means of communication system. The system is
expected to deploy ZigBee technology for communication of the sensor nodes. This is an
effective and a low cost technology however its effectiveness decreases with an increase in
distance. Hence for larger area monitoring, many senor nodes must be deployed.
1.6 METHODOLOGY
1.6.1 Literature review
This method involves searching for knowledge of topics directly related to this project through
different ways, including reading books, research articles, journal and online documents
amongst others. In search of literature about this project various sources have been observed to
state how challenging is the problem of poor air quality all around the world and DIT not being
an exception. Literature review has also revealed that there is no regular method of monitoring
air quality at Dar es Salaam city center and in Tanzania at large.
1.6.2 Data Collection
This step involves collecting information from different sources to verify whether there is really
a need to conduct this project. The data collected from DIT and the National Environmental
Management Council (NEMC) of Tanzania has proven the need of the proposed system.
Moreover this step involves collecting information which helps in solving the mentioned
problem through step by step accomplishment of the specific objectives. All data related to
designing of the system has been collected and it will be well revealed in chapter four of this
report.
4
1.6.3 Data Analysis
This part involves logical and scientific interpretation of the collected primary data. It also
involves manipulation of secondary data that yields to the design of the system and proper
realization of specification of components to be used in the system as a whole. Data analysis of
this project will be done as a second phase of the project.
1.6.4 System design
After the logical and scientific interpretation of the data, there comes designing procedure. The
results of data analysis are expected to be used in the whole process of designing the system.
Furthermore, each component in the system is to be selected based on the specifications
resulting from the data analysis. Designing of the system of this project will also be done as the
second phase of this project.
1.6.5 Circuit Simulation
This is where the designed system (circuit) is tested by the use of simulation software and
observation is made following the simulation results. Circuit simulation provides practical
feedback in designing of real world system henceforth allows determination of the correctness
and efficiency of the design before actual system construction. In this project circuit simulation
is expected to be done in the second phase.
1.6.6 System implementation and prototype testing
This part in general marks the climax in designing of the system. Implementation and prototype
testing involves the physical set up of components and integration of different blocks of system
to yield a whole system as stated by the main objective of the project. Moreover this is the part
of the project that will indicate the general success or failure of the designed system. This
method will as well be done in the second phase of the project.
1.6.7 Report writing
This is generally recording and gathering of information in each stage of the project. Report
writing is considered to be the most important part of this project because it generally states all
the necessary steps in implementation of this project and it outlines various literatures and
projects in attempt of solving this very same problem. Report writing of this project has been
5
divided in two phases. The first phase mainly includes introduction of the title, problem
statement, literature review and data collection. The second phase of this report will mainly deal
with data analysis and implementation of the prototype.
1.7 Chapter Summary
This chapter generally gives the background information, states the problem and explains the
objectives of this project. Moreover the significance of the project and its anticipated limitation
are also stated in this chapter. Briefing of each procedure that will be taken in the milestone of
accomplishing this project is as well explained in this chapter. Each of the explained procedures
will further be analyzed in the next chapters of this report. These next chapters are expected to
give more details by using references, figures, tables or any other means that will be seen fit to
enhance easy understanding of the reader.
6
CHAPTER TWO
LITERATURE REVIEW
2.1 Introduction
This chapter provides necessary information about the operation, features and limitation of the
previous works. Moreover, it gives the gap of development between existing system and the
proposed system. This chapter also provides basic knowledge of the whole concept of air
quality monitoring systems and a reason to implement the proposed system.
2.2 Background information
“Air quality” refers to the condition of the air within our surrounding. Good air quality pertains
to the degree which the air is clean, clear and free from pollutants such as smoke, dust and smog
among other gaseous impurities in the air. [4]
Air pollution can be defined as the presence of toxic chemicals or compounds in the air, at
levels that pose a health risk. In a broader sense, air pollution means the presence of chemicals
or compounds in the air which are usually not present and which lower the quality of the air or
cause detrimental changes to living organisms in a particular polluted air zone.
In Dar es Salaam city the major source of air pollution is the emissions from moving motor
vehicles, electricity generators and industrial activities. These sources emit a wide range of
pollutants classified under different categories that include Sulfur Dioxide (SO2), particulate
matter, Lead, Carbon Dioxide (CO2) and Carbon Monoxide (CO), Hydrogen Sulphide (H2S)
and Nitrogen Oxides (NOx). [5]
With all such a huge number of pollutants it is obvious that the lives of people breathing this air
at highly exposed to health implications such as lung cancer, asthmatic reactions and
tuberculosis to mention a few. [5] Since air pollution is a global issue, WHO has set some
standards for the air quality which are to be adhered worldwide, in the mission of protecting
lives of living organisms especially human beings. More details of air quality standards will be
provided in the next chapter of this report.
7
Air pollution being a global challenge, there exist several different systems at work in
monitoring air quality at different levels and in parts of the world. It is in acknowledging the
efforts made by different concerned engineers and scientists that this report admits that all the
systems/projects designed with the aim of monitoring air quality are of significant value and
definitely impact the improvement in solving air quality challenge.
2.3 International Air Quality Index (AQI)
The AQI set by the Environmental Protection Agency (EPA) of the USA is the one used as the
international standard index for air quality. This very same AQI standard is also used in
Tanzania. AQI can simply be compared to a yardstick that runs from 0 to 500. The higher the
AQI value, the greater the level of air pollution and the greater the health concern. For example,
an AQI value of 50 represents good air quality with little or no potential to affect public health,
while an AQI value over 300 represents air quality so hazardous that everyone may experience
serious effects. [6]
The purpose of the AQI is to help you understand what local air quality means to your health.
To make it easier to understand, the AQI is divided into six levels of health concern as shown in
Table 2.1.
8
Table 2.1: AQI in relation to health [6]
Each category in Table 2.1 corresponds to a different level of health concern:
 Good
The AQI value for your community is between 0 and 50. Air quality is satisfactory and
poses little or no health risk.
 Moderate
The AQI is between 51 and 100. Air quality is acceptable; however, pollution in this
range may pose a moderate health concern for a very small number of individuals.
People who are unusually sensitive to ozone or particle pollution may experience
respiratory symptoms.
 Unhealthy for Sensitive Groups
When AQI values are between 101 and 150, members of sensitive groups may
experience health effects, but the general public is unlikely to be affected.
 Ozone: People with lung disease, children, older adults and people who are
active outdoors are considered sensitive and therefore at greater risk.
9
 Particle pollution: People with heart or lung disease, older adults and children are
considered sensitive and therefore at greater risk.
 Unhealthy
Everyone may begin to experience health effects when AQI values are between 151 and
200. Members of sensitive groups may experience more serious health effects.
 Very Unhealthy
AQI values between 201 and 300 trigger a health alert, meaning everyone may
experience more serious health effects.
 Hazardous.
AQI values over 300 trigger health warnings of emergency conditions. The entire
population is even more likely to be affected by serious health effects.
2.4 How AQI is calculated
Different instruments are set up to collect air samples and physically measure SO2, NOx, PM,
etc.
these instruments measure concentration, i.e. unit less proportions (e.g. parts per million) or
mass per volume (e.g. micrograms per cubic meter) [6]
The goal is to convert the pollution concentration into a number between 0 and 500. The AQIs
of 0, 50, 100, 150…500 are referred to as “breakpoints.” Each AQI breakpoint corresponds to a
defined pollution concentration. The pollution concentration between the breakpoints is linearly
interpolated using the equation hereunder:
[6]
Where;
Ip is the index of the pollutant;
Cp is the rounded concentration of pollutant p;
BPhi is the breakpoint greater or equal to Cp
BPlow is the breakpoint less than or equal to Cp;
10
Ihi is the AQI corresponding to BPhi;
Ilow is the AQI corresponding to BPlow.
The AQI is determined by the pollutant with the highest index. For example, if the PM2.5 AQI
is 125, the PM10 AQI is 50, SO2 is 30, NOx is 50, and all other pollutants are less than 125, then
the AQI is 125–determined ONLY by the concentration of PM2.5.
Some several existing air quality monitoring systems are briefly explained in the following
section of this chapter.
2.5 Existing systems.
As mentioned earlier, there are several existing systems with the aim of monitoring air quality.
These systems are implemented at different levels and in different environments depending on
the particular objectives of the designed system. Below is a list of several existing systems with
a brief explanation of each.
2.5.1 HORIBA Air Quality Monitoring System
This system consists of an Air Quality Monitoring Station (AQMS) that measures metrological
parameters such as wind speed, wind direction, rainfall, radiation, temperature, barometric
pressure and ambient parameters. The system also integrates a series of ambient analyzers to
monitor the concentration of air pollutants (such as SO2, NOx, CO, O3, THC, PM, etc.),
continuously. HORIBA AQMS also provides mobile monitoring stations that are used to
monitor ambient conditions at multiple sites. [7]
The system is simply made of a moving vehicle with an embedded air quality monitoring
system. The data collected from the air quality monitoring system is directly sent to the central
office for further manipulation as seen in Figure 2.1.
11
Figure 2. 1 HORIBA Air Quality Monitoring System [7]
Advantages of HORIBA Air Quality Monitoring System
i) The measured data can be remotely monitored
ii) The system operates and sends data in real time
iii) The system is also used to monitor metrological parameters example wind speed,
wind direction and rainfall.
Disadvantages of HORIBA Air Quality Monitoring System
i) This system does not pose any indication to the community.
ii) Implementation of this system is intricate due to the use of moving vehicles
iii) The system design is complex
2.5.2 A Wireless Sensor Network for Air Monitoring System in Industrial Areas
In this system sensors such as MQ4, MQ9 and LM35 are used for detection of gases and
temperature. These sensors are connected to microcontrollers respectively and UART through
RF transmitter and receiver connected wirelessly cause communication between microcontroller
and lpc2148 for data transmission. [8] The lpc2148 interface with LCD display for the different
12
parameters and through ZigBee it is being transmitted to PC. A block diagram of this system is
shown in Figure 2.2.
Figure 2. 2 Block Diagram of WSN for Air Monitoring System in Industrial Areas [8]
Advantages of Wireless Sensor Network for Air Monitoring System in Industrial Areas
i) The major advantage of this system is capable of monitoring air quality of a large area
ii) The system allows remote monitoring of air quality
13
Disadvantages of Wireless Sensor Network for Air Monitoring System in Industrial Areas
i) The system design is relatively complex compared to the proposed one
ii) The system design is expensive since it requires separate nodes for separate sensors
iii) This system does not pose close indication to the community around the area
2.6 Existing methods in Tanzania [9]
Recently the existing systems and methods used for measuring and monitoring air quality in
Tanzania are based on laboratory tests. Samples are collected from pound sand of particular
places then taken for laboratory tests [10].The procedures are as seen in Figure 2.3.
Figure 2. 3 Block diagram presenting the existing procedures of air quality measurement
2.6.1 Indoor laboratory testing unit
Currently there many different instruments which are used in laboratories to measure the
concentration quantity of green gases but they are stationary and they are commonly used in
vast laboratories. These instruments are known as indoor air quality meters.
An indoor air quality meter is used in a confined space to prevent mold, to monitor CO2 levels,
or to detect other gas leaks [11].
Sample
collection unit
Laboratory
test unit
Data analysis
unit
Results
presentation
unit
14
Advantages of Laboratory based system
i. The system has relatively high degree of maintenance and no interferences from
outside air condition.
ii. The system has immunity to moisture interface.
iii. It is suitable in indoor ppm levels.
Disadvantages of Laboratory based system
i. The data recording mechanism is not of real time.
ii. Relatively of high cost because it requires drawing many samples and at different
places
iii. Most laboratory instruments have got detection limit.
iv. The laboratory instruments are not designed to store data after recordings.
v. The system is highly prone to human errors during reading and recording of the
results.
2.7 Embedded system for roadside air quality monitoring at DIT BRT station
This system is mainly made up of several sensors which are to detect changes in air quality, a
control unit which is used to process all the data received from the sensor and give indication by
the use of LEDs, then sends the particular data to a database for storage. The data is sent to the
database by a GSM communication module. Figure 2.4 below shows the block diagram of this
system. [9]
15
Figure 2. 4 Block Diagram for Embedded system for roadside air quality monitoring at DIT
BRT station
Advantages of Embedded system for roadside air quality monitoring at DIT BRT station
i) The system allows real time observation of air quality for passengers within DIT BRT
bus station
ii) The system sends data to the authorities, which helps in furthering researches related to
air quality monitoring.
Disadvantages of Embedded system for roadside air quality monitoring at DIT BRT
station
i) This system is only limited to air quality monitoring of one small specific area.
ii) The system used GSM communication as means of sending information to the
authorities. For real time monitoring, this could be expensive because air changes are
prone to happen every now and then, hence updates will also be required.
16
2.8 Reasons for Proposed System
There is an enormous need for air quality monitoring in Dar es Salaam city due to a vast
increase in number of moving motor vehicles and urban industries. Several methods are used in
monitoring air quality in Tanzania but all of them tend to have some limitation and hence
restrict the effectiveness of air quality monitoring.
The proposed system is mainly an advancement of the “Embedded system for roadside air
quality monitoring at DIT BRT station”. The major limitation of this system is the main
advancement of the proposed system. The proposed system is expected to cover a larger area in
monitoring as opposed to just one small specific area.
2.9 Chapter Summary
This chapter generally gave a brief background information of air quality monitoring concept.
Furthermore, this chapter has reviewed several systems applied in air quality monitoring in
Tanzania as well as technologies applied in some other countries. Moreover, a section in this
chapter has outlined the importance and the reason behind execution of the proposed system.
17
CHAPTER THREE
THE PROPOSED SYSTEM
3.1 Introduction
This chapter mainly describes the blocks and details of the proposed system; each block of the
system will be explained. Moreover, explanations will show how blocks are related to other
blocks in the system.
3.2 Block Diagram of the Proposed System
Figure 3.1 shows the block diagram of the proposed system; “Wireless Sensor Network for Air
Quality Monitoring at DIT Dar es Salaam campus”
Figure 3. 1 Block diagram of the proposed system
18
3.2.1 Parts of the Proposed System
i) Sensing Node
A single sensor node is mainly comprised of a sensing unit, control unit and a communication
module. For effective air quality monitoring, the system needs to have several similar sensing
nodes scattered in different places.
a) Sensing Unit
This unit is made up of several sensors, in which each sensor detects a particular change
of chemical concentration in the air, then converts the results into an electrical signal
which can further be processed by next part of the node.
b) Control Unit
This is a sub block made up of the processor and the memory. The processor is
responsible for manipulation and processing of the signal received from the sensing unit.
The memory is responsible for temporary storage of information from the processor
before transmission.
c) Communication Module
This module is responsible for transmission and reception of information from and into
the node respectively.
d) Power Supply
This unit supplies power to the all the parts of the node as per their specifications.
ii) Network Coordinator/Gateway
This is the brain of the whole system. Network coordinator/Gateway is composed of a
processor, memory, communication module and power supply.
a) Control Unit
This is main part of the gateway, it manipulates, processes and make intelligent decision
on the data that it receives from the communication module, it then sends the ready
processed data to the cloud through the same.
19
b) Communication Module
This part of the system is mainly used for transmission and reception of data from and to
the gateway respectively. This part is responsible for receiving data from the sensing
nodes and transmitting the processed final data from to the cloud.
c) Power Supply
This unit supplies power to the all the parts of the network coordinator/gateway as per
their specifications.
iii) Cloud
This is can simply be referred to as online storage of data. All the data from the system are
collectively sent to this online storage to allow wide access.
In this system data from the cloud will specifically be accessed by the use of an android
application. This application will be interfaced with Google map, to enhance the user to see the
exact location of air quality data being displayed.
3.3 Operation of the Proposed System
The system has two main parts, the sensing node and the network coordinator/ gateway. There
ought to be several sensor nodes placed in different areas of interest. The sensing units within
the nodes detect changes of chemical concentration in the air and convert the results into
electrical signals which can then be manipulated by the processor and sent to the
communication module for transmission.
These very same nodes that are used for detecting changes of chemical concentrations in the air
are also used as communication hops for the nodes that are far from the gate way. The furthest
node from the gateway will send its data to the fore next node and in a similar manner the data
will be transferred until it arrives to the network coordinator/gateway.
The network coordinator/gateway receives data from all the nodes in the system and
manipulates them. The memory within the network coordinator stores data temporarily because
20
it the processor itself cannot processes bulky data all at once. Moreover, the network
coordinator/gateway filters and rearranges data in a proper way and sends the data to the
communication module in order to be sent to the cloud.
An android application will be designed along with the system in order to ease the access of air
quality information to individuals. This android application will be interfaced with Google map
to enhance an individual to see the exact location of air quality data being displayed.
3.4 Advantages of the Proposed System
i. The proposed system is expected to achieve air quality monitoring in a very wide area.
The design enhances very wide coverage, it only requires addition of sensor nodes when
expansion coverage is required.
ii. The system allows access of air quality information to all individuals with android
smartphones.
iii. Stored data from the cloud can be used by authorities and stakeholders for further
researches with the aim of controlling air quality.
iv. The design of the system is simple and of low cost, hence it can easily be implemented
in any other area with similar requirements.
3.5 Drawback of the Proposed System
The major drawback of the proposed system lays in the security challenge that comes along
during transmission of data from one node to another, especially when the intended area of
coverage keeps increasing. For implementation in a more expanded area, it is a must to
incorporate cluster nodes between the sensor nodes and the network coordinator/gateway, which
in turn increases the cost and complexity of the system.
3.6 Chapter Summary
This chapter has given the details on the constituents of the proposed system. It also explains
how the system works by analyzing the function of each block in the system. The next chapter
will give details about the collected data to verify the need of the proposed system.
21
CHAPTER FOUR
DATA COLLECTION
4.1 Introduction
This chapter accounts for detailed information collected from different sources. The data
collected in this project can essentially be divided into two main categories which are primary
data and secondary data. Primary data is the type of data that mainly justifies existence of the
stated problem. From this project, amongst other cited/referenced sources, primary data has
been collected from Muhimbili National Hospital and the National Environmental Management
Council (NEMC)-Tanzania. Secondary data is the data that facilitates the implementation of the
proposed solution. The functionality of the proposed system all relies in the correctness of the
secondary data collected.
4.2 Deaths and health defects caused by poor air quality
Poor air quality remains a threat to the health of those exposed to the same, as it has been
proven by Muhimbili National Hospital in table 4.1. [12]
Table 4. 1: Numbers of deaths and health problems related to poor air quality
Years 2000-2002 2003-2005 2006-2008 2009-2011 2012-2014 2015-2017
Deaths 5 18 12 9 21 3
Health
problems
87 105 129 147 191 205
Table 4.1 provided by Muhimbili National Hospital is a vivid evidence that poor air quality can
cause health problems and even deaths to the victims affected. This data alone proves that the
problem stated exists not only at DIT environment but in Tanzania at large hence something has
to be in attempt of solving the stated problem.
22
The fact that poor air quality can cause health problems has also been put in records by the
International Journal of Communication Networks and Information Security of the USA in its
volume nine article with the title, “Urban Air Pollution Monitoring” [13] as it can be seen in
table 4.2.
Table 4. 2 The six standard pollutants and their health effects [13]
4.3 Data for Air quality monitoring in Tanzania at large
As explained by NEMC from an interview conducted on 22nd
January 2018, Tanzania does not
have an air quality monitoring system. NEMC only collects air quality data from a specific
location whenever it receives complains from a community residing in that specific location.
23
Table 4.3 shows a list of questions and their corresponding responses from NEMC recorded
from this interview.
Table 4.3: List of interview questions and their corresponding answers from NEMC
S/N Question Answer
1. How often is air quality monitored in
Dar es Salaam city?
There is no continuous monitoring of air
quality in Tanzania.
2. How does NEMC detect poor air
quality?
Through data collection in an area that has
been reported to have polluted air by the
community
3. Does Tanzania have a set of standards
for air quality?
Yes, Tanzania has air quality standards to
be adhered to.
4. Are there any health records arising
from air pollution effects?
Yes, a well detailed report can be obtained
from Muhimbili National Hospital
5. What AQI does Tanzania use? Tanzania uses the International AQI as set
by EPA from USA
6. Is there any need for having a real time
Air Quality Monitoring System?
Yes and it would be very helpful in keeping
records of air quality for further researches
24
As explained by NEMC from the interview, Tanzania has a set of air quality standards to be
adhered to. Table 4.3 shows air quality standards used in Tanzania as provided by NEMC.
Table 4. 4: Tanzania national air quality standards [14]
Pollutant
Averaging
period
Maximum
(ambient)
concentration
Goal within 10 years
(maximum allowable
exceedances)
Carbon monoxide 8 hours 9.0 ppm 1 day a year
Nitrogen dioxide
1 hour 0.12 ppm 1 day a year
1 year 0.03 ppm None
Photochemical
oxidants (as ozone)
1 hour 0.10 ppm 1 day a year
4 hours 0.08 ppm 1 day a year
Sulfur dioxide
1 hour 0.20 ppm 1 day a year
1 day 0.08 ppm 1 day a year
1 year 0.02 ppm None
Lead 1 year 0.50 µg/m3
None
Particles as PM10 1 day 50 µg/m3
5 days a year
25
4.4 Data collected from DIT Dar es Salaam campus
The figure below has been captured during morning hours from google map indicating
congestion of vehicles at the roads surrounding DIT Dar es Salaam campus.
Figure 4. 1 A picture of map showing congestion of roads around surrounding DIT
26
4.5 Data Collected on the Requirements of the Proposed System
These are the data to be used in designing the proposed system for solving the existing problem.
These data have been collected by reviewing relevant literatures from different books and
materials from the Internet.
4.5.1 DIT campus
Knowing the total area of DIT, the particular arrangement of the buildings and the general
environment will be useful in designing of the proposed system, since it helps in realizing where
exactly the sensor nodes should be placed.
The figure 4.2 below shows a satellite map of DIT obtained from google map, displaying area
of the campus in square meters.
Figure 4.2 Satellite map of DIT showing total area of the campus
27
4.5.2 Wireless Sensor Networks in details
With the technology development of the sensors, integrated circuits and wireless
communications have paved the way for the fast growth of wireless sensor networks. WSNs are
capable of detecting, measuring and gathering data from the real world (air quality, water
quality, weather and traffic conditions, etc.) and transferring the information to end users. [13]
Wireless sensors systems can be placed anywhere as the conventional wired network cannot be
deployed, example; volatile places like high-temperature areas, chemical and toxins prone areas.
The capability of self-organization, ability to process concurrently, economical, limited energy
resources, limited range of operation, fault tolerance and rapid deployment characteristics of
Wireless Sensor Networks make them resourceful for versatile applications like intelligence and
monitoring and of targeted areas.
Table 4. 5 below shows details of communication technologies deployed in WSNs [15]
Category BLE Wi-Fi ZigBee XBee LORA
Main Network
Topology
Star Star, Mesh Mesh,
star,P2P
Mesh, star,P2P Star
Range 50m 50 – 100m 305m -
6.5KM
305m - 6.5KM 433m –
10KM
RF Data Rate 3.5Kbps >11Mbps 250Mbps 200Mbps 600kbps
Power Consumption Low High Low Low Low
Connection Time <10s <3s 30ms 30ms 30ms
4.5.3 Gas Sensors Available
Gas sensors operate in different modes. Table 4.4 below display details of each mode.
Table 4. 6: Different types of gas sensor available in the market and their properties [9]
SENSOR
TYPES
AVAILABILITY COST SENSITIVITY RANGE OF
MEASUREMENT(ppm)
Opt-chemical High cheap Low 0-1000
Biomimetic Moderate Expensive Moderate 0-5000
Semiconductor Moderate Average High 0-10000
Electrochemical Moderate Average High 100-1000
28
4.6 Chapter Summary
This chapter has described the data collected from different sources. The collected has proven
the existence of the stated problem. The data collected also act as a guide towards designing of
the system proposed system. The next chapter contains the summary of this report wrapped up
as conclusion and recommendation.
29
CHAPTER FIVE
DATA ANALYSIS AND SYSTEM DESIGN
5.1 Introduction
This chapter gives details about data analysis and design of the proposed system. The analysis
and designs are all based on the data collected in the previous chapter. Data analysis involves
both qualitative and quantitative analysis. Designing of the system will emerge from the block
diagram of the proposed system as seen in figure 3.1 of chapter three.
5.2 Sensing node
As explained in chapter three of this report, a single sensing node will be comprised of a sensing
unit, a control unit, a communication module and a power supply system which will be used a
source of power by all the elements within this node.
Data analysis of the sensing node as whole will be done by analyzing each unit within the node.
5.2.1 Sensing unit
The sensing unit is mainly comprised of specific sensors that will be measuring and detecting
the presence of harmful gases present in the surroundings. Data collected from NEMC as seen
in table 4.1 of chapter four above identify the harmful gases to be; Carbon monoxide (CO),
Nitrogen dioxide(NO2), Photochemical oxidants (Ozone), Sulphur dioxide (S2), Lead (Pb) and
Particulate Matter.
In selecting appropriate sensors to measure and detect the above mentioned gases the following
criteria have been considered;
i. Good sensitivity to flammable gas in wide range
ii. High sensitivity to harmful gases
iii. Simple drive circuit
iv. Must have a capability of sensing gas concentration in wide range from 10ppm and
above.
From above considered criteria the following sensors have been selected for this project;
 CJMCU 4514: This sensors detects the amount of carbon monoxide (CO), Nitrogen
dioxide (NO2), Ammonia (NH3) and Methane (CH4) that is present in the air.
 MG8 11: This sensor detects the amount of CO2 present in the air.
30
 MG8 11: This sensor detects the amount of Particulate Matter (PM2.5 and PM10) present
the air.
5.2.2 Control unit for the sensing node
A control unit used to process the signal from input and produce the required output in
accordance to the proposed system. Requirements for a control unit are as follows.
i. Built in analog to digital converter ( ADC)
ii. At least 20 input/output pins
iii. Speed at least 16MHz
iv. Programming memory at least 32KB
v. At least 4 pins supporting serial communication
Qualitative Analysis of Control Unit
In order to select suitable control unit for the sensing node a comparison between different
Control units available in the market has been shown in table 5.1 below
Table 5.1: Comparison of the available control units
SPECIFICATIONS PIC 18F452 PIC 16F887 AT mega 328p PIC 16F84
Program memory(KB) AGREE DISAGREE AGREE DISAGREE
I/O pins AGREE AGREE AGREE DISAGREE
Built in ADC PRESENT PRESENT PRESENT ABSENT
Speed (MHz) AGREE AGREE AGREE DISAGREE
Oscillator circuit built
in
DISAGREE DISAGREE AGREE DISAGREE
Serial communication
support
DISAGREE DISAGREE AGREE DISAGREE
From the comparison made in table 5.1, ATMEGA 328P has been chosen as a control unit for
the sensing nodes. Moreover ATMEGA 328P is specifically used for the sensing nodes of this
project because of the following reasons;
 With program memory of 32 Kbytes ATMEGA328P applications are many.
31
 With various POWER SAVING modes it can work on MOBILE EMBEDDED
SYSTEMS.
 With Watchdog timer to reset under error it can be used on systems with minimal human
interference.
 Also with in chip temperature sensor the controller can be used at extreme temperatures.
5.2.3 Communication module
For communication to be well established between the sensing nodes of the proposed system,
communication module of the following requirements should be deployed;
i. Communication coverage range of at least 200m
ii. Low power consumption
iii. Ability to perform normal operations under temperatures of above 400
C
iv. Free communication service
v. Low coast
vi. Readily available in the market
Qualitative Analysis of Communication module
In order to select suitable communication module for the sensing node a comparison between
different Communication modules available in the market has been shown in table 5.2.
32
Table 5.2: Comparison of the available communication modules
5.3 Gateway / Network coordinator
This block of the system is responsible for receiving data collected from all the sensing nodes
and processing them as whole, in order to give a final output results which will then be sent to
the cloud database.
The Gateway / Network coordinator in this project consists of two major elements namely;
 Control unit
 Communication module
5.3.1 Control Unit for the gateway / network coordinator
Table 5.3 below shows a comparison of different control units and the specifications required
for the gateway / network coordinator.
SPECIFICATIONS BLE WI-FI ZigBee XBee LORA
Low Power
Consumption
AGREE DISAGREE AGREE AGREE AGREE
Communication
range of at least
200M
DISAGREE DISAGREE AGREE AGREE AGREE
Easy availability in
the Market
AGREE AGREE AGREE DISAGREE AGREE
Low Cost AGREE AGREE DISAGREE DISAGREE AGREE
Ability to operate
normally in
temperatures above
400
C
DISAGREE DISAGREE DISAGREE DISAGREE AGREE
Service Free AGREE DISAGREE AGREE AGREE AGREE
33
Table 5.3 Comparison of different control units and specifications required for the gateway
SPECIFICATIONS PIC18F452 PIC16F887 ATMEGA328P NODE MCU
12E
Embedded
communication module
DISAGREE DISAGREE DISAGREE AGREE
Low operating voltage AGREE AGREE AGREE AGREE
Small in physical size DISAGREE AGREE AGREE AGREE
Built in ADC AGREE AGREE AGREE AGREE
Processing speed
about 8Mhz
AGREE AGREE AGREE AGREE
From the above made comparison, Node MCU 12E has been selected to be used as a control
unit for the gateway mainly because it is has an embedded communication module. As
explained previously, the network coordinator/gateway is responsible for receiving data from
the sensing node, processing the received data and hence forth sending them to a cloud server.
Based on its function, the network coordinator / gateway must consists of two communication
modules, a single LoRa – 02 module for receiving data from the sensing nodes and another
communication module which will be responsible for sending the final results to a cloud sever.
Hence to avoid the complexity of having two communication modules, node MCU 12E has
been chosen to as control unit for this gateway because it has an embedded communication
module.
5.4 Software Design
In this project software design is divided into three main categories;
 Software design for the sensing node
 Software design for the gateway / network coordinator
 Software design for the android application
34
5.4.1 Software Design for the sensing node
The software in the sensing node is designed to bring about coordination of the whole block. The
control unit (ATMEGA 328P) interfaced with the sensing unit and the communication module (LoRa -
02), has been programmed to fetch data from the sensing unit, process the data and send it to the
communication module. The software used to program the control unit has been written using C
language and it has been designed based on the flow chart shown in figure 5.1 below
START
READ SENSORS
SEND DATATO
GATEWY
Figure 5.1 Flow chart of software design for the sensing node
5.4.2 Software Design for the gateway / network coordinator
The software for the network coordinator has been designed to receive data from the sensing nodes,
process them and send the processed data to the cloud server. The control unit for gateway / network
coordinator (Node MCU 12E) has been programmed by C language and it functionality is based on the
flow chart shown in figure 5.2 below.
35
START
GET DATA
FROM
SENSING
NODE
PROCESS RECEIVED
DATA
SEND DATATO
CLOUD
MORE DATA TO
SEND?
YES
NO
END
Figure 5.2 Flow chart of software design for the gateway / network coordinator
5.4.3 Software Design for android application
Android application software for this project has been designed in for the purpose of allowing
individuals to access the data of air quality collected by different sensing nodes. This android
application has been designed and written in an open source software platform called Android Studio.
The design of this application has been done base on the flow chart shown in figure 5.3 below.
36
START THEAPP
SPLASH SCREEN
APPEARS
REGISTERED
USER?
YES
ENTER LOGIN
CREDENTIALS
NO
CREATE NEW
ACCOUNT
YES
FORGOT
PASSWORD
RETRIEVE
PASSWORD USING
USER
INFORMATION
DOES LOGIN
CREDENTIAL
MATCH?
NO – REENTER CREDENTILS
YES
DISPLAY THEMAIN
SCREEN
IS DATA
DISPLAYED IN
REAL TIME?
NO
REFRESH APP/
FETCH DATA FROM
CLOUD
YES
END
Figure 5.3 Flow chart of android mobile application
5.4.3.1 Android development
Android software development is the process by which new applications are created for devices
running the Android operating system, Android apps can be written using Kotlin, Java, and C++
languages" using the Android software development kit (SDK), while using other languages is
also possible.
In this project both Kotlin and Java programming languages have been used for android
development.
Kotlin is a cross-platform, statically typed, general-purpose programming language. Kotlin is
designed to interoperate fully with Java, and the JVM version of its standard library depends on
the Java Class Library.
37
5.5 Location and positioning of the system
As the project title suggests, this project is intended to be placed at DIT – Dar es Salaam
campus. The gateway / network coordinator will be placed at Telecom department and the
sensing nodes will be placed at different positions within the campus. For effective air quality
monitoring within the campus there should be a minimum of five sensing nodes, each node
placed at different location as indicated in figure 5.4 below.
Figure 5.4 Location of the sensing nodes and gateway at DIT campus
KEY
- Location of the gateway / network coordinator
- Location of the sensing nodes
The sensing nodes will be positioned at a height of approximately three (3) meters from the
ground preferably outside the buildings, because this project aims at monitoring ambient air
quality. The gateway/network coordinator will be placed inside the Electronics and
Telecommunications building.
38
5.6 Overall circuit diagram
Figure 5.5 below shows the overall circuit diagram of whole proposed system which is to be
simulated.
Figure 5.5 Overall circuit diagram to be simulated
5.7 Conclusion
This chapter has analyzed all the basic elements that will be used in in the proposed system.
Furthermore, the software designing has also been analyzed based on flow charts. The analysis
in this chapter has also considered the placement and positioning of the system. System
simulation will be clearly presented in the next chapter based on overall circuit diagram shown
in this chapter.
39
CHAPTER SIX
SIMULATION AND RESULT DISCUSSION
6.1 Introduction
Electronic circuit simulation uses mathematical models to replicate the behavior of an actual
electronic device or circuit. Simulation software allows modeling of circuit operation and is an
invaluable analysis tool. Electronics simulation software engages the user by integrating them
into the learning experience. These kinds of interactions actively engage learners to analyze,
synthesize, organize, and evaluate content and result in learners constructing their own
knowledge. Simulating a circuit’s behavior before actually building it can greatly improve
design efficiency by making faulty designs known as such, and providing insight into the
behavior of electronics circuit designs.
6.2 Simulation Software
The simulation software used for this project is Proteus. The Proteus simulation tool is chosen
because of the following reasons;
i. It is rich in libraries of different types of electronic components and modules.
ii. It performs well in different varieties of projects ranging from simple electronic circuit
to complex ones.
iii. In addition to simulation Excellency, it offers a capability to prepare printed circuit
boards for actual realization of the prototypes of different designed systems.
6.2.1 Simulation Environment
The following are simulation environment for the designed system.
i. Available gas sensors library is digital, hence potentiometer is used instead to show gas
sensed at different concentration level.
ii. The information of the environmental condition in sensing and operation node is observed
by using Virtual terminals.
40
6.2.2 Complete Simulation Circuit for Proposed System
Figure 6.1 Complete Simulation Circuit for Proposed System
6.3 Simulation Description
The gases detection mechanism detects the presence of the harmful gases and convert the gas
concentration level into corresponding electrical signal. This is done by sensors at the sensing
node. The measured data is then sent to the control unit of the sensing node for processing, there
after the communication module of the sensing node (LoRa I) sends the data to the
gateway/network coordinator.
The gateway/network coordinator receives data from the sensing node through its
communication module (LoRa II), there after the data is processed by the control unit and sent
to the cloud server through internet which is accessed by the gateway via a Wi-Fi embedded
module namely node MCU 12E.
Individuals will be able to access the air quality data by the use of an android application which
will display the data in real time and the exact location of occurrence by using Google map.
41
6.4 Simulation results and discussion
The following snip shows proteus simulation according to the proposed system. The data
terminal at the sensing node displays the data as obtained from the sensors, virtual terminal for
LoRa I displays the data before sending it to the gateway. Virtual terminal for LoRa II displays
data as it is received from the sensing node before it further processed by the control unit of the
gateway. Finally the virtual terminal for node MCU verifies that the data processed by the
control unit it being sent to the cloud. Figure 6.2 below shows the simulation results of the
proposed system.
Figure 6.2 Simulation results of the proposed system
6.4.1 Simulation of the sensing node
The sensing unit which comprises of the PM sensor, Carbon dioxide gas sensor, Carbon
monoxide and Nitrogen dioxide gas sensor sends the measured data to the control unit for
processing, thereafter the communication module (LoRa I) sends the data to the gateway. The
virtual data terminal readings verifies that that data is captured from every element of the
sensing unit. Figure 6.3 below shows simulation of the sensing node.
42
Figure 6.3 Simulation of the sensing node
6.4.2 Simulation of the gateway/network coordinator
LoRa II (communication module) receives data from the sensing node, thereafter the data is
processed by the control unit of the gateway and is sent to the cloud by Node MCU terminal.
This can be verified by virtual terminal for LoRa II and virtual terminal for Node MCU as
captured from the simulation software in figure 6.4 below.
43
Figure 6.4 Simulation of the gateway/network coordinator
6.4.3 Simulation of the android application
As it has been clearly stated in previous chapters and in the specific objectives of this project,
air quality data measured by the system will be accessed by individuals through android
application. The android application has been designed and constructed by using Android
Studio. Upon separate simulation of the android application it has been observed that the
application is up and running and it can access the internet in real time, hence accessing the data
collected will be prosperous. Figure 6.5 below shows the captured screen of the application
44
from an android phone. This figure displays dummy data of pollutant gases just for simulation
purposes.
Figure 6.5 Simulation of android application displaying amounts of pollutant gases from one
specific node
Figure 6.6 below shows a screen shot of the android application displaying real data of
temperature and humidity from the internet. This simulation feature justifies that application can
access real time data from the internet.
45
Figure 6.6 Simulation of android application showing real time data of temperature and
humidity from the internet
46
CHAPTER SEVEN
PROTOTYPE IMPLEMENTATION
7.1 Introduction
This chapter gives details of the prototype construction from the design specifications. It also
describes the performance testing parameters, testing procedures, results and discussions of
overall performance of the prototype.
7.2 Printed Circuit Board Construction
The circuit layouts of the designed system were prepared in proteus software and translated into
Printed circuit board (PCB). Then, the etching process was done by using acidic solution.
Figure 7.1 shows the (PCB) layout of the sensing node, figure 7.2 shows the (PCB) layout of the
gateway circuit, figure 7.3 and 7.4 shows 3D views of the sensing node and the gateway design
respectively.
7.1 PCB layout of the sensing node
47
7.2 PCB layout of the gateway
7.3 3D layout of the sensing node
48
7.4 3D layout of the gateway circuit
7.3 Components Mounting and Connections
After the preparations of the PCB the components were mounted to their respective places and
soldered. Figure 7.5 and figure 7.6 show complete circuits of the sensing node and the gateway
respectively.
Figure 7.5 Complete circuit of the sensing node
49
Figure 7.6 Complete circuit of the gateway
7.4 Prototype Performance Test
The following are the performance testing parameters of the prototype
i. Voltage variation of the gases from the sensors at the sensing node
ii. Output voltage of the control unit at the sensing node
7.5 Prototype Performance Testing Tools and Procedures
The performance testing was done by using voltmeter for measuring voltage variation at
different test points. The sensing node circuit was switched on and the measurement of the
performance-testing variable was done by using the voltmeter.
7.6 Results and Discussion
The following table shows the results of the measurements from working prototype of the
sensing node.
50
Before any gas is detected, the analog output sensor must read 0V but because there is a small
amount of surrounding gases, a little amount of output voltage measured as shown below.
Table 7. 1 Variation of output voltage at the sensing node circuit
Gas sensor Vcc input power supply Analog output reading
(Before gas detection)
Analog output
reading(after gas
detection)
CJMCU 4514 4.8V 2.3V 3.3V
MG811 4.7V 3.5V 4.5V
SDS011 4.8V 1.8V 3.9V
The results shown on the table above clearly proves that the sensing node circuit does its
intended function of detecting the variation of pollutant gases from the surroundings.
7.7 Overall Results Discussions
The results show that the implemented prototype of the sensing node functions as expected.
Moreover after testing, the system was implemented to observe the results. One sensing node
was placed at Block A, near the main gate (see figure 7.8) and another node was placed at Block
IV near the football ground.
Figure 7.7 Sensing node prototype fixed at Block A
51
In a period of seven days, the average results obtained from the database reveal that, the areas
around Block A, near Morogoro road have higher levels of Carbon monoxide (CO) and
Nitrogen dioxide (NO2) as compared to any other area of the campus. See figure 7.8.
Figure 7.8 Average results obtained from sensing node I
Moreover, during the same seven days period, an average of results from the second sensing
node placed at Block IV revealed that, there is a higher content of PM10, PM2.5 and Carbon
dioxide (CO2) as compared to any other area of the institute’s campus. See figure 7.9.
52
Figure 7.8 Average results obtained from sensing node II
7.8 Chapter summary
This chapter has explained the prototype implementation and testing. The results from prototype
show that all the specific objectives have been achieved and main objective of the project has as
well been achieved. The next chapter concludes the project, it gives the overall summary of
what has been done and what has been achieved throughout the project.
53
CHAPTER EIGHT
CONCLUSION AND RECOMMENDATION
8.1 Introduction
This chapter provides conclusion of the project with respect to what had been proposed in the
beginning and what has been achieved with regard of the proposed system. Furthermore this
chapter recommends on what can be done in improving this project as well as how this project
can be used in solving the problem it has intended to solve.
8.2 Conclusion
This report has provided all basic information concerning the existence of the problem and the
procedures towards solving it. In addition, the system has been tested and appeared to give
results as expected. From the data collected, it can be clearly seen that the proposed Air quality
monitoring system is highly needed, not just by the DIT community as it is proposed, but in a
wider area. This is mainly due to its importance as it helps in recording of proper data for
furthering researches with the aim of controlling air quality.
8.3 Recommendation
It is with a vigor concern that my recommendation goes directly environmental authorities like
NEMC. These authorities ought to be monitoring air quality with regular basis, not just
collecting air quality data whenever a community raises concern. By using air quality
monitoring systems like the proposed system, these authorities can easily determine air quality
and take immediate actions whenever need arises. Moreover by using this proposed system,
individuals can have access to the air quality data from their surroundings at their fingertips.
Hence it will be easy to take action in controlling air quality whenever it is within their ability
as a community.
54
REFERENCES
[1] WHO, "Mortality and burden of disease from ambient air pollution," 2016. [Online]. Available:
https://www.who.int/airpollution/en/. [Accessed 08 January 2019].
[2] United Nations, "Sustainable Development Goals Knowlege Platform," UN, 2018. [Online].
Available: https://sustainabledevelopment.un.org/sdg11. [Accessed 10 January 2019].
[3] Transportation Association of Canada, "TAC Briefing," 2006. [Online]. Available: https://www.tac-
atc.ca/sites/tac-atc.ca/files/site/doc/resources/briefing-ut-and-airquality.pdf. [Accessed 13
January 2019].
[4] Conserve Energy Future, "Conserve Energy Future," 2019. [Online]. Available:
https://www.conserve-energy-future.com/what-is-air-quality.php. [Accessed 2019].
[5] J. MM, Roadside concentration of gaseous and particulate matter pollutants and risk assessment
in Dar-es Salaam, Tanzania, Dar es salaam: Journal of Environmental Monitoring and Assessment,
104: 385-407. M. M. JACKSON / Int. J. Biol. Chem, 2005.
[6] U.S. Environmental Protection Agency, "A Guide to Air Quality and Health," Outreach and
Information Division, NC, 2014.
[7] HORIBA, "Horiba technologies," 2017. [Online]. Available:
https://www.horiba.com/en_en/products/detail/action/show/Product/aqms-1560/. [Accessed
2019].
[8] V. R. K. V. V. M. Sayali C. Bhagwat, "A wireless sensor network air pollution monitoring system in
Industrial Areas," IRJET, SINHGAD, 2016.
[9] B. DESDEDITH, EMBEDED SYSTEM FOR ROADSIDE AIR QUALITY MONITORING AT DIT BRT STATION,
DAR ES SALAAM: DAR ES SALAAM INSTITUE OF TECHNOLOGY, 2018.
[10] J. MM, Roadside concentration of gaseous and particulate matter pollutants and risk assessment
in Dar-es Salaam, Tanzania, Dar es salaam:, dar es salaam: : Journal of Environmental Monitoring
and Assessment, 104: 385-407. M. M. JACKSON / Int. J. Biol. Chem, , 2005.
[11] A. q. i. H. K. 1. R. H. K. E. P. Department,
""http://www.opsi.gov.uk/acts/acts1995/ukpga_19950025_en_1," 1995. [Online]. [Accessed 14
january 2018].," [Online]. [Accessed 14 january 2018].
55
[12] m. n. hospital, "w.w.w.muhimbilinationalhospital.co. tz," [Online]. [Accessed 10 january 2018].
[13] P. R. Movva Pavani, "Urban Air Pollution Monitoring," International Journal of Communication
Networks and Information Security , vol. 9, 2017.
[14] N. Report, "urban air quality monitoring – Pilot project,," National Environment Management
Council,, Dar es Salaam, 1992.
[15] Department of Civil Engineering, Monash University, "Design and Implementation of a Low-Power
Wireless Sensor Network Platform Based on XBee," 2017.
[16] E. E. o. E. A. P. S. Performance, "https://www.epa.gov/air-sensor-toolbox/Evaluation-emerging-air-
pollution-sensor-performance,," 2017. [Online]. [Accessed 17 january 2018].
[17] ""https://www.epa.gov/air-sensor-toolbox/Evaluation-emerging-air-pollution-sensor-
performance,,"," 2017. [Online]. [Accessed 17 january 2018]].
[18] ""https://www.lumasenseinc.com/EN/products/technology-overview/our-
technologies/pas/photoacoustic-spectroscopy.html,"," [Online]. [Accessed 10 january 2018].
[19] m. k, Assessment of air pollution at bus stations in Dar-es Salaam, BSc (Env. Eng., Dar es salaam,
Dar es salaam: University College of Lands and Architectural Studies (UCLAS), , 2003.
[20] 1. B. S. BS, Methods for measurement of air pollution,, UK: UK: British Standards Institution (BSI),
London,, 1947.
[21] C. m. c. a. t. e. time, ""http://www.engineeringtoolbox.com/carbon-monoxide-
d_893.html[Accessed," 22 04 2017. [Online]. [Accessed 26 12 2018].," 2017. [Online]. [Accessed 26
12 2018].
[22] E. a. o. health,
"https://www.publichealthontario.ca/en/eRepository/Air_Quality_Indeces_Report_2013.pdf,"
[Online]. [Accessed 22 12 2017].
[23] Dangerous and tolerable levels of industrial gases, "http://www.engineeringtoolbox.com/gases-
dangerous-levels-d_1841.html," 22 04 2017. [Online]. [Accessed 2018 january 15].
[24] WHO, Air Quality Guidelines for Europe, EUROPE: WHO Regional Publications, European Series
No.23. , 1987.
[25] B. S. BS, Methods for measurement of air pollution, UK: British Standards Institution (BSI), London,
56
1947.
[26] "Environmental and occupational health," [Online]. [Accessed 10 JANUARY 2018].
57
APPENDIX A
Project time frame
Activity Weeks
1 2 3 ... 16 17 18 19 20 21 22 23 24 25 … 32
Literature Review
Problem Finding
Proposal Writing
Data Collection
Project I Write Up
Data Analysis
Project Design &
Simulation
Implementation
Of Design
Perform Testing
Project II Write Up
58
APPENDIX B
Project prototype budget
ITEM DESCRIPTION QUANTITY PRICE($) @ PRICE(TZS) @ PRICETOTAL
SDS011 Airqualitysensor(PM2.5&PM10) 2 18 43200 86400
CJMCU4541 NO2,CO,CH4,NH3,H2Sensor 2 21 50400 100800
MG811 CO2Sensor 2 28 67200 134400
LORA Communicationmodule forsensornodes 3 6 14400 43200
Atmega328 Control unitforsensornodes 2 18000 36000
Crystal Capacitor Forthe sensornodes 2 1000 2000
CeramicCapacitors Forthe sensornodes 4 3000 12000
PowerSupply 6A Adaptor(Forthe sensornodes) 2 15000 30000
2A Adaptor(Forthe gateway 1 12000 12000
Connectors Forthe sensornodesandthe Gateway 3 1000 3000
Regulators LM338(5A) Forthe sensornodes 4 5000 20000
LM317(2A) Forthe gateway 2 1500 3000
Resistors Forthe sensornodesandthe Gateway 15 200 3000
PCB Coppertype 1 8000 8000
Node MCU Control unitforthe gateway 1 18000 18000
Capacitors Forthe sensornodesandthe Gateway 15 800 12000
LED Foron/off Indication 3 300 900
Solderingwire (inmetres) Forsoldering 5 1000 5000
Male Pins 2 1000 2000
Female Pins 3 1000 3000
Switch 3 500 1500
Waterproof boxes Forenclosingthe circuits 3 20000 60000
596200
WIRELESSSENSOR NETWORKFOR REALTIMEAIR QUALITYMONITORINGATDIT-PROTOTYPEBUDGET
59
APPENDIX C
Code for the control unit of the sensing node
#include <SPI.h>
#include <LoRa.h>
#include "CO2Sensor.h"
#define SENSOR_NODE "abcd"
#define PRE_PIN 3
#define VNOX_PIN A0
#define VRED_PIN A1
#define CALIB_R0_NO2 2200 // R0 calibration value for the NO2 sensor
#define CALIB_R0_CO 750000 // R0 calibration value for the CO sensor
#define PRE_HEAT_SECONDS 10
int vnox_value = 0;
int vred_value = 0;
int counter = 0;
// MG8 11
CO2Sensor co2Sensor(A2, 0.99, 100);
60
void setup() {
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
LoRa.setSpreadingFactor(10);
LoRa.setSignalBandwidth(62.E3);
LoRa.crc();
pinMode(PRE_PIN, OUTPUT);
Serial.begin(9600);
Serial.print(SENSOR_NODE);
Serial.println(" Starting...");
digitalWrite(PRE_PIN, 1);
delay(PRE_HEAT_SECONDS * 1000);
digitalWrite(PRE_PIN, 0);
//LoRa.setSpreadingFactor(8);
co2Sensor.calibrate();
}
void loop() {
Serial.println("RSSI: " + String(LoRa.packetRssi()));
counter += 1;
61
delay(1000);
readCJMCU();
readCo2();
}
void readCo2() {
String msg;
int val = co2Sensor.read();
msg = 'd' + String(val);
Serial.print("Sending Carbon dioxide: ");
Serial.println(val);
sendMessage(msg);
delay(1000);
msg = "";
}
void readCJMCU() {
String msg = "";
float fvolt, fRes, fConc;
vnox_value = analogRead(VNOX_PIN);
vred_value = analogRead(VRED_PIN);
fConc = 0.00;
// -------- Reading CO --------------
fvolt = (vred_value * 3.3) / 1024.0;
fRes = (5000.0 / fvolt - 1000) / CALIB_R0_CO;
62
// Convert to ppm
if (fRes > 0.7) fRes = 0.7;
if (fRes > 0.6) fConc = (0.711 - fRes) / 0.011;
else if (fRes > 0.3) fConc = (0.7 - fRes) / 0.01;
else fConc = (0.3233 - fRes) / 0.00058;
msg = 'c' + String(fConc);
Serial.print("Message: " + msg);
Serial.println(msg);
Serial.print("Sending Carbon monoxide: ");
Serial.println(fConc);
sendMessage(msg);
msg = "";
delay(1000);
// Convert to NO2 ----------------
fvolt = (vnox_value * 3.3) / 1024.0;
fRes = (5000.0 / fvolt - 1000) / CALIB_R0_NO2;
if (fRes < 3.0) fRes = 3.0;
if (fRes >= 3.0 && fRes < 8.0) fConc = (fRes - 0.5) / 0.25;
else fConc = (fRes + 129.655) / 4.589;
msg = 'n' + String(fConc);
Serial.print("Message: " + msg);
Serial.println(msg);
63
Serial.print("NO2 (ppm)): ");
Serial.println(fConc);
Serial.println("Sending Nitrogen Oxide");
sendMessage(msg);
delay(1000);
}
void sendMessage(String msg) {
LoRa.beginPacket();
LoRa.print(msg);
LoRa.endPacket();
}
Code for the control unit of the gateway
#include <config.h>
#include <LoRaNode.h>
#include <config.h>
#include <LoRaNode.h>
#include <TFT.h>
#include <SPI.h> // include libraries
#include <LoRa.h>
void setup() {
Serial.begin(9600);
64
Serial.println("Air Quality Base Station Receiver");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
LoRa.setSpreadingFactor(10);
LoRa.setSignalBandwidth(62.E3);
LoRa.crc();
}
void loop() {
onReceive(LoRa.parsePacket());
delay(1000);
}
void onReceive(int packetSize) {
String incoming = "";
while (LoRa.available()) {
incoming += (char)LoRa.read();
}
Serial.println(incoming);
delay(1000);
}
65
Code for sending data from the gatewy to a cloud server
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#include <ESP8266WiFi.h>
//needed for library
#include <PubSubClient.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
// MQTT Details
#define MQTT_BROKER "m24.cloudmqtt.com"
#define MQTT_PORT 19576
#define MQTT_USERNAME "cosxuovc"
#define MQTT_PASSWORD "EiZIWjLTCvYk"
#define MAX_MSG_LEN (128)
#define SNR_TOPIC "air_quality/SNR"
#define RSSI_TOPIC "air_quality/RSSI"
66
#define CARBON_TOPIC_NODE_1 "air_quality/node_1/carbon_dioxide"
#define CARBON__MONOXIDE_1 "air_quality/node_1/carbon_monoxide"
#define NITROGEN_OXIDE_1 "air_quality/node_1/nitrogen_oxide"
#define PM_10 "air_quality/node_1/pm_10"
#define PM_25 "air_quality/node_1/pm_25"
void callback(char *topic, byte *payload, unsigned int len);
WiFiClient client;
PubSubClient mqtt(MQTT_BROKER, MQTT_PORT, client );
void setup() {
Serial.begin(9600);
WiFiManager wifiManager;
wifiManager.autoConnect("Air Quality Monitoring");
Serial.println("Connected !:)");
mqtt.setCallback(callback);
}
void loop() {
if (!mqtt.connected()) connectMQTT();
67
String sensor_reads;
if (Serial.available() > 0) {
while (Serial.available() > 0) {
char c = Serial.read();
sensor_reads += c;
}
Serial.println("RECEIVED: " + sensor_reads);
}
if (sensor_reads.charAt(0) == 's') {
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
mqtt.publish(SNR_TOPIC, sensor_data);
}
if (sensor_reads.charAt(0) == 'r') {
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
mqtt.publish(RSSI_TOPIC, sensor_data);
}
if (sensor_reads.charAt(0) == 'd') {
68
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
mqtt.publish(CARBON_TOPIC_NODE_1, sensor_data);
}
if (sensor_reads.charAt(0) == 'm') {
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
mqtt.publish(CARBON_TOPIC_NODE_1, sensor_data);
}
if (sensor_reads.charAt(0) == 'n') {
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
mqtt.publish(NITROGEN_OXIDE_1, sensor_data);
}
if (sensor_reads.charAt(0) == 'p') {
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
69
mqtt.publish(PM_10, sensor_data);
}
if (sensor_reads.charAt(0) == 'x') {
sensor_reads.remove(0, 1);
char sensor_data[7];
sensor_reads.toCharArray(sensor_data, 7);
mqtt.publish(PM_25, sensor_data);
}
mqtt.loop();
delay(500);
}
void connectMQTT() {
while (!mqtt.connected()) {
String clientID = "ESP-IoT";
clientID += String(random(0xffff), HEX);
Serial.printf("MQTT Connecting as client %s ... n", clientID.c_str());
if (mqtt.connect(clientID.c_str(), MQTT_USERNAME, MQTT_PASSWORD)) {
Serial.println("MQTT Connected");
} else {
Serial.printf("MQTT failed, state %s, retrying ... n", mqtt.state());
delay(1500);
70
}
}
}
void callback(char *topic, byte *payload, unsigned int len) {
static char message[MAX_MSG_LEN + 1];
if (len > MAX_MSG_LEN) len = MAX_MSG_LEN;
strncpy(message, (char *)payload, len);
message[len] = '0';
//Serial.printf("topic: %s, message received: %sn", topic, message);
}

More Related Content

Similar to Wireless Sensor Network for Real-Time Air Quality Monitoring

FINAL_FINAL_PROJECT_COMBINED[1]
FINAL_FINAL_PROJECT_COMBINED[1]FINAL_FINAL_PROJECT_COMBINED[1]
FINAL_FINAL_PROJECT_COMBINED[1]Ali Abdul Fatawu
 
Online job advertisement project report
Online job advertisement project reportOnline job advertisement project report
Online job advertisement project reportRodney kaweesa
 
Assessing The Impact Of Variation Orders On Public Building Projects In Addis...
Assessing The Impact Of Variation Orders On Public Building Projects In Addis...Assessing The Impact Of Variation Orders On Public Building Projects In Addis...
Assessing The Impact Of Variation Orders On Public Building Projects In Addis...Amy Cernava
 
Real data viewer_final_edition
Real data viewer_final_editionReal data viewer_final_edition
Real data viewer_final_editionkhoulouddridi2
 
Daniel Murray Final Report
Daniel Murray Final ReportDaniel Murray Final Report
Daniel Murray Final ReportDaniel Murray
 
Internship Final Report
Internship Final Report Internship Final Report
Internship Final Report Nadia Nahar
 
SMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdf
SMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdfSMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdf
SMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdfJamelBaili2
 
Accident detection and notification system
Accident detection and notification systemAccident detection and notification system
Accident detection and notification systemSolomon Mutwiri
 
Optical Fiber link Design Complete guide by Aamir Saleem
Optical Fiber link Design Complete guide by Aamir SaleemOptical Fiber link Design Complete guide by Aamir Saleem
Optical Fiber link Design Complete guide by Aamir SaleemAamir Saleem
 
140325 alexandros.zografos-with-cover
140325 alexandros.zografos-with-cover140325 alexandros.zografos-with-cover
140325 alexandros.zografos-with-covermadhu ck
 
MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0
MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0
MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0Duduetsang Kgosi Mogase
 
Intrusion Detection In Open Field Using Geophone (Report)
Intrusion Detection In Open Field Using Geophone (Report)Intrusion Detection In Open Field Using Geophone (Report)
Intrusion Detection In Open Field Using Geophone (Report)Nuthan Prasad
 
final year project
final year projectfinal year project
final year projectshiola kofi
 

Similar to Wireless Sensor Network for Real-Time Air Quality Monitoring (20)

FINAL_FINAL_PROJECT_COMBINED[1]
FINAL_FINAL_PROJECT_COMBINED[1]FINAL_FINAL_PROJECT_COMBINED[1]
FINAL_FINAL_PROJECT_COMBINED[1]
 
SMARTbus System
SMARTbus SystemSMARTbus System
SMARTbus System
 
Online job advertisement project report
Online job advertisement project reportOnline job advertisement project report
Online job advertisement project report
 
SI Thesis
SI ThesisSI Thesis
SI Thesis
 
MY PROJECT WORK
MY PROJECT WORKMY PROJECT WORK
MY PROJECT WORK
 
Assessing The Impact Of Variation Orders On Public Building Projects In Addis...
Assessing The Impact Of Variation Orders On Public Building Projects In Addis...Assessing The Impact Of Variation Orders On Public Building Projects In Addis...
Assessing The Impact Of Variation Orders On Public Building Projects In Addis...
 
Real data viewer_final_edition
Real data viewer_final_editionReal data viewer_final_edition
Real data viewer_final_edition
 
MUHUMUZA ONAN
MUHUMUZA ONANMUHUMUZA ONAN
MUHUMUZA ONAN
 
Daniel Murray Final Report
Daniel Murray Final ReportDaniel Murray Final Report
Daniel Murray Final Report
 
Internship Final Report
Internship Final Report Internship Final Report
Internship Final Report
 
SMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdf
SMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdfSMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdf
SMART_HOME_ENERGY_MANAGEMENT_DESIGN_AND _IMPLEMENTATION.pdf
 
Accident detection and notification system
Accident detection and notification systemAccident detection and notification system
Accident detection and notification system
 
Optical Fiber link Design Complete guide by Aamir Saleem
Optical Fiber link Design Complete guide by Aamir SaleemOptical Fiber link Design Complete guide by Aamir Saleem
Optical Fiber link Design Complete guide by Aamir Saleem
 
140325 alexandros.zografos-with-cover
140325 alexandros.zografos-with-cover140325 alexandros.zografos-with-cover
140325 alexandros.zografos-with-cover
 
MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0
MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0
MIT 840 ICT Skills Shortage_Supply and Demand Mini Dissertation v1.0
 
Sop
SopSop
Sop
 
Intrusion Detection In Open Field Using Geophone (Report)
Intrusion Detection In Open Field Using Geophone (Report)Intrusion Detection In Open Field Using Geophone (Report)
Intrusion Detection In Open Field Using Geophone (Report)
 
Project report
Project reportProject report
Project report
 
final year project
final year projectfinal year project
final year project
 
Term paper
Term paperTerm paper
Term paper
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Wireless Sensor Network for Real-Time Air Quality Monitoring

  • 1. 0 DAR ES SALAAM INSTITUTE OF TECHNOLOGY ELECTRONICS AND TELECOMMUNICATIONS DEPARTMENT BACHELOR OF ENGINEERING IN ELECTRONICS AND TELECOMMUNICATION ENGINEERING SENIOR PROJECT II PROJECT TITLE: WIRELESS SENSOR NETWORK FOR REAL TIME AIR QUALITY MONITORING AT DIT DAR ES SALAAM CAMPUS PROJECT TYPE: PROBLEM SOLVING NAME OF STUDENT: NURU D. KESSY ADMISSION NO: 160640710788 SUPERVISOR NAME:ASINTA MANYELE, PHD JULY 2019
  • 2. i DECLARATION I, NURU D. KESSY, student at the Dar es Salaam Institute of Technology (DIT), pursuing bachelor of Electronics and telecommunications engineering, declare to the best of my knowledge that the project presented here as a partial fulfillment of bachelor’s degree in Electronics and telecommunication engineering, is my original work and has not been copied anywhere or presented elsewhere, except where it has been unequivocally indicated with reference(s). CANDIDATE’S NAME SIGNATURE DATE NURU D. KESSY ............................. ........................
  • 3. ii CERTIFICATION As the candidate’s supervisor, I have approved this project report for submission. Supervisor’s Name: Asinta Manyele (PHD) Signature...................................... Date..............................................
  • 4. iii ABSTRACT DIT Dar es Salaam campus environment is located at the centre of Dar es Salaam city. Moreover it is located at the middle of highly congested roads; Morogoro road, Bibi Titi Mohamed and Aly Khan Road. This being the case the environment of DIT is likely to be highly subjected to poor air quality mainly due to the effect of green gases emitted by moving motor vehicles. Poor air quality at DIT is also contributed by construction activities of the nearby buildings. Hence, the lives of people at DIT could be vastly exposed to some dangerous diseases like lung cancer and Tuberculosis by inhaling polluted air. In this project report, WIRELESS SENSOR NETWORK FOR REAL TIME AIR QUALITY MONITORING is proposed at DIT Dar es Salaam campus. In this proposed system different sensing nodes will be placed at different places within DIT campus and there will be a single network coordinator/gateway. Using this proposed system changes in air will be measured in real time and the resulting data will be uploaded to a cloud server. By using an android application individuals will be able to access this real time air quality information mapped into DIT Google map. The proposed system has been tested and from the results it has been observed that; during busy hours there is a higher content of Carbon monoxide (CO) and Nitrogen dioxide (NO2) in the areas near Morogoro road compared to any other area in the campus. Moreover, during daytime areas around Block III, Block IV and the football ground have observed to have higher contents of PM10, PM2.5 and Carbon dioxide (CO2) compared to any other area of the institute’s campus. Practical implementation of the proposed system will enable individuals at DIT community to have access of air quality information at their fingertips. Moreover the authority will have a proper record of air quality data which can be used in further air quality studies and researches. Furthermore, this system can be extended to a broader network with the purpose of monitoring air quality in larger areas.
  • 5. iv ACKNOWLEDGEMENT My heart is filled with unexplained joyful cheers just because I have the best parents anyone could ever wish to have. My parents have always been beside me, to encourage and uplift me, even at times when school felt like walking on burning charcoal. I have to admit, I have made it this far because of my mother’s endless prayers. Sincere love and gratitude all extended to my Godmother, Edith Mbatia. Aunt, your everlasting prayers, support and scolding altogether have molded this hardworking lady in me. And just so you know, you are my role model. My one and only best friend, through thick and thin, one who has always pushed me beyond my limits, one who made me realize I could always do better than I thought. My friend, advisor and most definitely a shoulder to cry on, Iku, I am really short of words to express my gratitude, all I can say is, I am grateful. Special thanks to my project supervisor, Asinta Manyele, PHD. You have always been there to assist and support me in each and every step of my project. You actually guided me to find a project title when it seemed like the most challenging task I ever encountered. I will forever be grateful and appreciative, because it is through this project title that I will be granted a degree. Lastly, my extended appreciation goes out to every genuine soul that has been there to support me and add constructive inputs to my project. I very grateful and your support is highly acknowledged.
  • 6. v TABLE OF CONTENTS DECLARATION .........................................................................................................................................i CERTIFICATION....................................................................................................................................... ii ABSTRACT............................................................................................................................................... iii ACKNOWLEDGEMENT ......................................................................................................................... iv LIST OF FIGURES..................................................................................................................................... x LIST OF ABBREVIATIONS ................................................................................................................... xii CHAPTER ONE:INTRODUCTION ..........................................................................................................1 1.1 Background In formation ..............................................................................................................1 1.2 Problem Statement ........................................................................................................................2 1.3 Objectives......................................................................................................................................2 1.4 Significance of the project.............................................................................................................2 1.5 Limitation......................................................................................................................................3 1.6 METHODOLOGY........................................................................................................................3 1.6.1 Literature review ........................................................................................................................3 1.6.2 Data Collection...........................................................................................................................3 1.6.3 Data Analysis .............................................................................................................................4 1.6.4 System design.............................................................................................................................4 1.6.5 Circuit Simulation ......................................................................................................................4 1.6.6 System implementation and prototype testing ...........................................................................4 1.6.7 Report writing ............................................................................................................................4 1.7 Chapter Summary..........................................................................................................................5 CHAPTER TWO:LITERATURE REVIEW ..............................................................................................6 2.1 Introduction...................................................................................................................................6 2.2 Background information................................................................................................................6 2.3 International Air Quality Index (AQI) ..........................................................................................7 2.4 How AQI is calculated ..................................................................................................................9 2.5 Existing systems..........................................................................................................................10 2.5.1 HORIBA Air Quality Monitoring System ...............................................................................10 2.5.2 A Wireless Sensor Network for Air Monitoring System in Industrial Areas...........................11
  • 7. vi 2.6 Existing methods in Tanzania [9]................................................................................................13 2.6.1 Indoor laboratory testing unit...................................................................................................13 2.7 Embedded system for roadside air quality monitoring at DIT BRT station................................14 2.8 Reasons for Proposed System .....................................................................................................16 2.9 Chapter Summary........................................................................................................................16 CHAPTER THREE:THE PROPOSED SYSTEM....................................................................................17 3.1 Introduction.................................................................................................................................17 3.2 Block Diagram of the Proposed System......................................................................................17 3.3 Operation of the Proposed System ..............................................................................................19 3.4 Advantages of the Proposed System ...........................................................................................20 3.5 Drawback of the Proposed System..............................................................................................20 3.6 Chapter Summary........................................................................................................................20 CHAPTER FOUR:DATA COLLECTION...............................................................................................21 4.1 Introduction.................................................................................................................................21 4.2 Deaths and health defects caused by poor air quality..................................................................21 4.3 Data for Air quality monitoring in Tanzania at large..................................................................22 4.4 Data collected from DIT Dar es Salaam campus ........................................................................25 4.5 Data Collected on the Requirements of the Proposed System ....................................................26 4.5.1 DIT campus..............................................................................................................................26 4.5.2 Wireless Sensor Networks in details........................................................................................27 4.5.3 Gas Sensors Available..............................................................................................................27 4.6 Chapter Summary........................................................................................................................28 CHAPTER FIVE:DATA ANALYSIS AND SYSTEM DESIGN............................................................29 5.1 Introduction.................................................................................................................................29 5.2 Sensing node ...............................................................................................................................29 5.2.1 Sensing unit..............................................................................................................................29 5.2.2 Control unit for the sensing node .............................................................................................30 5.2.3 Communication module ...........................................................................................................31 5.3 Gateway / Network coordinator ..................................................................................................32 5.3.1 Control Unit for the gateway / network coordinator ................................................................32
  • 8. vii 5.4 Software Design ..........................................................................................................................33 5.4.1 Software Design for the sensing node......................................................................................34 5.4.2 Software Design for the gateway / network coordinator..........................................................34 5.4.3 Software Design for android application..................................................................................35 5.4.3.1 Android development............................................................................................................36 5.5 Location and positioning of the system.......................................................................................37 5.6 Overall circuit diagram................................................................................................................38 5.7 Conclusion...................................................................................................................................38 CHAPTER SIX:SIMULATION AND RESULT DISCUSSION .............................................................39 6.1 Introduction.................................................................................................................................39 6.2 Simulation Software....................................................................................................................39 6.3 Simulation Description................................................................................................................40 6.4 Simulation results and discussion................................................................................................41 6.4.1 Simulation of the sensing node ................................................................................................41 6.4.2 Simulation of the gateway/network coordinator ......................................................................42 6.4.3 Simulation of the android application ......................................................................................43 CHAPTER SEVEN:PROTOTYPE IMPLEMENTATION......................................................................46 7.1 Introduction.................................................................................................................................46 7.2 Printed Circuit Board Construction.............................................................................................46 7.3 Components Mounting and Connections ....................................................................................48 7.4 Prototype Performance Test ........................................................................................................49 7.5 Prototype Performance Testing Tools and Procedures................................................................49 7.6 Results and Discussion................................................................................................................49 7.7 Overall Results Discussions ........................................................................................................50 7.8 Chapter summary ........................................................................................................................52 CHAPTER EIGHT:CONCLUSION AND RECOMMENDATION...................................................................53 8.1 Introduction.................................................................................................................................53 8.2 Conclusion...................................................................................................................................53 8.3 Recommendation.........................................................................................................................53 REFERENCES ..............................................................................................................................................54
  • 9. viii APPENDIX A ...........................................................................................................................................57 Project time frame .....................................................................................................................................57 APPENDIX B ...........................................................................................................................................58 Project prototype budget ...........................................................................................................................58 APPENDIX C ...........................................................................................................................................59 Code for the control unit of the sensing node ...........................................................................................59 Code for the control unit of the gateway...................................................................................................63 Code for sending data from the gatewy to a cloud server .........................................................................65
  • 10. ix LIST OF TABLES Table 2. 1: AQI in relation to health..............................................................................................8 Table 4. 1: Numbers of deaths and health problems related to poor air quality………………...21 Table 4.2: The six standard pollutants and their health effects……………………….………...22 Table 4. 3: List of interview questions and their corresponding answers from NEMC.............. 23 Table 4. 4: Tanzania national air quality standards..................................................................... 24 Table 4. 5: Communication technologies deployed in WSNs..................................................... 27 Table 4. 6: Different types of gas sensor available in the market and their properties ............... 27 Table 5.1: Comparison of available control units….…………………………………………...30 Table 5.2: Comparison of available communication modules………………………………….35 Table 5.6: Comparison of different control units and specifications required for the gateway…33 Table 7. 1 Variation of output voltage at the sensing node circuit………………………….......50
  • 11. x LIST OF FIGURES Figure 2. 1 HORIBA Air Quality Monitoring System................................................................ 11 Figure 2. 2 Block diagram of WSN for Air Monitoring System in Industrial Areas.................. 12 Figure 2. 3 Block diagram presenting the existing procedures of air quality measurement ....... 13 Figure 2. 4 Embedded system for roadside air quality monitoring at DIT BRT station............. 15 Figure 3. 1 Block diagram of the proposed system...…………………………………………...17 Figure 4.1 A picture of map showing congestion of roads around surrounding DIT...………...25 Figure 4.2 Satellite map of DIT showing total area of the campus….……………………….…26 Figure 5.1 Flow chart of software design for the sensing node…...……………………………34 Figure 5.2 Flow chart of software design for the gateway / network coordinator...……………35 Figure 5.3 Flow chart of android mobile application..…………………………………………36 Figure 5.4 Location of the sensing node and the gateway at DIT campus..……………………37 Figure 5.5 Overall circuit diagram to be simulated……………………………………………..38 Figure 6.1 Complete simulation circuit for the proposed system…………………………….....40 Figure 6.2 Simulation results of the proposed system………………………………………......41 Figure 6.3 Simulation of the sensing node…………………………………..………………….42 Figure 6.4 Simulation of the gateway / network coordinator………..……………………….....43 Figure 6.5 Simulation of android application displaying amounts of pollutant gases from specific node………………………………………………………………………………….....44 Figure 6.6 Simulation of android application showing real time data of temperature and humidity from the internet………………………………………………………………………45 Figure 7.1 PCB layout of the sensing node……………………………………………………..46 Figure 7.2 PCB layout of the gateway………………………………………………………….47
  • 12. xi Figure 7.3 3D layout of the sensing node……………………………………………………...47 Figure 7.4 3D layout of the gateway circuit………………………………………………...…48 Figure 7.5 Complete circuit of the sensing node………………………………………………48 Figure 7.6 Complete circuit of the gateway………………………………………………...…49 Figure 7.7 Sensing node prototype fixed at Block A………………………………………….50 Figure 7.8 Average results obtained from sensing node I……………………….………….....51 Figure 7.9 Average results obtained from sensing node II………………………………….....52
  • 13. xii LIST OF ABBREVIATIONS BRT BLE Bus Rapid transit Bluetooth CH4 Methane CO Carbon monoxide CO2 Carbon dioxide CEM Continuous Emission Monitoring DIT Dar es salaam Institute of Technology GSM Global System for Mobile H2S Hydrogen Sulphide NO Nitrogen Oxide NO2 Nitrogen dioxide PM Particulate Matter SO2 Sulphur dioxide UV Ultra Violet WHO UART WSN SDGs SOC PCB World Health Organization Universal Asynchronous Receiver Transmitter Wireless Sensor Network Sustainable Development Goals System On Chip Printed Circuit Board
  • 14. 1 CHAPTER ONE INTRODUCTION This chapter highlights the challenge and effects of poor air quality all around the world. Moreover, this chapter outlines the problem of poor air quality at DIT Dar es Salaam campus. Furthermore, objectives and significance of this project are also stated in this chapter. This chapter also gives an overview of step by step procedures which will be taken upon implementation (Methodology) of wireless sensor network for real time air quality monitoring at DIT Dar es Salaam campus. Meeting the objectives of this project with accuracy highly depends upon proper fulfillment of each of the below mentioned methods. 1.1 Background In formation Air pollution is one of the very challenging issues across the globe. The most recent WHO report outlines that an average 4.2 million deaths occur every year as a result of exposure to ambient (outdoor) air pollution. And moreover 91% of the world’s population lives in places where air quality exceeds the WHO guideline limits [1]. Air pollution in urban cities is mostly caused by emission from industries and combustion of fossil fuels, like coal and oil for electricity and road transport. Being one of the global challenges, maintaining good air quality is one of the global agenda as stated in goal eleven (11) of the Sustainable Development goals (SDGs), “Make cities and human settlements inclusive, safe, resilient and sustainable” [2]. On the way to accomplishing SDG eleven (11), this proposed title plays a part of monitoring air quality for the purpose posing awareness to DIT community and storing data which will enhance further researches on air quality. There are many factors that contribute to air pollution at DIT Dar es Salaam campus including transportation and construction activities taking place in the nearby buildings. Among these, burning of fossil fuels in motor vehicles is among the most significant contributors to air pollution. Transportation is the largest contributor to emissions of carbon monoxide and nitrogen oxides (NOx) and a major contributor to Volatile Organic Compounds (VOCs). Transportation also produces particulate matter, a component of smog and a cause of respiratory and breathing problems. [3].
  • 15. 2 It is with facts that, there is a major need for air quality monitoring at DIT Dar es Salaam campus in order to obtain proper data for the purpose of community awareness and further scientific researches with the aim of controlling air pollution. 1.2 Problem Statement DIT Dar es Salaam campus environment is located at the centre of Dar es Salaam city, moreover it is located at the middle of highly congested roads, (Morogoro road, Bibi Titi Mohamed and Aly Khan Road). This being the case the environment of DIT is likely to be highly subjected to poor air quality mainly due to the effect of green gases emitted by moving motor vehicles. Poor air quality at DIT is also contributed by construction activities of the nearby buildings. Hence people at DIT could be at risk of encountering health problems by inhaling polluted air. 1.3 Objectives The objectives of this project are divided into two main categories, which are Main Objective and Specific Objectives. 1.3.1 Main Objectives The main objective of this project is to design and develop a real time air quality monitoring system by using wireless sensor network for monitoring air quality at DIT Dar es Salaam campus. 1.3.2 Specific Objectives i. To establish design specifications ii. To design the sensing unit iii. To interface sensing unit with the control unit of the sensing node iv. To program control unit and interface it with communication module at the sensing node v. To program control unit and interface it with communication module at the gateway vi. To develop an android application interfaced by Google map for the display of the collected data 1.4 Significance of the project At the end of this project the following benefits will be achieved; i. People will have real time access of air quality information from their smart phones.
  • 16. 3 ii. The real time collected data from the system can further be used in researches with the purpose of air quality control. iii. This system can be used to monitor air quality in a very large area because it employs a network of sensor nodes, hence the larger the network, the larger the area covered. iv. The system is of a simple design and low cost, hence it can easily be implemented in any other area 1.5 Limitation The major limitation in this project lies in the means of communication system. The system is expected to deploy ZigBee technology for communication of the sensor nodes. This is an effective and a low cost technology however its effectiveness decreases with an increase in distance. Hence for larger area monitoring, many senor nodes must be deployed. 1.6 METHODOLOGY 1.6.1 Literature review This method involves searching for knowledge of topics directly related to this project through different ways, including reading books, research articles, journal and online documents amongst others. In search of literature about this project various sources have been observed to state how challenging is the problem of poor air quality all around the world and DIT not being an exception. Literature review has also revealed that there is no regular method of monitoring air quality at Dar es Salaam city center and in Tanzania at large. 1.6.2 Data Collection This step involves collecting information from different sources to verify whether there is really a need to conduct this project. The data collected from DIT and the National Environmental Management Council (NEMC) of Tanzania has proven the need of the proposed system. Moreover this step involves collecting information which helps in solving the mentioned problem through step by step accomplishment of the specific objectives. All data related to designing of the system has been collected and it will be well revealed in chapter four of this report.
  • 17. 4 1.6.3 Data Analysis This part involves logical and scientific interpretation of the collected primary data. It also involves manipulation of secondary data that yields to the design of the system and proper realization of specification of components to be used in the system as a whole. Data analysis of this project will be done as a second phase of the project. 1.6.4 System design After the logical and scientific interpretation of the data, there comes designing procedure. The results of data analysis are expected to be used in the whole process of designing the system. Furthermore, each component in the system is to be selected based on the specifications resulting from the data analysis. Designing of the system of this project will also be done as the second phase of this project. 1.6.5 Circuit Simulation This is where the designed system (circuit) is tested by the use of simulation software and observation is made following the simulation results. Circuit simulation provides practical feedback in designing of real world system henceforth allows determination of the correctness and efficiency of the design before actual system construction. In this project circuit simulation is expected to be done in the second phase. 1.6.6 System implementation and prototype testing This part in general marks the climax in designing of the system. Implementation and prototype testing involves the physical set up of components and integration of different blocks of system to yield a whole system as stated by the main objective of the project. Moreover this is the part of the project that will indicate the general success or failure of the designed system. This method will as well be done in the second phase of the project. 1.6.7 Report writing This is generally recording and gathering of information in each stage of the project. Report writing is considered to be the most important part of this project because it generally states all the necessary steps in implementation of this project and it outlines various literatures and projects in attempt of solving this very same problem. Report writing of this project has been
  • 18. 5 divided in two phases. The first phase mainly includes introduction of the title, problem statement, literature review and data collection. The second phase of this report will mainly deal with data analysis and implementation of the prototype. 1.7 Chapter Summary This chapter generally gives the background information, states the problem and explains the objectives of this project. Moreover the significance of the project and its anticipated limitation are also stated in this chapter. Briefing of each procedure that will be taken in the milestone of accomplishing this project is as well explained in this chapter. Each of the explained procedures will further be analyzed in the next chapters of this report. These next chapters are expected to give more details by using references, figures, tables or any other means that will be seen fit to enhance easy understanding of the reader.
  • 19. 6 CHAPTER TWO LITERATURE REVIEW 2.1 Introduction This chapter provides necessary information about the operation, features and limitation of the previous works. Moreover, it gives the gap of development between existing system and the proposed system. This chapter also provides basic knowledge of the whole concept of air quality monitoring systems and a reason to implement the proposed system. 2.2 Background information “Air quality” refers to the condition of the air within our surrounding. Good air quality pertains to the degree which the air is clean, clear and free from pollutants such as smoke, dust and smog among other gaseous impurities in the air. [4] Air pollution can be defined as the presence of toxic chemicals or compounds in the air, at levels that pose a health risk. In a broader sense, air pollution means the presence of chemicals or compounds in the air which are usually not present and which lower the quality of the air or cause detrimental changes to living organisms in a particular polluted air zone. In Dar es Salaam city the major source of air pollution is the emissions from moving motor vehicles, electricity generators and industrial activities. These sources emit a wide range of pollutants classified under different categories that include Sulfur Dioxide (SO2), particulate matter, Lead, Carbon Dioxide (CO2) and Carbon Monoxide (CO), Hydrogen Sulphide (H2S) and Nitrogen Oxides (NOx). [5] With all such a huge number of pollutants it is obvious that the lives of people breathing this air at highly exposed to health implications such as lung cancer, asthmatic reactions and tuberculosis to mention a few. [5] Since air pollution is a global issue, WHO has set some standards for the air quality which are to be adhered worldwide, in the mission of protecting lives of living organisms especially human beings. More details of air quality standards will be provided in the next chapter of this report.
  • 20. 7 Air pollution being a global challenge, there exist several different systems at work in monitoring air quality at different levels and in parts of the world. It is in acknowledging the efforts made by different concerned engineers and scientists that this report admits that all the systems/projects designed with the aim of monitoring air quality are of significant value and definitely impact the improvement in solving air quality challenge. 2.3 International Air Quality Index (AQI) The AQI set by the Environmental Protection Agency (EPA) of the USA is the one used as the international standard index for air quality. This very same AQI standard is also used in Tanzania. AQI can simply be compared to a yardstick that runs from 0 to 500. The higher the AQI value, the greater the level of air pollution and the greater the health concern. For example, an AQI value of 50 represents good air quality with little or no potential to affect public health, while an AQI value over 300 represents air quality so hazardous that everyone may experience serious effects. [6] The purpose of the AQI is to help you understand what local air quality means to your health. To make it easier to understand, the AQI is divided into six levels of health concern as shown in Table 2.1.
  • 21. 8 Table 2.1: AQI in relation to health [6] Each category in Table 2.1 corresponds to a different level of health concern:  Good The AQI value for your community is between 0 and 50. Air quality is satisfactory and poses little or no health risk.  Moderate The AQI is between 51 and 100. Air quality is acceptable; however, pollution in this range may pose a moderate health concern for a very small number of individuals. People who are unusually sensitive to ozone or particle pollution may experience respiratory symptoms.  Unhealthy for Sensitive Groups When AQI values are between 101 and 150, members of sensitive groups may experience health effects, but the general public is unlikely to be affected.  Ozone: People with lung disease, children, older adults and people who are active outdoors are considered sensitive and therefore at greater risk.
  • 22. 9  Particle pollution: People with heart or lung disease, older adults and children are considered sensitive and therefore at greater risk.  Unhealthy Everyone may begin to experience health effects when AQI values are between 151 and 200. Members of sensitive groups may experience more serious health effects.  Very Unhealthy AQI values between 201 and 300 trigger a health alert, meaning everyone may experience more serious health effects.  Hazardous. AQI values over 300 trigger health warnings of emergency conditions. The entire population is even more likely to be affected by serious health effects. 2.4 How AQI is calculated Different instruments are set up to collect air samples and physically measure SO2, NOx, PM, etc. these instruments measure concentration, i.e. unit less proportions (e.g. parts per million) or mass per volume (e.g. micrograms per cubic meter) [6] The goal is to convert the pollution concentration into a number between 0 and 500. The AQIs of 0, 50, 100, 150…500 are referred to as “breakpoints.” Each AQI breakpoint corresponds to a defined pollution concentration. The pollution concentration between the breakpoints is linearly interpolated using the equation hereunder: [6] Where; Ip is the index of the pollutant; Cp is the rounded concentration of pollutant p; BPhi is the breakpoint greater or equal to Cp BPlow is the breakpoint less than or equal to Cp;
  • 23. 10 Ihi is the AQI corresponding to BPhi; Ilow is the AQI corresponding to BPlow. The AQI is determined by the pollutant with the highest index. For example, if the PM2.5 AQI is 125, the PM10 AQI is 50, SO2 is 30, NOx is 50, and all other pollutants are less than 125, then the AQI is 125–determined ONLY by the concentration of PM2.5. Some several existing air quality monitoring systems are briefly explained in the following section of this chapter. 2.5 Existing systems. As mentioned earlier, there are several existing systems with the aim of monitoring air quality. These systems are implemented at different levels and in different environments depending on the particular objectives of the designed system. Below is a list of several existing systems with a brief explanation of each. 2.5.1 HORIBA Air Quality Monitoring System This system consists of an Air Quality Monitoring Station (AQMS) that measures metrological parameters such as wind speed, wind direction, rainfall, radiation, temperature, barometric pressure and ambient parameters. The system also integrates a series of ambient analyzers to monitor the concentration of air pollutants (such as SO2, NOx, CO, O3, THC, PM, etc.), continuously. HORIBA AQMS also provides mobile monitoring stations that are used to monitor ambient conditions at multiple sites. [7] The system is simply made of a moving vehicle with an embedded air quality monitoring system. The data collected from the air quality monitoring system is directly sent to the central office for further manipulation as seen in Figure 2.1.
  • 24. 11 Figure 2. 1 HORIBA Air Quality Monitoring System [7] Advantages of HORIBA Air Quality Monitoring System i) The measured data can be remotely monitored ii) The system operates and sends data in real time iii) The system is also used to monitor metrological parameters example wind speed, wind direction and rainfall. Disadvantages of HORIBA Air Quality Monitoring System i) This system does not pose any indication to the community. ii) Implementation of this system is intricate due to the use of moving vehicles iii) The system design is complex 2.5.2 A Wireless Sensor Network for Air Monitoring System in Industrial Areas In this system sensors such as MQ4, MQ9 and LM35 are used for detection of gases and temperature. These sensors are connected to microcontrollers respectively and UART through RF transmitter and receiver connected wirelessly cause communication between microcontroller and lpc2148 for data transmission. [8] The lpc2148 interface with LCD display for the different
  • 25. 12 parameters and through ZigBee it is being transmitted to PC. A block diagram of this system is shown in Figure 2.2. Figure 2. 2 Block Diagram of WSN for Air Monitoring System in Industrial Areas [8] Advantages of Wireless Sensor Network for Air Monitoring System in Industrial Areas i) The major advantage of this system is capable of monitoring air quality of a large area ii) The system allows remote monitoring of air quality
  • 26. 13 Disadvantages of Wireless Sensor Network for Air Monitoring System in Industrial Areas i) The system design is relatively complex compared to the proposed one ii) The system design is expensive since it requires separate nodes for separate sensors iii) This system does not pose close indication to the community around the area 2.6 Existing methods in Tanzania [9] Recently the existing systems and methods used for measuring and monitoring air quality in Tanzania are based on laboratory tests. Samples are collected from pound sand of particular places then taken for laboratory tests [10].The procedures are as seen in Figure 2.3. Figure 2. 3 Block diagram presenting the existing procedures of air quality measurement 2.6.1 Indoor laboratory testing unit Currently there many different instruments which are used in laboratories to measure the concentration quantity of green gases but they are stationary and they are commonly used in vast laboratories. These instruments are known as indoor air quality meters. An indoor air quality meter is used in a confined space to prevent mold, to monitor CO2 levels, or to detect other gas leaks [11]. Sample collection unit Laboratory test unit Data analysis unit Results presentation unit
  • 27. 14 Advantages of Laboratory based system i. The system has relatively high degree of maintenance and no interferences from outside air condition. ii. The system has immunity to moisture interface. iii. It is suitable in indoor ppm levels. Disadvantages of Laboratory based system i. The data recording mechanism is not of real time. ii. Relatively of high cost because it requires drawing many samples and at different places iii. Most laboratory instruments have got detection limit. iv. The laboratory instruments are not designed to store data after recordings. v. The system is highly prone to human errors during reading and recording of the results. 2.7 Embedded system for roadside air quality monitoring at DIT BRT station This system is mainly made up of several sensors which are to detect changes in air quality, a control unit which is used to process all the data received from the sensor and give indication by the use of LEDs, then sends the particular data to a database for storage. The data is sent to the database by a GSM communication module. Figure 2.4 below shows the block diagram of this system. [9]
  • 28. 15 Figure 2. 4 Block Diagram for Embedded system for roadside air quality monitoring at DIT BRT station Advantages of Embedded system for roadside air quality monitoring at DIT BRT station i) The system allows real time observation of air quality for passengers within DIT BRT bus station ii) The system sends data to the authorities, which helps in furthering researches related to air quality monitoring. Disadvantages of Embedded system for roadside air quality monitoring at DIT BRT station i) This system is only limited to air quality monitoring of one small specific area. ii) The system used GSM communication as means of sending information to the authorities. For real time monitoring, this could be expensive because air changes are prone to happen every now and then, hence updates will also be required.
  • 29. 16 2.8 Reasons for Proposed System There is an enormous need for air quality monitoring in Dar es Salaam city due to a vast increase in number of moving motor vehicles and urban industries. Several methods are used in monitoring air quality in Tanzania but all of them tend to have some limitation and hence restrict the effectiveness of air quality monitoring. The proposed system is mainly an advancement of the “Embedded system for roadside air quality monitoring at DIT BRT station”. The major limitation of this system is the main advancement of the proposed system. The proposed system is expected to cover a larger area in monitoring as opposed to just one small specific area. 2.9 Chapter Summary This chapter generally gave a brief background information of air quality monitoring concept. Furthermore, this chapter has reviewed several systems applied in air quality monitoring in Tanzania as well as technologies applied in some other countries. Moreover, a section in this chapter has outlined the importance and the reason behind execution of the proposed system.
  • 30. 17 CHAPTER THREE THE PROPOSED SYSTEM 3.1 Introduction This chapter mainly describes the blocks and details of the proposed system; each block of the system will be explained. Moreover, explanations will show how blocks are related to other blocks in the system. 3.2 Block Diagram of the Proposed System Figure 3.1 shows the block diagram of the proposed system; “Wireless Sensor Network for Air Quality Monitoring at DIT Dar es Salaam campus” Figure 3. 1 Block diagram of the proposed system
  • 31. 18 3.2.1 Parts of the Proposed System i) Sensing Node A single sensor node is mainly comprised of a sensing unit, control unit and a communication module. For effective air quality monitoring, the system needs to have several similar sensing nodes scattered in different places. a) Sensing Unit This unit is made up of several sensors, in which each sensor detects a particular change of chemical concentration in the air, then converts the results into an electrical signal which can further be processed by next part of the node. b) Control Unit This is a sub block made up of the processor and the memory. The processor is responsible for manipulation and processing of the signal received from the sensing unit. The memory is responsible for temporary storage of information from the processor before transmission. c) Communication Module This module is responsible for transmission and reception of information from and into the node respectively. d) Power Supply This unit supplies power to the all the parts of the node as per their specifications. ii) Network Coordinator/Gateway This is the brain of the whole system. Network coordinator/Gateway is composed of a processor, memory, communication module and power supply. a) Control Unit This is main part of the gateway, it manipulates, processes and make intelligent decision on the data that it receives from the communication module, it then sends the ready processed data to the cloud through the same.
  • 32. 19 b) Communication Module This part of the system is mainly used for transmission and reception of data from and to the gateway respectively. This part is responsible for receiving data from the sensing nodes and transmitting the processed final data from to the cloud. c) Power Supply This unit supplies power to the all the parts of the network coordinator/gateway as per their specifications. iii) Cloud This is can simply be referred to as online storage of data. All the data from the system are collectively sent to this online storage to allow wide access. In this system data from the cloud will specifically be accessed by the use of an android application. This application will be interfaced with Google map, to enhance the user to see the exact location of air quality data being displayed. 3.3 Operation of the Proposed System The system has two main parts, the sensing node and the network coordinator/ gateway. There ought to be several sensor nodes placed in different areas of interest. The sensing units within the nodes detect changes of chemical concentration in the air and convert the results into electrical signals which can then be manipulated by the processor and sent to the communication module for transmission. These very same nodes that are used for detecting changes of chemical concentrations in the air are also used as communication hops for the nodes that are far from the gate way. The furthest node from the gateway will send its data to the fore next node and in a similar manner the data will be transferred until it arrives to the network coordinator/gateway. The network coordinator/gateway receives data from all the nodes in the system and manipulates them. The memory within the network coordinator stores data temporarily because
  • 33. 20 it the processor itself cannot processes bulky data all at once. Moreover, the network coordinator/gateway filters and rearranges data in a proper way and sends the data to the communication module in order to be sent to the cloud. An android application will be designed along with the system in order to ease the access of air quality information to individuals. This android application will be interfaced with Google map to enhance an individual to see the exact location of air quality data being displayed. 3.4 Advantages of the Proposed System i. The proposed system is expected to achieve air quality monitoring in a very wide area. The design enhances very wide coverage, it only requires addition of sensor nodes when expansion coverage is required. ii. The system allows access of air quality information to all individuals with android smartphones. iii. Stored data from the cloud can be used by authorities and stakeholders for further researches with the aim of controlling air quality. iv. The design of the system is simple and of low cost, hence it can easily be implemented in any other area with similar requirements. 3.5 Drawback of the Proposed System The major drawback of the proposed system lays in the security challenge that comes along during transmission of data from one node to another, especially when the intended area of coverage keeps increasing. For implementation in a more expanded area, it is a must to incorporate cluster nodes between the sensor nodes and the network coordinator/gateway, which in turn increases the cost and complexity of the system. 3.6 Chapter Summary This chapter has given the details on the constituents of the proposed system. It also explains how the system works by analyzing the function of each block in the system. The next chapter will give details about the collected data to verify the need of the proposed system.
  • 34. 21 CHAPTER FOUR DATA COLLECTION 4.1 Introduction This chapter accounts for detailed information collected from different sources. The data collected in this project can essentially be divided into two main categories which are primary data and secondary data. Primary data is the type of data that mainly justifies existence of the stated problem. From this project, amongst other cited/referenced sources, primary data has been collected from Muhimbili National Hospital and the National Environmental Management Council (NEMC)-Tanzania. Secondary data is the data that facilitates the implementation of the proposed solution. The functionality of the proposed system all relies in the correctness of the secondary data collected. 4.2 Deaths and health defects caused by poor air quality Poor air quality remains a threat to the health of those exposed to the same, as it has been proven by Muhimbili National Hospital in table 4.1. [12] Table 4. 1: Numbers of deaths and health problems related to poor air quality Years 2000-2002 2003-2005 2006-2008 2009-2011 2012-2014 2015-2017 Deaths 5 18 12 9 21 3 Health problems 87 105 129 147 191 205 Table 4.1 provided by Muhimbili National Hospital is a vivid evidence that poor air quality can cause health problems and even deaths to the victims affected. This data alone proves that the problem stated exists not only at DIT environment but in Tanzania at large hence something has to be in attempt of solving the stated problem.
  • 35. 22 The fact that poor air quality can cause health problems has also been put in records by the International Journal of Communication Networks and Information Security of the USA in its volume nine article with the title, “Urban Air Pollution Monitoring” [13] as it can be seen in table 4.2. Table 4. 2 The six standard pollutants and their health effects [13] 4.3 Data for Air quality monitoring in Tanzania at large As explained by NEMC from an interview conducted on 22nd January 2018, Tanzania does not have an air quality monitoring system. NEMC only collects air quality data from a specific location whenever it receives complains from a community residing in that specific location.
  • 36. 23 Table 4.3 shows a list of questions and their corresponding responses from NEMC recorded from this interview. Table 4.3: List of interview questions and their corresponding answers from NEMC S/N Question Answer 1. How often is air quality monitored in Dar es Salaam city? There is no continuous monitoring of air quality in Tanzania. 2. How does NEMC detect poor air quality? Through data collection in an area that has been reported to have polluted air by the community 3. Does Tanzania have a set of standards for air quality? Yes, Tanzania has air quality standards to be adhered to. 4. Are there any health records arising from air pollution effects? Yes, a well detailed report can be obtained from Muhimbili National Hospital 5. What AQI does Tanzania use? Tanzania uses the International AQI as set by EPA from USA 6. Is there any need for having a real time Air Quality Monitoring System? Yes and it would be very helpful in keeping records of air quality for further researches
  • 37. 24 As explained by NEMC from the interview, Tanzania has a set of air quality standards to be adhered to. Table 4.3 shows air quality standards used in Tanzania as provided by NEMC. Table 4. 4: Tanzania national air quality standards [14] Pollutant Averaging period Maximum (ambient) concentration Goal within 10 years (maximum allowable exceedances) Carbon monoxide 8 hours 9.0 ppm 1 day a year Nitrogen dioxide 1 hour 0.12 ppm 1 day a year 1 year 0.03 ppm None Photochemical oxidants (as ozone) 1 hour 0.10 ppm 1 day a year 4 hours 0.08 ppm 1 day a year Sulfur dioxide 1 hour 0.20 ppm 1 day a year 1 day 0.08 ppm 1 day a year 1 year 0.02 ppm None Lead 1 year 0.50 µg/m3 None Particles as PM10 1 day 50 µg/m3 5 days a year
  • 38. 25 4.4 Data collected from DIT Dar es Salaam campus The figure below has been captured during morning hours from google map indicating congestion of vehicles at the roads surrounding DIT Dar es Salaam campus. Figure 4. 1 A picture of map showing congestion of roads around surrounding DIT
  • 39. 26 4.5 Data Collected on the Requirements of the Proposed System These are the data to be used in designing the proposed system for solving the existing problem. These data have been collected by reviewing relevant literatures from different books and materials from the Internet. 4.5.1 DIT campus Knowing the total area of DIT, the particular arrangement of the buildings and the general environment will be useful in designing of the proposed system, since it helps in realizing where exactly the sensor nodes should be placed. The figure 4.2 below shows a satellite map of DIT obtained from google map, displaying area of the campus in square meters. Figure 4.2 Satellite map of DIT showing total area of the campus
  • 40. 27 4.5.2 Wireless Sensor Networks in details With the technology development of the sensors, integrated circuits and wireless communications have paved the way for the fast growth of wireless sensor networks. WSNs are capable of detecting, measuring and gathering data from the real world (air quality, water quality, weather and traffic conditions, etc.) and transferring the information to end users. [13] Wireless sensors systems can be placed anywhere as the conventional wired network cannot be deployed, example; volatile places like high-temperature areas, chemical and toxins prone areas. The capability of self-organization, ability to process concurrently, economical, limited energy resources, limited range of operation, fault tolerance and rapid deployment characteristics of Wireless Sensor Networks make them resourceful for versatile applications like intelligence and monitoring and of targeted areas. Table 4. 5 below shows details of communication technologies deployed in WSNs [15] Category BLE Wi-Fi ZigBee XBee LORA Main Network Topology Star Star, Mesh Mesh, star,P2P Mesh, star,P2P Star Range 50m 50 – 100m 305m - 6.5KM 305m - 6.5KM 433m – 10KM RF Data Rate 3.5Kbps >11Mbps 250Mbps 200Mbps 600kbps Power Consumption Low High Low Low Low Connection Time <10s <3s 30ms 30ms 30ms 4.5.3 Gas Sensors Available Gas sensors operate in different modes. Table 4.4 below display details of each mode. Table 4. 6: Different types of gas sensor available in the market and their properties [9] SENSOR TYPES AVAILABILITY COST SENSITIVITY RANGE OF MEASUREMENT(ppm) Opt-chemical High cheap Low 0-1000 Biomimetic Moderate Expensive Moderate 0-5000 Semiconductor Moderate Average High 0-10000 Electrochemical Moderate Average High 100-1000
  • 41. 28 4.6 Chapter Summary This chapter has described the data collected from different sources. The collected has proven the existence of the stated problem. The data collected also act as a guide towards designing of the system proposed system. The next chapter contains the summary of this report wrapped up as conclusion and recommendation.
  • 42. 29 CHAPTER FIVE DATA ANALYSIS AND SYSTEM DESIGN 5.1 Introduction This chapter gives details about data analysis and design of the proposed system. The analysis and designs are all based on the data collected in the previous chapter. Data analysis involves both qualitative and quantitative analysis. Designing of the system will emerge from the block diagram of the proposed system as seen in figure 3.1 of chapter three. 5.2 Sensing node As explained in chapter three of this report, a single sensing node will be comprised of a sensing unit, a control unit, a communication module and a power supply system which will be used a source of power by all the elements within this node. Data analysis of the sensing node as whole will be done by analyzing each unit within the node. 5.2.1 Sensing unit The sensing unit is mainly comprised of specific sensors that will be measuring and detecting the presence of harmful gases present in the surroundings. Data collected from NEMC as seen in table 4.1 of chapter four above identify the harmful gases to be; Carbon monoxide (CO), Nitrogen dioxide(NO2), Photochemical oxidants (Ozone), Sulphur dioxide (S2), Lead (Pb) and Particulate Matter. In selecting appropriate sensors to measure and detect the above mentioned gases the following criteria have been considered; i. Good sensitivity to flammable gas in wide range ii. High sensitivity to harmful gases iii. Simple drive circuit iv. Must have a capability of sensing gas concentration in wide range from 10ppm and above. From above considered criteria the following sensors have been selected for this project;  CJMCU 4514: This sensors detects the amount of carbon monoxide (CO), Nitrogen dioxide (NO2), Ammonia (NH3) and Methane (CH4) that is present in the air.  MG8 11: This sensor detects the amount of CO2 present in the air.
  • 43. 30  MG8 11: This sensor detects the amount of Particulate Matter (PM2.5 and PM10) present the air. 5.2.2 Control unit for the sensing node A control unit used to process the signal from input and produce the required output in accordance to the proposed system. Requirements for a control unit are as follows. i. Built in analog to digital converter ( ADC) ii. At least 20 input/output pins iii. Speed at least 16MHz iv. Programming memory at least 32KB v. At least 4 pins supporting serial communication Qualitative Analysis of Control Unit In order to select suitable control unit for the sensing node a comparison between different Control units available in the market has been shown in table 5.1 below Table 5.1: Comparison of the available control units SPECIFICATIONS PIC 18F452 PIC 16F887 AT mega 328p PIC 16F84 Program memory(KB) AGREE DISAGREE AGREE DISAGREE I/O pins AGREE AGREE AGREE DISAGREE Built in ADC PRESENT PRESENT PRESENT ABSENT Speed (MHz) AGREE AGREE AGREE DISAGREE Oscillator circuit built in DISAGREE DISAGREE AGREE DISAGREE Serial communication support DISAGREE DISAGREE AGREE DISAGREE From the comparison made in table 5.1, ATMEGA 328P has been chosen as a control unit for the sensing nodes. Moreover ATMEGA 328P is specifically used for the sensing nodes of this project because of the following reasons;  With program memory of 32 Kbytes ATMEGA328P applications are many.
  • 44. 31  With various POWER SAVING modes it can work on MOBILE EMBEDDED SYSTEMS.  With Watchdog timer to reset under error it can be used on systems with minimal human interference.  Also with in chip temperature sensor the controller can be used at extreme temperatures. 5.2.3 Communication module For communication to be well established between the sensing nodes of the proposed system, communication module of the following requirements should be deployed; i. Communication coverage range of at least 200m ii. Low power consumption iii. Ability to perform normal operations under temperatures of above 400 C iv. Free communication service v. Low coast vi. Readily available in the market Qualitative Analysis of Communication module In order to select suitable communication module for the sensing node a comparison between different Communication modules available in the market has been shown in table 5.2.
  • 45. 32 Table 5.2: Comparison of the available communication modules 5.3 Gateway / Network coordinator This block of the system is responsible for receiving data collected from all the sensing nodes and processing them as whole, in order to give a final output results which will then be sent to the cloud database. The Gateway / Network coordinator in this project consists of two major elements namely;  Control unit  Communication module 5.3.1 Control Unit for the gateway / network coordinator Table 5.3 below shows a comparison of different control units and the specifications required for the gateway / network coordinator. SPECIFICATIONS BLE WI-FI ZigBee XBee LORA Low Power Consumption AGREE DISAGREE AGREE AGREE AGREE Communication range of at least 200M DISAGREE DISAGREE AGREE AGREE AGREE Easy availability in the Market AGREE AGREE AGREE DISAGREE AGREE Low Cost AGREE AGREE DISAGREE DISAGREE AGREE Ability to operate normally in temperatures above 400 C DISAGREE DISAGREE DISAGREE DISAGREE AGREE Service Free AGREE DISAGREE AGREE AGREE AGREE
  • 46. 33 Table 5.3 Comparison of different control units and specifications required for the gateway SPECIFICATIONS PIC18F452 PIC16F887 ATMEGA328P NODE MCU 12E Embedded communication module DISAGREE DISAGREE DISAGREE AGREE Low operating voltage AGREE AGREE AGREE AGREE Small in physical size DISAGREE AGREE AGREE AGREE Built in ADC AGREE AGREE AGREE AGREE Processing speed about 8Mhz AGREE AGREE AGREE AGREE From the above made comparison, Node MCU 12E has been selected to be used as a control unit for the gateway mainly because it is has an embedded communication module. As explained previously, the network coordinator/gateway is responsible for receiving data from the sensing node, processing the received data and hence forth sending them to a cloud server. Based on its function, the network coordinator / gateway must consists of two communication modules, a single LoRa – 02 module for receiving data from the sensing nodes and another communication module which will be responsible for sending the final results to a cloud sever. Hence to avoid the complexity of having two communication modules, node MCU 12E has been chosen to as control unit for this gateway because it has an embedded communication module. 5.4 Software Design In this project software design is divided into three main categories;  Software design for the sensing node  Software design for the gateway / network coordinator  Software design for the android application
  • 47. 34 5.4.1 Software Design for the sensing node The software in the sensing node is designed to bring about coordination of the whole block. The control unit (ATMEGA 328P) interfaced with the sensing unit and the communication module (LoRa - 02), has been programmed to fetch data from the sensing unit, process the data and send it to the communication module. The software used to program the control unit has been written using C language and it has been designed based on the flow chart shown in figure 5.1 below START READ SENSORS SEND DATATO GATEWY Figure 5.1 Flow chart of software design for the sensing node 5.4.2 Software Design for the gateway / network coordinator The software for the network coordinator has been designed to receive data from the sensing nodes, process them and send the processed data to the cloud server. The control unit for gateway / network coordinator (Node MCU 12E) has been programmed by C language and it functionality is based on the flow chart shown in figure 5.2 below.
  • 48. 35 START GET DATA FROM SENSING NODE PROCESS RECEIVED DATA SEND DATATO CLOUD MORE DATA TO SEND? YES NO END Figure 5.2 Flow chart of software design for the gateway / network coordinator 5.4.3 Software Design for android application Android application software for this project has been designed in for the purpose of allowing individuals to access the data of air quality collected by different sensing nodes. This android application has been designed and written in an open source software platform called Android Studio. The design of this application has been done base on the flow chart shown in figure 5.3 below.
  • 49. 36 START THEAPP SPLASH SCREEN APPEARS REGISTERED USER? YES ENTER LOGIN CREDENTIALS NO CREATE NEW ACCOUNT YES FORGOT PASSWORD RETRIEVE PASSWORD USING USER INFORMATION DOES LOGIN CREDENTIAL MATCH? NO – REENTER CREDENTILS YES DISPLAY THEMAIN SCREEN IS DATA DISPLAYED IN REAL TIME? NO REFRESH APP/ FETCH DATA FROM CLOUD YES END Figure 5.3 Flow chart of android mobile application 5.4.3.1 Android development Android software development is the process by which new applications are created for devices running the Android operating system, Android apps can be written using Kotlin, Java, and C++ languages" using the Android software development kit (SDK), while using other languages is also possible. In this project both Kotlin and Java programming languages have been used for android development. Kotlin is a cross-platform, statically typed, general-purpose programming language. Kotlin is designed to interoperate fully with Java, and the JVM version of its standard library depends on the Java Class Library.
  • 50. 37 5.5 Location and positioning of the system As the project title suggests, this project is intended to be placed at DIT – Dar es Salaam campus. The gateway / network coordinator will be placed at Telecom department and the sensing nodes will be placed at different positions within the campus. For effective air quality monitoring within the campus there should be a minimum of five sensing nodes, each node placed at different location as indicated in figure 5.4 below. Figure 5.4 Location of the sensing nodes and gateway at DIT campus KEY - Location of the gateway / network coordinator - Location of the sensing nodes The sensing nodes will be positioned at a height of approximately three (3) meters from the ground preferably outside the buildings, because this project aims at monitoring ambient air quality. The gateway/network coordinator will be placed inside the Electronics and Telecommunications building.
  • 51. 38 5.6 Overall circuit diagram Figure 5.5 below shows the overall circuit diagram of whole proposed system which is to be simulated. Figure 5.5 Overall circuit diagram to be simulated 5.7 Conclusion This chapter has analyzed all the basic elements that will be used in in the proposed system. Furthermore, the software designing has also been analyzed based on flow charts. The analysis in this chapter has also considered the placement and positioning of the system. System simulation will be clearly presented in the next chapter based on overall circuit diagram shown in this chapter.
  • 52. 39 CHAPTER SIX SIMULATION AND RESULT DISCUSSION 6.1 Introduction Electronic circuit simulation uses mathematical models to replicate the behavior of an actual electronic device or circuit. Simulation software allows modeling of circuit operation and is an invaluable analysis tool. Electronics simulation software engages the user by integrating them into the learning experience. These kinds of interactions actively engage learners to analyze, synthesize, organize, and evaluate content and result in learners constructing their own knowledge. Simulating a circuit’s behavior before actually building it can greatly improve design efficiency by making faulty designs known as such, and providing insight into the behavior of electronics circuit designs. 6.2 Simulation Software The simulation software used for this project is Proteus. The Proteus simulation tool is chosen because of the following reasons; i. It is rich in libraries of different types of electronic components and modules. ii. It performs well in different varieties of projects ranging from simple electronic circuit to complex ones. iii. In addition to simulation Excellency, it offers a capability to prepare printed circuit boards for actual realization of the prototypes of different designed systems. 6.2.1 Simulation Environment The following are simulation environment for the designed system. i. Available gas sensors library is digital, hence potentiometer is used instead to show gas sensed at different concentration level. ii. The information of the environmental condition in sensing and operation node is observed by using Virtual terminals.
  • 53. 40 6.2.2 Complete Simulation Circuit for Proposed System Figure 6.1 Complete Simulation Circuit for Proposed System 6.3 Simulation Description The gases detection mechanism detects the presence of the harmful gases and convert the gas concentration level into corresponding electrical signal. This is done by sensors at the sensing node. The measured data is then sent to the control unit of the sensing node for processing, there after the communication module of the sensing node (LoRa I) sends the data to the gateway/network coordinator. The gateway/network coordinator receives data from the sensing node through its communication module (LoRa II), there after the data is processed by the control unit and sent to the cloud server through internet which is accessed by the gateway via a Wi-Fi embedded module namely node MCU 12E. Individuals will be able to access the air quality data by the use of an android application which will display the data in real time and the exact location of occurrence by using Google map.
  • 54. 41 6.4 Simulation results and discussion The following snip shows proteus simulation according to the proposed system. The data terminal at the sensing node displays the data as obtained from the sensors, virtual terminal for LoRa I displays the data before sending it to the gateway. Virtual terminal for LoRa II displays data as it is received from the sensing node before it further processed by the control unit of the gateway. Finally the virtual terminal for node MCU verifies that the data processed by the control unit it being sent to the cloud. Figure 6.2 below shows the simulation results of the proposed system. Figure 6.2 Simulation results of the proposed system 6.4.1 Simulation of the sensing node The sensing unit which comprises of the PM sensor, Carbon dioxide gas sensor, Carbon monoxide and Nitrogen dioxide gas sensor sends the measured data to the control unit for processing, thereafter the communication module (LoRa I) sends the data to the gateway. The virtual data terminal readings verifies that that data is captured from every element of the sensing unit. Figure 6.3 below shows simulation of the sensing node.
  • 55. 42 Figure 6.3 Simulation of the sensing node 6.4.2 Simulation of the gateway/network coordinator LoRa II (communication module) receives data from the sensing node, thereafter the data is processed by the control unit of the gateway and is sent to the cloud by Node MCU terminal. This can be verified by virtual terminal for LoRa II and virtual terminal for Node MCU as captured from the simulation software in figure 6.4 below.
  • 56. 43 Figure 6.4 Simulation of the gateway/network coordinator 6.4.3 Simulation of the android application As it has been clearly stated in previous chapters and in the specific objectives of this project, air quality data measured by the system will be accessed by individuals through android application. The android application has been designed and constructed by using Android Studio. Upon separate simulation of the android application it has been observed that the application is up and running and it can access the internet in real time, hence accessing the data collected will be prosperous. Figure 6.5 below shows the captured screen of the application
  • 57. 44 from an android phone. This figure displays dummy data of pollutant gases just for simulation purposes. Figure 6.5 Simulation of android application displaying amounts of pollutant gases from one specific node Figure 6.6 below shows a screen shot of the android application displaying real data of temperature and humidity from the internet. This simulation feature justifies that application can access real time data from the internet.
  • 58. 45 Figure 6.6 Simulation of android application showing real time data of temperature and humidity from the internet
  • 59. 46 CHAPTER SEVEN PROTOTYPE IMPLEMENTATION 7.1 Introduction This chapter gives details of the prototype construction from the design specifications. It also describes the performance testing parameters, testing procedures, results and discussions of overall performance of the prototype. 7.2 Printed Circuit Board Construction The circuit layouts of the designed system were prepared in proteus software and translated into Printed circuit board (PCB). Then, the etching process was done by using acidic solution. Figure 7.1 shows the (PCB) layout of the sensing node, figure 7.2 shows the (PCB) layout of the gateway circuit, figure 7.3 and 7.4 shows 3D views of the sensing node and the gateway design respectively. 7.1 PCB layout of the sensing node
  • 60. 47 7.2 PCB layout of the gateway 7.3 3D layout of the sensing node
  • 61. 48 7.4 3D layout of the gateway circuit 7.3 Components Mounting and Connections After the preparations of the PCB the components were mounted to their respective places and soldered. Figure 7.5 and figure 7.6 show complete circuits of the sensing node and the gateway respectively. Figure 7.5 Complete circuit of the sensing node
  • 62. 49 Figure 7.6 Complete circuit of the gateway 7.4 Prototype Performance Test The following are the performance testing parameters of the prototype i. Voltage variation of the gases from the sensors at the sensing node ii. Output voltage of the control unit at the sensing node 7.5 Prototype Performance Testing Tools and Procedures The performance testing was done by using voltmeter for measuring voltage variation at different test points. The sensing node circuit was switched on and the measurement of the performance-testing variable was done by using the voltmeter. 7.6 Results and Discussion The following table shows the results of the measurements from working prototype of the sensing node.
  • 63. 50 Before any gas is detected, the analog output sensor must read 0V but because there is a small amount of surrounding gases, a little amount of output voltage measured as shown below. Table 7. 1 Variation of output voltage at the sensing node circuit Gas sensor Vcc input power supply Analog output reading (Before gas detection) Analog output reading(after gas detection) CJMCU 4514 4.8V 2.3V 3.3V MG811 4.7V 3.5V 4.5V SDS011 4.8V 1.8V 3.9V The results shown on the table above clearly proves that the sensing node circuit does its intended function of detecting the variation of pollutant gases from the surroundings. 7.7 Overall Results Discussions The results show that the implemented prototype of the sensing node functions as expected. Moreover after testing, the system was implemented to observe the results. One sensing node was placed at Block A, near the main gate (see figure 7.8) and another node was placed at Block IV near the football ground. Figure 7.7 Sensing node prototype fixed at Block A
  • 64. 51 In a period of seven days, the average results obtained from the database reveal that, the areas around Block A, near Morogoro road have higher levels of Carbon monoxide (CO) and Nitrogen dioxide (NO2) as compared to any other area of the campus. See figure 7.8. Figure 7.8 Average results obtained from sensing node I Moreover, during the same seven days period, an average of results from the second sensing node placed at Block IV revealed that, there is a higher content of PM10, PM2.5 and Carbon dioxide (CO2) as compared to any other area of the institute’s campus. See figure 7.9.
  • 65. 52 Figure 7.8 Average results obtained from sensing node II 7.8 Chapter summary This chapter has explained the prototype implementation and testing. The results from prototype show that all the specific objectives have been achieved and main objective of the project has as well been achieved. The next chapter concludes the project, it gives the overall summary of what has been done and what has been achieved throughout the project.
  • 66. 53 CHAPTER EIGHT CONCLUSION AND RECOMMENDATION 8.1 Introduction This chapter provides conclusion of the project with respect to what had been proposed in the beginning and what has been achieved with regard of the proposed system. Furthermore this chapter recommends on what can be done in improving this project as well as how this project can be used in solving the problem it has intended to solve. 8.2 Conclusion This report has provided all basic information concerning the existence of the problem and the procedures towards solving it. In addition, the system has been tested and appeared to give results as expected. From the data collected, it can be clearly seen that the proposed Air quality monitoring system is highly needed, not just by the DIT community as it is proposed, but in a wider area. This is mainly due to its importance as it helps in recording of proper data for furthering researches with the aim of controlling air quality. 8.3 Recommendation It is with a vigor concern that my recommendation goes directly environmental authorities like NEMC. These authorities ought to be monitoring air quality with regular basis, not just collecting air quality data whenever a community raises concern. By using air quality monitoring systems like the proposed system, these authorities can easily determine air quality and take immediate actions whenever need arises. Moreover by using this proposed system, individuals can have access to the air quality data from their surroundings at their fingertips. Hence it will be easy to take action in controlling air quality whenever it is within their ability as a community.
  • 67. 54 REFERENCES [1] WHO, "Mortality and burden of disease from ambient air pollution," 2016. [Online]. Available: https://www.who.int/airpollution/en/. [Accessed 08 January 2019]. [2] United Nations, "Sustainable Development Goals Knowlege Platform," UN, 2018. [Online]. Available: https://sustainabledevelopment.un.org/sdg11. [Accessed 10 January 2019]. [3] Transportation Association of Canada, "TAC Briefing," 2006. [Online]. Available: https://www.tac- atc.ca/sites/tac-atc.ca/files/site/doc/resources/briefing-ut-and-airquality.pdf. [Accessed 13 January 2019]. [4] Conserve Energy Future, "Conserve Energy Future," 2019. [Online]. Available: https://www.conserve-energy-future.com/what-is-air-quality.php. [Accessed 2019]. [5] J. MM, Roadside concentration of gaseous and particulate matter pollutants and risk assessment in Dar-es Salaam, Tanzania, Dar es salaam: Journal of Environmental Monitoring and Assessment, 104: 385-407. M. M. JACKSON / Int. J. Biol. Chem, 2005. [6] U.S. Environmental Protection Agency, "A Guide to Air Quality and Health," Outreach and Information Division, NC, 2014. [7] HORIBA, "Horiba technologies," 2017. [Online]. Available: https://www.horiba.com/en_en/products/detail/action/show/Product/aqms-1560/. [Accessed 2019]. [8] V. R. K. V. V. M. Sayali C. Bhagwat, "A wireless sensor network air pollution monitoring system in Industrial Areas," IRJET, SINHGAD, 2016. [9] B. DESDEDITH, EMBEDED SYSTEM FOR ROADSIDE AIR QUALITY MONITORING AT DIT BRT STATION, DAR ES SALAAM: DAR ES SALAAM INSTITUE OF TECHNOLOGY, 2018. [10] J. MM, Roadside concentration of gaseous and particulate matter pollutants and risk assessment in Dar-es Salaam, Tanzania, Dar es salaam:, dar es salaam: : Journal of Environmental Monitoring and Assessment, 104: 385-407. M. M. JACKSON / Int. J. Biol. Chem, , 2005. [11] A. q. i. H. K. 1. R. H. K. E. P. Department, ""http://www.opsi.gov.uk/acts/acts1995/ukpga_19950025_en_1," 1995. [Online]. [Accessed 14 january 2018].," [Online]. [Accessed 14 january 2018].
  • 68. 55 [12] m. n. hospital, "w.w.w.muhimbilinationalhospital.co. tz," [Online]. [Accessed 10 january 2018]. [13] P. R. Movva Pavani, "Urban Air Pollution Monitoring," International Journal of Communication Networks and Information Security , vol. 9, 2017. [14] N. Report, "urban air quality monitoring – Pilot project,," National Environment Management Council,, Dar es Salaam, 1992. [15] Department of Civil Engineering, Monash University, "Design and Implementation of a Low-Power Wireless Sensor Network Platform Based on XBee," 2017. [16] E. E. o. E. A. P. S. Performance, "https://www.epa.gov/air-sensor-toolbox/Evaluation-emerging-air- pollution-sensor-performance,," 2017. [Online]. [Accessed 17 january 2018]. [17] ""https://www.epa.gov/air-sensor-toolbox/Evaluation-emerging-air-pollution-sensor- performance,,"," 2017. [Online]. [Accessed 17 january 2018]]. [18] ""https://www.lumasenseinc.com/EN/products/technology-overview/our- technologies/pas/photoacoustic-spectroscopy.html,"," [Online]. [Accessed 10 january 2018]. [19] m. k, Assessment of air pollution at bus stations in Dar-es Salaam, BSc (Env. Eng., Dar es salaam, Dar es salaam: University College of Lands and Architectural Studies (UCLAS), , 2003. [20] 1. B. S. BS, Methods for measurement of air pollution,, UK: UK: British Standards Institution (BSI), London,, 1947. [21] C. m. c. a. t. e. time, ""http://www.engineeringtoolbox.com/carbon-monoxide- d_893.html[Accessed," 22 04 2017. [Online]. [Accessed 26 12 2018].," 2017. [Online]. [Accessed 26 12 2018]. [22] E. a. o. health, "https://www.publichealthontario.ca/en/eRepository/Air_Quality_Indeces_Report_2013.pdf," [Online]. [Accessed 22 12 2017]. [23] Dangerous and tolerable levels of industrial gases, "http://www.engineeringtoolbox.com/gases- dangerous-levels-d_1841.html," 22 04 2017. [Online]. [Accessed 2018 january 15]. [24] WHO, Air Quality Guidelines for Europe, EUROPE: WHO Regional Publications, European Series No.23. , 1987. [25] B. S. BS, Methods for measurement of air pollution, UK: British Standards Institution (BSI), London,
  • 69. 56 1947. [26] "Environmental and occupational health," [Online]. [Accessed 10 JANUARY 2018].
  • 70. 57 APPENDIX A Project time frame Activity Weeks 1 2 3 ... 16 17 18 19 20 21 22 23 24 25 … 32 Literature Review Problem Finding Proposal Writing Data Collection Project I Write Up Data Analysis Project Design & Simulation Implementation Of Design Perform Testing Project II Write Up
  • 71. 58 APPENDIX B Project prototype budget ITEM DESCRIPTION QUANTITY PRICE($) @ PRICE(TZS) @ PRICETOTAL SDS011 Airqualitysensor(PM2.5&PM10) 2 18 43200 86400 CJMCU4541 NO2,CO,CH4,NH3,H2Sensor 2 21 50400 100800 MG811 CO2Sensor 2 28 67200 134400 LORA Communicationmodule forsensornodes 3 6 14400 43200 Atmega328 Control unitforsensornodes 2 18000 36000 Crystal Capacitor Forthe sensornodes 2 1000 2000 CeramicCapacitors Forthe sensornodes 4 3000 12000 PowerSupply 6A Adaptor(Forthe sensornodes) 2 15000 30000 2A Adaptor(Forthe gateway 1 12000 12000 Connectors Forthe sensornodesandthe Gateway 3 1000 3000 Regulators LM338(5A) Forthe sensornodes 4 5000 20000 LM317(2A) Forthe gateway 2 1500 3000 Resistors Forthe sensornodesandthe Gateway 15 200 3000 PCB Coppertype 1 8000 8000 Node MCU Control unitforthe gateway 1 18000 18000 Capacitors Forthe sensornodesandthe Gateway 15 800 12000 LED Foron/off Indication 3 300 900 Solderingwire (inmetres) Forsoldering 5 1000 5000 Male Pins 2 1000 2000 Female Pins 3 1000 3000 Switch 3 500 1500 Waterproof boxes Forenclosingthe circuits 3 20000 60000 596200 WIRELESSSENSOR NETWORKFOR REALTIMEAIR QUALITYMONITORINGATDIT-PROTOTYPEBUDGET
  • 72. 59 APPENDIX C Code for the control unit of the sensing node #include <SPI.h> #include <LoRa.h> #include "CO2Sensor.h" #define SENSOR_NODE "abcd" #define PRE_PIN 3 #define VNOX_PIN A0 #define VRED_PIN A1 #define CALIB_R0_NO2 2200 // R0 calibration value for the NO2 sensor #define CALIB_R0_CO 750000 // R0 calibration value for the CO sensor #define PRE_HEAT_SECONDS 10 int vnox_value = 0; int vred_value = 0; int counter = 0; // MG8 11 CO2Sensor co2Sensor(A2, 0.99, 100);
  • 73. 60 void setup() { if (!LoRa.begin(433E6)) { Serial.println("Starting LoRa failed!"); while (1); } LoRa.setSpreadingFactor(10); LoRa.setSignalBandwidth(62.E3); LoRa.crc(); pinMode(PRE_PIN, OUTPUT); Serial.begin(9600); Serial.print(SENSOR_NODE); Serial.println(" Starting..."); digitalWrite(PRE_PIN, 1); delay(PRE_HEAT_SECONDS * 1000); digitalWrite(PRE_PIN, 0); //LoRa.setSpreadingFactor(8); co2Sensor.calibrate(); } void loop() { Serial.println("RSSI: " + String(LoRa.packetRssi())); counter += 1;
  • 74. 61 delay(1000); readCJMCU(); readCo2(); } void readCo2() { String msg; int val = co2Sensor.read(); msg = 'd' + String(val); Serial.print("Sending Carbon dioxide: "); Serial.println(val); sendMessage(msg); delay(1000); msg = ""; } void readCJMCU() { String msg = ""; float fvolt, fRes, fConc; vnox_value = analogRead(VNOX_PIN); vred_value = analogRead(VRED_PIN); fConc = 0.00; // -------- Reading CO -------------- fvolt = (vred_value * 3.3) / 1024.0; fRes = (5000.0 / fvolt - 1000) / CALIB_R0_CO;
  • 75. 62 // Convert to ppm if (fRes > 0.7) fRes = 0.7; if (fRes > 0.6) fConc = (0.711 - fRes) / 0.011; else if (fRes > 0.3) fConc = (0.7 - fRes) / 0.01; else fConc = (0.3233 - fRes) / 0.00058; msg = 'c' + String(fConc); Serial.print("Message: " + msg); Serial.println(msg); Serial.print("Sending Carbon monoxide: "); Serial.println(fConc); sendMessage(msg); msg = ""; delay(1000); // Convert to NO2 ---------------- fvolt = (vnox_value * 3.3) / 1024.0; fRes = (5000.0 / fvolt - 1000) / CALIB_R0_NO2; if (fRes < 3.0) fRes = 3.0; if (fRes >= 3.0 && fRes < 8.0) fConc = (fRes - 0.5) / 0.25; else fConc = (fRes + 129.655) / 4.589; msg = 'n' + String(fConc); Serial.print("Message: " + msg); Serial.println(msg);
  • 76. 63 Serial.print("NO2 (ppm)): "); Serial.println(fConc); Serial.println("Sending Nitrogen Oxide"); sendMessage(msg); delay(1000); } void sendMessage(String msg) { LoRa.beginPacket(); LoRa.print(msg); LoRa.endPacket(); } Code for the control unit of the gateway #include <config.h> #include <LoRaNode.h> #include <config.h> #include <LoRaNode.h> #include <TFT.h> #include <SPI.h> // include libraries #include <LoRa.h> void setup() { Serial.begin(9600);
  • 77. 64 Serial.println("Air Quality Base Station Receiver"); if (!LoRa.begin(433E6)) { Serial.println("Starting LoRa failed!"); while (1); } LoRa.setSpreadingFactor(10); LoRa.setSignalBandwidth(62.E3); LoRa.crc(); } void loop() { onReceive(LoRa.parsePacket()); delay(1000); } void onReceive(int packetSize) { String incoming = ""; while (LoRa.available()) { incoming += (char)LoRa.read(); } Serial.println(incoming); delay(1000); }
  • 78. 65 Code for sending data from the gatewy to a cloud server #include <WiFi.h> #include <WiFiClient.h> #include <WiFiServer.h> #include <WiFiUdp.h> #include <ESP8266WiFi.h> //needed for library #include <PubSubClient.h> #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> // MQTT Details #define MQTT_BROKER "m24.cloudmqtt.com" #define MQTT_PORT 19576 #define MQTT_USERNAME "cosxuovc" #define MQTT_PASSWORD "EiZIWjLTCvYk" #define MAX_MSG_LEN (128) #define SNR_TOPIC "air_quality/SNR" #define RSSI_TOPIC "air_quality/RSSI"
  • 79. 66 #define CARBON_TOPIC_NODE_1 "air_quality/node_1/carbon_dioxide" #define CARBON__MONOXIDE_1 "air_quality/node_1/carbon_monoxide" #define NITROGEN_OXIDE_1 "air_quality/node_1/nitrogen_oxide" #define PM_10 "air_quality/node_1/pm_10" #define PM_25 "air_quality/node_1/pm_25" void callback(char *topic, byte *payload, unsigned int len); WiFiClient client; PubSubClient mqtt(MQTT_BROKER, MQTT_PORT, client ); void setup() { Serial.begin(9600); WiFiManager wifiManager; wifiManager.autoConnect("Air Quality Monitoring"); Serial.println("Connected !:)"); mqtt.setCallback(callback); } void loop() { if (!mqtt.connected()) connectMQTT();
  • 80. 67 String sensor_reads; if (Serial.available() > 0) { while (Serial.available() > 0) { char c = Serial.read(); sensor_reads += c; } Serial.println("RECEIVED: " + sensor_reads); } if (sensor_reads.charAt(0) == 's') { sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7); mqtt.publish(SNR_TOPIC, sensor_data); } if (sensor_reads.charAt(0) == 'r') { sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7); mqtt.publish(RSSI_TOPIC, sensor_data); } if (sensor_reads.charAt(0) == 'd') {
  • 81. 68 sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7); mqtt.publish(CARBON_TOPIC_NODE_1, sensor_data); } if (sensor_reads.charAt(0) == 'm') { sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7); mqtt.publish(CARBON_TOPIC_NODE_1, sensor_data); } if (sensor_reads.charAt(0) == 'n') { sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7); mqtt.publish(NITROGEN_OXIDE_1, sensor_data); } if (sensor_reads.charAt(0) == 'p') { sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7);
  • 82. 69 mqtt.publish(PM_10, sensor_data); } if (sensor_reads.charAt(0) == 'x') { sensor_reads.remove(0, 1); char sensor_data[7]; sensor_reads.toCharArray(sensor_data, 7); mqtt.publish(PM_25, sensor_data); } mqtt.loop(); delay(500); } void connectMQTT() { while (!mqtt.connected()) { String clientID = "ESP-IoT"; clientID += String(random(0xffff), HEX); Serial.printf("MQTT Connecting as client %s ... n", clientID.c_str()); if (mqtt.connect(clientID.c_str(), MQTT_USERNAME, MQTT_PASSWORD)) { Serial.println("MQTT Connected"); } else { Serial.printf("MQTT failed, state %s, retrying ... n", mqtt.state()); delay(1500);
  • 83. 70 } } } void callback(char *topic, byte *payload, unsigned int len) { static char message[MAX_MSG_LEN + 1]; if (len > MAX_MSG_LEN) len = MAX_MSG_LEN; strncpy(message, (char *)payload, len); message[len] = '0'; //Serial.printf("topic: %s, message received: %sn", topic, message); }