0% found this document useful (0 votes)
98 views4 pages

NB-IoT Air Quality Monitoring Design

This document describes an air quality monitoring system designed based on NB-IoT (Narrowband Internet of Things) technology. The system uses an STM32 microprocessor as the core controller and collects data from gas sensors via serial port. It can transmit data through an NB-IoT or GPRS module, and is designed to automatically switch between the two network modes if one is abnormal. It can also store data locally in SPI flash memory if both networks are down, and reupload the data once the network reconnects. The system aims to remotely monitor air quality in special field environments using a low power wireless network solution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views4 pages

NB-IoT Air Quality Monitoring Design

This document describes an air quality monitoring system designed based on NB-IoT (Narrowband Internet of Things) technology. The system uses an STM32 microprocessor as the core controller and collects data from gas sensors via serial port. It can transmit data through an NB-IoT or GPRS module, and is designed to automatically switch between the two network modes if one is abnormal. It can also store data locally in SPI flash memory if both networks are down, and reupload the data once the network reconnects. The system aims to remotely monitor air quality in special field environments using a low power wireless network solution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2019 IEEE International Conference on Power, Intelligent Computing and Systems (ICPICS)

Design of Air Quality Monitoring System Based on


NB-IoT

Yuanhang Cheng Xueshu Xu Yingkui Du


Shenyang University Shenyang University Shenyang University
College of Information Engineering College of Information Engineering College of Information Engineering
Shenyang, China Shenyang, China Shenyang, China
E-mail: [email protected] E-mail: [email protected] E-mail: [email protected]

Ping Guan Shu Liu Lijuan Zhao


Shenyang Hengyuanweiye Liaoning ecological environment Liaoning ecological environment
Environmental Service Co., Ltd monitoring center monitoring center
Research and development department Research and development department Research and development department
Shenyang, China Shenyang, China Shenyang, China
E-mail: [email protected] E-mail: [email protected] E-mail: [email protected]

Abstract—A air quality monitoring system based on the packages the data. The system uploads data packets to the
NB-IoT was designed for wireless monitoring of special field cloud platform through the NB-IoT module. Wireless
environment. The STM32F103RCT6 microprocessor unit was network switching mechanism is designed to ensure the
the core processor and the data of gas pollutants was collected stability of wireless data transmission, if the NB-IoT
by electrochemical gas sensor through serial port. The network is abnormal, the network will switch to GPRS
switching mechanism of wireless network and the data storage network, if the NB-IoT network and GPRS network are
mechanism of disconnected network was designed. The abnormal at the same time, the data will be stored in SPI
network communication based on the TCP/IP protocol was
Flash. Waiting for the network reconnected successfully, the
realized through NB-IoT module or GPRS module. The
data will be uploaded again. The low power consumption
experimental results show that the data transmission of
NB-IoT network is stable. The system can automatically switch
and wide coverage of the NB-IoT network enable the
to GPRS network as the NB-IoT network is abnormal. In the system to monitor air quality in special field environment.
absence of network, the data is stored in SPI Flash. The People can query air quality data from the cloud platform.
collected data can be reloaded as the disconnected network is
recovered.
II. OVERALL DESIGN
The design of the system includes perceptual layer,
Keywords—air quality monitoring, NB-IoT, sensor, network transmission layer and control layer.
communication
Perception layer: The sensor PTQS1005 measures
I. INTRODUCTION temperature, humidity, carbon dioxide and other gas
concentration. The sensor transmits a variety of gas
Narrowband IoT (Narrowband Internet of Things,
parameters to the main control chip in the form of digital
NB-IoT) technology is compared with 4G network, ZigBee
signals.
and other short-range communication technology, it has
characteristics of large capacity, wide coverage, low cost, Transport Layer: The transport layer is composed of
and low power consumption [1]. The NB-IoT is built on a NB-IoT module and GPRS module, NB-IoT module
cellular network and consumes only about 180kHz of BC35-G and GPRS module SIM900A transmit data to cloud
bandwidth [2]. platform.
At present, there are many air quality monitoring Control layer: The main control chip STM32F103RCT6
terminals based on wireless networks, and the special field controls the sensor and network module. The sensor sends
environment has the security danger, the workers are the data through the serial port to the STM32F103RCT6.
inconvenient to go there frequently, so the existing system is STM32F103RCT6 parses and packages the data, and
still not easy to maintain [3]. In view of this problem, this STM32F103RCT6 controls the network module to upload
paper proposes to use STM32 single-chip microcomputer the data. The wireless network switching mechanism is
[4], gas sensor, NB-IoT module to build a air quality designed. Under the abnormal condition of NB-IoT network
monitoring system based on NB-IoT. The system uses connection, the system can automatically switch to GPRS
NB-IoT communication by default, and automatically network connection. When the NB-IoT network and the
switches to GPRS network communication mode when the GPRS network are abnormal at the same time, the data is
NB-IoT network is not signaled [5]. deposited into the external SPI Flash. After the network
reconnection is successful, the data in the Flash is uploaded
The system uses STM32F103RCT6 as the main control
again.
chip, electrochemical gas sensor collects data and sends data
to STM32F103RCT6, STM32F103RCT6 analyzes and At the same time, System designs two power supply

978-1-7281-3720-9/19/$31.00 ©2019 IEEE 385 July 12-14, 2019•Shenyang, China


modes: commercial power supply and battery power supply. module has the following three working states:
The schematic diagram of the system is shown in Fig. 1.
• Connection status (Connect): The NB-IoT module
The cloud
can send and receive data normally.
platform
• Idle mode (Idle): At this point, the module accepts
The base Remote user downlink data. When the module has data to be sent
station computer on its own initiative, the NB-IoT module will be
UART
multisensor awakened and the module will be in connection
NB-IoT module UART Main control chip
Store the data
status again.
/GPRS module (STM32F103RCT6)
Power supply • Power Save Mode (PSM) [6]: The NB-IoT module
design
accepts downstream data no longer. The module will
Fig. 1. Schematic diagram of the system wake up when the terminal device actively sends
data or the module internal timer expires. The PSM
III. HARDWARE DESIGN function is the most suitable for scenarios where the
network sends messages with low frequency, fixed
A. Master Chip Module transmission time and no needs to communicate at
The system uses a 32-bit STM32F103RCT6 other times [7].
microcontroller, the chip has 64 pins, the program memory
type is FLASH, W25Q16 Storages the data. NB-IoT module achieves energy saving by setting PSM
or eDRX (extended Discontinuous Reception) [8]. The
B. Power Module NB-IoT module periodically goes to sleep in eDRX mode.
System designs two power supply modes: commercial BC35-G and SIM900A communication protocols are serial
power supply and battery power supply. Voltage regulator ports. STM32F103RCT6 can control BC35-G and
module uses SM-PLF12A module, SM-PLF12A module SIM900A through the AT command according to the
can be directly connected to the 220V AC. Power can be requirements of the system. The BC35-G circuit diagram is
supplied to the main control chip and peripheral chip after shown in Fig. 4.
voltage reduction. At the same time, the SM-PLF12A C2

module is connected to a lithium battery UPS module, and C3 VCC_BC35-G

the UPS module connects the lithium battery. Power can be 54


53
52
51
50
49
48
47
46
45
44
supplied to the main control chip and peripheral chip by the
GND
RF_ANT
GND
GND

GND
GND
RESERVED
RESERVED

VBAT1
VBAT2
RESERVED
lithium battery. Power component block diagram is shown
1 43
RESERVED GND
2 42
GND USIM_GND
3
in Fig. 2. RESERVED 41 R1 SIM_CLK
USIM_CLK
4 40 R2 SIM_DATA
RESERVED USIM_DATA
5 39 R3 SIM_RST
RESERVED USIM_RST
6 38 SIM_VCC
RESERVED USIM_VDD
7 37 RI
RESERVED RESERVED
8
Main control chip and 9
RESERVED RESERVED
36
RESERVED 35

1
3
4
5
6
RESERVED
peripheral chip 10
RESERVED 34 R4 RI
RI
11 33
RESERVED RESERVED
SM-PLF12A 12

2
RESERVED 32
RESERVED SMF05C
13 31
RESERVED RESERVED
220V AC voltage regulator R10
14
RESERVED 30 R5 PB11
RST TXD
RESERVED

RESERVED
RESERVED
RESERVED
RESERVED

RESERVED

15
NETLIGHT

29 PB10
DBG_RXD
DBG_TXD

R6
VDD_EXT

RESET
module 16
RESERVED
RXD
28
C1 RESERVED
ADC

The lithium Main control chip and


UPS module 3.0V
battery peripheral chip
17
18
19
20
21
22
23
24
25
26
27

NETLIGHT_L R8 VCC_EXT
D_TX
R9 R7 D_RX
Fig. 2. Power component block diagram
Fig. 4. BC35-G circuit diagram
C. Information Acquisition Module
The system uses PTQS1005 multi-in-one IV. SOFTWARE DESIGN
electrochemical sensor for data acquisition, the working The system transplants the embedded real-time
voltage is 5V. The sensor communication protocol is a serial operating system FreeRTOS to the STM32 platform to
port. The sensor can measure temperature, carbon dioxide, achieve the purpose of multi-tasking synchronization.
formaldehyde and other gas concentration indicators, and Software design mainly includes : measuring data,
various parameters will be output in digital form.
establishing TCP connection, calibrating time, and
PTQS1005 circuit diagram is shown in Fig. 3.
uploading data to cloud platform. When the NB-IoT
+3.3V
C1
+5V
network connection is abnormal, the system will switch to
1 VCC GPRS network. When the NB-IoT network and GPRS
R21 R22 R23
2
3
GND network are abnormal at the same time, the data is stored in
SET
PC10 R11
4 RXD
SPI Flash. After the network reconnection is successful, the
PC11
PC15
R12
R13
5 TXD data in SPI Flash is uploaded again.
6 RESET
7
8
NC A. Data Acquisition Module
NC
PTQS1005
The main control chip sends an array of inquiry gas
index to the sensor through serial port. When the sensor
Fig. 3. PTQS1005 circuit diagram receives the array, the gas data is returned uniformly to the
main control chip in digital form. The main control chip
D. Wireless Communication Module checks, parses and packages arrays.
The wireless communication circuit uses NB-IoT
B. Data Transmission Module
module BC35-G and GPRS module SIM900A. The NB-IoT
This system realizes the network transmission between

386
the terminal and the cloud platform under the TCP/IP [9] C. Data Filtering Algorithms
protocol. When the system initializes the NB-IoT module, Considering the non-catastrophic characteristics of
PSM mode and eDRX mode are set according to the actual temperature, humidity and other parameters [10], the
needs of the project. The system closes the PSM mode, and numerical values with large fluctuations are modified.
sets the period of the eDRX mode to 40.96 seconds, and the Therefore, in the programming, the data measured in a short
paging window time is set to 20.48 seconds. That is, the period of time are accumulated and summed, then the
module can receive the data packet sent by the cloud minimum and maximum values are subtracted. Finally, the
platform in 20.48 seconds per cycle. average operation is done to get the final value.
After the power-on initialization setting,
"AT+NSOCR=STREAM,6,2000,1\r\n" is sent to the N=(x1+x2+x3+…+xn-xmax-xmin)/(n-2) (1)
module to create the Socket. When the module returns the
Socket channel, STM32F103RCT6 Sends In the formula, the number of sampling values is n, and
"AT+CGATT?\r\n" to the module to query the network the final value is N. Each data obtained in this short period
attachment status until the module returns 1. Then the is set to xi. The maximum value is xmax and the minimum
system will start the TCP connection. value is xmin.
After the TCP connection is established successfully, the D. Data Storage Module
master chip sends a login package to the cloud platform The data storage chip uses W25Q16. When the system
through the NB-IoT module. If the cloud platform receives has no network, the data will be stored in this chip. Data is
the login package normally, the answer package will be stored at address 0x00, and the address which data is to be
issued from the cloud platform. The NB-IoT module will stored next time is recorded at 0x1FFE0C. Each time the
receive "AT+NSONMI=1,31\r\n", the Socket channel is 1 system transmits 111 bytes of data packets, the system sends
and the answer package is 31-byte, indicating that the cloud data to the cloud platform every 60 seconds, that is,
platform has received the data. The Master chip Control W25Q16 can store data of 12 days in the case of network
NB-IoT module to send " AT+NSORF=1,31\r\n" to read disconnection.
out the packet content, which includes the Socket channel,
the IP address of the communication destination, the byte E. The Cloud Platform
length and the cloud platform answer package. After the The cloud platform of this system is developed under the
main control chip analyzes, it confirms that the response framework of SSM (Spring + Spring MVC + Mybatis). The
packet is sent by the cloud platform and the response packet concurrent data acquisition uses Netty framework to
contains the logo of successful login. The system will establish long link channels and uses Redis to cache data,
realize the functions of time calibration, real-time data which ensures that the data can not be lost when the server
transmission and data reissue. is powered off. The cloud platform is responsible for
receiving data, parsing data packets, caching data and
When the NB-IoT network is abnormal, the network sending reply messages.
automatically switches to the GPRS network. The system
will initialize the GPRS module, and establish a TCP V. EXPERIMENTAL TESTING AND ANALYSIS
connection. After the module connects to the TCP
connection successfully, it will send network login packets Network communication test mainly includes: whether
and data packets. If the data transmission of both the the long TCP/IP link between NB-IoT module and the cloud
NB-IoT network and the GPRS network fail, the data will platform is successful or not. When the NB-IoT network is
be stored in the external SPI Flash. When the module is abnormal, whether the network can be converted into GPRS
connected to the network again, the data in the SPI Flash is network to send data. Whether the data transmission is
uploaded again while the data is uploaded in real time. The stable after the interruption of NB-IoT and GPRS network,
network communication flow chart is shown in Fig. 5. the main process is as follows:
• The serial port of the main control chip is connected
Power-On starts
to the NB-IoT module. The NB-IoT module is
NB-IoT module connects
initialized, the IP address and the port number are
network, and calibrates time connected to the NB-IoT module. When the TCP
connection is established, the login package is sent
The NB-IoT Module uploads
packets to the cloud platform
by the NB-IoT module, and the time is checked
through the network.
Y
Sent successfully? • When the calibrating time is successful, the NB-IoT
module will carry out real-time data transmission.
N Y
When the NB-IoT network has errors, the network
Switch to GPRS network to will be switched to the GPRS network to send data.
transfer data
When the NB-IoT network and the GPRS network
simultaneously have errors, the data will be stored in
Sent successfully? SPI Flash. After the network returns to normal, the
data in SPI Flash is retransmitted. The serial assistant
N
shows the test results of NB-IoT network data
Store the data in SPI Flash
transmission is shown in Fig. 6. The serial assistant
Fig. 5. Network communication flow chart
shows the test results of NB-IoT network data
retransmission is shown in Fig. 7. The information

387
acquisition and monitoring interface of cloud A variety of power supply modes make the terminal
platform data management background is shown in more convenient to use. The system has a longer standby
Fig. 8. The device 1 is an on-line device. time without charging the battery. The wireless networking
mode and the energy-saving feature of NB-IoT make the
system suitable for deployment in complex outdoor
environment. It is verified by experiments that the online
data transmission of the system is stable. When the network
is abnormal, the data transmission is stable after the network
is restored.
ACKNOWLEDGMENT
The Guidance Plan for Key Research and Development
Plans of Liaoning Province(2018104013), Shenyang Young
and Middle-aged Science and Technology Innovation
Talents Support Plan(RC180338), Innovative Talents
Support Plan of Liaoning Education
Fig. 6. NB-IoT network data transmission Department(LR2016074)
At the end of the paper, I would like to thank my family
and tutor for their help and support in my study. In the topic
selection and data collection, I have received the mentor's
attentive instruction and selfless help. At the same time, in
the experiment, I also got valuable suggestions from my
classmates. Here I would like to express my sincere thanks.
Finally, I would like to express my heartfelt thanks to all
my good teachers and friends who have helped, cared for
and supported me.
REFERENCES
[1] Song Hongru, Wang Yihuai, Yang Fan. Design and implementation
of intelligent gas meter system based on narrowband IoT [J]. Sensors
Fig. 7. NB-IoT network data retransmission & amp; micro Systems, 2019,38 (03): 113-116.
[2] Fan Huizhen, Wang Lei. Application of NB-IoT in the construction of
Intelligent City [J]. Technology and markets, 2018 (12): 46-47.
[3] Wang Deqi, Feng Junshuai, Song Hailiang, Xie Zhimei. Research on
Remote Environment Monitoring system based on wireless sensor
network and 3G/4G [J]. IoT Technology, 2015,5 (03): 17-18.
[4] Yan Ruan. Design and Realization of Smart Home System Based on
Wireless Sensor Networks[J]. Applied Mechanics and
Materials,2015,3752(716).
[5] Sun Jinquan, Shi Feng. Design of industrial environmental safety
Fig. 8. The information acquisition and monitoring interface monitoring system based on NB-IoT/LoRa [J/OL]. Sensor World,
2018 (11) [2019-01-02].
VI. CONCLUSION [6] Yu Min. A new type of power manhole cover monitoring and alarm
system based on NB-IoT technology [J]. Electronic components and
The system uses STM32F103RCT6 microprocessor, the Information technology, 2018 (09): 123-126.
serial port is connected to the electrochemical gas sensor to
[7] Liu Keqing, Zhou Jun, Li Shiguang, Ren Xiaohua. NB-IoT Low
collect data. The system can test temperature, humidity, power technology and Power parameter configuration research [J].
formaldehyde, PM2.5 and so on. Network communication Mobile Communications, 2018,42 (12): 32-36.
based on TCP/IP protocol is implemented by NB-IoT [8] Li Guiyong, Shu Qiang, Li Wenbin. Analysis and research of eDRX
module or GPRS module, and time-stamped data can be based on NB-IoT system [J]. Electronic technology applications,
uploaded in real time. 2018,44 (08): 98-101.
[9] Postolache O.A., Pereira J.D., Girão P.S. Smart sensors network for
The switching mechanism of wireless network is air quality monitoring applications. IEEE Trans. Instrum. Meas.
designed. When the NB-IoT network is abnormal, the 2009;58:3253–3262.
system can switch to the GPRS network. The data storage [10] Zhou Donghui, Zhang Lingyun, Chen Minghui, Mao Licheng, Cheng
mechanism of disconnected network is designed. When the Wansheng. Multi-point monitoring system for greenhouse shed
NB-IoT and GPRS network are abnormal, the data is stored environment based on NB-IoT and Stm32 [J]. Journal of Liaoning
University of Science and Technology, 2018,41 (05): 389-394.
in SPI Flash. SPI Flash supports storing data of 12 days.
After the network is restored to normal, the data in the SPI
Flash is retransmitted to the cloud platform to ensure the
integrity of the data.

388

You might also like