Project Report on Air Quality Monitoring Device using Arduino
Mục lục
Project Report on Air Quality Monitoring Device using Arduino
1. INTRODUCTION
As our project is based on IoT, let us throw some light on the topic of IoT itself.
The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and digital machines, objects, animals, or people that are provided with unique identifiers (UIDs) and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction.
APPLICATIONS OF IOT:
A growing portion of IoT devices are created for consumer use, including connected vehicles, home automation, wearable technology, connected health, and appliances with remote monitoring capabilities.
In the consumer market, IoT technology is most synonymous with products pertaining to the concept of the “smart home”
Therefore, using IoT, the aim of this project is to monitor the air quality level in the surrounding of our device using Arduino and MQ135 gas sensor and show the results in PPM units
Problem Statement
As urbanization causes the growth of suburban communities, the existing transportation infrastructure dependent on fossil fuels must expand. An increase in vehicle use gives rise to an increase in traffic-related pollutant emissions. According to science, the six common air pollutants are particulate matter, ground-level ozone, carbon monoxide, sulfur oxides, nitrogen oxides, and lead. These are called the criteria pollutants and thus are required to be measured to tell us how healthy the air is to breathe. Vehicular emissions contribute carbon monoxide, carbon dioxide, and nitrogen oxides to air pollution.
The current pollution measurement methodology uses expensive equipment at fixed locations or dedicated mobile equipment. The raw data obtained in this manner is used to further extrapolate the extent and concentration of pollution through dispersion models. This is a coarse-grained system where the pollution measurements are few and far in-between. Widespread deployment of this measurement paradigm is constrained by its prohibitive cost. In addition, it is desirable to have access to real-time measurements to be able to quickly analyses and identify alarming levels of pollutants. Currently, access to such data is limited if not absent. It is available to and discernable by only a few who are well informed on the subject of pollution.
As opposed to a coarse-grained sensing system, a fine-grained approach would provide more frequent and spatially dense pollutant measurements. A scalable sensing platform could effectively disseminate pollution information to users in need. Today, the scarcity of fine-grained air quality information is hindering public awareness of health issues arising from pollution. Studies suggest that the health effects among asthmatics from short-term changes in air pollution levels are an important public health problem. We anticipate that, with the help of fine-grained air quality measurements, people could be advised to take actions based on real-time pollution levels to accommodate individual health needs.
The availability of real-time air quality data could make drivers better educated about driving patterns and how it impacts the environment and increases pollution. Better driving habits will lead to reduced pollution. Also, more health-conscious citizens may choose alternate “healthy” routes based on pollution information. It will benefit them as well as others by reducing pollution concentration in peak roadways so everybody breathes cleaner air.
At the same time, the emergence of cheap commodity air pollution sensors and the increase of cellular bandwidth have made mobile sensing platforms capable of real-time air quality data collection increasingly feasible. Several manufacturers such as Auroral or Variable Technologies have recently introduced handheld pollution measurement devices. These devices are small enough to be carried by walking people for personal use and measure all the criteria pollutants contributed by vehicle emissions. But none of these off-the-shelf devices has been evaluated with respect to their real-time sensing performance when installed on mobile platforms such as vehicles. To the best of our knowledge, we have not come across any work that studies the long-term stability, reliability, and impact of real-time pollution monitoring systems using commodity sensors and the problems associated with deploying such systems.
2. Background Research
A WIFI-enabled indoor air quality monitoring and control system:- Published in Control & Automation (ICCA), 2017 13th IEEE International Conference
Authors: Xiaoke Yang, Lingyu Yang, Jing Zhang
(School of Automation Science and Electrical Engineering, Beihang University, Beijing, 100191, China)
This paper proposes an open platform of a Wi-Fi-enabled indoor air quality monitoring and control system, which could be incorporated into such a ‘smart building’ structure. The complete software and hardware design of this system is presented, along with a series of control experiments. The proposed system operates over an existing WiFi wireless network utilizing the MQTT protocol. It is capable of monitoring the indoor air quality as well as controlling an air purifier to regulate the concentration of the particulate matter. Experiment results under a real-world office environment demonstrate the effectiveness of the proposed design.
A low-power real-time air quality monitoring system using LPWAN: –
Published in: Solid-State and Integrated Circuit Technology (ICSICT), 2016 13th IEEE International Conference
Authors: Sujuan Liu, Chuyu Xia, Zhenzhen Zhao
(College of Electronic Information and Control Engineering, Beijing University of Technology, 100124, China)
This paper presents a low-power real-time air quality monitoring system based on the LoRa Wireless Communication technology. The proposed system can be laid out in a large number in the monitoring area to form a sensor network. The system integrates a single-chip microcontroller, several air pollution sensors (NO2, SO2, O3, CO, PM1, PM10, PM2.5), Long Range (LoRa) — Modem, a solar PV-battery part, and graphical user interface (GUI). As a communication module, LoRa sends the data to the central monitoring unit, and then the data would be saved in the could. The range tests at an outdoor area show that LoRa is able to reach approximately 2Km. The TX power is only about 110mA which is lower compared with other used wireless technology. An easy-to-use GUI was designed in the system. Based on LoRa technology, GUI, and Solar PV- battery part the system has several progressive features such as low cost, long-distance, high coverage, long device battery life, ease to operation.
IoT enabled proactive indoor air quality monitoring system for sustainable health management: –
Published in: Computing and Communications Technologies (ICCCT), 2017 2nd International Conference
Authors: M.F.M Firdhous, B.H Sudantha, P.M Karunaratne (Dept. of Information Technology, University of Moratuwa, Sri Lanka)
This paper proposes an IoT-based indoor air quality monitoring system for tracking ozone concentrations near a photocopy machine. The experimental system with a semiconductor sensor capable of monitoring ozone concentrations was installed near a high-volume photocopier. The IoT device has been programmed to collect and transmit data at an interval of five minutes over a blue tooth connection to a gateway node that in turn communicates with the processing node via the WIFI local area network. The sensor was calibrated using the standard calibration methods. As an additional capability, the proposed air pollution monitoring system can generate warnings when the pollution level exceeds a predetermined threshold value.
A wireless system for indoor air quality monitoring: –
Published in: Industrial Electronics Society, IECON 2016–42nd Annual Conference of the IEEE
Authors: R du Plessis, A Kumar, GP Hancke
(Department of Electrical, Electronic and Computer Engineering, University of Pretoria, South Africa)
This paper describes the development of a wireless monitoring system that can be deployed in a building. The system measures carbon dioxide, carbon monoxide, and temperature. The system developed in this paper can serve as the monitoring component of an HVAC control system and function as an indoor air quality monitor independently.
Pollution: An efficient cloud-based management of IoT devices for air quality monitoring: –
Published in: Research and Technologies for Society and Industry Leveraging a better tomorrow (RTSI), 2016 IEEE 2nd International Forum
The Internet of Things paradigm originates from the proliferation of intelligent devices that can sense, compute and communicate data streams in a ubiquitous information and communication network. The great amounts of data coming from these devices introduce some challenges related to the storage and processing capabilities of the information. This strengthens the novel paradigm known as Big Data. In such a complex scenario, Cloud computing is an efficient solution for the managing of sensor data. This paper presents Polluino, a system for monitoring air pollution via Arduino. Moreover, a cloud-based platform that manages data coming from air quality sensors is developed.
An embedded system model for air quality monitoring: –
Published in: Computing for Sustainable Global Development (INDIA.Com), 2016 3rd International Conference
Authors: Sneha Jangid, Sandeep Sharma (School of ICT, Gautam Buddha University, Greater Noida, India)
The objective of the paper is to present a system model which can facilitate the assessment of health impacts caused due to indoor air pollutant as well as outdoor and can intimate the human prior about the risk he/she going to have, here we are focusing our work in context to allergic patients as they will be informed by this tool such that they can secure themselves without actually experiencing the risk factors, here a sensing network-based microcontroller equipped with gas sensors, optical dust particle sensor, humidity, and temperature sensor has been used for air quality monitoring. The design included various units mainly: sensing unit, processing unit, power unit, display unit, communication unit. This work will apply the techniques of electrical engineering with the knowledge of environmental engineering by using sensor networks to measure Air Quality Parameters.
Ambient air quality monitoring wireless sensor network for schools in smart cities: –
Published in: Smart Cities Conference (ISC2), 2015 IEEE First International Authors: H. Ali, J. K. Soe, Steven. R. Wel
(School of Electrical Engineering & Computer Science, The University of Newcastle, Callaghan, NSW 2308, Australia)
In this paper, a low-cost solar-powered air quality monitoring system based on ZigBee wireless network system technology is presented. The solar-powered network sensor nodes can be deployed by schools to collect and report real-time data on carbon monoxide (CO), nitrogen dioxide (NO2), dust particles, temperature, and relative humidity. The proposed system allows schools to monitor air quality conditions on a desktop/laptop computer through an application designed using LabVIEW and provides an alert if the air quality characteristics exceed acceptable levels. They tested the sensor network successfully at the Singapore campus of the University of Newcastle, Australia. The experimental results obtained by them demonstrated that the sensor network can provide high-quality air quality measurements over a wide range of CO, NO2, and dust concentrations.
A smart sensor system for air quality monitoring and massive data collection:-
Published in: Information and Communication Technology Convergence (ICTC), 2015 International Conference
Authors: Yonggao Yang, Lin Li
(Department of Computer Science, Prairie View A&M University, Prairie View, TX 77446, U.S.A)
Air pollution has been a global challenge for environmental protection. Effectively collecting and scientifically visualizing the air quality data can better help us monitor the environment and address related issues. This article presents a smart sensor system for air quality monitoring which consists of three units: the smart sensor unit, the smartphone, and a server. The smart
Proposed System
Now in this project, we are using the locally available gas sensors for observing polluted gases like Carbon monoxide (CO), Carbon dioxide (CO2), and parameters like temperature, humidity. By using this method people can view the level of pollution through a wireless system. It reduced cost, is reliable, and is comfortable for any place where we are monitoring the gases.
Goals and Objectives
• quality of air can be checked indoors as well as outdoor.
• Detecting a wide range of physical parameters.
• Indoor air quality monitoring.
• Industrial perimeter monitoring.
• Roadside pollution monitoring.
• To make this data available to the common man.
3. Project Planning
Project Setup
Connections:
MQ135’s voltage and ground are connected to +5V and 0V and the analog output pin is connected to analog pin A0 of Arduino Uno.
LCD RS pin to digital pin 12, Enable pin to digital pin 11, D4 pin to digital pin 5, D5 pin to digital pin 4, D6 pin to digital pin 3, D7 pin to digital pin 2, R/W pin to ground, VSS pin to ground, VCC pin to 5V, 10K resistor ends to +5V and ground and wiper to LCD VO pin.
- The Analog pin of the MQ-135 sensor is connected to the analog pin of the Arduino UNO.
Stakeholders:
Project Resources
HARDWARE REQUIREMENTS:
• Air Quality sensor (MQ 135)
• Potentiometer
• 16×2 LCD Panel
• Arduino Uno
• Wires
SOFTWARE REQUIREMENTS:
• Arduino (Version 1.8.2)
- THINGSPEAK website
SYSTEM ANALYSIS AND DESIGN
COMPONENT DESCRIPTION:
Air Quality Sensor (MQ135):-
Product Description:
Air quality click is suitable for detecting ammonia (NH3), nitrogen oxides (NOx) benzene, smoke, CO2, and other harmful or poisonous gases that impact air quality. The MQ-135 sensor unit has a sensor layer made of tin dioxide (SnO2), an inorganic compound that has lower conductivity in clean air than when polluting gases are present. To calibrate Air quality, use the onboard potentiometer to adjust the load resistance on the sensor circuit.
Pin Description:
· the VDD power supply 5V DC
· GND used to connect the module to system ground
· DIGITAL OUT, you can also use this sensor to get digital output from this pin, by setting a threshold value using the potentiometer
ANALOG OUT, this pin outputs 0–5V analog voltage based on the intensity of the gas.
Potentiometer: –
Product Description:
A potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a variable resistor or rheostat. The measuring instrument called a potentiometer is essentially a voltage divider used for measuring electric potential (voltage); the component is an implementation of the same principle, hence its name.
16X2 LCD Panel:-
Product Description:
A liquid-crystal display (LCD) is a flat-panel display or another electronically modulated optical device that uses the light-modulating properties of liquid crystals. Liquid crystals do not emit
[1]
light directly, instead of using a backlight or reflector to produce images in color or monochrome. LCDs are available to display arbitrary images (as in a general-purpose computer display) or fixed images with low information content, which can be displayed or hidden, such as preset words, digits, and seven-segment displays.
Pin Description:
· Connect pin 1 (VEE) to the ground.
· Connect pin 2 (VDD or VCC) to the 5V.
· Connect pin 3 (V0) to the middle pin of the 10K potentiometer and connect the other two ends of the potentiometer to the VCC and the GND. The potentiometer is used to control the screen contrast of the LCD. A potentiometer of values other than 10K will work too.
· Connect pin 4 (RS) to pin 12 of the Arduino.
· Connect pin 5 (Read/Write) to the ground of Arduino. This pin is not often used so we will connect it to the ground.
· Connect pin 6 (E) to pin 11 of the Arduino. The RS and E pin are the control pins that are used to send data and characters.
· The following four pins are data pins that are used to communicate with the Arduino.
· Connect pin 11 (D4) to pin 5 of Arduino.
· Connect pin 12 (D5) to pin 4 of Arduino.
· Connect pin 13 (D6) to pin 3 of Arduino.
· Connect pin 14 (D7) to pin 2 of Arduino.
· Connect pin 15 to the VCC through the 220-ohm resistor. The resistor will be used to set the backlight brightness. Larger values will make the backlight much darker.
· Connect pin 16 to the Ground.
Pin Description of 16×2 LCD Panel:
Arduino Uno:-
Product Description:
Arduino is an open-source computer hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and control objects in the physical world.
Arduino board designs use a variety of microprocessors and controllers. The boards are equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The boards feature serial communications interfaces, including Universal Serial Bus (USB) on some models, which are also used for loading programs from personal computers. The microcontrollers are typically programmed using a dialect of features from the programming languages C and C++. In addition to using traditional compiler toolchains, the Arduino project provides an integrated development environment (IDE) based on the Processing language project.
Pin Description: Pin Category
Design diagrams/ UML diagrams/ Flow Charts/ E-R diagrams
use case diagramclass diagramactivity diagramSequence diagram
User Interface
Arduino is an open-source computer hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and control objects in the physical world. Arduino board designs use a variety of microprocessors and controllers. The boards are equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The boards feature serial communications interfaces, including Universal Serial Bus (USB) on some models, which are also used for loading programs from personal computers. The microcontrollers are typically programmed using a dialect of features from the programming languages C and C++. In addition to using traditional compiler toolchains, the Arduino project provides an integrated development environment (IDE) based on the Processing language project.
UI Mockup
1. Algorithms/Pseudo Code
Code Explanation:
Before beginning the coding for this project, we need to first Calibrate the MQ135 Gas sensor. There are lots of calculations involved in converting the output of the sensor into a PPM value. we are using the Library for MQ135, you can download and install this MQ135 library from here: https://github.com/GeorgK/MQ135.
Using this library, you can directly get the PPM values, by just using the below two lines:
MQ135 gasSensor = MQ135(A0);
float air quality = gasSensor.getPPM();
But before that, we need to calibrate the MQ135 sensor, for calibrating the sensor upload the below-given code and let it run for 12 to 24 hours, and then get the RZERO value.
#include "MQ135.h"
void setup (){
Serial.begin (9600);
}
void loop() {
MQ135 gasSensor = MQ135(A0); // Attach sensor to pin A0
float rzero = gasSensor.getRZero();
Serial.println (rzero);
delay (1000);
}
After getting the RZERO value. Put the RZERO value in the library file you downloaded “MQ135.h”: #define RZERO 494.63
Now we can begin the actual code for our Air quality monitoring project.
In the code, first of all, we have defined the libraries and the variables for the Gas sensor and the LCD. By using the Software Serial Library, we can make any digital pin as TX and RX pin. In this code, we have made Pin 9 as the RX pin and pin 10 as the TX pin for the ESP8266. Then we have included the library for the LCD and have defined the pins for the same. We have also defined two more variables: one for the sensor analog pin and the other for storing air quality value.
#include <SoftwareSerial.h>
#define DEBUG true
SoftwareSerial esp8266(9,10);
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11, 5, 4, 3, 2);
const int sensorPin= 0;
int air_quality;
Then we will declare pin 8 as the output pin where we have connected the buzzer. lcd.begin(16,2) command will start the LCD to receive data and then we will set the cursor to first-line and will print the ‘ ’. Then we will set the cursor on the second line and will print ‘Sensor Warming’.
pinMode(8, OUTPUT);
lcd.begin(16,2);
lcd.setCursor (0,0);
lcd.print (" ");
lcd.setCursor (0,1);
lcd.print ("Sensor Warming ");
delay(1000);
Then we will set the baud rate for the serial communication. Different ESP’s have different baud rates so write it according to your ESP’s baud rate. Then we will send the commands to set the ESP to communicate with the Arduino and show the IP address on the serial monitor.
Serial.begin(115200);
esp8266.begin(115200);
sendData("AT+RST\r\n",2000,DEBUG);
sendData("AT+CWMODE=2\r\n",1000,DEBUG);
sendData("AT+CIFSR\r\n",1000,DEBUG);
sendData("AT+CIPMUair_quality=1\r\n",1000,DEBUG);
sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG);
pinMode(sensorPin, INPUT);
lcd.clear();
The following code will print the data on the LCD. We have applied various conditions for checking air quality, and LCD will print the messages according to conditions and the buzzer will also beep if the pollution goes beyond 1000 PPM.
lcd.setCursor (0, 0);
lcd.print ("Air Quality is ");
lcd.print (air_quality);
lcd.print (" PPM ");
lcd.setCursor (0,1);
if (air_quality<=1000)
{
lcd.print("Fresh Air");
digitalWrite(8, LOW);