Low-Cost IoT Enabled Embedded System for Measurement of Environmental Pollutants

In today’s world, with ever-changing pollutants and their concentrations, the designing of lowcost meteorological systems is unavoidable for assessing environmental parameters. Wireless instrumentation is an effective way of measuring the physical quantities as it can measure and transmit the data to the targeted location at high speed. In the present work, an IoT-enabled embedded system was developed to measure the concentration of carbon dioxide, ozone, and the presence of smoke. The ARM microcontroller reads the sensor data and processes the information to calculate the pollutant parameters. The measured data is displayed on the LCD, mobile phone, and a computer simultaneously using wireless technology. With Embedded C, the Keil compiler was used to develop the interfacing software for the designed system. Portability, user-friendliness, and reliability are the significant advantages of the device compared with the conventional systems, and it can be widely used as an inexpensive solution for the monitoring of environmental conditions.


INTRODUCTION
Air pollution is a significant threat to human life, which harms the environment, and it is evident in the health of humans as well as the other creatures of this world. Air pollution has become a primary concern for both the developed and developing countries in the world, and it affects the environmental condition every day. One of the leading causes of premature deaths and diseases is the increased levels of different air pollutants in the atmosphere, and as per WHO, almost 8 million premature deaths per annum are recorded worldwide (Xue et al. 2020). Long-term exposure to polluted air can have permanent health effects such as respiratory illness, asthma, heart and lung problems (Flavio et al. 2012). The high concentrations of air pollutants in the air have had negative effects on our daily lives and the global ecology, resulting in changes in climate extremes as well (Wenxia et al. 2020). The increasing use of automobiles and waste emitted by industries are the primary causes of pollution. The continuous burning of fuels in power plants and industries at different places produces hazardous pollutants such as CO 2 and dust particles. The existence of unwanted particles in abnormal quantities causes air pollution and causes health complications (Hanna et al. 2010). There is an inevitable need to control this situation; for this, it is needed to detect and measure the quantities of these air pollutants continuously (Chun et al. 2016). Conventional techniques, which necessitate a great deal of human effort, are extremely expensive. Designing a cost-effective pollutant monitoring mobile system with different sensors and embedded controllers becomes crucial. The sensors measure the concentration of pollutant gases with high accuracy and the measured values can be shared using IoT-enabled devices. The system can be used to let people know about the increased levels of pollutant gases so that all the necessary steps can be taken to decrease the effects in the future.
Carbon dioxide (CO 2 ) is an odorless gas produced by burning carbon and different organic compounds. It is one of the most abundant gases in the environment: a colorless, odorless, and non-flammable gas. Carbon dioxide typically enters the body through inhalation. High concentration levels of carbon dioxide (CO2) may cause different health issues in humans such as incapacitation and unconsciousness. The ozone gas in the troposphere is a very harmful pollutant, and breathing O3 above 120 ppb can affect lungs, chest pain, and cause coughing, throat infections, and many other severe problems in human beings. The 8 hours' exposure limit of ozone gas is 50 ppb on average as per the guidelines suggested by the WHO (Zhang et al. 2019).
The introduction of the IoT-based pollution measurement system can produce substantial changes in the environmental monitoring systems. The wireless systems can be used in hostile conditions since they are durable enough to survive them (Jayavardhana et al. 2013). Embedded systems are inexpensive to maintain and are proven to be reliable over a long period of time. Apart from the sensors and the control circuitry, the use of sophisticated software development tools creates a user-friendly gadget to achieve the task of environmental monitoring.
The present paper deals with the sensors and their integration for tracking the concentration of carbon dioxide, ozone, and the presence of smoke.

Instrumentation
The block diagram for the developed gadget can be viewed in Fig. 1. The system was built around the controller LPC 2148 (Barkunan et al. 2019). It is an ARM-based controller with a 32 bit ALU. The microcontroller from NXP semiconductor possesses a vast amount of resources for building an effective embedded system. The availability of different protocols and a couple of 14-channel ADCs makes it perfectly suitable for handling numerous sensors simultaneously. The processor is built to withstand a wide range of temperatures from -40°C to +85°C; hence it can be used in domestic as well as industrial applications. The 60 MHz clock, RAM of 40 kilobytes, and the Flash memory of 512 kB assures that the system developed with the processor has enough memory to store and run the program with good speed. It is also enriched with serial communication terminals such as USB, UART, I2C, SPI, and SSP. The watchdog timer takes care in case of erroneous conditions without any human intervention (Seyyed et al. 2018).

Interfacing of Carbon Dioxide Sensor
The MHZ-19B sensor is used to detect carbon dioxide gas concentration using the non-dispersive infrared (NDIR) principle to sense the existence of CO 2 gas in the air. It delivers two digital outputs in the form of UART and PWM output, and it also produces output in analog. The sensor measures the CO 2 ranging from 0 to 5000 parts per million with good stability and non-oxygen dependency (Shahid et al. 2020). The sensor can operate in the temperature range of 0-50°C and the humidity range of 0-90%. The sensor's preheating time is 180 seconds only, which is very less compared to other CO 2 sensors. The NDIR gas sensor is more technically advanced as it has long-term stability, high accuracy, and high selectivity in an open-air environment (Martín-Garín et al. 2018, JongSeon et al. 2010). In the NDIR principle, an infrared beam is passed through the gas to detect the gas concentration. The gas concentration is calculated by measuring the amount of absorbed infrared radiation using the IR receiver at the required frequency. In the present work, the measured analog output is taken from the sensor given to the inbuilt ADC available in the microcontroller to convert the analog output from the sensor into digital form.

Interfacing of Ozone Sensor
The concentration of ozone is tracked by using a MICS-2614 sensor (Nagendra et al. 2019). It is a Metal Oxide Sensor (MOS) with a detection range between 10 ppb (parts per billion) -1000ppb. MOS-type sensors are often used in the gas sensing field because of their small size, low cost, and high production abilities. In a MOS-type sensor, the sensing material is printed on the sensing element, with the heater created on the reverse side. When the sensing material is in clean air, the free electrons generated by the heating moves freely, and in the presence of ozone gas, the sensor resistance decreases. In this way, the MOS-type gas sensor detects the concentration levels of ozone gas O 3 . The voltage from the MICS-2614 sensor connected to the inbuilt ADC of the microcontroller is directly proportional to the ozone concentration in the air.

Interfacing of Smoke Sensor
The MQ-2 sensor is based on the electrochemical variable resistance concept, which is used in smoke detection (Borah et al. 2018). This sensor is highly sensitive to smoke. It is interfaced to the microcontroller through a digital pin using a comparator. The comparator is designed by using an LM358 operational amplifier. When the detected smoke exceeds the threshold point, the comparator sends a signal to the microcontroller's digital pin, triggering an alert in the event of a probable catastrophe. The sensor is also sensitive to consumable gas so that it can be employed to detect gas leakage in a household. The sensing range of the sensor is 300 ppm to 10000ppm.

Wireless System
The detected values can be locally displayed, but most of the time, they need to be accessed in remote locations rather than only showing them on the local device. For remote access, a wired connection can be provided, however, there are some constraints like expensive hardware, installation, and reconfiguration. A wireless connection is established to eliminate these constraints by using the microchip ESP8266 . It follows the IEEE802.11 protocol standard for Wireless Fidelity (Wi-Fi) implementation and is available in many economic modules such as ESP01 and ESP32. The 8-pin ESP01 module works with a power supply of +3.3V, is user-friendly as it can be easily connected and replaced to the system through the socket inserted in the system. The ESP-01 is enriched with antenna diversity, gives a reliable and qualitative link between the transmitter and receiver wirelessly. It also possesses security protocols such as WPA/ WPA-II, and data collected from the system is sent to a computer and mobile phone. The detailed schematic diagram of the integrated system is as shown in Fig. 2.

Software Implementation
The software development for the system involves two steps. Primarily, the system needs to collect information from the sensors. Further, the data collected is to be displayed on a Graphical User Interface (GUI) environment. For these, we need the help of a couple of software tools. The sensor interfacing software is developed by Embedded C programming language using Keil Compiler. The sensor readings are continuously collected, and the values are calculated by Embedded C coding and the results are visualized in a liquid crystal display present in the system. Apart from this, the data sent through the wireless network is displayed in a user-friendly environment using the Visual Basic Integrated Development Environment (Ling & Wong 2017). Then, the computer/mobile connected to the Internet, and the measured values can be accessed from wherever the Internet is available. The flowchart of the program is shown in Fig. 3. The parameters displayed on LCD and GUI output on the mobile phone and computer are shown in Fig. 4.

RESULTS AND DISCUSSION
An ARM-based pollutant monitoring mobile system is designed and developed to measure the atmospheric pollutants under different environmental conditions. The system was placed in an industrial area (Port Area) and a heavy traffic area (Dwaraka Nagar) in Visakhapatnam, India, in different seasons during the working hours as depicted in   pollutants is found due to the different activities performed. Dwaraka Nagar is one of the highest traffic areas in the city where the roads are always full of heavy vehicles such as city buses and lorries.
The values are recorded for these areas on different days during the three seasons. The measured data is in good agreement when compared with the values provided by the Andhra Pradesh Pollution Control Board, Visakhapatnam, India (APPCB). The recorded values plotted with the error bars are as depicted in Fig. 6 and Fig. 7. In summer, the system was taken to the port area to measure CO 2 and O 3 values during the daytime and the concentration of CO 2 was observed to be high during the afternoon time between noon and 2.00 pm. It was found that different fuels are burned at the port area during this period, and smoke from the industries is emitted, which is the primary cause of higher values being recorded. The concentration of O 3 was tracked high in the summer season compared to the other two seasons as the Sun rays play a major role in the formation of O 3 . Ozone being a secondary pollutant is not emitted directly     by industrial activities or traffic. It is formed by the reaction between ozone precursors such as nitrogen oxides (NO x ) and VOCs under warm sunlight or solar radiation. Hence during the summer, the concentration of ozone measured was high. The developed system was then taken to the Dwaraka Nagar area of the city during the summer season, which is a heavy traffic area of the city. The concentration of CO 2 measured was around 430 ppm, and the concentration of ozone was recorded around 51.05 µg.m -3 , which is the highest value recorded at 2.00 pm. Owing to the heavy traffic in this area, the concentration of CO 2 and O 3 measured was high during the daytime.
Further, in autumn, CO 2 and O 3 concentrations were measured at both the port and Dwaraka Nagar areas for the same duration. The prototype was first used to measure the pollutants at the port area, where the concentration of CO 2 was found to be high during the afternoon time. The maximum value of CO 2 was at noon as 440 ppm. The concentration of O3 measured was around 28.2 µg.m -3 , which was found comparatively less than in the summer season. The system was then taken to Dwaraka Nagar, where the values were found to be nearly equivalent to those of the summer season in the area, which was plotted in the graph. The maximum concentration of CO 2 was tracked as 428 ppm, and the maximum concentration of O 3 measured was 25.5 µg.m -3 .
The concentrations of CO2 and O3 in the port area measured less during the winter season than during the other two seasons. The maximum concentration of CO 2 measured was 335 ppm, whereas the maximum concentration of O 3 was 22.02 µg.m -3 . The concentration of ozone is less compared to the summer and autumn seasons, which is also shown in previous studies (Khoder et al. 2009). The designed system was then taken to the Dwaraka Nagar area. In winter, the concentrations of CO2 and O3 were observed to be lower in this area. The concentration of CO2 in this area was found to be high during peak hours of 9.00 a.m. to 11.00 a.m. and 4.00 p.m. to 5.00 p.m., which is primarily attributable to vehicle exhaust gas during high traffic. The maximum value of the CO 2 measure was 340 ppm, and the concentration of O 3 was around 22.59 µg.m -3 .

CONCLUSION
An IoT-enabled environmental monitoring device was designed and developed to measure the concentration of pollutant gases under different environmental conditions. The results were in good agreement when compared with the standard values of the pollution control board. The system is equipped with wireless connectivity for incessantly collecting and storing the results. The developed economical device with in-system programmability and low maintenance provides access to a remote location using IoT technology.