2.1. Carbon Dioxide Measurement Device
The proposed measurement network for monitoring air quality in the Department of Cybernetics and Biomedical Engineering laboratories was based on wireless measurement nodes called RMCDs (Room Measurement of Carbon Dioxide). These devices are permanently powered from the mains via a micro USB power adapter. By using this connector, powering this device from any commercially available power adapter with a
supply voltage and current of at least
is possible. A photograph of one of the RMCD devices is shown in Figure 1
The internal structure of the RMCD is shown in Figure 2
. This block diagram of the wireless measurement module shows the links between the blocks [4
As already described, the module is powered from a USB power supply. Battery management handles recharging of a Lithium Polymer battery as well as short-circuit and under-charge protection. The battery in this RMCD device serves as a backup power supply when the node is not powered from the USB power supply. The battery, therefore, serves as a backup power supply that can maintain network operation of the entire monitoring system during mains power cuts. Especially when installing such monitoring systems in an environment where there are students, this solution seems to be very suitable. The battery in this RMCD device can operate for 24 to 36 h, depending on the data transmission period of the IQRF® module. At 36 h of battery life, it is assumed that the measured data transmission period is every 5 min. Also, in battery mode, the indication of the measured CO2 concentration by the RGB LED is switched off. The measured CO2 concentration indication can be called up by pressing the user key “SHOW” on the RMCD. The power management block provides power adjustment for the TR-76 IQRF® module and battery voltage switching for the DC/DC converter, CDM7160 carbon dioxide sensor and MCP9800 temperature sensor. The DC/DC boost block is a step-up module for powering the carbon dioxide concentration sensor and MCP9800 temperature sensor. The TR-76 block has an IQRF® TR-76 transceiver. The Voltage Level Translator block is used to modify the voltage on the IIC bus and control the signals for the CDM7160 sensor. The HTU21 temperature and relative humidity sensor together with the MPL3115 atmospheric pressure sensor are connected to the IQRF® TR-76 directly via the IIC bus.
The use of two temperature sensors is optional and depends on whether the user requires measurements of relative humidity and atmospheric pressure. If temperature measurement is sufficient, the less expensive MCP9800 may be used. RMCD devices have been installed in the authors’ department, which only allow monitoring of CO2 concentration and temperature using the MCP9800 temperature sensor. At the Grammar School and Secondary School of Electrical Engineering and Computer Science, Frenštát pod Radhoštěm, were used RMCD devices, which are able to measure CO2 concentration, temperature and relative humidity of ambient air and atmospheric pressure.
The CDM7160 carbon dioxide concentration sensor is a Non-Dispersive Infra-Red (NDIR) type. It works by reducing the intensity of a certain wavelength of infra-red light absorbed by CO2
molecules in the air. Specifically, it applies a differential spectral method. Air naturally (diffuses) flows into the sensor. IR light is used as a light source. IR spectrum selectivity is provided by a 4.3 μm wavelength filter in front of the detector. Drops in intensity are detected by an IR light detector. The FIGARO CDM7160 uses a second detector as a reference, which only detects a reference wavelength of 3.8 μm. Concentration is calculated according to intensity differences. The sensor is equipped with a non-woven particle filter. This filter reduces the effect of light scattering on particles and contamination of the optical system elements [27
]. The advantage of using this sensor is that carbon dioxide concentration values are directly readable through the IIC bus or via the PWM output in the case of simpler circuits. Measurement accuracy is 50 ppm in the range 300–5000 ppm of CO2
. Its disadvantage is increased consumption during measurement. Current consumption during measurement achieves up to
. For this purpose, the sensor is switched off when there is no need to measure carbon dioxide concentration. A rough CO2
concentration value in certain intervals is also indicated by an RGB LED, as shown in Figure 1
Permanently turning on the CDM7160 carbon dioxide sensor increases RMCD power consumption, which could then not last up to 36 h on a single battery charge. The RMCD is equipped with a battery to be able to monitor the environment even during a power outage. Switching off the CO2 concentration sensor is necessary to increase the battery operating time. The RMCD is designed to be able to measure and signal CO2 concentration without the need for communication in the IQRF® network. This means that it acts autonomously as a mobile indicator of CO2 concentration at the installation site. In that case, the battery life of the RMCD is prolonged up to 100 h.
The main part of the RMCD device is an IQRF®
module manufactured by the Microrisc company, indicated in Figure 2
as TR-76. IQRF®
is a platform used for low speed, low power, reliable and easy-to-use wireless connectivity, for example, for telemetry, industrial control and building automation. It can be used with any electronic equipment and wherever wireless information transfer is needed in applications such as remote control, monitoring, alarms, displaying remotely acquired data or connecting several devices to a wireless network. IQRF®
is a complete system from a single brand that includes hardware, software, development support and services. IQRF®
transceivers can operate in worldwide ISM bands of
. Data rate is limited to
, but for automated data collection from sensors or for controlling actuators in home automation, this is sufficient. The IQRF®
consists of an 8-bit microcontroller and RF chip with additional hardware such as EEPROM memory, LED, and temperature indicator. Several types of IQRF®
modules are available. The TR-76 module has a minimum of additional components, which reduces power consumption. Its additional advantage is extra input/output ports. Communication is packet-oriented and allows a maximum payload of
per packet. The maximum number of nodes in one IQRF®
network is 240 devices, including the coordinator [7
]. In the article [29
] which deals about smart home monitoring system, they use XBee technology for individual sensors. At the end of this article, the authors argue that by replacing this communication technology with IQRF®
technology, they have managed to reduce the power consumption of each wireless sensor node by
at the same coverage. As a further advantage, they highlight the wider scalability of the system based on this technology. One of the case studies using IQRF®
technology is monitoring of cattle in outdoor environment—see [30
]. The article [31
] briefly describes the genesis of IQRF®
technology and shows a simulation of signal propagation in IQMESH network in various environments. Finally, it provides a comparison with other wireless communication technologies such as LoRa WAN, ZigBee, BLE, Wi-Fi MESH HaLow and LoRaWAN. The article [32
] gives a comparison of IQRF®
technology with LoRa and Sigfox technologies in terms of data throughput and collisions in transmitting messages. Based on the findings and the authors’ own experience, IQRF®
technology is ideal for the implementation of the Internet of Things in the field of monitoring of environmental quantities.
MESH topology involves connecting each node to all others (full mesh), thereby providing high reliability. If any of the routes become unavailable, an alternative path to deliver messages (usually multiple paths) can therefore be formed.
In a wireless IQRF®
network using mesh topology, each node has a defined time transmission slot, which ensures transmission does not interfere with other nodes. Nodes continuously receive and forward messages during their transmission slots to all nearby devices. If multiple nodes are somehow damaged, messages have a high probability of arriving at the destination due to the presence of alternative paths. Routing in IQRF®
networks is based on directional flooding of the network and TDMA (Time division multiple access) [33
]. An example of how the communication among IQRF®
nodes works is shown in animation [34
IQMESH is a protocol for wireless IQRF® networks developed by the Microrisc company. It is based on mesh topology, which ensures better coverage and a broader range for IQRF® transceivers deployed at a location. Neighbors are transceivers that are mutually within the transmission range.
If, for example, 15 transceivers are deployed in an area using mesh topology, each of them transmits during its own time interval. In this case, this will be maximum of 15 intervals. Transceivers transmit in a synchronized manner and therefore they do not interfere with each other during transmission.
Current situation of installing 34 RMCD sensors in the main building of the Grammar School and Secondary School of Electrical Engineering and Computer Science, Frenštát pod Radhoštěm shows Figure 3
shows that the maximum number of jumps (routes) from the network coordinator to the furthest IQMESH node of the network is three. The outermost network nodes are located in zone 2, they are RMCD nodes No. 1, 2 and 11. In Figure 3
you can also see the “undiscovered” network nodes No. 24 and 29, for which the IQMESH network coordinator sets the maximum number jumps to the addressed sensor to the maximum number of nodes in the network.
The total timeout time can be calculated according to the formula:
The length of the TimeSlot
depends on the size of the data message and the type of IQMESH network (standard mode or low-power mode). This TimeSlot
is controlled by the operating system of the IQRF®
module itself and in this case it is 90 ms. It follows that the “undiscovered” nodes No. 24 and 29 will have a timeout for their response:
This timeout is only a recommendation for the superior system not to send a new data request before a response to the previous request arrives. The way of addressing the undiscovered node is done by the “flooding” method [24
]. The main control transceiver—the IQMESH network coordinator—dispatches data when required. Nearby transceivers receive these data and progressively forward them to the neighborhood during their time intervals. Other transceivers then receive this data and again progressively forward it during their time intervals, spreading the data throughout the network in this manner [7
]. Due to the robustness of the IQMESH network, however, a message from an undiscovered network node is delivered in approximately 3 s, as shown in the Terminal Log window in Figure 3
2.2. Measurement Network
The proposed measurement network consists of wireless RMCD measuring nodes and a central unit. The quantities measured are CO2
concentration, temperature and relative humidity in the surrounding air and atmospheric pressure. The sensors have a digital output with communication via an IIC bus. Data measured by these sensors are sent through IQRF®
transceivers, or nodes [7
The measured data can be processed and visualized on a Raspberry Pi3 microcomputer [4
]. The IQMESH network coordinator can be connected to up to 239 wireless measurement nodes consisting not only of RMCD measuring modules but also other types of sensors capable of connecting to IQMESH. The basic structure of a Raspberry Pi system with the required applications installed is shown in Figure 4
Measured data are accepted from the IQMESH network coordinator by the IQRF®
Daemon application and subsequently transferred via the MQTT service to an application in the Node-RED environment. Data processed in this way are already recorded in a ready-to-read format and transferred to the local MySQL database [36
]. The stored data are visualized using the Grafana platform. Data from individual RMCD devices is sent via DPA packets. Direct Peripheral Access (DPA) protocol is a simple byte-oriented protocol used to control IQMESH network services (Coordinator and Nodes) [26
]. For easier work with the database and visualization, this DPA packet is converted into a so-called ready-to-read format. This means that the ready-to-read format is the form of a message that is directly readable by a human. This shape is easy to store in a database and then visualized in the Grafana platform.
In the cases presented in these studies [2
], all processing and visualized components ran simultaneously on a single board computer. However, using separate computers (servers) for individual services is also possible.
Daemon establishes communication between the IQMESH network coordinator and other systems via UDP, MQTT or WebSocket. The application can be connected to the IQRF®
IDE development environment (see Figure 3
) through a UDP channel. The IQRF®
Daemon application has a superstructure with a web interface for configuring and controlling the IQMESH network directly from a web browser. The application is designed to be modular and open source.
The measured data are received in raw form via MQTT as JSON text. The collected data are then processed. Processing includes converting CO2 concentrations, temperatures, relative humidities and atmospheric pressures of all polled sensors. For simplicity, a custom RMCD data processing block has been created. Data collected in this manner are then used to compile the SQL query through which the MySQL database is stored. All data processed in this manner have unique identifiers in the database and contain timestamps and NODE identifiers.
Grafana is a visualization tool for web interfaces. Visualizations for measured data can be created using the Grafana platform. Users can browse information in historical graphs, or they can inspect current or recently measured values.
As mentioned above, data from RMCD sensors measuring CO2 could be analyzed on a Raspberry Pi3 microcomputer. However, where a reliable wireless sensor network is required, using a dedicated IQRF®/Ethernet gateway was more suitable. The device transmitted the measured CO2 concentrations to a cloud as raw data. These data were then processed on the server side located at VŠB-TUO. The Grafana visualization software also ran on this server and was used to monitor the levels of CO2 concentration, temperature, relative humidity, and atmospheric pressure from any place with internet access.
The measurement network consists of four main components:
RMCD device—transmits measured CO2 concentration, temperature and relative humidity of ambient air, and atmospheric pressure data upon request.
IQRF®/Ethernet gateway contains a network coordinator, microcontroller and Ethernet interface for internet connectivity. This device works in two modes either as a datalogger or a gateway. In datalogger mode, all data received from an IQRF® network is sent to the cloud, or vice versa, data are transmitted from the cloud to the IQRF® network. Gateway mode allows messages to be transmitted from the IQRF® network to the IQRF® IDE development environment. This mode enables the remote setting of IQRF® network parameters, such as adding or removing network nodes. The gateway also works with the UDP channel, providing communication with the IQRF® IDE development environment as well as an MQTT broker with the Node-RED tool.
IQRF® Cloud—a commercial service that collects IQRF® data from IQRF®/GSM or IQRF®/Ethernet gateway. This cloud enables bi-directional data transfer, i.e., from the gateway to the cloud and the cloud to the gateway. The gateway must be set in datalogger mode.
Visualization—measured data are visualized using Grafana software. This SW is installed on the VŠB-TUO server. The basis of each visualization tool is a data source. In our case studies, we have used the MySQL database, which was also installed on the university server enviro.vsb.cz [38
] (login: sensors, password: sensors). For each IQRF®
/Ethernet gateway, a table is created in the database where processed data from the IQRF®
cloud are stored. Grafana is also accessible from outside the university network, therefore dashboards can be viewed from anywhere as long as access to the Internet is available.
An integral part of the IQRF®/Ethernet gateway is the IQRF® network coordinator. The network coordinator contains a custom DPA handler, which is a program that automatically sends commands to read all measured data from individual RMCD devices. The reading period of the sensors can be set in the coordinator’s EEPROM. The time interval can range from one minute up to 255 min. In this study, the time interval was set to 5 min. Another parameter of this program is the maximum number of queried nodes and the number of query repetitions if the coordinator did not receive a response from the requested network node.
Data processing of measured quantities takes place on the side of the university server, see Figure 5
Measured data in raw format are sent to the IQRF®
cloud via the IQRF®
/Ethernet gateway. On the university server enviro.vsb.cz runs a software utility created in the programming language JAVA. This utility queries the IQRF®
cloud for measured data cyclically using HTTP request with a period of 1 min. The raw data are then converted into individual values of measured quantities using this utility and these measured quantities are then stored in the appropriate table in the MySQL database. The database then serves as a data source for visualization using the Grafana SW system. If it is not necessary to use a commercial IQRF®
cloud, the solution shown in Figure 4
can be used, where the conversion of raw data from individual sensors is done in Node-RED.