Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 4, No. 2, 2022 21 Research and Development of Cellar Pool Environmental Monitoring System Based on NB‐IOT and Cloud Platform Yi Luo, Yan Shi College of Mechanical Engineering, Sichuan University of Science and Engineering, Yibin, Sichuan, 644000, China Abstract: NB-IOT and cloud platform technology are used to monitor the cellar pool environment, which is difficult to collect by hand. Under the zigbee self-organizing network, the system collects the parameters of the terminal nodes distributed in each cellar pool through a coordinator, and then sends them to the ali cloud internet of things platform for display and control through the nb-IOT communication module. Experiments show that the system can display the environment data of the cellar pool in real time and open the execution device outside the threshold range, which proves the practicability and convenience of the system. 1. The Introduction Chinese liquor has a long history. Traditional winemaking technology has been in existence for thousands of years. Among many wines, Chinese liquor stands out for its unique flavor. In the process of brewing Chinese white wine, temperature will affect the growth and metabolism of microorganism and the quality of metabolites, which will affect the flavor of white wine. Therefore, the research and monitoring of temperature and carbon dioxide concentration during alcohol fermentation is worth studying in the brewing industry. At present, the method of obtaining cellar temperature and carbon dioxide concentration in most Chinese wine enterprises is relatively backward, and the parameter information mainly relies on manual measurement by workers to obtain data. This acquisition method not only cannot achieve real-time monitoring, but also has a relatively large error and low credibility, and can not provide reliable guidance basis for the next production. In this context, it is the only way for traditional handicraft industry to brew liquor by integrating modern science and technology into it and forming new industrial production [1]. In the Twelfth Five- Year Plan of the Chinese liquor industry [2], it was emphatically put forward that the Chinese liquor industry should guide production from experienced understanding to scientific organization based on production transformation. Domestic and foreign scholars have actively explored and studied the automation of liquor brewing. Gao Chang [3] explored the variation rule of carbon dioxide concentration in alcohol fermentation process through experiments, in order to master the parameters of reactive fermentation process. Liu Gang [4] designed a set of remote temperature and humidity monitoring system for brewing room by using radio frequency chip SI4463 and microprocessor stm32[5], achieving the purpose of monitoring the whole system through the upper computer software. Wang Xudong [6] conducted near-infrared spectrum calibration modeling for online detection of glucose concentration in ethanol fermentation, so as to quickly and effectively detect the changes of various parameters in the fermentation process. Based on embedded and wireless sensing technologies, Li Suiqun [7] designed a visualization system for liquor solid state fermentation temperature and conducted visualization processing on the measured data. LucianoBoquete, RafaelCambralla et al. [8] introduced a low-cost and highly general temperature monitoring system, which can use ZigBee to transfer the digital memory of temperature data to the control center for processing and display. B Sainz, J Antolin [9] et al. proposed a multi-functional low-cost sensor for temperature control of wine fermentation process, which can transmit data in real time and stably to the mobile or fixed equipment of the viticulturist through a wireless module. Therefore, based on cloud platform, NB-IOT narrowband technology and zigbee technology, this design realizes real- time monitoring of the cellar environment through data acquisition of the terminal and wireless communication of the mobile and web terminals. 2. Design the Overall System Scheme The system includes the collection layer using sensors to collect data, the network transmission layer to realize data receiving and sending and the application layer to monitor the data, the data analysis, reasonable control of industrial air conditioning and fans to make the temperature and carbon dioxide concentration of the cellar in the best range. According to the actual situation in the cellar, after planning in the cellar, lay out the temperature sensor node and carbon dioxide sensor node, and install the two sensors on the corresponding ZigBee modules. Then a coordinator node is set. In the zigbee AD hoc network, several terminal nodes transfer the data collected by the sensor to the coordinator node. According to the network structure, the coordinator node then upload the received data to the Ali Cloud server under the NB-IOT communication module through the serial port to display the relevant data. The staff analyze the obtained data of the cellar and control the execution device to achieve the best monitoring of the cellar environment. 3. System Hardware Design 3.1. Zigbee module The core board module of the terminal node and the coordinator node in this design scheme is the same. The zigbee core board uses CC2530 produced by Texas Instruments as the chip, which has the characteristics of low 22 cost, low power consumption and AD hoc networking, and can transmit data in a large range and a long distance, which is suitable for the data collection of the cellar. It is fully compatible with the 8051 kernel and supports the IEEE 802.15.4 radio frequency microcontroller. The CC2530 can access SFR, DATA and main SRAM memory in a single cycle, and some interrupts can wake up the CC2530 in idle mode or sleep mode, which is the specific performance of zigbee energy saving. The Flash memory space of CC2530 can be selected in various ways, including 32KB, 64KB, 128KB and 256KB respectively. For example, the CC2530F256 selected in this scheme has 256KB flash memory, which can satisfy the sending and receiving of data collected by terminal nodes. External 32MHz and 32.768KHz crystal frequencies connected to XOSC32M-Q2 and XOSC32M-Q1 interfaces and P2-3 and P2-4 interfaces are selected for CC2530. The 32MHz external crystal oscillator provides the master clock for the CC2530 to ensure the stable operation of the chip. The external crystal oscillator of 32.768KHz provides an accurate and stable clock signal for CC2530 and provides timing sleep and wake up for zigbee terminals to achieve low power consumption. The schematic diagram of Zigbee core board is shown in Figure 1. Figure 1. Zigbee core board schematic 3.2. Sensor The values monitored by the whole system are the temperature and carbon dioxide content in the fermentation process of the cellar. The temperature is measured by ds18b20 sensor, which is a single-bus digital temperature sensor and can directly output the digital temperature signal, which can be transmitted to the CPU through the one-line bus serial, and the CRC check code can be transmitted at the same time. With strong anti-interference and error correction ability, the test temperature range is as follows: -55 ℃ -125 ℃ , has the advantages of small volume, high precision. Carbon dioxide content is measured by RBY-CO2 sensor, which is an analog sensor with power supply voltage: +5V. The AOUT pin interface is the analog output. The gas quantity detected by the chip corresponds to the change of voltage value. The DOUT pin interface is a digital output quantity, which is the result of the comparison between the output voltage value of AOUT and the adjustable resistor. The output semaphore 0 and 1, the adjustment module can adjust the resistance. When the output voltage of the adjustable resistor is less than AOUT, the DOUT output high level, and the LED light is on; Otherwise, the DOUT output is low and the LED light is off. 3.3. NB-IOT Communication module Similar to common TDU devices, NB-IoT devices also use serial ports to communicate directly with the MCU. CoAP is shorthand for Constrained ApplicationProtocol. In the current world of PCS, information is exchanged over TCP and the application layer protocol HTTP. But for small devices, implementing the TCP and HTTP protocols is obviously too much to ask. The CoAP protocol was designed to allow small devices to access the Internet. CoAP is an application-layer protocol that runs on top of UDP rather than TCP like HTTP. CoAP protocol is very small, the smallest packet is only 4 bytes. In this mode, the terminal device of the user can send request data to the specified CoAP server through this module, and then the module receives the data from the CoAP server, analyzes the data and sends the result to the serial port device. Users do not need to pay attention to the data conversion process between serial port data and network data packets, and can realize the data request from the serial port device to the CoAP server through simple parameter Settings. NB-IOT has so many advantages.(1) Repeated transmission, extending the transmission time of the message number. The repeated transmission of the symbol is actually the simplest channel encoding. Although the transmission rate of the message is reduced, the reliability of demodulation or decoding is more effective, especially in the receiving environment with low signal-to-noise ratio. For example, if you want to decode the error probability is 10%, the number of repeats increases, making the overall decoding error probability greatly reduced. (2) Existing TTI bundling and HARQ retransmission technologies can also extend message cell transmission times. The related enhancement of coverage values has been shown to improve signal coverage effectively in VoLTE's commercial network practice. (3) In view of the low rate required by NB-IoT business, most of the business can be realized around 100 bps. Therefore, low-order modulation technologies such as BPSK, 23 QPSK and CRC check code with shorter length can be adopted. (4) In terms of coding, NB-IoT adopts Turbo coding, while GPRS adopts convolution code. The advantages are reflected in the reduced demand for decoding signal-to-noise ratio, and the corresponding coverage distance is enhanced by 3-4 dB. (5) The reduction of delay requirements and the use of Power Boost in some downlink physical channels have direct enhancement of signal coverage. A single sector of NB-IoT can support tens of thousands of connections, supporting low latency sensitivity, ultra-low equipment cost, low device power consumption, and optimized network architecture. NB-IoT has 50-100 times more uplink capacity than 2G/3G/4G, and it can provide 50-100 times more access than existing wireless technologies with the same base station. Below the frequency of 200KHz, a single base station cell can support 50,000 NB-IoT terminals based on simulation test data. Although two-way data penetration is supported, it is different from the traditional 2G network. In order to save power, the module can send data to the server at any time, but the server cannot send data to the serial port at any time. For the explanation, read the low-power mode chapter carefully, which is also a feature of NB-IoT network. Considering that the bad environment of the cellar is not suitable for wired network access, the NB-IOT wireless network technology is chosen. The data collected by the terminal node is transmitted to the coordinator node under the zigbee autonomous network, and then connected to the NB-IOT module through serial port. Finally, the MQTT protocol based on the TCP protocol is further encapsulated to communicate with Aliyun Internet of Things platform. BC26 module developed by Mediatek based on MT2625 chip platform is adopted in this design scheme. The required typical voltage value is 3.3v, and the operating temperature is between -40� and 85�. It can work normally at a higher temperature. The specific access methods are as follows: 1. Screw the antenna, insert the Internet of Things card and set the mode to A (auto); 2. Connect the serial port with the baud rate of 115200 and send AT command through the serial port; 3. To a certain extent, it solves the problem that the terminal equipment needed for the cellar needs to communicate at a long distance. 3.4. Power module The power supply circuit uses a 10uF capacitor, which makes the circuit more gentle. The power supply can be supplied in two ways: one is 1300mA rechargeable lithium battery with a voltage of 3.3v; the other is USB direct power supply. As shown in Figure 3, the power supply adopts AMS1117 forward low-voltage drop regulator, DC 5v to 3.3v switching power supply, 3.3v is directly connected to the board through the switching power supply. Figure 2. Power circuit diagram 4. System Software Design The zigbee module and bc26 module of the software part are developed in IAR Embedded Workbench software using c language. 4.1. Zigbee Terminal node ZigBee technology is a new type of technology, it recently emerged, mainly relies on wireless network transmission, it can be close to the wireless connection, belongs to the wireless network communication technology. In the transmission of data information as the carrier, ZigBee technology is the main technical index, it is relatively safe to use, and its strong capacity, is widely used in human daily communication transmission. First, the real life data information transmission is based on the ZigBee wireless sensor technology as the communication network, can establish a lot of network connection points, and rely on the network auxiliary device can also be real-time transmission of data communication. Therefore, data transmission with large information capacity is the main feature of ZigBee technology. In order to avoid signal collision and unstable transmission during data transmission, it adopts an efficient collision avoidance mechanism to better ensure the safe transmission of data. Another advantage of ZigBee technology is that the compatibility performance is very strong, in the operation, can connect to the control network in the family, and there will be no collision, can be well integrated with the network. Second, the duration of the ZigBee system is not long, it takes 15 to 30 minutes to start its communication operation, in such a short time, the system can quickly receive all the information sent by the user, and in the use of ZigBee technology, its working time is very short, the energy consumption is very low, can save the cost of sustainable development. When ZigBee sends and receives information, each node can save electricity very well. The working hours can last one to two years and meet the common needs of each family. In general, ZigBee technology has many advantages. As a new technology, it is widely used in many network technologies. For the temperature sensor and carbon dioxide content sensor required by this design, each sensor will obtain a zigbee terminal. After waiting for the coordinator node to initiate network initialization, the terminal node actively scans the coordinator after powering-on, obtains the information of the coordinator after scanning and sends the associated request to the coordinator. The coordinator immediately replies the confirmation frame to the terminal 24 node after receiving it, and the terminal node will wait for a period of time. This time is waiting for the coordinator to process the request for the terminal node to join. The coordinator assigns a short address to the end node and generates a connection response command containing the new address and connection success status. After that, the terminal node successfully connects to and communicates with the coordinator. 4.2. Zigbee coordinator node The coordinator is the information convergence point of each terminal node. The coordinator finds the appropriate channel after sending the beacon request command and setting a scan period. When a terminal node successfully requests to join the network, a unique 16-bit network address will be automatically assigned and the address of the terminal node and updated data will be stored. The coordinator collects the data from the terminal node and transmits it to the NB- IOT module through the serial port. 4.3. Aliyun Internet of Things platform The configuration of cloud server environment includes the configuration of Alibaba Cloud Internet of Things cloud platform. The data collected by the device can be securely and reliably communicated with the Internet of Things cloud platform by MQTT protocol. Connecting to Alicloud Internet of Things platform requires initialization of products and devices, and the triplet information obtained includes product key ProductKey, device name DeviceName and device key DeviceSecret. Data can be transmitted only when the triplet information matches the device. 5. System Test and Analysis cloud platform is an open Internet of Things cloud platform of China Mobile Internet of Things. The communication protocols include public protocols and private protocols, among which the public protocols include EDP, MQTT, HTTP and other access protocols. Its distinction between public and private protocols provides users with a variety of choices. Its user-friendly design proves that it is a powerful cloud platform for the Internet of Things. The following sections will introduce EDP and other protocols respectively. EDP protocol: It is a long-connection protocol developed by OneNET cloud platform in order to better realize the connection between objects and the Internet. This protocol provides functions such as data transmission, device access and command receiving. The advantages and functions of this protocol are as follows: device data upload, command parsing and long-connection protocol; It can realize floating type, whole point type, string type, binary, JSON and other end-to- end data forwarding. MQTT protocol: It is an instant communication protocol provided by OneNET cloud platform for Internet of Things applications. This protocol can identify load content, thus cutting off message transmission and reducing network traffic consumption; It supports data point upload, individual command delivery, and service push. Messages between devices can be unicast or multicast. Support for data types including string, integer, floating point, JSON, etc. RGMP protocol: Private protocol. It is a protocol proposed by OneNET in order to protect the security of user equipment data and simplify the development process. The difference between private protocol and other open protocol is that developers need to obtain SDK source code according to the device data model set by themselves when connecting device platforms. The OneNET platform officially does not provide the corresponding message format of protocol. Then, you embed the source code into the device yourself to achieve the docking between the device and the platform. Proprietary protocols are suitable for data confidentiality, and have good real-time performance, flexible service data types, and high data transmission efficiency. HTTP protocol: Following the principle of Restful access to the platform, convenient for developers debugging; It is suitable for data interconnection between platforms, fast access of devices, lightweight and upper-layer application access. The protocol has access authentication and control command delivery functions. The HTTP protocol uses short connection protocol and has good terminal data point reporting function, supporting plastic data, floating point data, string data, JSON data, and other data. Binary data and other data types; Provides methods for configuring resources, such as POST and GET. After the software and hardware of the system are set up, the terminal node and coordinator node are arranged in the cellar pool of a winery in Yibin. The length and width of the cellar are about 30m×10m respectively. A terminal node is placed in each cellar. Finally, the data of each cellar is received by the coordinator. In order to test its performance, after the whole system is powered on, the terminal node is deliberately heated. When the temperature exceeds the set threshold, the controller control relay switch turns on the industrial air conditioner. Figure 3 shows the values of temperature and CO2 concentration remotely displayed on the cloud platform. The test results show that the system can complete the real-time monitoring of the parameters of the cellar and deliver the control. Figure 3. Cloud platform 25 6. Closing Remarks The NB-IOT based cellar environment monitoring system designed in this paper collects cellar parameters through zigbee terminal nodes and transmits them to Ali Cloud server through the coordinator to realize accurate and efficient monitoring of the cellar environment. Compared with the traditional cellar by manual parameter acquisition, this system has more flexibility and higher degree of automation. It has a certain reference role and reference value for the development and implementation of the real-time monitoring system of the cellar environment, and has important significance for the reliability and convenience of agricultural intelligent production. References [1] China's 12th Five-Year (2011-2015) Development Plan for brewing Industry. [2] Su Jinlan, Xu Baitian, Lin Pei. Research on the development of Chinese liquor flavor [J]. Brewing Science and Technology,2017(8) : 102-111. [3] SU M. Overview on the development of industrialization and mechanization of traditional liquor brewing [J]. Wine Science and Technology, 2020, 308(2): 87-91. [4] GAO C. Study on changes of carbon dioxide concentration in wine alcohol fermentation process [D]. Northwest A&F University, 2000. [5] LIU G. Design and implementation of wine brewing monitoring System [D]. University of Electronic Science and Technology of China, 2015. [6] WANG X D. On-line monitoring and calibration modeling of ethanol fermentation process based on near infrared spectroscopy [D]. Dalian University of Technology, 2019. [7] Li Suiqun, Gao Xiang, Ju Jinwu, et al. Research on visualization analysis system of liquor solid state fermentation temperature [J]. Brewing Science and Technology, 2020, 312(6): 26-29. [8] Boquete L , Cambralla R , JM Rodríguez-Ascariz, et al. Portable system for temperature monitoring in all phases of wine production[J]. Isa Transactions, 2010, 49(3):270-276. [9] Sainz B , J Antolín, M López-Coronado, et al. A Novel Low- Cost Sensor Prototype for Monitoring Temperature during Wine Fermentation in Tanks[J]. Sensors (Basel, Switzerland), 2013, 13(3).