Wireless Internet of Things-Based Air Quality Device for Smart Pollution Monitoring

Living in a healthy environment is a need for every human being whether indoor or outdoor. However, pollutions occur everywhere and most people are merely mindful of the importance of having clean outdoor air to breathe and are not concerned about the indoor air quality. Indoor air quality refers to the quality within the building, and relates to the health and comfort of the building occupants. Dangerous particles exist in the outside air, pollute the indoor environment and produce harmful conditions as the polluted air travels into the house or building through windows or doors. Therefore, a wireless Internet of Things-based air quality device is developed to monitor the air quality in the indoor environment. The proposed system integrates a low-cost air quality sensor, temperature and humidity sensors, a single-board computer (Raspberry Pi 2 microprocessor) and cloud storage. The system provides realtime air quality reading, transfers the data through a wireless network to the Internet and displays the data in dedicated webpage. Furthermore, it stores records in cloud storage and sends e-mail notification message to the user when unhealthy condition is met. The study has a significant impact on promoting affordable and portable smart pollution monitoring system as the development of the device utilizing low-cost and off-the-shelf


INTRODUCTION
Most people are concerned about their health, whether the food is safe to eat or the water is clean to drink.The most important thing in healthy life is the air quality which most people pay little attention to the environment.The air pollution is frequently happening in Malaysia due to many sources such as open-fire, gas combustion from vehicles, and factories waste.These events release harmful gases and one of the examples is nitrogen oxide (NO X ) which is the primary component of acid rain formation.Harmful gases affect our wellness and can induce lung cancer or chronic heart disease even though in indoor environments.This is because the polluted outdoor air come into the indoor environment through windows and doors.Thus, a system which detects the air pollution is necessary so that people are able to monitor the air quality and perform the necessary action to keep the harmful gases away.
At present the sensor technology is improving as compared to previously.A number of researchers work with sensors to monitor the environment and resolve environmental issues.For example, a work by Kaur et al. [1] recognized environmental parameters such as the temperature, relative humidity, carbon monoxide (CO), carbon dioxide (CO 2 ) and luminosity by using SHT10, MQ7, T6615, LDR respectively.Likewise, [2] used MQ-135 and DHT-11 sensors to detect the temperature, humidity, CO, CO 2 , smoke and alcohol.The DHT-11 sensor consists of Negative Temperature Coefficient (NTC) component to measure temperature and resistive type component to measure humidity.Ibrahim et al. [3] proposed an environmental monitoring device using a single board computer which allows remote access and control of a platform with Python programming language.The system measures concentrations of carbon monoxide and detects earthquakes through an assembled seismic sensor.Furthermore, Devarakonda [4] implemented a vehicularbased mobile access for measuring fine-grained air quality in real-time.However, this work used expensive equipment at specified locations or dedicated mobile equipment and laboratories to perform the measurement of the pollution and it has portability issue.Another work by [5] depended on the base station to function.The value from every sensor node is sent after a request is received from the base station.It uses ultra-low power sensor based microcontroller and suitable for business sector.The drawback of this system is every sensor node needs to be ready and power up at all times to achieve total measurement, although the data are only required for a short period.This incurs high usage of power and it is costly.An option of a low power consumption device will benefit the research.Moreover, [6] proposed a scheme that comprises of a base station associated with the network and a few selfgoverning hubs furnished with various sensors to measure temperature, stickiness, light and air quality.A system with LabVIEW is used in order to administer the operation and www.ijacsa.thesai.orgestimates the system.Nevertheless, this work focus on a huge and comprehensive system which is suitable for large scale arrangement.
There are many commercial air quality sensor products and monitoring systems available in the market but the price is expensive and not affordable to employ.They consist of many features, functions and high-end equipment with complex technologies.Special skills and knowledge are required for system's handling and at times it is hard to set up for those with no expertise.Besides, the physical size of the commercial air quality system is usually huge and heavy and some of the existing systems do not provide the notification alert and data storage for further analysis.Thus a device with small scale size is necessary to increase the portability aspects of the arrangement so that the device can be used anywhere and at any time.Hence, this study has been carried out with three (3) research questions: (1) What is the suitable low-cost component that can be used to monitor the air quality?(2) How can the user be alerted in specific condition?(3) What is the appropriate mechanism for data display and storage?These research questions are mapped with the research objectives of this study which are to develop a wireless and affordable Internet of Things (IoT)-based device that can monitor the air quality which can affect human's health, to integrate the monitoring system with a cloud storage so that the information can be viewed online on a web, and generate an alert notification e-mail when the air quality is in unhealthy condition.The proposed solution intends to solve the highlighted issues by using IoT technology, wireless communication and cloud services.
A number of low-cost components, off-the-shelf and opensource products are involved in the development of the proposed system.For example Raspberry Pi 2 microprocessor which is an integrated circuit that has a processing unit inside the on-board chip, air quality sensor to sense harmful gases, temperature sensor and humidity sensor.A web page is created on open-source cloud platform to display and analyse the air quality data from the sensors.Furthermore, a notification message is transmitted to the user through the e-mail service when the air quality value is beyond the threshold limit which indicates the indoor atmosphere is in an unhealthy state.The transfer of air quality data and e-mail notification message to cloud storage and user are by using wireless network connections.So, with the proposed system the air quality in the indoor environment can be easily monitored in real-time.
The remainder of this report is organized into four (4) parts.Section 2 presents the methodology employed in this work and Section 3 provides a detailed explanation of results and discussion.The final section concludes the paper.

II. METHODOLOGY
In general the implementation of the proposed system was guided by Rapid Application Development model (RAD) [7].RAD is a type of incremental model as depicted in Fig. 1.The RAD methodology involves four (4) main phases which are requirements planning, user design, construction and testing and cutover.The details of each phases are described as follows.

A. Requirements Planning
The objective of this phase is a process to determine the needs of the study such as establishment of the problem statement, scope, objectives, data and functional requirements, and types of hardware and software used in the implementation.

1) Data Requirement
The input of the system is the air quality sensor MQ-135, temperature and humidity sensor DHT-22.The MQ-135 sensor is used to sense the air quality which comprises of chemical substances such as ammonia (NH 3 ), nitrogen oxide (NO X ), alcohol, benzene and other harmful gases.The concentration scope of the detection for benzene vapour and ammonia (NH 3 ) are 10ppm to 1000ppm and 10ppm to 300ppm respectively, whereas the DHT-22 is used to sense the temperature and humidity in the air in degree Celsius and percentage.The output of the system is a notification email alert and online data display and storage.

2) Software Requirement
The main programming language used was Python.It was for code development of the system.It was integrated with several modules to realize the system's functionalities.Other related software requirements were Hypertext Markup Language (HTML) and Hypertext Preprocessor (PHP) for web development that incorporated with open source ThingSpeak [8] cloud storage.ThingSpeak requires an Application Programming Interface (API) in order to provide web services for connecting things or objects such as storing and retrieving data from the sensors using Hypertext Transfer Protocol (HTTP) at port 80 over the Internet.As for the alert notification part, the system communicated with Google e-mail server for e-mail service of personal account.

3) Hardware Requirement
The core development of this IoT device comprised of a credit-card sized microprocessor computer i.e.Raspberry Pi 2 [9] that plugs into the monitor and a keyboard.It is the processing device used in this system.The specification of Raspberry Pi 2 is listed in Table 1.
Another key component is the sensor.A sensor is a device that can detect and sense some specific input from the physical environment such as light, heat, motion, moisture, and pressure.The output of the sensor is usually converted the signal to human-readable display at the sensor location or transmitted electronically using network environment for viewing or further processing.In this case, low cost MQ-135 air quality gas sensor and DHT-22 temperature and humidity sensor were used in the implementation with additional hardware such as Wi-Fi module for wireless communication, LEDs for indicator, MCP3008 component for analogue to digital converter, breadboard, and jumper wires.

B. User Design
In user design phase, model and prototype that represent all system processes, inputs, and outputs are developed.User design is a continuous interactive process that allows users to understand and modify a working model of the system that meets their needs.In this study, the air quality monitoring system model and prototype were developed based on system operations, inputs and outputs.The design for the proposed system is illustrated in Fig. 2. It demonstrates the integration of the sensors, LEDs, Internet and cloud storage with the processing platform i.e.Raspberry Pi 2 microprocessor.

C. Construction
The objective of the construction phase is to carry out the detailed plan of the proposed scheme.The design of the proposed system is initially described in the user design phase and completed in construction phase.In this research, the construction was divided into three (3) parts.The first part was to configure all hardware and program the Raspberry Pi 2 board based on the design to ensure the system works properly.Next, the cloud storage was configured so that the data acquisition can be stored in the cloud.The last part was the notification part; where a client and an e-mail server were configured in this system and alert notification message was sent to the user.The process cycles between the user design phase and construction until final prototype is created.Fig. 3 illustrates the flow of the proposed system, whereas Fig. 4 demonstrates the example of hardware connectivity, in this case is MQ-135 gas sensor to the Raspberry Pi board.

D. Testing and Cutover
In testing and cutover phase, the system combines the software and hardware components in order to acquire a complete system and test the system's functionalities.The hardware prototype and the web page developed in ThingSpeak cloud storage were tested together to ensure all sensors, e-mail and LEDs work properly based on the setup function.In this proposed system, the level of the air pollution was set in the construction step accordingly as indicated in Table 2.It is a simplified setting of Air Quality Index (AQI) level 2 .However, this setting can be easily modified by changing the configuration program to cater future requirement.When the device detected the level of the health concern was at good and moderate level, the green-coloured LED lighted up, whereas when the health concern was in unhealthy level, the red-coloured LED turned on and a notification message was sent to the user via an e-mail.In this study, three (3) experiments were conducted, namely connectivity test of sensors with Raspberry Pi, generation of the alert notification message by e-mail service test and integration test of cloud storage.
In the first experiment, the connectivity of MQ-135 and DHT-22 sensors with the Raspberry Pi board as depicted in Fig. 5 were tested.The connections of the sensors to the Raspberry Pi board were by using the general purpose input/output (GPIO) pins.Initially, the Raspberry Pi was switched on and Python script was run in the terminal by executing a command sudo python analog.py.This calibrated the air quality data.Then, the Raspberry Pi read the air quality data from the air sensor and displayed the data in the terminal of the Raspberry Pi.The DHT-22 sensor sensed the temperature and humidity reading whereas the MQ-135 gas sensor detected the air quality value.Fig. 6 illustrates the results of the air quality level which is in healthy condition with 83 ppm and temperature and humidity values are 32.7 degree Celsius and 67.4% respectively.
The second experiment was to send e-mail alert to user when the air quality value reaches the threshold limit based on the values listed in Table 2.The threshold value was configured in the main program (analog.py).The same command was executed to initiate the system and calibrate the readings from the sensors.E-mail notification was generated when the set threshold had been met.Fig. 7 presents the data retrieved from the sensors.When the air quality value was beyond the limit of the threshold, the air quality condition was stated as unhealthy/hazardous in the terminal and an e-mail alert was sent to the user.Fig. 8 represents the sample of the email notification that is received by the user when the air quality level is at unhealthy or hazardous condition.With this warning notification, user aware of the current condition of the indoor environment and further action to amend the situation can be considered.
The third experiment was to examine the functionality of web-based cloud storage for record keeping and data presentation.All parts such as sensors, Raspberry Pi and ThingSpeak web-based cloud storage were set up accordingly.The command sudo python analog.pywas executed to start the system.ThingSpeak cloud storage was used and proper login was required.Then, channel type Private was chosen to record the current reading of data from the system in graphical form.In addition, Data Import/Export option was selected for data saving.In this system the data were displayed in an online chart and saved on the cloud storage for further analysis.Fig. 9 shows the web-based cloud storage platform "ThingSpeak.com".An account and channels were created in the implementation phase.The channel ID and API key were added into the main script (analog.py) to enable the reading process from the sensors and data saving in the cloud storage.Fig. 10 illustrates the data reading retrieved from the sensors which comprises of temperature, humidity and air quality values.The data from the sensors were sent to the cloud storage and displayed in graphical form.It shows the cloud storage receives the data successfully.Moreover, Fig. 11 illustrates the .csvfile that was exported from the cloud storage.The information is downloadable by the system's user as reference report for further analysis of the air quality.

IV. CONCLUSION
In this paper, we have shown the development of the proposed solution which integrates Raspberry Pi microprocessor, air quality, temperature sensor and humidity sensor to form an Internet of Things (IoT) -based air quality monitoring system.The proposed system exhibits several strengths such as providing a real-time web-based cloud application that monitor, update, and display air quality data online, and sends an e-mail alert notification to the user when air quality is in unhealthy condition that is when the set threshold has been met.Further analysis of the air quality status can be carried out by the user, such as home owners, school operators, company managers, and manufacturing plant directors to ensure indoor conditions of living or working environment of the building is in healthy level for all occupants.This smart pollution monitoring system is easy to install and maintain, as it requires very low technical skills and knowledge for device handling and system operation which will benefit various users.However, most of the real-time functionality of this system is only limited to the area that have wireless network access.Thus, further research in the network communication area should be explored to enhance the usefulness of the system in a wider application area towards achieving conducive and healthy surroundings.

Fig. 2 .
Fig. 2. System design of the proposed solution.

TABLE I .
SPECIFICATION OF RASPBERRY PI 2 MODEL1

TABLE II .
AIR QUALITY INDEX (AQI) LEVEL