Skip to main content

Building an indoor air quality monitoring system based on the architecture of the Internet of Things

Abstract

With rapidly changing technology, people have more and more requirements for thermal comforts regarding indoor temperature, humidity, and wind speed, and pay more attention to air quality. Indoor air quality has serious effects on the elderly, children, and those with respiratory allergies. Based on the architecture of the Internet of Things smart home, this study constructed an indoor air quality monitoring system to explore how people can live in an environment with good air quality. Among the numerous air quality indices (AQIs), the carbon dioxide index and AQI of the American Society of Heating, Refrigerating and Air-Conditioning Engineers are selected as the indices suitable for this study. The common points of the two indices are combined, and then, based on the data of the Environmental Protection Administration, indoor and outdoor environmental parameters are analyzed, and controllable environment variables are simulated to analyze their effects on air quality. This study designed effective load control using fuzzy control and developed a fuzzy rule base for simulation of the environment variables. Decision logic was used to replace the threshold control of indoor air quality in the past, and a comfortable air quality monitoring system was designed by combining the Arduino Uno development board and ESP8266 Wi-Fi wireless transmission modules.

Introduction

Technology is changing rapidly, from the old slide phones to today’s smart phones, tablet computers, and even artificial intelligence, thus, it is not difficult to find that technology is gradually affecting our surroundings and making us increasingly dependent on technology products. However, the technological advancements have led to deterioration of our living environment, and various problems, such as air pollution, smog, and PM2.5 (particulate matters with a diameter of 2.5 μm or less) have gradually emerged. Poor air quality has caused respiratory problems to many newborns and many smog-themed disaster films have been shot, which seem to reflect the problems the world must face. There are 3 effects of smog:

  1. 1.

    Smog’s effects on the human body: It is widely known that smog has the greatest effects on the respiratory system because the large area of the respiratory system is most frequently in contact with the environment. While hundreds of atmospheric particles enter the respiratory tract each day, and adhere to lung lobes, most of them will be absorbed by the human body. Harvard University has verified that the patient mortality rate increases by 10–27% for every 10ug/m3 pollutant increase in PM2.5.

  2. 2.

    Smog’s effects on traffic: When there is smog, due to poor air quality and low visibility, accidents are more likely to occur to railway, highway, sea transportation, and aviation traffic, which affects traffic order, disrupts people’s schedules, and causes inconvenience.

  3. 3.

    Smog’s effects on the economy: Smog not only affects respiratory tracts and intelligence, it also reduces of the efficiency of solar power generation, which is reduced due to rain, fog, and smog. Therefore, some scholars have pointed out that solar panel power generation would decline year by year as air pollution becomes the norm.

In Taiwan, the Environmental Protection Administration uses a monitoring network for air quality for the people to view; however, these data only show a large-scale area and there is no way to know the actual situations in homes. The quality of indoor air is the closest to people’s living environment.

This study focuses on air quality. The Air Quality Index (AQI), which is a nonlinear index that quantitatively describes air quality, is mainly used to explain that severer air pollution is more harmful for human health, including the respiratory tract, and leads to greater index values, higher categories, and darker display colors. However, there are no hourly concentration standards regarding particles with the severest air pollution, and air quality is only measured in 24-h average concentrations. As changes in air quality can be somewhat delayed, for the people to know their true feelings, the Environmental Protection Administration announced the concentration data of a “real-time air quality index”, which mainly measures primary pollutants, fine particulate matters, and particle matters. It makes more practical sense that the real-time concentration data shall be monitored when air quality is being observed.

Based on the system architecture of a smart home and the IoT, the purpose of this study is mainly to explore how users construct an index system in the home environment. AQI is now the most commonly used index in the world, and mainly explores 6 gases: ozone (O3), fine particulate matters, particle matters, carbon monoxide (CO), sulfur dioxide (SO2), and nitrogen dioxide (NO2). This study further explored the fine particulate matters, CO, and carbon dioxide (CO2) commonly found in homes. The indoor environment was analyzed by MATLAB simulation, fuzzy control was applied to the data of fine particulate matters and CO2 in the indoor environment, and a logic base was established based on the AQI data for better air quality in homes.

This study conducted on-site measurements of indoor environment data with two sets of equipment equipped with sensor modules for fine particulate matters, CO, and CO2. After receiving the data, the 3 modules collected the data of the Arduino Uno board for integration, and then, transmitted them to the computer terminals through the ESP8266 Wi-Fi module for subsequent calculation and analysis. This study adopted Visual Studio C# software as the human–machine and monitoring interface, where AQI estimation applied fuzzy control to decide the time to open the air purifier, window, and ventilation unit, in order to reduce the fine particulate matter and CO2 concentrations. The system threshold of CO concentration was designed based on AQI, and the users were reminded by automated warnings and buzzers [1].

Literature review

IoT

The Internet of Things (IoT) was originally mentioned in a speech by Peter T. Lewis in 1985, and in 1999, the Massachusetts Institute of Technology (MIT) combined Radio Frequency Identification (RFID) with the network to realize intelligent planning and management. After that, the International Telecommunication Union (ITU) introduced the concept of the IoT at the World Summit on the Information Society (WSIS), which brought the term IoT into people’s lives [2]. IoT refers to combining the information received by sensors from electronic tags or RFID devices, which cannot be connected to the Internet, to collect various data, such as temperature, brightness, and air quality sensors, in order that sensors can record the environmental changes and users can search the information they need through wireless networks, such as Wi-Fi, ZigBee, BlueTooth and LoRa, or wired networks. There are many mainstream IoT technologies, and the communications they use are also different, including NB-IOT, LoRa, and SIGFOX. Various IoT devices have different network nodes, such as IPv4 and IPv6.

Based on the above concept, the 3-layer IoT architecture, as established according to the European Telecommunications Standards Institute (ETSI), is comprised of an application layer, internet layer, and a sensing layer according to different work projects. The architecture is shown in Fig. 1:

  1. 1.

    Sensing layer: the sensing layer is mainly divided into sensing and identification technologies, which carries out different monitoring and sensing of different environments. Sensing technology: temperature, humidity, brightness, infrared, and other sensors are used. Identification technology: the sensor data are transmitted to the internet layer through transport protocols, such as LoRa, ZigBee, RFID tags, and RS232.

  2. 2.

    Internet Layer: the internet layer is between the sensing layer and the application layer, and is mainly a communication bridge. The technologies of the internet layer include a low power and low transmission wireless network, ultra-high-speed short-range wireless transmission, a long-distance Wi-Fi wireless network, and the latest 5G LTE mobile communication protocol.

  3. 3.

    Application layer: on the application layer, the data measured by the sensing layer are transmitted to the application system of the top layer through the network on the internet layer, and then, the responses to specific events are conducted according to the result analysis to build models, which are similar to human brains and central nerves, such as logistics management, access control systems, environmental monitoring, smart home appliances, medical care, transportation, and decision support. As the main technologies of the application layer are cloud computing, massive data analysis, and big data analysis, these technologies will be widely used in the future.

Fig. 1
figure1

IoT architecture. Based on the above concept, the 3-layer IoT architecture, as established according to the European Telecommunications Standards Institute (ETSI), is comprised of an application layer, internet layer, and a sensing layer according to different work projects

CO2

CO2, which is easily accumulated in poorly ventilated places, is a high-density greenhouse gas with contents approximately ranging 300–400 ppm in the atmosphere. People produce CO2 with every breath they take, and while CO2 is non-toxic, it may cause hypoxia if its concentration is higher than the general level in the air, which is bad for the human body. If one spends a lot of time in an overly crowded environment or a place with poor ventilation, the CO2 concentration will exceed the standard and cause discomfort. CO2 is used as a hygienic index by the State to measure indoor air pollution; the CO2 concentration shall not exceed 0.07–0.1% in the case of a long stay in a crowded area, and shall not exceed 0.15% in the case of a short stay. The Ministry of Labour has also stipulated the immediate danger to life or health concentration (IDLH) for acute respiratory hazards. At a CO2 concentration of 4%, people are in danger; at a CO2 concentration of 7.5%, people begin to experience palpitations, dizziness, and headaches; at a CO2 concentration above 10%, people lose hearing, start to vomit, and feel nauseous; at a CO2 concentration above 30%, people lose consciousness and go into convulsions. The indoor CO2 concentration ranging from 350 to 450 ppm is good, and at a concentration higher than 1000 ppm, people begin to experience symptoms, such as drowsiness, and such higher concentration leads to severe symptoms. Hence, ASHRAE suggests that the indoor CO2 concentration should not be higher than 1000 ppm. The detailed effects of CO2 concentration on human health are shown in Fig. 2 [3].

Fig. 2
figure2

Effects of CO2 concentration on the human body. The indoor CO2 concentration ranging from 350 to 450 ppm is good, and at a concentration higher than 1000 ppm, people begin to experience symptoms, such as drowsiness, and such higher concentration leads to severe symptoms. Hence, ASHRAE suggests that the indoor CO2 concentration should not be higher than 1000 ppm

CO

As a compound, CO is a colorless, tasteless, non-irritating, and odorless gas, and the most common toxic gas in daily life. While the activities of general organisms produce CO, it mainly comes from fire, engine exhaust, and incomplete gas combustion [4]. In the blood, as its heme-binding capacity is 200 times more than that of oxygen (O2), it is difficult for the heme to carry O2 after binding, and after inhaling CO, people will experience various symptoms, such as headaches, vomiting, dizziness, and chest pains. Hence, the United States Environmental Protection Agency (USEPA) stipulated that the maximum CO concentration in the air shall not be more than 10 mg/m3, and the National Fire Protection Association (NFPA) also defined the toxic symptoms for people inhaling different levels of CO, as shown in Table 1 [5].

Table 1 Effects of CO concentration on the human body

Fine particulate matters

The air quality has slowly deteriorated since the Industrial Revolution, and is now further affected by climate change and denser urban vehicle use. In recent years, while Taiwan’s smoking population has decreased year by year, the rate of cancers, such as lung cancer, have increased year by year, and poor air quality may be an important factor in this phenomenon, with particle matters having the most serious effects on the human body. Particle matters are referred to as “smog”, and can be divided into 4 categories according to the size, including total suspended particulates (TSP), 10 μm particle matters (PM10), coarse particulate matters (PM2.5–10), and fine particulate matters (PM2.5), with the details shown in Table 2. Fine particulate matters are mainly discussed in this study.

Table 2 Description of particle matters and particle sizes

There are 3 main sources of fine particulate matters (PM2.5): natural, primary, and derived. A natural source generally refers to forest fires or volcanic eruptions; primary fine particulate matters are generally produced by incomplete combustion in factories, including many toxic substances, such as organic carbon, dioxin, and heavy metals; derived fine particulate matters refer to oxycarbide and oxysulfide emitted by factories and in petrochemical industries, and oxycarbide and oxysulfide often produce secondary toxic pollutants due to sunlight, such as nitrate and sulfate. Fine particulate matters mainly invade human’s blood circulation through alveoli, indicating their tiny sizes, as shown in Fig. 3 [6]. After entering the blood, they cause inflammation in organs, such as hearts, blood vessels, brains, and reproductive systems, as shown in Fig. 4 [6], which mainly occurs because fine particulate matters are toxic substances containing heavy metals.

Fig. 3
figure3

Diagram of fine particulate matter size. Fine particulate matters mainly invade human’s blood circulation through alveoli, indicating their tiny sizes

Fig. 4
figure4

Effects of fine particulate matters entering the human body. After entering the blood, they cause inflammation in organs, such as hearts, blood vessels, brains, and reproductive systems

In 2005, the World Health Organization (WHO) developed measures to restrict fine particulate matters. In Taiwan, fine particulate matters were included in AQI in May 2012, and specific indices were developed for fine particulate matters, with details as shown in Table 3 and Eq. 2-1 [7].

$$ \begin{aligned} {\text{PM2}}.{5} & = 0.{5}\,*\,{\text{mean}}\,{\text{of}}\,{\text{the}}\,{\text{first}}\,{12}\,{\text{h}} + 0.{5}\,*\,{\text{mean}}\,{\text{of}}\,{\text{the}}\,{\text{first}}\,{ 4}\,{\text{h }}\left( {{2} - {1}} \right) \\ & \quad {8}\,\,{\text{valid}}\,\,{\text{data}}\,\,{\text{are}}\,\,{\text{needed}}\,\,{\text{in}}\,\,1{2}\,{\text{h}} \\ & \quad {3}\,\,{\text{valid}}\,{\text{data}}\,{\text{are}}\,{\text{needed}}\,{\text{in}}\,{4}\,{\text{h}}{.} \\ \end{aligned} $$
(2-1)
Table 3 Fine particulate matter indices

Wireless transmission

People choose the most suitable methods to transmit data depending on the circumstances, and such transmission modes are divided into wired and wireless transmissions, which have their own advantages and disadvantages, as shown in Table 4. Smart homes show their effects through IoT applications. In smart homes, the transmission distance is basically within the residence, and the data to be transmitted will not be a large amount; hence, without emphasizing transmission rate, wireless transmission was selected in this study. The transmission rate involves several factors, such as indoor environment, sheltered areas, and different floors, meaning the transmission rate at all locations is basically the same on the same floor, provided it is not too heavily sheltered, and while the transmission rate on different floors is more or less affected, the main difference of the transmission rate on different floors is stability. The greater the distance between the floors, the more unstable the transmission rate. The wired network line shall be arranged first when designing smart homes; otherwise, it will be troublesome to modify or build a new wired network. Therefore, if the system is set up on different floors and without a line arrangement, it is suggested that wired transmission is more stable than wireless transmission. However, the disadvantages of wired transmission are that the network cannot be modified or rearranged as easily as those with wireless transmission, thus, wireless networks are gradually replacing wired networks in smart homes.

Table 4 Advantages and disadvantages of transmission modes

The network architecture of wireless transmission consists of 4 layers: application layer, transport layer, internet layer, and link layer, and is often referred to as the TCP/IP or DoD (Department of Defense) model. With their own responsibilities, all layers are closely related and work together, and the detailed transmission flow chart is shown in Fig. 5.

Fig. 5
figure5

Wireless transmission flow chart. The network architecture of wireless transmission consists of 4 layers: application layer, transport layer, internet layer, and link layer, and is often referred to as the TCP/IP or DoD (Department of Defense) model

The major network types are shown in Table 6, and the local area network architecture is mainly used in this study. Different network architectures, such as the Wireless Personal Area Network and Wireless Local Area Network (WLAN), are developed according to the 3 network types in Table 5.

Table 5 Major network architectures

WLAN was developed according to IEEE 802.11, as published in 1997 [7]; however, with the rapid advances in technology, many WLAN transmission modes have been developed, such as Bluetooth, ZigBee, LoRa, and Wi-Fi.

Bluetooth

Ericsson first developed Bluetooth wireless technology in 1994, and in 1998 released specification 0.4, which supports 2 communication protocols: Baseband and LMP (Link Manager Protocol). In 2001, IEEE included Bluetooth 1.1 in the standard IEEE 802.15.1 [8]. There are many types of Bluetooth, such as traditional Bluetooth, standard Bluetooth, and the recently well-used Bluetooth low energy (BLE), as detailed in Table 6.

Table 6 Bluetooth protocol comparison

ZigBee

ZigBee protocols are the wireless communication protocols [9] developed by the Zigbee Alliance in 2001. Developed based on IEEE 802.15.4 standard in 2003, to date, ZigBee has been developed rapidly in many current wireless transmissions due to its advantages of low complexity, low cost, and low power consumption, such as ZigBee V1.0 opened in 2005, ZigBee V1.1 opened in 2007, ZigBee V1.2 opened in 2008, and ZigBee V1.2 + Pro opened recently. The detailed ZigBee protocols are shown in Table 7.

Table 7 ZigBee protocol comparison

Wi-Fi

The Wireless Ethernet Compatibility Alliance (WECA) was founded in 1999. At that time, 802.11a and 802.11b defined 5 GHz and 2.4 GHz, respectively, and the rates of the 2 frequency bands have reached 54 M bit/s and 11 M bit/s. Then, in 2002, it was officially named the Wi-Fi Alliance [10].

In recent years, due to the popularity of 3C devices, such as mobile phones and computers, Wi-fi tends to be complete and mature in the use of WLAN. The detailed Wi-Fi protocols are shown in Table 8.

Table 8 Wi-Fi protocol comparison

Communication comparison

This study compares the above-mentioned 3 wireless transmission technologies recently used by most people, including Bluetooth, ZigBee, and Wi-Fi, and lists their advantages, as shown in Table 9.

Table 9 Comparison of 3 wireless transmissions

Air Quality Index (AQI)

In recent years, due to the rapid development of global technology, the air in the world is becoming increasingly worse. At the end of October 2018, in order to remind people of the irreversible effects of air pollution on human health, WHO held the first global conference on “air pollution and health” in Switzerland, specially emphasizing that children are the most seriously hurt by air pollution.

Internationally, PM2.5 has been classified as a high-risk cancerogen by the WHO, and the United States has used the new AQI since 1999. Taiwan’s Environmental Protection Administration previously used the pollution standard index (PSI); however, the system’s disadvantage was that PM2.5 could not be monitored, and the new AQI was launched in July 2014. The difference between AQI and the old PSI is the addition of O3 and PM2.5, as well as more prudent evaluation; for example, when calculating the days of air pollution, AQI has 50 days more than PSI, which indicates that AQI is more accurate in calculating air pollution.

The AQI refers to the classification of the effects of the CO, O3, fine particulate matter (PM2.5), particle matter (PM10), SO2, and NO2 concentrations in the air test data of the Environmental Protection Administration on that day on human health, and the detailed classifications of effects on human health are shown in Table 10. The calculated results according to various pollutant concentrations and air quality sub-indices are shown in Eq. 2-2, where all values are compared to calculate the maximum value, and then, the maximum value of the data is set as the AQI of that day, as shown in Eq. 2-3 [11].

$$ {\text{IAQIp}} = \frac{{{\text{IAQI}}_{{{\text{Hi}}}} {\text{ - IAQI}}_{{{\text{Lo}}}} }}{{{\text{BP}}_{{{\text{Hi}}}} {\text{ - BP}}_{{{\text{Lo}}}} }} \left( {C_{{\text{p}}} - {\text{BP}}_{{{\text{Lo}}}} } \right) + {\text{IAQI}}_{{{\text{Lo}}}} $$
(2-2)
Table 10 Comparison of pollutant concentrations and sub-indices

\(IAQIp\): Indoor air quality sub-index of pollutant item P; \(C_{{\text{p}}}\): Mass concentration of pollutant item P; \({\text{BP}}_{{{\text{Hi}}}}\): The high value of the pollutant concentration similar to CP in the table of the indoor air quality sub-indices and pollutant item concentration indices. \(BP_{Lo}\): The low value of the pollutant concentration similar to CP in the table of the indoor air quality sub-indices and pollutant item concentration indices. \({\text{IAQI}}_{{{\text{Hi}}}}\): The indoor air quality sub-index, namely, the indoor air quality sub-index relevant to BPHi in the table of relevant pollutant item concentration indices. \({\text{IAQI}}_{{{\text{Lo}}}}\): The indoor air quality sub-index, namely, the indoor air quality sub-index relevant to BPLo in the table of relevant pollutant item concentration indices.

$$ {\text{AQI}} = \max \left\{ {{\text{IAQI}}_{1} ,{\text{IAQI}}_{2} ,{\text{IAQI}}_{3} , \ldots ,{\text{IAQI}}_{n} } \right\} $$
(2-3)

IAQI: indoor air quality sub-index; n: pollutant item.

According to the hazard degree and air pollution, the index is divided into six equal levels, namely, good, normal, unhealthy for sensitive groups, unhealthy for all groups, very unhealthy, and harmful, which are represented by green, yellow, orange, red, purple, and maroon, respectively, including the degree of pollution above the purple level. The 6 grades, and their related colors, represent different effects on the human body. Based on the AQI level evaluation standards, this study analyzed the air quality levels at which people can go out, the air quality levels at which people are suggested not to go out, and the air quality above the purple level at which people shall not go out, in order to avoid placing greater burdens on the body. The detailed comparison of the effects on the AQI is shown in Table 11.

Table 11 Comparison of effects on AQI

Indoor Air Quality (IAQ)

As outdoor air pollution has become more and more serious in the last 2 decades, we encourage our children and elderly to stay at home. However, according to the EPA investigation of the U.S., indoor air pollution is 5 times worse than outdoor air pollution, thus, the hazards of indoor air quality are gradually taken seriously by people. Most people spend 85% of a day in an air-conditioned closed indoor environment, such as schools, offices, and homes, and while people enjoy such a comfortable environment, closed buildings often lead to insufficient ventilation, and result in the sick building syndrome [12], as defined in 1982 by WHO.

The sick building syndrome is caused by poor indoor air quality resulting from constant accumulation of air pollutants indoors, which lead to abnormal issues, such as irritation to the eyes and nose, and in some cases, asthma. The detailed critical concentration of indoor air quality is shown in Table 12.

Table 12 Indoor air quality standards

Clean air delivery rate

The Clean Air Delivery Rate (CADR) is defined by the Association of Home Appliance Manufacturers (AHAM) for cleaning technology, as shown in Fig. 6. CADR mainly refers to the rate at which an air purifier is used to clean the common sources of air pollution, such as pollen, dust, and dirt.

Fig. 6
figure6

CADR representing graph. The Clean Air Delivery Rate (CADR) is defined by the Association of Home Appliance Manufacturers (AHAM) for cleaning technology

The calculation of CADR is shown in Eq. 2-4, where Ka represents the descending rate of air pollution when useing an air purifier; Kn represents the natural settlement rate of pollutants; V represents the interior volume. The CADR value represents the natural settlement of indoor air pollutants without external interference, but at a slow rate. Therefore, if an air purifier is turned on, the concentration will decrease significantly and rapidly, and during this process, the difference of the pollutant descending rate is the CADR value [13].

$$ {\text{CADR}} = \left( {K_{a} - K_{n} } \right)*V $$
(2-4)

V: tested interior volume, Unit: ft3. \(K_{a}\): measured decay rate, unit: number of dust particles/minutes. \(K_{n}\): natural decay rate, Unit: number of dust particles/minutes.

After the CADR is calculated, the area in pings can be converted. AHAM’s standard is 5 times per hour; however, there is no standard rule in Taiwan. The equation of area conversion is shown in Eq. 2-5, where S denotes square meters, and the area in pings is obtained after multiplying by 0.3025; H is the building height; 5 is the number of cleaning tis per hour according to AHAM.

$$ {\text{S}}\left( {m^{2} } \right) = {\text{CADR/}}5H $$
(2-5)

H: building height.

Fuzzy theory

Binary logic, which is a classical logic commonly referred to, was proposed by Aristotle; however, the disadvantage of such classical logic is that only discrete events, but not continuous events, can be determined. Hence, the fuzzy theory is applied to deal with continuous problems. The detailed differences [14] between the classical theory and fuzzy theory are shown in Table 13.

Table 13 Difference between classical theory and fuzzy theory

The fuzzy theory is the fuzzy sets proposed by Professor L.A. Zadeh in 1965, and mainly covers 4 parts: fuzzy sets, fuzzy logic, fuzzy control, and fuzzy measurement [14].

In this study, defuzzification, rule base setting, and fuzzy inference in fuzzy control were used to evaluate the output of the experimental load.

Multisensor information fusion algorithm

Multi-sensor data fusion refers to the collected data of several sensors obtained from different information sources. The system automatically analyzes and synthesizes the information processing process under certain criteria to achieve a better understanding of the observed phenomenon. The application of information fusion technology to the water environment monitoring and control system to process the data provided by multiple heterogeneous sensors at multiple levels and in multiple aspects has many advantages. For example, multi-sensor data fusion has more comprehensive and accurate system information than single-sensor data. The information collected by a group of similar sensors is redundant, and the appropriate fusion of such redundant information can reduce the uncertainty of the information as a whole. The information collected by some different types of sensors has obvious complementarity. After proper processing, this complementarity can compensate for the uncertainty of a single sensor and the limitations of the measurement range. Multiple sensors can increase the reliability of the system. For example, when one or several sensors fail or fail, the system can still work normally [15, 16].

The air environment detection system has a large number of sensors, a wide distribution, and a large amount of information. In order to reduce the burden of communication lines and reduce the amount of calculation in the fusion center, the system is divided into several subsystems for analysis, and then the analysis results are integrated to obtain the fusion result of the entire system, that is, a decentralized two-level fusion scheme is adopted for local fusion integrate with the whole domain, as shown in Fig. 7.

Fig. 7
figure7

The structure of system fusion model. The air environment detection system has a large number of sensors, a wide distribution, and a large amount of information. a decentralized two-level fusion scheme is adopted for local fusion integrate with the whole domain

This data fusion method allocates sensors to air detection points according to design requirements, and uploads data after each air detection point has completed feature extraction. The relay station of the system performs partial fusion; the total detection station performs global fusion and generates auxiliary decision-making [17, 18].

Local fusion algorithm

Since the number of air detection points is often not too many, that is, the dimensionality of the subsystem is low, the local fusion can be realized by the classic vector Kalman filter algorithm. Assuming that there are a total of q air detection points, the signals from each air detection point form a q-dimensional vector \({\mathbf{\rm X}}\left( k \right) = [x_{1} \left( k \right) x_{2} \left( k \right) \cdots x_{q} \left( k \right)]^{T}\). Process noise is a sequence of independent white noise \({{ \omega }}\left( k \right) = [\omega_{1} \left( k \right)\omega_{2} \left( k \right) \cdots \omega_{q} \left( k \right)]^{T}\), then the mathematical model of the multi-dimensional random signal can be expressed as.

$$ {\mathbf{\rm X}}\left( k \right) = A{\mathbf{X}}\left( {k - 1} \right) + \omega \left( {k - 1} \right) $$
(3-1)

among them, A = diag(\(a_{1} a_{2} \cdots a_{q}\)) is the coefficient matrix.

In order to optimally filter the q-dimensional random signal X(k), the first r components of X(k) (r < q) are measured simultaneously at k time, and an r-dimensional measurement data vector Y(k), its mathematical model can be expressed as

$$ {\mathbf{Y}}\left( k \right) = {\mathbf{CX}}\left( k \right) + {\text{V}}\left( k \right) $$
(3-2)

among them, C = diag(\(c_{1} c_{2} \cdots c_{r} )\) is the observation matrix; V(k) = \([\upsilon_{1} \left( k \right)\upsilon_{2} \left( k \right) \cdots \upsilon_{r} \left( k \right)]\) is an additional measurement noise sequence.

So there is the vector Kalman filter algorithm

$$ \hat{x}\left( k \right) = {\varvec{A}}\hat{x}\left( {k - 1} \right) + K\left( k \right)\left[ {{\varvec{Y}}\left( k \right) - {\varvec{CA}}\hat{x}\left( {k - 1} \right)} \right] $$
(3-3)
$$ {\text{K}}\left( k \right) = P_{1} \left( k \right){\varvec{C}}^{T} [{\varvec{CP}}_{1} \left( k \right){\varvec{C}}^{T} + R\left( k \right)]^{ - 1} $$
(3-4)
$$ P\left( k \right) \, = P_{1} \left( k \right){ } - {\text{K}}\left( k \right){\varvec{C}}P_{1} \left( k \right) $$
(3-5)

among them, (3-3) is the filter estimation equation; (3-4) is the filter gain equation, where \(P_{1} \left( k \right){ } = { }{\varvec{A}}P\left( {k - 1} \right){\varvec{A}}^{T} + {\varvec{Q}}\left( {k - 1} \right);\) (3-5) Formula is the filter covariance equation.

Vector Kalman filter is a basic algorithm of prediction plus correction as its recursive filtering. Using this feature, it is easy to use a computer to filter the real-time signal. Figures 8 and 9 respectively show the algorithm block diagrams of the main program and the sub-program of the vector Kalman filter [19, 20].

Fig. 8
figure8

The main program of vector Kalman filtering. Vector Kalman filter is a basic algorithm of prediction plus correction as its recursive filtering. Using this feature, it is easy to use a computer to filter the real-time signal

Fig. 9
figure9

The subroutine of the vector Kalman filtering. Vector Kalman filter is a basic algorithm of prediction plus correction as its recursive filtering

Global fusion algorithm

The air data filtered and processed by the fusion station more accurately reflects the air environment in space [21, 22]. The processing of the data uploaded by each relay fusion station by the total inspection center station can be regarded as a system transformation from a set of input modes to a set of output modes. Therefore, the global fusion algorithm uses a forward neural network model, such as the single hidden layer neural network shown in Fig. 10.

Fig. 10
figure10

The single hidden layer neural network structure. The global fusion algorithm uses a forward neural network model, such as the single hidden layer neural network

The output of each relay fusion station forms a vector X(k) = [\(x_{1} \left( k \right)x_{2} \left( k \right) \cdots x_{n} \left( k \right)]^{T}\), as the input group of the neural network, the output group is Y(k) = [\(y_{1} \left( k \right)y_{2} \left( k \right) \cdots y_{n} \left( k \right)]^{T}\), which depends on actual engineering needs.

Take the activation function of the hidden unit as the sigmoid function

$$ g\left( Z \right) = \frac{1}{{1 + e^{ - x} }} $$
(3-6)

The implicit output is

$$ x_{ni} { } = {\text{g }}\left( {{ }\mathop \sum \limits_{j = 1}^{N} \omega_{ij} Z_{j} + \theta_{i} } \right) $$
(3-7)

Taking the excitation function of the output node as a linear function, the output of the entire network is

$$ {\mathbf{Y}} = \mathop \sum \limits_{j = 1}^{N} \omega_{IJ}^{2} x_{ni} = f\left( {x_{1} ,x_{2} , \ldots ,x_{n} } \right) $$
(3-8)

For the training of the forward neural network weight matrix, the BP algorithm is generally used. However, the traditional BP algorithm is essentially a least squares estimation, robustness is poor, and very sensitive to outliers, so this article uses the robust BP algorithm (RBP algorithm)

$$ W_{IJ} \left( {k + 1} \right){ } = { }W_{ij} \left( k \right) + \eta \delta_{j} O_{I} + \alpha \left[ {W_{ij} \left( k \right) - W_{ij} \left( {k - 1} \right)} \right] $$
(3-9)
$$ \theta_{j} \left( {k + 1} \right){ } = { }\theta_{j} + \eta \delta_{j} + \alpha \left[ {\theta_{j} \left( k \right) - \theta_{j} \left( {k - 1} \right)} \right] $$
(3-10)

where \(\eta\) is the learning rate; \(\alpha\) is the inertia term constant, \({\varvec{\varPsi}}\left( e \right) \, = \rho^{\prime } \left( e \right),\rho \left( e \right)\) is the Hampel function.

$$ O_{i} { } = { }f_{i} \left( {net_{i} } \right) = 1 + exq( - \mathop \sum \limits_{j} W_{ij} O_{j} - \theta_{i} )^{ - 1} $$
(3-11)
$$ \delta_{j} = O_{j} \left( {1 - O_{j} } \right)\varphi \left( e \right)\quad ({\text{Output layer}}) $$
(3-12)
$$ \delta_{j} = O_{j} \left( {1 - O_{j} } \right)\mathop \sum \limits_{k} \delta_{k} W_{kj} \quad ({\text{Hidden layer}}) $$
(3-13)

Among them, f(x) is the Sigmoid function.refere

System architecture and hardware

The system architecture of this study was established based on the concepts of the IoT smart home, and divided into 4 major parts: Part 1—environmental sensing, Part 2—wireless transmission, Part 3 – analysis, and Part 4—load control, as shown in Fig. 11. Regarding environmental sensing, the nodes of 2 environmental sensors were set up, including an indoor sensing device and an outdoor sensing device, as shown in Figs. 12 and 13, respectively. The indoor nodes contained 3 sensors for fine particulate matter, CO2, and CO, as well as an infrared emitter; the sensors retrieved the data of the control panel for subsequent processing; the infrared emitter was used to control the ventilation unit and air purifier, and was installed in the center of the laboratory due to the laboratory’s small space; the outdoor node was a fine particulate matter sensor installed next to a window [23,24,25]. The detailed locations of the 2 sensors are shown in Fig. 14. In wireless transmission, after the Arduino board obtained the data, in order to transmit the received data to the computer terminal and the webpage, the ESP8266 Wi-Fi module was used as the communication bridge for data transmission. Fuzzy control was mainly used for analysis by combining it with the Visual Studio C# 2015 software to realize the AQI, as mentioned in Sect. 2, and C# software was used as the human–machine interface for users to inspect the environmental values. Regarding load control, after fuzzy analysis was conducted on the data captured in environmental sensing, the corresponding loads were activated for different values of various data, in order to achieve good indoor air quality. The loads under control were the window, air purifier, and the ventilation unit. When CO increases slightly, the buzzer will be activated first to remind the users to open the window as soon as possible to reduce CO concentration; when the CO2 or fine particulate matters exceed the standard, the Arduino Uno board will activate the ventilation unit and air purifier through the infrared emitter to reduce the concentration [26,27,28].

Fig. 11
figure11

System architecture. The system architecture of this study was established based on the concepts of the IoT smart home, and divided into 4 major parts: Part 1—environmental sensing, Part 2—wireless transmission, Part 3—analysis, and Part 4—load control

Fig. 12
figure12

Environmental sensing nodes (indoor). Regarding environmental sensing, the nodes of 2 environmental sensors were set up, including an indoor sensing device and an outdoor sensing device

Fig. 13
figure13

Environmental sensing nodes (outdoor). Regarding environmental sensing, the nodes of 2 environmental sensors were set up, including an indoor sensing device and an outdoor sensing device

Fig. 14
figure14

Indoor environment and locations of sensing nodes. In wireless transmission, after the Arduino board obtained the data, in order to transmit the received data to the computer terminal and the webpage

The software architecture consists of 2 parts: the indoor node flow chart, as shown in Fig. 15, and the outdoor node flow chart, as shown in Fig. 16. The 3 sensors and 1 sensor were set in the indoor and outdoor nodes, respectively, which returned environmental data to the Arduino Uno board at regular intervals and communicated with each other through ESP8266 Wi-Fi wireless transmission. Among them, the indoor nodes were equipped with the infrared emission module and buzzer, which could receive the results of the computer analysis to determine whether to turn on the air purifier, ventilation unit, or load strength setting, and whether the buzzer gave off warning sounds, in order to further remind the users to pay attention to environmental issues [29,30,31].

Fig. 15
figure15

Indoor node flow chart. The software architecture consists of 2 parts the indoor node flow chart

Fig. 16
figure16

Outdoor node flow chart. The software architecture consists of 2 parts the outdoor node flow chart

This study used the Arduino Uno module as the core architecture of the overall system for indoor air monitoring, as shown in Fig. 17. The core of the Arduino Uno board is an ATmega328 microprocessor with a built-in analog-to-digital converter (ADC for short) and 14 digital input/output pins numbered from 0 to 13, including 6 pins for PWM control, 1 for UART control, 1 for SCL/SDA of I2C, and 6 analog input/output pins. It is supplied by a transformer or USB, and the detailed specifications are shown in Table 14. In this paper, the Arduino Uno board was used as the main body, and combined with the ESP8266 ESP01 module, infrared receiver, infrared emitter, and various gas sensors [32].

Fig. 17
figure17

Arduino UNO. This study used the Arduino Uno module as the core architecture of the overall system for indoor air monitoring

Table 14 Detailed specifications of Arduino UNO
Table 15 Detailed specifications of CO2 sensing module

CO sensor module

This study used MQ-7 as the indoor CO sensor module, as shown in Fig. 18. The gas sensitive material used in this sensor is stannic oxide (SnO2), which is an inorganic compound with low conductivity in general air. Sensor conductivity depends on the CO concentration in the air, where higher concentration leads to higher conductivity. MQ-7 detects CO by the high and low temperature circle detection method, where the voltages for high and low temperatures are 5 V and 1.5 V, respectively. Low temperature is used to detect CO, and the changes in conductivity can be known with the simple circuit design and be converted into output signals related to the CO concentration; high temperature is used to clean the gases absorbed at a low temperature. MQ-7 is highly sensitive in sensing CO and is a low-cost and suitable sensor for CO detection (Table 15).

Fig. 18
figure18

CO sensor module. This study used MQ-7 as the indoor CO sensor module

CO2 sensor module

This study used the NDIR infrared sensor module (MH-Z14A) as the CO2 sensor module, as shown in Fig. 19, which mainly senses CO2 in indoor air using the theory of the non-distributed infrared ray. In addition to long service life, it has internal temperature compensation, digital and analog output, and the sensing range of 0–5000 ppm. The detailed specifications are shown in Table 16.

Fig. 19
figure19

CO2 sensing module (MH-Z14A). This study used the NDIR infrared sensor module (MH-Z14A) as the CO2 sensor module, which mainly senses CO2 in indoor air using the theory of the non-distributed infrared ray

Table 16 ESP8266-01 specifications

Fine particulate matter sensor module

The sensor for measuring the fine particulate matter (PM2.5) concentration in this study was designed by SHARP, namely, the GP2Y1010AU0F model, as shown in Fig. 20. With the range of 0–520 μg/m3, it mainly measures dirt, dust, and fine particulate matters indoors. This sensor detects particle matters in the air using an LED light source, and the actual operating circuit is shown in Fig. 21.

Fig. 20
figure20

Fine particulate matter sensor module (GP2Y1010AU0F). The sensor for measuring the fine particulate matter (PM2.5) concentration in this study was designed by SHARP, namely, the GP2Y1010AU0F model

Fig. 21
figure21

Circuit of fine particulate matter sensor module (GP2Y1010AU0F). This sensor detects particle matters in the air using an LED light source, and the actual operating circuit

Wi-Fi wireless transmission module

This study used ESP8266 ESP-01 in the Wi-Fi wireless transmission module, as shown in Fig. 22, which was taken as the bridge for wireless transmission between the computer and the Arduino Uno board for the indoor environment data. Due to its very low power consumption, the UART-Wi-Fi transmission module is compatible with numerous hardware interfaces, thus, this module can support many transmissions and applications, such as UART, I2C, PWM, GPIO, and ADC. The detailed specifications of the software and hardware of ESP8266 are shown in Table 16.

Fig. 22
figure22

ESP8266 ESP-01 Wi-Fi module. This study used ESP8266 ESP-01 in the Wi-Fi wireless transmission module, which was taken as the bridge for wireless transmission between the computer and the Arduino Uno board for the indoor environment data

Infrared emission module

The infrared emission module used in this study is shown in Fig. 23, which has an operating temperature range of − 25 to 80 °C and wasted power of 90 mW. This module can effectively control the system load, and through wireless remote control, can adjust the air purifier and ventilation unit, in order to minimize the trouble caused by the requirements of line arrangement for wired control.

Fig. 23
figure23

Infrared emission module. This module can effectively control the system load, and through wireless remote control, can adjust the air purifier and ventilation unit, in order to minimize the trouble caused by the requirements of line arrangement for wired control

Infrared receiving module

As shown in Fig. 24, the infrared receiving module is the component that combines receiving, amplification, and demodulation, and can complete internal decoding. In addition, the emitter and receiver shall be used in pairs, otherwise they cannot be used due to the effects of sensitivity or failure to pair.

Fig. 24
figure24

Infrared receiving module. The infrared receiving module is the component that combines receiving, amplification, and demodulation, and can complete internal decoding

PL2303 USB to TTL

As shown in Fig. 25, the PL2303 USB to TTL in this study is a data converter, which converts the single chip USB into UART. Through PL2303, ESP8266 can communicate with the PC, thus, the PC can use ESP8266 to install the local area network of the wireless Wi-Fi base station, and be the bridge of wireless transmission among the various environmental data, load devices, and computer terminals in the system.

Fig. 25
figure25

PL2303 USB to TTL. The PL2303 USB to TTL in this study is a data converter, which converts the single chip USB into UART. Through PL2303, ESP8266 can communicate with the PC, thus, the PC can use ESP8266 to install the local area network of the wireless Wi-Fi base station

Load control

There were mainly three loads for control used in this study, namely, air purifier, ventilation unit, and buzzer, as shown in Figs. 26, 27 and 28, respectively.

Fig. 26
figure26

Air purifier. An air purifier is one of the three main control loads used in this study

Fig. 27
figure27

Ventilation unit. A ventilation unit is one of the three main control loads used in this study

Fig. 28
figure28

Buzzer. A buzzer is one of the three main control loads used in this study

Simulation and experiment

Air quality evaluation and MATLAB simulation analysis

In order to maintain the indoor air quality within a good range, this study first evaluated the indoor air pollutant evaluation method, and selected the suitable AQI evaluation method according to the fine particulate matters, CO, and CO2 in the AQI, and then, made a comparison by referring to the CO2 evaluation standard, as proposed by ASHRAE mentioned in Sect. 2, as well as the CO and fine particulate matters, as proposed by the AQI.

In 1993, the Environmental Protection Administration proposed the air pollution index of the Republic of China, which monitors particle matters, SO2, NO2, CO, and O3, but not the fine particulate matters responsible for the severe damages to human bodies recently. Accordingly, the air pollution index of the Republic of China has been gradually replaced by AQI. The air evaluation standard commonly used in Taiwan in the past was the Air Pollution Index (API), as based on the cancelled GB3095-1996 ambient air quality standard, which only evaluated SO2, NO2, and particulate matters. Compared with the air pollution index of the Republic of China and API, AQI is universal and has the advantages of stricter standards, more pollutant indices, and evaluation results closer to the public’s feelings, thus, AQI was selected as the evaluation standard.

AQI in this study mainly refers to CO, fine particulate matters, O3, particle matters, SO2 and NO2, by cooperating with the CO2 evaluation standard proposed by ASHRAE. In order to effectively control loads to achieve the ideal environment, MATLAB was used to simulate the indoor CO and fine particulate matters, and the effects of the 2 different indices on the indoor air quality were analyzed as the experimental basis for subsequent load control. MATLAB was also used to simulate the effects of fine particulate matters and CO in the environment on the air quality sub-indices, and the results are shown in Figs. 29 and 30, respectively.

Fig. 29
figure29

Effects of fine particulate matters on AQI values. MATLAB was also used to simulate the effects of fine particulate matters and CO in the environment on the air quality sub-indices

Fig. 30
figure30

Effects of CO on AQI values. The simulation results show that fine particulate matters and CO are nonlinearly related to AQI values. If one of the indices is too high, the maximum value of all values will be set as the current AQI, resulting in unsatisfactory AQI

The simulation results show that fine particulate matters and CO are nonlinearly related to AQI values. If one of the indices is too high, the maximum value of all values will be set as the current AQI, resulting in unsatisfactory AQI. According to the ASHRAE CO2 index, AQI shall be less than 50 and the CO2 index shall be less than 450 ppm for the environment with the best indoor air quality. As the indoor fine particulate matters mainly come from the outside, the indoor fine particulate matter concentration can be reduced by closing windows; however, closing windows for a long time will increase the CO2 concentration, and it is necessary to open windows or turn on ventilation units for ventilation. Hence, how to deal with the indoor and outdoor air quality is the main evaluation method of fuzzy logic.

Fuzzy control

In order to use AQI and ASHRAE’s CO2 index as the load control standards, it is necessary to use the nonlinear multi-input multi-output (MIMO) mathematic model, as formed by the interaction between the input parameters and the output loads, as it is difficult for the traditional PID control or constant control to achieve accurate control of air quality. Therefore, the fuzzy theory was used to control the load in this study, in order that the air quality could meet the best air quality stipulated by international standards: 0 < AQI < 50, 0 < CO2 concentration < 400. The detailed fuzzy architecture is shown in Fig. 31, and the fuzzy control flow chart is shown in Fig. 32.

Fig. 31
figure31

Fuzzy system architecture. The fuzzy theory was used to control the load in this study, in order that the air quality could meet the best air quality stipulated by international standards

Fig. 32
figure32

Fuzzy control flow chart. This figure presents the fuzzy control flow chart. How to deal with the indoor and outdoor air quality is the main evaluation method of fuzzy logic

In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of CO2 membership, indoor PM2.5 membership, and outdoor PM2.5 membership, as based on the data indices, are shown in Figs. 33, 34 and 35, respectively. The output membership function controls the loads of this study including the air purifier, ventilation unit, and window, as shown in Figs. 36, 37 and 38, respectively.

Fig. 33
figure33

CO2 membership function. In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of CO2 membership

Fig. 34
figure34

Indoor PM2.5 membership function. In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of indoor PM2.5 membership

Fig. 35
figure35

Outdoor PM2.5 membership function. In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of Outdoor PM2.5 membership

Fig. 36
figure36

Air purifier membership function. In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of Air purifier membership

Fig. 37
figure37

Ventilation unit membership function. In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of Ventilation unit membership

Fig. 38
figure38

Window membership function. In the fuzzy system, according to the inputs simulated by MATLAB and the data settings provided in the literature review, the function results of Window membership

The fuzzy rule base is designed by collecting indoor and outdoor environmental data, analyzing massive data, and cooperating with reference data. There is an ideal method in fuzzy control for nonlinear environmental data. The fuzzy decisions for different environments also test the designers’ familiarity with the environment, which requires massive experimental data for analysis and comparison to design a perfect fuzzy logic rule base, as shown in Fig. 39. The detailed rule base settings are shown in “Appendix 1”.

Fig. 39
figure39

Rule base settings. The fuzzy decisions for different environments also test the designers’ familiarity with the environment, which requires massive experimental data for analysis and comparison to design a perfect fuzzy logic rule base

As the focus of fuzzy control, the fuzzy inference simulates the thinking of human beings in different environments and makes corresponding actions by setting the rule base. When the CO2 concentration is 382 ppm, the indoor PM2.5 is 39.6 μg/m3, the outdoor PM2.5 is 28 μg/m3, the indoor AQI is calculated to be 112, and the outdoor AQI is 82. At this time, the fuzzy inference results show that the ventilation unit is 1, the air purifier is 0, and the window is 0.5, as shown in Fig. 40. Regarding the inferred 3D load diagrams; the relationship between indoor PM2.5, CO2 and the air purifier is shown in Fig. 41; the relationship between outdoor PM2.5, CO2 and the air purifier is shown in Fig. 42; the relationship between outdoor PM2.5, CO2, and the window is shown in Fig. 43; the relationship between outdoor PM2.5, indoor PM2.5, and the window is shown in Fig. 44; the relationship between indoor PM2.5, CO2, and the window is shown in Fig. 45; the relationship between indoor PM2.5, CO2, and the ventilation unit is shown in Fig. 46. The final step of the fuzzy theory is defuzzification, which has the purpose of converting sets into specific data. The ventilation unit is 1, indicating the ventilation unit operates at a low speed; the air purifier is 0, indicating closed; and the window is 0.5, indicating the window is half open.

Fig. 40
figure40

Fuzzy inference. When the CO2 concentration is 382 ppm, the indoor PM2.5 is 39.6 µg/m3, the outdoor PM2.5 is 28 µg/m3, the indoor AQI is calculated to be 112, and the outdoor AQI is 82. At this time, the fuzzy inference results show that the ventilation unit is 1, the air purifier is 0, and the window is 0.5

Fig. 41
figure41

Relationship diagram of air purifier. Regarding the inferred 3D load diagrams; the relationship between indoor PM2.5, CO2 and the air purifier

Fig. 42
figure42

Relationship diagram of air purifier. The relationship between outdoor PM2.5, CO2 and the air purifier

Fig. 43
figure43

Relationship diagram of window. The relationship between outdoor PM2.5, CO2, and the window

Fig. 44
figure44

Relationship diagram of window. The relationship between outdoor PM2.5, indoor PM2.5, and the window

Fig. 45
figure45

Relationship diagram of window. The relationship between indoor PM2.5, CO2, and the window

Fig. 46
figure46

Relationship diagram of ventilation unit. The relationship between indoor PM2.5, CO2, and the ventilation unit

Comparison of 3 types of environmental monitoring

According to the explanation of the above fuzzy control methods for air quality, the 3 conditions are compared, namely, no control, constant control, and fuzzy control. As the environmental data changed slightly in a short time, the indoor and outdoor sensing data were captured every 30 s in this study. No control is to sense the air quality after closing the door and window, turning off the air purifier and ventilation unit, and without any load; constant control is to sense the air quality by opening the door and window, and the ventilation unit and air purifier operate at a low wind speed; fuzzy control is to control the air quality under the load by integrating the sensing data through the C# interface and fuzzy analysis.

The best air quality can also be obtained with no controlled load, as most indoor air pollution sources come from the outside, thus, the best air quality can be achieved if the door and window are closed. However, if the room is closed for a long time, due to poor ventilation, the CO2 concentration will be the highest of the three; hence, the key to this study is to strike a balance between the two. The detailed comparison of the no control mode is shown in Table 17.

Table 17 Comparison of no control mode

Under constant control, because the door and window are opened and good indoor and outdoor air circulation is achieved, the CO2 concentration is obviously highly reduced; however, the dirty outdoor air is also brought into the room. In the room, the low efficient air purifier and ventilation unit will indirectly lead to unsatisfactory indoor air quality. The detailed comparison of constant control mode is shown in Table 18.

Table 18 Comparison of constant control mode

Under fuzzy control, the CO2 concentration and AQI can be in good condition provided the fuzzy rule base is properly set, and energy will not be wasted by leaving the load on all the time. The detailed comparison of the fuzzy control mode is shown in Table 19. The detailed comparison of air quality under no control, constant control, and fuzzy control is shown in Fig. 47.

Table 19 Comparison of fuzzy control mode
Fig. 47
figure47

Comparison of air quality. The detailed comparison of air quality under no control, constant control, and fuzzy control

The no control mode achieves the best air quality because the window is kept closed for a long time. Under constant control, the door and window are kept open for a long time, but regardless of the good ventilation rate, the cleaning speed of the load cannot keep up with the environment changes, thus, the air quality is poor. Therefore, the correlation between indoor air quality and outdoor air quality can be determined. Under fuzzy control, after long-term measurement and observation, the rules are established and good choices are made according to the current environment, thus, indoor air quality and CO2 can achieve the standard of the ideal environment.

System implementation and application

This study transmitted environmental data to the computer using Wi-Fi wireless transmission technology, and the values measured by the sensors are shown through the C# graphical human–machine interface. Moreover, with the Microsoft Excel database, the data were stored for historical data experimentation, analysis, and research. After entering the online system, users will see a reminder showing that the system is online, as shown in Fig. 48.

Fig. 48
figure48

Connection interface of the monitor system. The data were stored for historical data experimentation, analysis, and research. After entering the online system, users will see a reminder showing that the system is online

Figure 49 shows the main interface of the monitoring system, where the current connection quality is shown in the upper left of this interface, as well as the 2 indoor environment nodes and the outdoor environment node, the current states of the load devices, and the measurement of the overall indoor air quality. The CO2, indoor fine particulate matter and outdoor particulate matter data are combined with fuzzy control for indoor air quality control. CO is controled by the threshold, and if the CO is greater than 9 ppm, the buzzer will sound. Different colors directly reflect the AQI indices in reality, in order that users can directly understand the indoor and outdoor air quality without consulting other information.

Fig. 49
figure49

Main interface of the monitor system. The main interface of the monitoring system, where the current connection quality is shown in the upper left of this interface, as well as the 2 indoor environment nodes and the outdoor environment node, the current states of the load devices, and the measurement of the overall indoor air quality

The above experiment found that, under the 3 control modes, the fine particulate matter concentration is the minimum under no load control, followed by fuzzy control and constant control. Regarding the CO2 concentration, fuzzy control is best, followed by constant control and no control, which indicates the importance of outdoor and indoor air circulation for CO2 concentration and the necessity of avoiding air quality deterioration during air circulation. In this study, all experiments of the fuzzy theory reached the ideal range, thus, the proposed method is effective.

Conclusions

In this study, an indoor air quality control system was developed under the architecture of an IoT smart home. The Arduino Uno board, ESP8266 wireless transmission technology, and various sensors were taken as the core of the hardware, and C# and Excel were used for terminal processing of the software. According to the experimental results, the data of indoor environment were analyzed, and the load was controlled by combining the fuzzy logic rules. The purpose of this study was to improve the living quality in all residences and maintain good indoor air quality, in order that children and people with allergies are less likely to suffer from asthma and respiratory problems due to poor air quality, and people are less likely to have reduced office efficiency and fall asleep because of high CO2 concentrations, thus, creating good air quality environments for the public.

AQI and the CO2 concentration index by ASHRAE were taken as the standard to evaluate indoor air quality, and the indoor fine particulate matters, outdoor particulate matters, CO, and CO2 standards were developed according to the common relation between the 2 indices. Scholars consider that AQI values between 0 < AQI < 50 have the best quality, and the CO2 concentration shall be between 0(ppm) < CO2 (ppm) < 450(ppm) in the CO2 concentration table, as developed by ASHRAE. MATLAB was used for simulation, and the controllable environmental factors that could be used as the fuzzy rule base were analyzed. The outdoor air quality had the greatest effects on the indoor air quality, meaning the indoor air quality improved provided the door and window were opened for a short period of time under any control, while the CO2 concentration increased if the door and window were closed for a long time. Hence, through data integration, the purpose of this study was to immediately respond to increased pollution concentration and poor air quality, in order to prevent people from physical and mental diseases due to staying in a bad environment for a long time. In this study, the data of no control, constant control, and fuzzy control were stored in Excel, in order to improve the reliability of the fuzzy control mode, and to carry out the subsequent analysis and development of the data.

This study analyzed the common fine particulate matters, CO, and CO2. Many families have pets at home these days, which we hope to add to the fuzzy inference in the future, as human dander and pet hair cause air pollution, and some volatile gases can also lead to temporary poor air quality. Therefore, by adding these components, indoor environmental quality measurements may be more detailed, and more appropriate actions may be taken to reduce allergies and physical discomforts. In the future, various factors can be integrated, such as temperature, humidity, home safety, and hygiene, in order that everyone can have a clean and safe environment, and achieve a truly ideal home environment.

Availability of data and materials

Data sharing not applicable to this article as no datasets were generated or analysed during the current study.

Abbreviations

IoT:

Internet of things

AQI:

Air quality indices

CO2 :

Carbon dioxide

ASHRAE:

American society of heating, refrigerating and air-conditioning engineers

IAQ:

Indoor air quality

PM2.5:

Particulate matters with a diameter of 2.5 μm or less

PM10:

Particulate matters with a diameter of 10 μm or less

O3 :

Ozone

CO:

Carbon monoxide

SO2 :

Sulfur dioxide

NO2 :

Nitrogen dioxide

MIT:

Massachusetts institute of technology

RFID:

Radio frequency identification

ITU:

International telecommunication union

WSIS:

World summit on the information society

ETSI:

European telecommunications standards institute

USEPA:

United States environmental protection agency

NFPA:

National fire protection Aassociation

TSP:

Total suspended particulates

WHO:

World Health Organization

DoD:

Department of Defense

TCP/IP:

Transmission control protocol/internet protocol

WLAN:

Wireless local area network

BLE:

Bluetooth low energy

WECA:

Wireless ethernet compatibility alliance

PSI:

Pollution standard index

IAQ:

Indoor Air Quality

CADR:

Clean air delivery rate

AHAM:

Association of home appliance manufacturers

ADC:

Analog to digital converter

SnO2 :

Stannic oxide

MIMO:

Multi-input multi-output

References

  1. 1.

    J. Huang, N. Duan, P. Ji, C. Ma, A crowdsource-based sensing system for monitoring fine-grained air quality in urban environments. IEEE Internet Things J. 6(2), 3240–3247 (2019)

    Article  Google Scholar 

  2. 2.

    S. Dhingra, R.B. Madda, A.H. Gandomi, R. Patan, M. Daneshmand, Internet of Things mobile–air pollution monitoring system (IoT-Mobair). IEEE Internet Things J 6(3), 5577–5584 (2019)

    Article  Google Scholar 

  3. 3.

    D. Zhang, S.S. Woo, Real time localized air quality monitoring and prediction through mobile and fixed IOT sensing network. IEEE Access 8, 89584–89594 (2020)

    Article  Google Scholar 

  4. 4.

    McGrath S, Flanagan C, Zeng L, O'Leary C. IoT personal air quality monitor. In: 2020 31st Irish signals and systems conference (ISSC), 2020.

  5. 5.

    K. Zheng, S. Zhao, Z. Yang, X. Xiong, W. Xiang, Design and implementation of LPWA-based air quality monitoring system. IEEE Access 4, 3238–3245 (2016)

    Article  Google Scholar 

  6. 6.

    Kumar A, Kumari M, Gupta H. Design and analysis of iot based air quality monitoring system. In: 2020 International conference on power electronics and IoT applications in renewable energy and its control (PARC), 2020.

  7. 7.

    M.P. Ha, S. Metia, M.D. Phung, Sensing data fusion for enhanced indoor air quality monitoring. IEEE Sens J 20(8), 4430–4441 (2020)

    Article  Google Scholar 

  8. 8.

    Jha RK. Air quality sensing and reporting system using IoT. In: 2020 Second international conference on inventive research in computing applications (ICIRCA), 2020.

  9. 9.

    L. Zhao, Wu. Wenyan, S. Li, Design and implementation of an IoT-based indoor air quality detector with multiple communication interfaces. IEEE Internet Things J. 6(6), 9621–9632 (2019)

    Article  Google Scholar 

  10. 10.

    Moharana BK, Anand P, Kumar S, Kodali P. Development of an IoT-based real-time air quality monitoring device. In: 2020 International conference on communication and signal processing (ICCSP), 2020.

  11. 11.

    C. Santos, J.A. Jiménez, F. Espinosa, Effect of event-based sensing on Iot node power efficiency. Case study: air quality monitoring in smart cities. IEEE Access 7, 132577–132586 (2019)

    Article  Google Scholar 

  12. 12.

    Kumar S, Jasuja A. Air quality monitoring system based on IoT using Raspberry Pi. In: 2017 International conference on computing, communication and automation (ICCCA), 2017.

  13. 13.

    B. Wang, W. Kong, H. Guan, N.N. Xiong, Air quality forecasting based on gated recurrent long short term memory model in internet of things. IEEE Access 7, 69524–69534 (2019)

    Article  Google Scholar 

  14. 14.

    Cheng Y, Xu X, Du Y, Guan P, Liu S, Zhao L. Design of air quality monitoring system based on NB-IoT. In: 2019 IEEE International conference on power, intelligent computing and systems (ICPICS), 2019.

  15. 15.

    B. Tian, K.M. Hou, X. Diao, X. Shi, H. Zhou, W. Wang, Environment-adaptive calibration system for outdoor low-cost electrochemical gas sensors. IEEE Access 7, 62592–62605 (2019)

    Article  Google Scholar 

  16. 16.

    Pradityo F, Surantha N. Indoor air quality monitoring and controlling system based on IoT and fuzzy logic. In: 2019 7th International conference on information and communication technology (ICoICT), 2019.

  17. 17.

    S. Ameer, M.A. Shah, A. Khan, H. Song, C. Maple, S.U. Islam, M.N. Asghar, Comparative analysis of machine learning techniques for predicting air quality in smart cities. IEEE Access 7, 128325–128338 (2019)

    Article  Google Scholar 

  18. 18.

    Choudhary V, Teh JH, Beltran V, Lim HB. AirQ: a smart iot platform for air quality monitoring. In: 2020 IEEE 17th annual consumer communications and networking conference (CCNC), 2020.

  19. 19.

    D.C. Yacchirema, D. Sarabia-JáCome, C.E. Palau, M. Esteve, A smart system for sleep monitoring by integrating IoT with big data analytics. IEEE Access 6, 35988–36001 (2018)

    Article  Google Scholar 

  20. 20.

    Bazurto J, Zamora W, Larrea J, Muñoz D, Alvia D. System for monitoring air quality in urban environments applyng low-cost solutions. In: 2020 15th Iberian conference on information systems and technologies (CISTI), 2020.

  21. 21.

    A. Venkatanarayanan, A. Vijayavel, A. Rajagopal, P. Nagaradjane, Design of sensor system for air pollution and human vital monitoring for connected cyclists. IET Commun. 13(19), 3181–3186 (2019)

    Article  Google Scholar 

  22. 22.

    E. Cañete-Carmona, J.-J. Gallego-Martínez, C. Martín, M. Brox, J.-J. Luna-Rodríguez, J. Moreno, A low-cost iot device to monitor in real-time wine alcoholic fermentation evolution through CO2 emissions. IEEE Sens J. 20(12), 6692–6700 (2020)

    Article  Google Scholar 

  23. 23.

    T. Becnel, K. Tingey, J. Whitaker, T. Sayahi, K. Lê, P. Goffin, A. Butterfield, K. Kelly, P.-E. Gaillardon, A distributed low-cost pollution monitoring platform. IEEE Internet Things J. 6(6), 10738–10748 (2019)

    Article  Google Scholar 

  24. 24.

    E. Gambi, G. Temperini, R. Galassi, L. Senigagliesi, A. De Santis, ADL recognition through machine learning algorithms on IoT air quality sensor dataset. IEEE Sens J. 20(22), 13562–13570 (2020)

    Article  Google Scholar 

  25. 25.

    Y. Liu, K.A. Hassan, M. Karlsson, O. Weister, S. Gong, Active plant wall for green indoor climate based on cloud and Internet of Things. IEEE Access 6, 33631–33644 (2018)

    Article  Google Scholar 

  26. 26.

    C.Y. Chang, S.J. Guo, S.S. Hung, Y.T. Lin, Performance analysis of indoor smart environmental control factors: using temperature to control the rate of formaldehyde emission. IEEE Access 7, 163749–163756 (2019)

    Article  Google Scholar 

  27. 27.

    D. Kim, S. Cho, L. Tamil, D.J. Song, S. Seo, Predicting asthma attacks: effects of indoor PM concentrations on peak expiratory flow rates of asthmatic children. IEEE Access 8, 8791–8797 (2019)

    Article  Google Scholar 

  28. 28.

    C.K. Wu, K.F. Tsang, Y. Liu, H. Wang, H. Zhu, C.H. Koo, W.H. Wan, Y. Wei, An IoT tree health indexing method using heterogeneous neural network. IEEE Access 7, 66176–66184 (2019)

    Article  Google Scholar 

  29. 29.

    Bo. Wang, M. Li, X. Jin, C. Guo, A reliable iot edge computing trust management mechanism for smart cities. IEEE Access 8, 46373–46399 (2020)

    Article  Google Scholar 

  30. 30.

    S. Corneliu Folea, G.D. Mois, Lessons learned from the development of wireless environmental sensors. IEEE Trans. Instrum. Meas. 69(6), 3470–3480 (2020)

    Article  Google Scholar 

  31. 31.

    S. Gao, G.Y. Tian, X. Dai, S.X. FanM, J. Zhu, K. Li, A novel distributed linear-spatial-array sensing system based on multichannel LPWAN for large-scale blast wave monitoring. IEEE Internet Things J 6(6), 9679–9688 (2019)

    Article  Google Scholar 

  32. 32.

    G. Jingjing, C. Liu, Yi. Zhuang, D. Xiaojiang, F. Zhuang, H. Ying, Y. Zhao, M. Guizani, Dynamic measurement and data calibration for aerial mobile IoT. IEEE Internet Things J. 7(6), 5210–5219 (2020)

    Article  Google Scholar 

Download references

Acknowledgements

This research was supported by the Department of Electrical Engineering, National Chin-Yi University of Technology. The authors would like to thank the National Chin-Yi University of Technology, Takming University of Science and Technology, Taiwan, for financially supporting this research.

Funding

The author(s) received no specific funding for this study.

Author information

Affiliations

Authors

Contributions

W-TS is responsible for research planning and providing improvement methods. S-JH is responsible for thesis writing and experimental verification. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Sung-Jung Hsiao.

Ethics declarations

Competing interests

The authors declare that they have no conflicts of interest to report regarding the present study.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Sung, WT., Hsiao, SJ. Building an indoor air quality monitoring system based on the architecture of the Internet of Things. J Wireless Com Network 2021, 153 (2021). https://doi.org/10.1186/s13638-021-02030-1

Download citation

Keywords

  • Internet of Things (IoT)
  • Smart home
  • Air quality
  • Fuzzy control
  • Wireless transmission