You are on page 1of 10

Aquacultural Engineering 90 (2020) 102088

Contents lists available at ScienceDirect

Aquacultural Engineering
journal homepage: www.elsevier.com/locate/aque

Design of water quality monitoring system for aquaculture ponds based on T


NB-IoT
Juan Huan*, Hui Li, Fan Wu, Weijian Cao
School of Information Science & Engineering, Changzhou University, Changzhou, China

A R T I C LE I N FO A B S T R A C T

Keywords: In order to promote the development of aquaculture informatization and monitor aquaculture ponds more ac-
Aquaculture curately and conveniently, this article has developed a water quality monitoring system for aquaculture ponds
The water quality based on the narrow band internet of things (NB-IoT) technology. This system realizes remote collection and
Monitoring data storage of multi-sensor processor information (temperature, pH, dissolved oxygen (DO) and other en-
The internet of things
vironmental parameters), as well as intelligent control and centralized management of breeding ponds. The
Narrow band internet of things
system uses STM32L151C8 microcontroller and sensor terminal real-time acquisition, such as temperature, pH
value, dissolved oxygen. It realizes data aggregation and transmission over a long distance to the Internet of
things (IoT) telecom cloud platform through the technology of NB-IoT. The software called Keil implement the
data format design of wireless communication module and data transmission. Java is used to develop back-
ground monitoring applications for accessing cloud platform, controlling underlying devices and local data
processing. It can not only send hypertext transfer protocol (HTTP) requests to monitor cloud platform data, but
also issue commands to the underlying control module to control the startup and shutdown of equipment such as
aerator. The system was implemented and tested in ChangZhou, JiangSu Province, China. The experimental
results showed that the system can obtain water quality parameters in time. The temperature control accuracy is
maintained at ± 0.12℃, the average relative error is 0.15 %, the dissolved oxygen control accuracy is main-
tained within ± 0.55mg/L, the average relative error is 2.48 %, the pH control accuracy is maintained at ± 0.09,
and the average relative error is 0.21 %. The system has stable overall operation, real-time and accurate data
transmission, which can meet the actual production needs and provide strong data and technical support for
further water quality regulation and aquaculture production management.

1. Introduction fishery environment by combining ZigBee and WiFi. Schmidt et al.


(2018) designed an autonomous buoy system for coastal aquaculture
With the rapid development of aquaculture industry in various and water quality monitoring. Lorena et al. (2018) combined WSN and
countries, water factors in the water quality environment, such as general packet radio service (GPRS) to remotely monitor water quality
temperature, pH and dissolved oxygen (DO), are becoming more and parameters and feed consumption in fish breeding bases. The above
more important (Li and Yang, 2018). They are not only the basis for the aquaculture monitoring systems have their own characteristics, but
survival of aquatic animals, but also the key factors affecting water with the development of the Internet of things technology, in recent
quality. Therefore, monitoring of water quality timely is of great years, the emergence of equipment access oriented low power wan. A
practical significance to aquaculture for high yield, health and safety. typical example is Narrow Band Internet of Things (NB-IoT), its single-
Researchers have conducted research on aquaculture environmental hop distance can be up to thousands of meters, which is more suitable
monitoring in recent years. Wang et al. (2012) designed the ocean re- for parks, breeding ponds and other places in terms of node commu-
mote monitoring system. Nam et al. (2015) deployed wireless sensor nication range, node deployment number and environmental applic-
networks (WSN) in aquaculture farms by combining ZigBee and code ability. In a short period of two years, NB-IoT is taking root in various
division multiple access (CDMA) technologies to monitor the environ- fields of life, such as intelligent parking, intelligent street lights, shared
mental information of offshore fish species (Rawat et al., 2013). Chen bicycles, intelligent manhole covers, remote meter reading, intelligent
et al. (2016) established the WSN automatic monitoring system for buildings and so on. Zhang et al. (2018a, 2018b) proposed an


Corresponding author at: Changzhou University, 1 Gehu road, Wujin, Changzhou, Jiangsu 213164, China.
E-mail address: huanjuan@cczu.edu.cn (J. Huan).

https://doi.org/10.1016/j.aquaeng.2020.102088
Received 16 July 2019; Received in revised form 16 April 2020; Accepted 18 April 2020
Available online 21 April 2020
0144-8609/ © 2020 Elsevier B.V. All rights reserved.
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

Fig. 1. System architecture.

architecture based on NB-IoT to connect intelligent hospital equipment, module, periodically detect the credibility of each node, so as to ensure
and introduced edge computing to deal with delay requirements in the integrity and security of the sensor node (Shetty et al., 2018). The
medical process. Wang and Yang (2018) designed a smart street light results provide reference for further water quality regulation and
management system based on solar street light with good stability and aquaculture production management.
broad application prospect by adopting multi-layer distributed struc- The system consists of four layers: perception layer, transport layer,
ture and NB-IoT network. Cao and Li (2018) proposed a data acquisi- platform layer and application layer. The perception layer is deployed
tion scheme for the Internet of vehicles based on NB-IoT transforma- in the pond, which is responsible for the data collection and aerator
tion, and deployed and analyzed the network structure. Zhang et al. control of the aquaculture tank. The transport layer mainly contains the
(2018a, 2018b) designed a low-power information monitoring system core network and the communication base station, which is responsible
by adopting NB-IoT communication technology, the long range (LoRa) for the transmission of business data. The platform layer saves the
communication technology and least recently used (LRU) algorithm. Jia business data and monitors the system in real time. The application
et al. (2017) proposed an intelligent manhole cover management layer controls the opening and closing of the bottom module and the
system for smart city based on edge computing, with high application aerator.
efficiency. He et al. (2018) developed a set of intelligent greenhouse The rest of this paper is organized as follows: Section 2 introduces
environmental automatic regulation system based on the early-stage the hierarchical structure of the system and the two functions it im-
technology of 5 G low-power mass connection scene by taking ad- plements. Section 3 mainly describes the design of the hardware part of
vantage of the strong penetration and wide coverage of this technology. the perception layer. Section 4 presents the transport layer network and
Anand and Regi (2018) uses NB-IoT to remotely monitor water levels in topology diagram. Section 5 discusses the design of the platform layer.
tanks. Lv and Zhao (2018) designed a temperature acquisition system Section 6 is about the design of the software part of the application
that uses low-power single-chip microcomputer as processor and com- layer. Section 7 gives results and data monitored, and finally, Section 8
bines NB-IoT communication module for wireless transmission. Chen concludes the article.
(2018) designed a new temperature monitoring system for electro-
plating production line, which has good regulatory performance. In 2. System design and overview based on CoAP protocol
order to effectively solve the current problems of insufficient coverage
of aquaculture regional network, excessive terminal power consump- The aquaculture pond water quality monitoring system designed in
tion, a large number of terminal equipment and high comprehensive this paper has the functions of data collection, remote transmission,
cost, this paper selects NB-IoT to be applied in aquaculture pond storage management, remote monitoring and intelligent control, which
monitoring, which is based on the cellular network. Direct access to realizes the distributed monitoring and centralized management of
cellular network can greatly simplify the network structure, and reduce aquaculture environment water quality parameters. The system consists
the difficulty of deployment and maintenance. The technology si- of four layers: perception layer, transport layer, platform layer and
multaneously have achieved low cost, low power consumption, wide application layer. The system architecture diagram is shown in Fig. 1.
coverage and large connection, which is very suitable for aquaculture The first layer is the perception layer which mainly including power
industry like low frequency, small data packet and communication supply module, sensor module (temperature sensor, pH composite
delay insensitive the Internet of things (IoT) business. Low-cost and electrode, dissolved oxygen sensor, etc.), microcontroller unit (MCU)
low-power mobile terminals be distributed in each breeding base and NB module. Different farming ponds are deployed separately. It is
through the connection between NB-IoT and sensors, it is will provide responsible for aquaculture pond data collection and aerator control,
guarantee for aquaculture production and research on the IoT. different sensors collected corresponding data through the NB com-
Considering the advantages of this technology in the application to munication module to connect physical entity to the transport layer.
the aquaculture industry and the current development trend, this paper The second layer is the transport layer mainly comprising a core net-
designed and realized the aquaculture pond water quality monitoring work and a base station communication. After collecting the data of the
system based on NB-IoT, which uses STM32L151C8 chip and sensor breeding pond from the first layer, the data will be sent to nearby
technology to collect aquatic environment information, and implements communication base station through core network of the transport
the non-gateway data report through the Narrow Band (NB) module. layer, which will establish the user surface bearing for the hardware
The cloud platform saves immediately after receiving the data or is- terminal and transfer business data. The third layer is the platform
suing the command, and it is ready to parse and send the protocol layer, whose function is to gather relevant data of the cloud platform
package at any time. On the one hand, the system can monitor the obtained by the access network, and forward it to monitoring applica-
aquaculture environment in real time and send relevant data through tion system for specific processing according to different perceived data
the IoT platform to Personal Computer (PC) and remote clients. On the types. Meanwhile, it opens the interface to the system for data acqui-
other hand, it can control the work of the underlying module by issuing sition. The last layer is the application layer. On the basis of the plat-
a command, coordinate each sensor node and configure a credible form, the aquaculture pond monitoring system is deployed on it. It can

2
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

Fig. 3. Design block diagram of main control board.

encoding (converting from json to hexadecimal code stream). The de-


vice receives and executes the control command of aerator to return the
result.

3. Design and development of perception-layer hardware based


on NB module

Fig. 2. Flow chart of perception layer to cloud platform. The design of perception layer is mainly divided into five parts:
main control board design, communication module circuit design, data
frame format design, power module design and embedded develop-
not only call the query interface to monitor data on the platform, but ment. Among them, NB-IoT main control board and communication
complete the data preprocessing and storage. You can surely issue module circuit design are the core of perception layer. The main control
commands to underlying control module to control the opening and board is responsible for the collection of pond data, and the commu-
closing of equipment such as aerator. nication module controls the data interaction with the base station.
The division of labor at all levels is clear, and the two main func-
tions are realized: remote monitoring of data is realized by reporting
data from the perception layer to the application layer, and intelligent 3.1. Design of main control board
control of equipment is realized by issuing commands from the last
layer to the first layer. The docking flow chart of the first two layers is The design block diagram of the main control board is shown in
shown in Fig. 2. Fig. 3. Temperature sensor DHT12, pH composite electrode E-201-C
and digital DO sensor DOS-600 were used to obtain the temperature,
pH and DO in the farming pond. MCU is the core of the whole main
2.1. Remote monitoring control board, it is used for data acquisition, processing, analysis and
communication module communication connection, we choose
Temperature and other sensor devices collect relevant data of the STM32L151C8 as the main control chip, its kernel is based on ultra-low
breeding pond, and encode them according to the data frame format. power consumption ARM Cortex-m4 CPU, which can reduce the power
The encoded data is sent to the NB module in the form of AT command loss to the greatest extent. It also built-in timer, direct memory access
through MCU serial port. After receiving the AT command, the NB-IoT (DMA), universal asynchronous receiver/transmitter (UART), rapid
chip automatically encapsulates payload into a message of constrained storage technology (RST), Analog-to-Digital Converter (ADC), General-
application protocol (CoAP) which proposed to solve the problem of purpose input/output (GPIO) and other modules, these modules can
limited device resources in the Internet of things, where traditional meet the NB-IoT hardware design functional requirements (Song et al.,
hypertext transfer protocol (HTTP) is not applicable and sends it to the 2018). The chip will store the processed data in the internal storage
preconfigured IoT telecom cloud platform. Once the platform receives module and send it to the specified object through the module of BC95-
the data, it will find the matching codec plug-in according to the device B5. The internal timer is used to control the data and send it every 30
Profile, and then parse the protocol package in detail, until it becomes min. The setting of system working parameters can be completed by AT
the json data matched by the service in the Profile and stored on the instruction. For example, AT + NMSTATUS determines the connection
platform (Paramesh and Robin, 2018). The monitoring system acquires between the current module and the platform, AT + NMGS means that
data on the platform through query interface and remotely monitors the corresponding breeding pond monitoring data can be obtained by
data changes. Every monitoring csycle of the platform will send data to sending the binary code designed according to the communication
the specified server through a POST message. frame protocol.
After the MCU sends the data, the NB communication module cre-
2.2. Intelligent control ates the transmission channel between the NB and the base station, so
as to receive the data and monitor the command. When receiving the
The aquaculture monitoring system can issue commands to control request signal from the base station, the NB communication module can
the aerator to the platform. If the platform judges that the equipment is respond in time.
online, the platform will forward the commands to the hardware The acquisition terminal includes sensor module, single chip pro-
terminal. Otherwise, the command is cached in the database on the cessor, NB-IoT communication module. The system uses an internal
platform. The forward operation is not performed until the device is timer to collect temperature, pH and DO signals, and encodes the
online. Once the NB device reports data at a certain moment, after the processed data in accordance with the data frame design format, and
platform receives the data, it will firstly retrieve whether the corre- finally stores them in the internal memory. Analog signals collected by
sponding device has valid unissued commands in the database. If so, the dissolved oxygen sensor and pH composite electrode need to be con-
command will be given priority. It is sent to the device side by plug-in verted into Digital signals that can be processed by single chip

3
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

microcomputer through Analog to Digital Convert (ADC) module and


sent to NB-IoT module in the form of AT + NMGS command through
serial port. After receiving the AT command, the module automatically
encapsulates payload as a message required by CoAP protocol and
sends it to the IoT telecom cloud platform via the base station. The
system is powered by batteries with a supply voltage of 3.3 V.

3.2. Design of communication module circuit

The NB module receives and forwards the water quality data of the
breeding pond. MCU programming realizes the control of NB-IoT chip,
which sends the detected data after encoding through this module to
determine whether the SIM card information is read completely and Fig. 5. Physical drawing of terminal hardware.
then matches the corresponding state.
BC95-B5 is a wireless communication module based on NB-IoT directly to the NB-IoT base station via the radio frequency antenna. The
technology. The design uses this module to report water quality mon- terminal sensor node is composed of all kinds of sensors and BC95 radio
itoring data and receive control orders of aerator. The NB-IoT wireless frequency chip. The physical terminal node is shown in Fig. 5.
communication protocol (3GPP Rel.13) establishes connections with
network operators' devices and works primarily in the 850 MHz au-
thorized band. It is also small in size to save area, minimum depth of 3.3. Design of data frame format
sleep up to 5 μA, which can save power consumption. IoT subscriber
identity module (SIM) card is a 4 G NB-IoT card provided by China In order to facilitate the parsing and processing of data by software
telecom, which stores user information, encryption keys and time in- and hardware modules and improve the correctness of data, the frame
formation, etc. This card also meets the management requirements of structure is adopted to reduce the probability of errors in the trans-
intelligent hardware and intelligent agriculture for the Internet of de- mission process of data packets. According to the application archi-
vices. tecture, the method of IP address + international mobile subscriber
The schematic diagram of the communication module circuit is identity (IMSI) number is used to distinguish the device terminal in the
shown in Fig. 4. The communication module BC95, as the radio fre- communication. The unique IP address and IMSI number exist in the
quency module, interacts with the special NB-IoT card for data inter- device terminal, and these two factors are added into the transmitted
action, and finally sends the water quality data of the breeding pond data packets to ensure the sending and timely response of data packets.

Fig. 4. Schematic diagram of communication module.

4
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

Table 1 3.5. Embedded development


Frame format design.
Frame header Frame length Control word Data The ultimate purpose of the perception layer design is to complete
the data reporting, which is the most basic item in the Internet of things
2Byte 2Byte 1Byte Multibyte retention business.
Keil integrated development environment was used to program
STM32 MCU, and SEGGER j-link emulator and MCU were connected.
Table 2 After compiling download and simulation, the program burn to the
Control word part design.
MCU, the completion of development. The specific functions are data
Operation type Temperature pH Dissolved oxygen acquisition, signal conversion, data sending and command receiving,
etc. Some codes are shown as follows:
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
Step 1. uint8_t DHT12_Read_Data(uint8_t *temp) // Gets the tem-
perature value
The content of frame format is shown in Table 1, including four parts, Step 2. uint8_t PH_Read_Data(uint8_t *pH) // Get the pH
namely frame header, frame length, control word and data. Step 3.pH_value = -0.005816*PH_Read_Data +19.2654; // Convert
The frame header portion is 2 Byte, which is the starting character pH from analog to digital
of each frame data. In this paper, the fixed frame header content is 0 × Step 4. uint8_t DO_Read_Data(uint8_t *do) // Get the DO
7E 0 × 7E. The part of frame length is 2 Byte, which means the data Step 5. DO_value = (unsigned int)((float)DO_Read_Data/228/100);
length of the frame, including only the control word part and data part // Convert DO from analog to digital
length; The control word part accounts for 1 Byte, which is divided into Step 6. Void BC95_SendCOAPdata(uint8_t *len,uint8_t *data) //
four parts: operation type, data type, data item and reserved bit (Deng Send CoAP data
et al., 2018). The number of bytes occupied by the data part is not fixed Step 7. Void BC95_RECCOAPData(void) // Receive commands from
and depends on the actual length of data transmission. This part stores the platform layer
the data content that is actually sent.
The content of control word design is shown in Table 2. Among
4. Transport layer for transferring data and commands
them, the control word occupies 1 Byte, including 8 bits in total. If the
data type value of Bit7 and Bit6 is 00, it means the reported data; 01
After the detected data is sent by NB module, it is sent to the nearby
means the command is issued. Bit5 and Bit4 transmit data or command
communication base station through the core network of the transport
data related to the temperature module; Bit3 and Bit2 transmit data or
layer. The transport layer includes the core network and the commu-
commands related to the pH module. Bit1 and Bit0 transmit data or
nication base station. The core network is mainly responsible for the
commands related to the dissolved oxygen module. When the operation
interaction with the non-access layer, and the water quality data
type is 00, it means to upload the corresponding temperature mea-
monitored is forwarded to the IoT platform for processing.
surement value, pH measurement value and dissolved oxygen mea-
The communication base station is built by operators, and the NB-
surement value, and the remaining values are reserved. When the op-
IoT wireless access network is composed of one or more base stations
eration type is 01, the data item value 00 means open measurement, 01
(eNB), which is responsible for the management of wireless resources,
means close measurement, 10 means obtain measurement value, and
including wireless load control, wireless access control, connection
the rest values are reserved. When the operation type is a command
mobility control, dynamic allocation and scheduling of upstream and
response, the data item values are preserved.
downstream resources, encryption of user data flow, IP header com-
pression and other functions.
3.4. Design of power module As shown in Fig. 6, NB-IoT wireless input network is composed of
multiple base stations (eNB). eNB communicates with NB-IoT terminal
The power supply module is responsible for the power supply of the (UE) through Uu interface (air interface) and is the protocol termina-
entire main control board. The power supply voltage of MCU is 3.3 V, tion point of user interface and control surface in UE. eNB is connected
and that of NB module is 3.8 V. Therefore, the input voltage of 5 V to the NB module through interface, which transmits the monitoring
needs to be stabilized to 3.3 V and 3.8 V. data of the breeding pond. Interface between two eNB base stations that
It is stable from 5 V to 3.3 V. AMS1117−3.3 step-down stabilizer is
adopted. AMS1117 is a linear stabilizer, and the maximum output
current is 0.8A. As can be seen from the schematic diagram of the
power module shown in Fig. 3, the 5 V power supply enters the IN end
of AMS1117 through a 220 u F and a 0.1 u F decoupling capacitor, and
its OUT end passes through a 0.1 u F and a 10 u F decoupling capacitor
and the output voltage is 3.3 V. The capacitance of 202 u F at the input
can store a large amount of electricity, and the ESL of the capacitance of
0.1 u F is lower, which is suitable for high-frequency circuits. Therefore,
the combination of the two can effectively reduce power ripple, reduce
power noise and improve the response time of transient current. The
function of 0.1 u F capacitor and 10 u F capacitor at the output end is
also decoupling, reducing the noise and ripple of the output voltage.
5 V voltage regulator to 3.8 V, using MIC29302WU step-down
voltage regulator. MIC29302WU is a linear voltage regulator, the
maximum output current of 3A, is a large current, low voltage differ-
ence voltage regulator (Khriji et al., 2014). Considering that 4 G and 2
G modules require a large current, this high-current regulator is se-
lected, and its maximum output current is enough to meet the current
requirements of the module. Fig. 6. Network topology.

5
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

"propertyName": "DO","dataType": "int","required": true,"min":


"0","max": "100", "step": 1.0,"maxLength": 0,"method": "RE","unit": "%",
"enumList":
Taking temperature code as an example, propertyName for temp
means access device for temperature sensor, dataType for int means
dataType for integer, required for true means mandatory item, min and
max stipulate the range of attribute is 0–100, step means step length is
equal to 1.0, method means the access mode of the attribute, RE means
it can be read, and can be saved after change. Only when the device
Profile file is uploaded can the device be properly bound to receive data
and send commands.

5.2. Design of codec plug-in

After the data monitored by the aquaculture pond is reported to the


Fig. 7. Flow chart of IoT platform design. platform through the transport layer via the NB module, it is necessary
to decode the data. Similarly, the platform needs to encode the com-
mands sent by the system to control the aerator. Therefore, a codec
enables UE to quickly start the recovery process when it is idle.
plug-in is designed on the platform to realize data encoding and com-
mand decoding (Osanaiye et al., 2018).
5. Platform layer built by mobile operator The data of application layer is usually in hexadecimal format be-
cause of the high requirement of power saving. When the data is parsed
After binding the NB module to the IoT platform, the data sent by on the IoT platform, it is converted into a unified json format to facil-
sensor devices such as temperature, pH and DO are stored. Then, pro- itate the use of the aquaculture pond monitoring system. In order to
files are written on the platform and codec plug-ins are designed. achieve the conversion function of hexadecimal message and json
Finally, the application of farming monitoring system is created and format message, the platform needs to use the device manufacturer to
deployed on the client side to realize unified management of NB-IoT provide the codec plug-in. An NB module corresponds to a codec plug-
devices. The interface is also opened to the deployed monitoring ap- in.
plication system for remote monitoring of platform data. Plug-in to achieve decoding and coding, mainly for the specific
If the platform receives the reported data, the corresponding json implementation of two interfaces for code development, they are en-
data will be decoded by the codec plug-in and stored for remote code and decode, it assumes four tasks: decoding the data reported;
monitoring by the breeding monitoring system. If the platform receives Decoding the reported response command; Code the commands issued;
the commands issued by the aquaculture monitoring system, it encodes Encode the data response issued.
them into a hexadecimal code stream through the codec plug-in and This is essentially a jar package that implements the
sends it to the device end to realize the intelligent control of the device. IProtocolAdapter interface and needs to complete the modification of
The flowchart of platform layer design is shown in Fig. 7. four interface functions.
This paper uses the SP Portal front-end interface provided by the IoT Step 1. String getManufacturerId() // Returns the device vendor ID.
platform to realize the basic application management, equipment Step 2. String getModel () // Returns the device type.
management, data view, command view and other functions of aqua- Step 3. ObjectNode decode(final byte[] binaryData)throws
culture pond monitoring. Login to SP Portal (the account name and Exception // Convert the temperature, pH, DO and other binary data
password will be issued together with the platform resources) to create reported by the device into json format data.
an "application". "Application" is a mapping of the monitoring system Step 4. byte[] decode(final ObjectNode input)throws Exception
on the platform. When the application is created, the platform returns //Converts commands issued under the application layer to device-
the appid and secret. These two values are used for the unique binding aware binary data.
of the aquaculture monitoring system and NB equipment. Interface 1 and 2 are used to obtain the relevant information of the
equipment and facilitate the verification of the target of codec.
5.1. Design of profile Interface 3 decodes the temperature, pH, DO and other data reported by
the equipment, and interface 4 encodes the commands controlling the
In order to ensure the uniqueness of data monitored in different aerator.
farming ponds, the temperature and other data can be accurately saved Codec plug-in deployment is completed through the IMSI number to
to the cloud platform. It is necessary to establish the mapping re- register binding equipment, access to the data as shown in Fig. 8a, the
lationship between different perceptive nodes and cloud platform. first act on September 22, 2018 12:04 platform of data sensing module,
Therefore, the mapping Profile is designed in this paper. where the temperature is 23.7 ℃, the values of DO is 8.12 mg/L, pH
The content of the file mainly includes two parts. The first part is the equals 8.3, once every half hour monitoring. The platform receives the
device attribute information, such as the manufacturer's ID, the man- command issued by the monitoring system, as shown in Fig. 8b. If the
ufacturer's name, the type of device and protocol to ensure the one-to- status is delivered, it means that the command to control the oxyge-
one correspondence of the binding NB module. The other part is the nator switch has been executed. The first line indicates that the plat-
equipment service information, which defines the data field of the form receives the command to open the oxygenator from the mon-
breeding pond to be reported by the equipment. The json code of some itoring system at 8:00 on September 22, 2018, and sends the command
business data is as follows: to the local module for execution. The second line executes the com-
"propertyName":"temp","dataType": "int","required": true,"min": mand to turn off the aerator at 20:00, and so on.
"0","max": "100","step": 1.0, "maxLength": 0, "method": "RE","unit":"C",
"enumList":, 6. Develop application layer monitoring system with software
"propertyName": "pH","dataType": "int","required": true,"min":
"0","max": "100", "step": 1.0,"maxLength": 0,"method": "RE","unit": "%", The application layer is actually a local server-side aquaculture
"enumList":, pond monitoring application system, which mainly achieves two

6
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

Fig. 8. IoT platform management page.

functions: one is to obtain the aquaculture environment data sent to the aerator can be issued to the cloud platform. The command cache time
IoT platform by the aquaculture NB monitoring equipment through the can be set on the cloud platform(Shi et al., 2018; Salim et al., 2017; Ma
data query interface. The second is to control the work of the under- et al., 2015). After receiving the command, the local device controls the
lying module by issuing commands on the IoT platform. The monitoring oxygenator switch and returns the result.
system issues commands to the NB devices in the perception layer, and
the devices will also make some corresponding responses. Control the
7. Result and discussion
opening and closing of the aerator control unit.
The application server communicates with the platform through the
The configuration of hardware equipment and software environ-
HTTP protocol, and controls the device by calling the platform's open
ment is shown in Table 3, the microcontroller uses STM32L151C8 chip
application programming interface (API). The platform pushes the re-
and Yiyuan BC95-B5 wireless communication module as nb-iot module.
ported data of the device to the application server (Muangprathub
The sensor is mainly responsible for real-time collection of environ-
et al., 2019). The platform supports protocol parsing of device data into
mental parameters such as temperature, pH and dissolved oxygen.
standard json format data.
CoAP protocol is adopted to send the collected data through nb-iot
Step 1. String appId = Constant.APPID; // Set application ID.
module and receive control commands from the server. Temperature
Step 2. String secret = Constant.SECRET; // Set the application
sensor collects DHT12 temperature sensor, measurement range of
password.
minus 20 degrees to 60 degrees, the accuracy of plus or minus 0.5 ℃.
Step 3. String urLogin = Constant.APP_AUTH; // Set the authenti-
The DO sensor uses a DOS-600 sensor with a measuring range is
cation serial number.
0–20.00 mg/L and a precision of 0.1 mg/L. The pH electrode was made
Step 4. QueryDeviceHistoryData data = new
of E-201-C pH composite electrode, and the measurement range is
QueryDeviceHistoryData(); // Get the data of cloud platform.
0–14, and the accuracy is 0.05.
Step 5. PostAsynCommand command = new PostAsynCommand();
The system is used for the test in Changzhou fishery breeding base
// Issue commands to the device side.
of Jiangsu province. The base adopts the pond farming mode, covering
The system obtains the data on the platform through the query in-
an area of 0.1 square kilometers. Different aquatic organisms are placed
terface for remote monitoring of the breeding pond. The data is saved in
in different depths of aquaculture ponds, and the aquaculture en-
the database of the client, and then the front-end page is designed for
vironment is very representative. In order to verify that the system run
display. Some data are shown in Fig. 9. At the same time, the command
time for timely monitoring and precise control of water quality factors,
interface can be invoked in advance to remotely control the aerator
more efficient access to information, including temperature, pH and
equipment. Click the button in Fig. 9, and the command to control the
DO, we choose different weather (cloudy, sunny, rainy), different time

Fig. 9. System management page.


Note:The monitoring node are circled, which built-in hardware modules such as sensors and single-chip microcomputer.

7
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

Table 3 Table 5
Hardware equipment and software environment. Comparison of measured and standard values of no. 4 aquaculture pond.
Hardware and software Equipment model and environment Date Parameter Time Standard Data received by the
values cloud platform and
Sensor module DHT12 temperature sensor, E-201-C ph measured by sensor
composite electrode, DOS-600 dissolved nodes
oxygen sensor
MCU microprocessor STM32L151C8 chip Measured Relative
Analog to Digital Convert module HX711 conversion chip value error/%
Wireless communication module Yiyuan BC95-B5 module
Emulator SEGGER j-link September 20, Temperature/℃ 0:00 26.56 26.55 –0.04
Power source 5 V, 3000 mA h rechargeable power 2018 12:00 25.50 25.52 +0.08
Voltage regulator AMS1117, MIC20302WU (Moderate 20:00 24.71 24.68 –0.12
Aerator 4RB-520-H26 three-phase double- rain) DO/(mg·L−1) 0:00 4.92 4.73 –3.86
impeller oxygenator 12:00 5.13 5.34 +4.09
IoT platform China telecom IoT platform 20:00 4.88 4.86 –0.41
Embedded programming debugging Keil uVision4 pH Value 0:00 8.67 8.68 +0.12
Application layer interface docking, Eclipse and tomcat 12:00 7.24 7.25 +0.14
Javaweb development 20:00 8.22 8.23 +0.12
Database Mysql and Java DataBase Connectivity
September 22, Temperature/℃ 0:00 24.18 24.19 +0.04
2018 12:00 24.80 24.83 +0.12
(Cloudy) 20:00 24.71 24.76 +0.02
Table 4
DO/(mg·L−1) 0:00 4.97 4.88 –1.81
Comparison of measured and standard values of no. 1 aquaculture pond.
12:00 8.13 8.05 –0.98
Date Parameter Time Standard Data received by the 20:00 4.62 4.88 +5.63
values cloud platform and pH Value 0:00 7.10 7.11 +0.14
measured by sensor 12:00 6.56 6.55 –0.15
nodes 20:00 6.99 6.98 –0.14

Measured Relative September 29, Temperature/℃ 0:00 27.19 27.07 –0.44


value error/% 2018 12:00 27.90 27.92 +0.07
(Sunny) 20:00 28.71 28.76 +0.17
September 20, Temperature/℃ 0:00 26.33 26.41 +0.30 DO/(mg·L−1) 0:00 4.55 4.81 +5.71
2018 12:00 25.20 25.11 ―0.36 12:00 7.50 7.53 +4.00
(Moderate 20:00 24.00 24.08 +0.33 20:00 5.49 5.38 –2.00
rain) DO/(mg·L−1) 0:00 6.56 6.43 ―1.98 pH Value 0:00 8.41 8.41 0
12:00 7.73 7.94 +2.72 12:00 6.93 6.90 –0.43
20:00 7.21 7.15 –0.83 20:00 8.65 8.66 +0.12
pH Value 0:00 8.25 8.24 –0.12
12:00 8.54 8.56 +0.23
20:00 8.54 8.53 –0.12 the data volume of no. 1 breeding pond was 1426 frames, and 4 frames
were lost on September 15, and the package loss rate was 0.28 %. The
September 22, Temperature/℃ 0:00 23.30 23.40 +0.43
2018 12:00 23.67 23.70 +0.13 data volume of no. 4 breeding pond was 1468 frames, and 2 frames
(Cloudy) 20:00 24.60 24.68 +0.33 were lost on September 7, with the package loss rate of 0.13 %. The
DO/(mg·L−1) 0:00 6.03 5.90 –2.16 data volume of no. 6 breeding pond is 1520 frames, 2 frames were lost
12:00 8.10 8.12 +0.25 on September 14, 4 frames were lost on September 15, and 7 frames
20:00 7.00 7.12 +1.71
pH Value 0:00 8.52 8.54 +0.23
were lost on September 21, with a packet loss rate of 0.85 %. In the
12:00 8.29 8.30 +0.12 actual deployment, the communication distance between the node and
20:00 8.51 8.49 –0.23 the gateway is about 3 km, and the average packet loss rate is 0.42 %,
September 29, Temperature/℃ 0:00 27.14 27.16 +0.07 which has a very good communication reliability.
2018 12:00 27.11 27.10 –0.03
As can be obtained from Tables 4–6, the cloud platform can display
(Sunny) 20:00 28.84 28.86 +0.07
DO/(mg·L−1) 0:00 6.32 6.19 –2.06 the monitoring data of each pond accurately and timely, and the water
12:00 7.88 7.97 +1.14 quality parameter information such as temperature, pH value and dis-
20:00 7.56 7.34 –2.91 solved oxygen can be acquired in real time through this system. Among
pH Value 0:00 8.41 8.42 –0.12 them, the temperature control accuracy is maintained at ± 0.12℃. The
12:00 8.25 8.24 –0.12
20:00 8.65 8.65 0
relative errors of no.1, no. 4, no. 6 and no. 6 were 0.22 %, 0.12 % and
0.15 % respectively. The control accuracy of dissolved oxygen was kept
within 0.55 mg /L. The relative errors of no.1, no.4 and no. 6 were 1.75
(0:00, 12:00, 20:00) different breeding ponds (no.1 breeding pond, no.4 %, 3.17 %, 2.51 % and 2.48 % respectively. The pH value control ac-
breeding pond, no.6 breeding pond) for data monitoring. Made by curacy is maintained at ± 0.09, the relative error of no.1, no. 4, no. 6
HASH COMPANY production MS5-Hydrolab portable multi-parameter and no. 6 is 0.14 %, 0.15 % and 0.33 % respectively. The average re-
monitor the water quality parameters measured by as the standard, the lative error is 0.21 %. Compared with the standard values, the relative
sensor measurement accuracy is higher, DO measurement precision error of the measured parameters is very small. The reaction time of the
of ± 1%, the temperature of ± 0.2 ℃, pH accuracy to 0.2. The data remote control aerator is within 100 ms, which meets the system design
collected from the sensor nodes are compared with the standard values. requirements. The system runs steadily under real-time on-site mon-
The data is shown in Table 4, Table 5 and Table 6, and the actual de- itoring, realizes the accurate monitoring and control of temperature, pH
ployment is shown in Fig. 10. value, dissolved oxygen and other aquaculture environmental factors,
The upload cycle of the sensor node is set to 30 min, and the packet as well as the network communication function of wireless sensors,
loss rate of the node is calculated according to the data obtained from which meets the requirements of aquaculture.
the cloud platform. The packet size is 40 bits, and the statistical date is
17:00 on September 1, 2018 to 11:00 on September 30. Among them,

8
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

Table 6 collection and coding. The data is reported to the cloud platform
Comparison of measured and standard values of no. 6 aquaculture pond. through the NB module via the core network, and the application layer
Date Parameter Time Standard Data received by the monitoring system calls the query interface in real time to realize the
values cloud platform and online remote monitoring of the breeding pond.
measured by sensor The above conclusions prove the stability and reliability of NB-IoT
nodes technology, the convenience of data acquisition and prompt command
Measured Relative
response, which can provide technical support and reference for the
value error/% technology in a wider range of fields such as agricultural
monitoring.With the help of the IoT telecom cloud platform, water
September 20, Temperature/℃ 0:00 26.27 26.23 –0.15 quality parameter data are stored at any time. Profile describing the
2018 12:00 24.82 24.79 +0.12
functions of the equipment is set and the codec plug-in for analyzing
(Moderate 20:00 23.90 23.92 +0.08
rain) DO/(mg·L−1) 0:00 5.90 5.92 +0.34 and processing protocol package is set. Finally, the binding of NB
12:00 7.12 7.77 +7.72 module equipment is completed to ensure the uniqueness and accuracy
20:00 6.82 6.91 +1.32 of data of different farming ponds. The monitoring system can issue
pH Value 0:00 8.21 8.22 +0.12
commands to control the aerator to the cloud platform at any time, and
12:00 8.47 8.48 +0.12
20:00 8.33 8.31 –0.24
then the platform codec plug-in can encode the commands and send
them to the hardware terminal to perform corresponding operations.
September 22, Temperature/℃ 0:00 24.65 24.66 +0.04 The results show that the reaction time of the remote control equipment
2018 12:00 25.14 25.10 –0.16 is within 100 ms, and the intelligent control of the aerator is realized.
(Cloudy) 20:00 26.64 26.67 +0.11
The above conclusions prove that NB-IoT technology is stable and
DO/(mg·L−1) 0:00 6.63 6.25 –5.73
12:00 8.17 8.08 –1.10 reliable, with convenient data acquisition and timely command re-
20:00 7.22 7.23 +0.14 sponse, which can provide technical support and reference for the
pH Value 0:00 7.10 7.01 –1.27 technology in a wider range of fields such as agricultural monitoring
12:00 7.33 7.32 –0.14
and water quality and environment prediction.
20:00 7.26 7.26 0
Although data collection and equipment control are achieved in this
September 29, Temperature/℃ 0:00 26.55 26.59 +0.15 paper, intelligent prediction is the development direction to solve the
2018 12:00 26.74 26.76 +0.07 problem of actual water quality production. In order to better play the
(Sunny) 20:00 28.00 28.05 +0.18 role of the Internet of things, we will integrate water quality and en-
DO/(mg·L−1) 0:00 6.80 6.45 –5.15
vironmental data collected by NB-IOT in the following research.
12:00 8.10 8.02 –0.99
20:00 7.22 7.21 –0.14 Machine learning methods such as the gradient boosting decision tree
pH Value 0:00 8.35 8.33 –0.24 (GBDT) and the long short-term memory network (LSTM) were used to
12:00 8.56 8.54 +0.23 establish the water quality prediction model and realize the rapid re-
20:00 8.38 8.39 +0.12
sponse online prediction application.
Author contributions Juan Huan contributed to the conception of
the study;
Hui Li proposed a constructive method in the previous study and
analyzed it. After receiving the referee's comments, Li Hui seriously
revised the article;
Fan Wu performed the data analyses and wrote the manuscript;
Weijian Cao contributed significantly to analysis and manuscript
preparation.

Declaration of Competing Interest

No conflict of interest exits.

Acknowledgments

This study is funded by the Chinese National Natural Science


Fig. 10. No.1 aquaculture pond node deployment diagram. Foundation (61803050) and the 2016 annual Liyang key research and
development project (modern agriculture) (LB2016003).

8. Conclusion References

In order to monitor the water quality of aquaculture ponds, this Anand, S., Regi, R., 2018. Remote monitoring of water level in industrial storage tanks
paper designs and develops a water quality monitoring system based on using NB-IoT. 2018 International Conference on Communication Information and
NB-IoT. In particular, it specifically designs and implements software Computing Technology (ICCICT). IEEE 1–4.
Cao, X., Li, Y., 2018. Data collection and network architecture analysis in internet of
and hardware such as terminal sensor nodes, background control
vehicles based on NB-IoT. 2018 International Conference on Intelligent
modules, monitoring applications, etc., and realizes remote monitoring Transportation, Big Data & Smart City (ICITBS). IEEE 157–160.
of aquaculture ponds and intelligent control of equipment such as Chen, C., 2018. Research on temperature monitoring system of electroplating production
line. Electroplating & Pollution Control. 38 (3), 58–60.
aerator. The developed system was installed in Changzhou fishery
Chen, J.H., Sung, W.T., Lin, G.Y., 2016. Automated monitoring system for the Fish Farm
breeding base, Jiangsu province,China. The main conclusions are as aquaculture environment. IEEE International Conference on Systems. IEEE 1–6.
follows: Deng, F., Wu, X., Li, B., Tao, W., Jun, L., 2018. Monitoring technology of farmland soil
The monitoring system adopts the NB-IoT technology deployment environment based on passive RFID sensor tag. Transactions of the Chinese Society
for Agricultural Machinery. 49 (8), 187–193.
network structure, and also uses sensor nodes to obtain water quality He, C.E., Shen, M., Longshen, L., Cedric, O., Ji, Y., Hong, S., 2018. Design and realization
parameters such as temperature, pH, DO, etc. to complete the data of a greenhouse temperature intelligent control system based on NB-IoT. Journal of

9
J. Huan, et al. Aquacultural Engineering 90 (2020) 102088

South China Agricultural University. 39 (2), 117–124. survey on recent developments and potential synergies. J. Supercomput. 68 (1), 1–48.
Jia, G., Han, G., Rao, H., Shu, L., 2017. Edge computing-based intelligent manhole cover Salim, T.I., Alam, H.S., Pratama, R.P., Anto, I.A.F., Munandar, A., 2017. Portable and
management system for smart cities. Ieee Internet Things J. 5 (3), 1648–1656. online water quality monitoring system using wireless sensor network. 2017 2nd
Khriji, S., Kanoun, O., El Houssaini, D., Viehweger, C., Jmal, M.W., Abid, M., 2014. International Conference on Automation, Cognitive Science, Optics, Micro Electro-
Precision irrigation based on wireless sensor network. Iet Sci. Meas. Technol. 8 (3), Mechanical System, and Information Technology (ICACOMIT). IEEE 1–7.
98–106. Schmidt, W., Raymond, D., Parish, D., Ashton, I.G.C., Miller, P.I., Campos, C.J.A., et al.,
Li, D., Yang, H., 2018. State-of-the-art review for internet of things in agriculture. 2018. Design and operation of a low-cost and compact autonomous buoy system for
Transactions of the Chinese Society for Agricultural Machinery 49 (1), 1–20. use in coastal aquaculture and water quality monitoring. Aquac. Eng. 141 (80),
Lorena, P., Sandra, S., Laura, García, Jaime, L., 2018. Design and deployment of low-cost 28–36.
sensors for monitoring the water quality and fish behavior in aquaculture tanks Shetty, S., Pai, R.M., Pai, M.M.M., 2018. Energy efficient message priority based routing
during the feeding process. Sensors 18 (3), 750–772. protocol for aquaculture applications using underwater sensor network. Wirel. Pers.
Lv, W., Zhao, J., 2018. Design of a high-precision and low-power temperature acquisition Commun. 1–24.
system based on NB-IoT. Chinese Journal of Sensors and Actuators. 31 (6), 836–840. Shi, B., Sreeram, V., Zhao, D., Duan, S., Jiang, J., 2018. A wireless sensor network-based
Ma, C., Zhao, D., Wang, J., Chen, Y., Li, Y., 2015. Intelligent monitoring system for monitoring system for freshwater fishpond aquaculture. Biosyst. Eng. 172, 57–66.
aquaculture dissolved oxygen in pond based on wireless sensor network. Transactions Song, Q., Guo, S., Liu, X., Yang, Y., 2018. Csi amplitude fingerprinting-based NB-IoT
of the Chinese Society of Agricultural Engineering 31 (7), 193–200. indoor localization. Ieee Internet Things J. 5 (3), 1494–1504.
Muangprathub, J., Boonnam, N., Kajornkasirat, S., Lekbangpong, N., Wanichsombat, A., Wang, S., Yang, Y., 2018. Intelligent street lamp management system based on NB-IoT.
Nillaor, P., 2019. IoT and agriculture data analysis for smart farm. Comput. Electron. Video Engineering. 42 (8), 143–146.
Agric. 156, 467–474. Wang, Y., Qi, C., Pan, H., 2012. Design of remote monitoring system for aquaculture cages
Nam, H., An, S., Kim, C.H., Park, S.H., Kim, Y.W., Lim, S.H., 2015. Remote monitoring based on 3g networks and arm-android embedded system. Procedia Eng. 29 (4),
system based on ocean sensor networks for offshore aquaculture. Oceans. IEEE 1–7. 79–83.
Osanaiye, O.A., Alfa, A.S., Hancke, G.P., 2018. Denial of service defence for resource Zhang, H., Li, J., Wen, B., Xun, Y., Liu, J., 2018a. Connecting intelligent things in smart
availability in wireless sensor networks. IEEE Access 6, 6975–7004. hospitals using NB-IoT. Ieee Internet Things J. 5 (3), 1550–1560.
Paramesh, J., Robin, C.R.R., 2018. A novel and efficient routing protocol for fishermen Zhang, X., Zhang, M., Meng, F., Qiao, Y., Xu, S., Hour, S.H., 2018b. A low-power wide-
using underwater wireless sensor network. J. Comput. Theor. Nanosci. 15 (4), area network information monitoring system by combining NB-IoT and LoRa. Ieee
1226–1232. Internet Things J. 1–7.
Rawat, P., Singh, K.D., Chaouchi, H., Bonnin, J.M., 2013. Wireless sensor networks: a

10

You might also like