INTERNATIONAL BURCH UNIVERSITYFACULTY OF ENGINEERING AND NATURAL SCIENCESDEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERINGAIR QUALITY TESTING BY CITYOS SYSTEMSUNDERGRADUATE PROJECT Muhamed Hadžiefendi?Supervisor:Assist.
Prof. Dr. Dejan Joki?SARAJEVOSeptember 2018AIR QUALITY TESTING BY CITYOS SISTEMSMUHAMED HADŽIEFENDI?Report Submitted in Fulfillment of Requirements for the Degree of Bachelor of Science in Electrical and Electronics EngineeringINTERNATIONAL BURCH UNIVERSITY2018APPROVAL PAGEStudent name and surname: Muhamed Hadžiefendi?Faculty : Faculty of Engineering and Natural SciencesDepartment : Department of Electrical and Electronics EngineeringProject Title : Air quality testing by CityOS systemsDate of Defense : 10.
09.2018 I certify that this final work satisfies all the requirements as an Undergraduate Project for the Bachelor degree in Electrical and Electronics Engineering.……………………………………… Assist. Prof. Dr. Jasmin Kevri?Head of DepartmentThis is to certify that I have read this final work and that in my opinion it is fully adequate, in scope and quality, as an Undergraduate Project for the Bachelor degree in Electrical and Electronics Engineering.
……………………………………Assist. Prof. Dr.
Dejan Joki? MentorExamining Committee MembersTitle / Name and Surname Affiliation Signature1. Assist. Prof. Dr. Nejra Beganovi? IBU 2.
Assist. Prof. Dr. Dejan Joki? IBU 3. Assist. Prof. Dr.
Jasmin Kevri? IBU It is approved that this final work has been written in compliance with the formatting rules laid down by the Department of Electrical and Electronics Engineering.……………………………………… Head of CommitteeAIR QUALITY TESTING BY CITYOS SYSTEMSABSTRACTFast development of industry and increased number of the population are reasons of extremely polluted air. The goal of this project was to design and implement the device that is the effective solution to keep people safe and informed about air quality. The device is composed of numerous sensors. Sensors collect data about air quality from some area in real time and send it to a web application via Wifi network. Particles that can be measured by this device are PM1, PM2.
5, and PM10. Temperature and humidity can be measured too. There are six levels of air quality: Great, Ok, sensitive beware, unhealthy, very unhealthy, hazardous.Keywords: air quality, sensors, particles, temperature, humidityACKNOWLEDGEMENTSThere are many people who helped to make my years at the graduate school most valuable.
First of all, many thanks go to my family. I thank my parents and my sister for their great support and assistance throughout my life. Without them, I would not achieve this and I would not be where I am now.
They are my greatest support.Second, I would like to thank Dejan Joki?, my major professor, and dissertation supervisor. Having the opportunity to work with him over the years was intellectually rewarding and fulfilling. Many thanks to Department electronic staff, who patiently answered my questions and problems on word processing.
I would also like thank to my graduate student colleagues who helped me all through the years full of classwork and exams.DECLARATIONI hereby declare that this Undergraduate Project titled as: “Air quality testing by CITYOS systems” is based on my original work except quotations and citations which have been duly acknowledged. I also declare that this thesis has not been previously or concurrently submitted for the award of any degree, at International Burch University, any other University or Institution.………………..Muhamed Hadžiefendi?Date: 10.09.
2018 TABLE OF CONTENTS TOC h z u “No Spacing;1” APPROVAL PAGE PAGEREF _Toc521496689 h iAIR QUALITY TESTING BY CITYOS SYSTEMS PAGEREF _Toc521496690 h iiABSTRACT PAGEREF _Toc521496691 h iiACKNOWLEDGEMENTS PAGEREF _Toc521496692 h iiiDECLARATION PAGEREF _Toc521496693 h ivTABLE OF CONTENTS PAGEREF _Toc521496694 h vLIST OF TABLES PAGEREF _Toc521496695 h viiLIST OF FIGURES PAGEREF _Toc521496696 h viiiLIST OF ABBREVIATIONS PAGEREF _Toc521496697 h x TOC h z “Heading 1;1;Title;2;Subtitle;3” CHAPTER 1 PAGEREF _Toc521515586 h 1AIR QUALITY TESTING BY CITYOS SYSTEMS PAGEREF _Toc521515587 h 11.1 Introduction PAGEREF _Toc521515588 h 1CHAPTER 2 PAGEREF _Toc521515589 h 6HARDWARE PAGEREF _Toc521515590 h 62.1 Hardware parts PAGEREF _Toc521515591 h 62.1.1 ESP 8266 12 E NodeMCU PAGEREF _Toc521515592 h 72.1.2 PMS1003 – Digital Laser Dust Sensor PAGEREF _Toc521515593 h 92.1.
3 BME280 Temp, Humidity and Pressure Sensor PAGEREF _Toc521515594 h 112.1.4 LED Ring PAGEREF _Toc521515595 h 122.1.5 Resistors PAGEREF _Toc521515596 h 132.1.6 Capacitor PAGEREF _Toc521515597 h 142.1.
7 Micro USB Cable and Power Adapter PAGEREF _Toc521515598 h 152.1.8 Prototyping breadboard PAGEREF _Toc521515599 h 162.1.9 Jumper Cable Wires PAGEREF _Toc521515600 h 172.1.10 Male Crimp Pins PAGEREF _Toc521515601 h 172.
1.11 Lamp box PAGEREF _Toc521515602 h 182.2 Final Setup PAGEREF _Toc521515603 h 19CHAPTER 3 PAGEREF _Toc521515604 h 20SOFTWARE PAGEREF _Toc521515605 h 203.1 NodeMCU Control Algorithm PAGEREF _Toc521515606 h 20CHAPTER 4 PAGEREF _Toc521515607 h 22CONCLUSION PAGEREF _Toc521515608 h 22REFERENCES PAGEREF _Toc521515609 h 23APPENDIX 1 PAGEREF _Toc521515610 h 24NODEMCU CODE PAGEREF _Toc521515611 h 24LIST OF TABLES TOC h z “Tabele;2” Table 1.1 Particulate matter (PM) PAGEREF _Toc521496581 h 2Table 1.
2 PM 10 Index (AQI) PAGEREF _Toc521496582 h 4Table 1.3 PM2.5 Index (AQI) PAGEREF _Toc521496583 h 5LIST OF FIGURES TOC h z “Figure;2” Fig 2.
1 ESP8266 12 E NodeMCU Pin definition (retrieved from http://Arduining.com) PAGEREF _Toc521515534 h 7Fig 2.2 ESP8266 (retrieved from http://ESP8266.
com ) PAGEREF _Toc521515535 h 8Fig. 2.3 NodeMCU connection with a breadboard (retrieved from http://cityOS.io ) PAGEREF _Toc521515536 h 9Fig 2.
4 PMS1003 Sensor structure diagram (retrieved from http://plantower.com ) PAGEREF _Toc521515537 h 10Fig 2.5 PMS1003 connection with adapter (retrieved from http://cityOS.io ) PAGEREF _Toc521515538 h 10Fig 2.6 PMS1003 Connection with NodeMCU (retrieved from http://cityOS.
io ) PAGEREF _Toc521515539 h 11Fig 2.7. BME280 Temp, Humidity and Pressure Sensor (retrieved from http://amazon.com ) PAGEREF _Toc521515540 h 12Fig. 2.8 Led Ring Connection with breadboard (retrieved from http://cityOS.
io ) PAGEREF _Toc521515541 h 13Fig 2.9 Resistors : a)100?, b)470?, c)10k? (retrieved from http://petervis.com ) PAGEREF _Toc521515542 h 14Fig 2.10 Capacitor (16 V 1000µF) (retrieved from http:// http://lampatronics.com ) PAGEREF _Toc521515543 h 15Fig 2.11 Micro USB Cable and Power Adapter PAGEREF _Toc521515544 h 16Fig 2.
12 Breadboard (retrieved from https://cdn.solarbotics.com ) PAGEREF _Toc521515545 h 16Fig 2.13 Jumper Cable Wires PAGEREF _Toc521515546 h 17Fig. 2.14 Male Crimp Pins PAGEREF _Toc521515547 h 17Fig 2.
15 LEXAN THERMOCLEAR sheet and acrylic plastic sheet PAGEREF _Toc521515548 h 18Fig 2.16 Whole system PAGEREF _Toc521515549 h 19LIST OF ABBREVIATIONSPM Particulate MatterIoT Internet of ThingsAQIAir Quality IndexAQCAir Quality ConditionsGPIO General Purpose Input/OutputWiFi Wireless FidelityHTTP Hyper Text Transfer Protocol Temp TemperatureLED Light Emitting DiodeUSB Universal Serial BusCHAPTER 1AIR QUALITY TESTING BY CITYOS SYSTEMS1.1 IntroductionAir pollution has become one of the major problems for human health and one of the main factors of premature deaths in the recent years in developing countries. The impacts of air pollution on the environment is the very important challenge for public authorities.
Our country, Bosnia and Herzegovina is one of the most polluted countries in Europe and in the world. Sarajevo, the capital city of Bosnia and Herzegovina have the very unpopular all-time record for one of the worst air pollutions in Europe. The best way to reduce health risks is to react to the high level of air pollution detected by the detection system in one of the following ways: stay indoors because indoor air pollution is 70% of the outdoor air pollution, wear the mask if you go outside or to buy the air purifier if you can afford it. Thus, there is a need for automated air quality detection systems.
Table 1.1 Particulate matter (PM) Pollutant Description Sources Effects ReleaseParticulate Matter (PM)orParticle Pollution PM is a small and complex mixture of solid and liquid matter that is suspended in the air. They vary in size, composition, and concentration.
PM is classified due to their size : PM10,PM2.5,PM1.PM10 have a mass median aerodynamic less than 10µm. They are „big particles” and can stay for hours in the air.PM2.5 are „Fine particles”. They are lighter than PM10 and can stay in the air for weeks and travel more farther. PM2.
5 are 2.5µm or smaller.PM1 are particles smaller than 1µm. They are the most dangers and the most harmful.These particles are emitted as particles or formed through chemical reactions.
„Big particles” are formed directly from sources like cars, trucks, buses, factories, sea spray and construction.„Fine particles” are formed indirectly when fuel is burned and due to a reaction between gases with sunlight and water vapor. PM have effects on the health and on the environment.
Health effects:Lung damage, asthma attack, bronchitis, respiratory problems, cancer, and early death.Environmental effects :Reduced visibility, corrosion of the metal, dirty and discolored structure and property. Direct Formed in the air.The main goal of this project is to make inexpensive and reliable air quality tester device. Moreover, this device will have a prefix IoT, which basically means that it is possible to obtain some data from it by using the internet. Automated air quality detection systems provide fast detection of air pollutants in the air, alarms and inform us about air quality level.
Systems consisting of the big number of sensors, such as the sensor of temperature, humidity, pressure, and dust can detect the level of the air quality and with the help of the processing unit can alert them immediately to the occurrence of the air pollutants.The air quality testing system can be monitored locally in the premises, via visual signaling or remotely via a WiFi network. The remote system allows the owner of the device to monitor the level of the air quality and when the system shows a purple or red color it indicates the low level of the air quality.The old and outdated systems often are not in the function and don’t work. They use “old fashion” sensors. Also often there are not sensors for monitoring and collecting the data of the most dangerous and very important pollutants PM2.
5 and PM1. So “old fashion” sensors are difficult and not reliable for the collection of data. Advantages of the new sensors system are low cost, small dimensions, portable, easier to maintain, more friendly to use and higher quality results.The Web application allows a visual display of the situation at some specific location. All data is available on the web to everyone who has an internet connection.Even in case if Wifi breaks out and lost of the connection with Web there is still visual signaling. Table 1.
2 PM 10 Index (AQI)PM10AQI(µg/m3) COLOR AQC DESCRIPTION0-54 BLUE GREAT AQI is considered great. Enjoy activities without risk.55-154 GREEN OK AQI is considered acceptable.Only people who are extra sensitive to air pollution need to be careful.155-254 YELLOW SENSITIVE BEWARE Unhealthy for Sensitive groups. Reduce strenuous outdoor activities and plan them when AQI is better.
255-354 ORANGE UNHEALTHY Unhealthy for everyone. It is recommended for people with heart or lung disease to avoid physical outdoor activities and to wear a mask.355-424 PURPLE VERYUNHEALTHY Very unhealthy for everyone. Everyone may experience very serious health effects.
It is recommended to wear a mask.425+ RED HAZARDOUS Emergency conditions and a health warning. Air is hazardous for everyone. It is recommended to wear a mask. Avoid all outdoor activities.Table 1.
3 PM2.5 Index (AQI)PM2.5AQI(µg/m3) COLOR AQC DESCRIPTION0-12 BLUE GREAT AQI is considered great. Enjoy activities without risk.13-35 GREEN OK AQI is considered acceptable.Only people who are extra sensitive to air pollution need to be careful.
36-55 YELLOW SENSITIVE BEWARE Unhealthy for Sensitive groups. Reduce strenuous outdoor activities and plan them when AQI is better.56-150 ORANGE UNHEALTHY Unhealthy for everyone.
It is recommended for people with heart or lung disease to avoid physical outdoor activities and to wear a mask.151-250 PURPLE VERYUNHEALTHY Very unhealthy for everyone. Everyone may experience very serious health effects.It is recommended to wear a mask.251+ RED HAZARDOUS Emergency conditions and a health warning. Air is hazardous for everyone. It is recommended to wear a mask. Avoid all outdoor activities.
CHAPTER 2HARDWARE2.1 Hardware partsESP8266 NodeMCU microcontrollerPMS1003 – Digital Laser Dust SensorBME280 Temp, Humidity and Pressure SensorLed RingResistorsCapacitorMicro USB Cable and Power AdapterPrototyping breadboardJumper Cable WiresMale Crimp PinsLamp box2.1.
1 ESP 8266 12 E NodeMCUESP8266 NodeMCU microcontroller is the main part of this project. It is used to implement this IoT project. Advantages of this development platform are an ability to connect on Wifi network, easily programmed, low consumption, low price and it is compact. This development platform is connected to the sensors by GPIO pins.
It has 17 GPIO pins (0-16). Six GPIO pins (6-11) are used for connection with the flash memory chip. If they are used for something else program can be crashed.
So only eleven can be used.Fig 2.1 ESP8266 12 E NodeMCU Pin definition (retrieved from HYPERLINK “http://Arduining.com” http://Arduining.com)Fig 2.
2 ESP8266 (retrieved from HYPERLINK “http://ESP8266.com” http://ESP8266.com ) Minimum Working Voltage Value: 3.0 VTypical Working Voltage Value: 3.3 VMinimum Working Voltage Value: 3.6 VThe disadvantage of this development platform is operating at 3.3 V because sensors and other hardware part operate on voltages higher than that one. Hopefully, there are effective techniques on how to solve this problem.
Fig. 2.3 NodeMCU connection with a breadboard (retrieved from HYPERLINK “http://cityOS.io” http://cityOS.
io )2.1.2 PMS1003 – Digital Laser Dust SensorPMS1003 is a kind of digital and general purpose particle concentration sensor.
It can be used to get information about the number of suspended particles in the air and output in digital form. This device provides timely and accurate concentrate data also.Main characteristics of this sensors are zero false alarm rate, real-time response, minimum distinguishable particle diameter: 0.3 micrometers.This sensor is based on laser scattering principle. First, laser produce scattering for radiation of suspending particles in the air, and then collect scattered light at the specific degree. In the end, the curve of scattered light change with time can be obtained. Calculations of equivalent particle diameter and the number of particles with different diameter per unit volume are done by the microprocessor which works on MIE theory.
The unit volume of particle number is 0.1L.The unit of mass concentration is ? g/m³.Fig 2.
4 PMS1003 Sensor structure diagram (retrieved from HYPERLINK “http://plantower.com” http://plantower.com )Fig 2.
5 PMS1003 connection with andapter (retrieved from HYPERLINK “http://cityOS.io” http://cityOS.io )Fig 2.6 PMS1003 Connection with NodeMCU (retrieved from HYPERLINK “http://cityOS.io” http://cityOS.io )2.1.
3 BME280 Temp, Humidity and Pressure SensorThe BME280 is the sensor for measuring digital humidity, pressure and temperature. Its work is based on proven principles. The greatest advantages of this sensor are small dimensions, low consumption, and the possibility of improvement. This sensor has a high performance in the measurement of humidity and pressure too. There are also advantages such as fast response, high accuracy, and high resolution.
Minimum Supply Voltage : 1.71 VTypical Supply Voltage : 1.8 VMaximum Supply Voltage : 3.6 VSensor Supply Voltage : 1.2 V – 3.
6VFig 2.7. BME280 Temp, Humidity and Pressure Sensor (retrieved from HYPERLINK “http://amazon.com” http://amazon.com )2.1.4 LED RingLED Ring in this project is used for visual signalization. Color which LED Ring will shine depends on level of air quality.
Great – BlueOk – GreenSensitive Beware – YellowUnhealthy – OrangeVery Unhealthy – PurpleHazardous – RedOne RGB LED consists of red, green, and blue LEDs. With these three colors, it is possible to produce a huge number of colors. By controlling the intensity of each color it is possible to create the color we want.
This LED ring is composed of RGB (Red-Green-Blue) LEDs that are connected as a chain. The output of one is connected to the input of the following. It is used only one pin of the microcontroller to control LED Ring.Power supply voltage of LED Ring is 5V.Fig. 2.8 Led Ring Connection with breadboard (retrieved from HYPERLINK “http://cityOS.
io” http://cityOS.io )2.1.5 Resistors Resistors are electrical components which are resisting the flow of electrical energy in the circuit. They change the voltage and current as a result. They have specific and constant resistance.
For this project is needed one resistor of 100?, one of 470?, and one of 10k?.a)b)c)Fig 2.9 Resistors : a)100?, b)470?, c)10k? (retrieved from http://petervis.com ) 2.1.6 CapacitorAn electrical component that stores and release electrical energy in a circuit is called a capacitor.
If the voltage in the circuit is higher than the voltage which is stored in the capacitor, then the current will flow and give the charge to the capacitor.If the voltage of the circuit is lower, then the stored charge is released.The capacitor smooth out fluctuations in voltage.In this project, it is needed one capacitor (16V and 1000µF).Fig 2.10 Capacitor (16 V 1000µF) (retrieved from http:// http://lampatronics.com ) 2.1.
7 Micro USB Cable and Power AdapterMicro USB cable has two functions. One function is to connect NodeMCU to the computer and the second one is to supply power to the device. This cable has 4 wires. Two wires are for charging and two for transfer of data. Output: 5V/2A.Fig 2.11 Micro USB Cable and Power Adapter2.
1.8 Prototyping breadboardConstruction base for prototyping of electronics is called a breadboard.Fig 2.
12 Breadboard (retrieved from HYPERLINK “https://cdn.solarbotics.com” https://cdn.
solarbotics.com )2.1.9 Jumper Cable WiresA jump wire is consists of one or more electrical wires in the cable. At the ends, they have connectors or pins. They are used for the connection of components on the breadboard.
Pins could be male or female.Fig 2.13 Jumper Cable Wires2.1.
10 Male Crimp PinsFig. 2.14 Male Crimp Pins2.1.11 Lamp boxLEXAN THERMOCLEAR sheet and acrylic plastic sheet are used for enclosure of the device.
Fig 2.15 LEXAN THERMOCLEAR sheet and acrylic plastic sheet2.2 Final SetupFig 2.16 Whole systemCHAPTER 3SOFTWARE3.1 NodeMCU Control AlgorithmNodeMCU Control Algorithm consists of some basic parts of the code. One part is related to the observation of data by the sensors.
The second one is related to the obtaining the data from the sensors. And the third one is related to the flow of information which is sent to the Web and is also used for the visual sign about the level of pollution. The complete code is in Appendix 1.The current values of PMs, temperature, humidity, and other parameters will be obtained by the sensors. There is no need to measure values every second so the values will be obtained every minute. Afterward, those obtained values will be displayed on the Web and also used for visualizing results.
Data is stored and synchronized in real time to every client on the Web. This real-time database is a cloud-hosted database. The real-time database receives updates with the newest data automatically.When the connection is established client device measures the parameters and synchronize it with the server.
The database can be accessed from the mobile phone or the computer through the Web browser.CHAPTER 4CONCLUSIONIn this senior design project, it is successfully developed the air quality testing device, which is capable of monitoring of air pollution in real time. The project is written with the intention of improving air quality. With the installation of this device, it is possible to decrease the number of victims and the environmental damages. It is important for this project that the device is reliable and has the possibility to monitor information about air quality via the internet. So this device has IoT prefix and it is the trend today.The cost of the project would be less than 100 BAM or more precisely 56,52$.
The price of “old-fashioned systems” is much higher ($50.000). Also, there are more advantages to “new-fashioned systems” such as they are accurate, easy to maintain, smaller and reliable.REFERENCES1 Ragazzi, M.
(2016). Air quality. Apple Academic Press Inc.
2 http://cityos.io 3 Mazzeo, N. (2011). Air quality monitoring, assessment and management. Rijeka: InTech.4 Yong Z. ; Haoxin Z (2016) Digital universal particle concentration sensor 5 Sokhi, R. (1998).
Urban Air Quality: Monitoring and Modelling. Dordrecht: Springer Netherlands.APPENDIX 1NODEMCU CODE