Keywords

1 Introduction

Due to the changeable climate and environment of the Earth, People’s Daily production and life are greatly affected. In order to obtain meteorological data accurately and timely, meteorological stations are established all over the world for meteorological monitoring [1]. In order to develop meteorological monitoring, our country has also made great efforts to build meteorological stations, most of which are centralized and the system used is relatively backward. Because there are many manufacturers of domestic weather stations, their quality is mixed and their technology is uneven, so there is no certain standard for meteorological data. In addition, China has introduced a variety of foreign weather stations for direct application. Due to geographical and human factors [2], these weather stations are really not suitable for China’s actual situation.

The rapid development of Internet of Things (IoT) technology has triggered more scholars to explore the application of NB-IoT in industrial and commercial fields. The current wireless data transmission modes, such as WiFi and Bluetooth modes, have a series of disadvantages, such as high power consumption and unstable data transmission efficiency [3, 4]. The existence of this phenomenon makes it necessary for the Internet of Things to study a new wireless data transmission technology to solve the above disadvantages [5]. NB-IoT technology is well suited for data transmission in IoT related applications. Driven by operators and device manufacturers, it has developed rapidly, and in a very short period of time [6], pilot projects have been opened in many cities. It can be seen that NB-IoT technology has developed rapidly in a very short period of time, from project landing to pilot in a very short time. The biggest factor is that NB-IoT technology has the advantages of low power consumption, low cost and long distance.

In this paper, STM32L051C8T6 development board is used as the master controller to connect with the weather sensor, and NB-IoT technology is used for wireless communication to optimize the traditional weather station. The main work is as follows:

  1. (1)

    Design a low-consumption system scheme, so that the system can keep running for a long time, low power demand.

  2. (2)

    Solar panels and ultracapacitors are used to construct energy capture and storage of the system, and NB-IoT wireless communication module is built based on BC35 series chips, which has the characteristics of low cost and stable communication.

  3. (3)

    The cloud platform for data upload to the Internet of Things is realized to provide an interface for real-time acquisition of meteorological data, with the goal of building smart weather.

2 Related Work

Literature [7] proposes a multi-functional integrated weather station, which is mainly applied to precision agriculture and urban climate. Compared with the reference station, it is very consistent in most standard weather variables, and has the characteristics of low cost, low maintenance cost and low power demand. Literature [4] proposes portable automatic weather station, which is mainly used to measure glaciers, and includes three important components: The data recorder records wind direction, wind speed, relative humidity, atmospheric pressure, freezing temperature, temperature, solar radiation meteorological elements. The power system consists of a 10 W, 20 × 30 cm solar panel. The tripod is made of carbon fiber and stainless steel, a recyclable material. Literature [8] proposes the ZigBee-based intelligent weather station, which is mainly used to provide data for weather prediction. It is composed of the measurement unit based on the SiLab C8051F020 microcontroller to measure the data of temperature, relative humidity, atmospheric pressure and solar radiation, which is sent to the base station by the XBee module. Then the base station will store the data to the Access database. Literature [9] based on Internet of things technology and automatic meteorological monitoring system, embedded system is mainly used in monitoring of air and weather conditions, to collect the meteorological data such as temperature, relative humidity and atmospheric pressure, and then sends the data to the remote application or database, finally the data, can be in the form of graphics and tables to visualize, Provides remote access and mail alerts. Literature [10] proposes wireless portable meteorological monitoring station, which is mainly used to collect weather data and provide shared data. The meteorological sensor is connected with THE PIC16F887 microcontroller to measure wind speed, wind direction, relative humidity, atmospheric pressure, rainfall, solar radiation, ground and environmental temperature, and the industrial standard Modbus communication protocol is realized. Upload data to the online MYSQL data server for data sharing. Literature [11] is proposed based on NB-IoT communication model and the Internet of things technology of automatic meteorological station, is mainly used in intelligence, wisdom, meteorological city, based on the technology of digital sensors and independent power supply, intelligent sensor run independently and wireless data transmission, data through data platform for data analysis, data interface for networking meteorological information.

In this paper, the NB-IoT wireless data transmission technology is adopted to optimize the weather station and upload the acquired data to the cloud platform for users to monitor the meteorological data in real time [12]. The research results solve the disadvantages of traditional weather stations to a certain extent, and have a certain research significance for the development of weather stations and NB-IoT.

3 Hardware Design

The hardware design of intelligent weather station based on NB-IoT is BME680 sensor, ZPH02 dust sensor, VEML6070 ultraviolet sensor used to collect data, and the main controller module STM32L051C8T6 is used to ensure the stability of data transmission [13], signal control order, and program implementation efficiency. The energy capture module uses 3 W 9 V small solar panel to capture energy, and the NB-IoT wireless communication module uses BC35G chip to transmit data to the Cloud platform of the Internet of Things (Fig. 1).

Fig. 1.
figure 1

Overall hardware architecture

The main controller module is the core of the whole hardware. It is connected with the data acquisition module through the serial port to collect meteorological data. The main controller module is connected to the wireless data transmission module to realize data uploading to the cloud platform [7]. As for the main controller module, STM32L051C8T6 development board is selected, which can carry out high-speed data processing under the condition of low power consumption and is equipped with high-speed embedded storage and memory protection unit and rich input and output data interfaces. In order to ensure the stable operation of the hardware part of the system, it is necessary to design the circuit, and the stable voltage required by each device is different. The design of low-power system is carried out. The main controller of STM32L051C8T6 uses 1.8 V voltage. The working voltage of NB-IoT wireless communication module is 3.3 V; BME680 sensor and VEML6070 sensor in the data acquisition module need 3.3 V working voltage, while ZPH02 sensor needs 5 V power supply; The MICROcontroller uses XC6206P182 ultra-low pressure difference 1.8 V LDO to supply power; The sensor and wireless communication module use the automatic pressure raising chip TPS63070, and the PM2.5 sensor needs 5 V power supply. To sum up, the system circuits need to be designed to allow each module to operate at a normal operating voltage (Fig. 2).

Fig. 2.
figure 2

Circuit design of voltage regulation scheme

The energy capture module uses a 3 W 9 V small solar panel to capture energy, and two 2.8 V 3000 F supercapacitors in series to store energy. The LM2596S stabilized power module can stabilize the output voltage of the supercapacitor. The NB-IoT wireless communication module selects BC35G chip, which has the characteristics of wide coverage, low power consumption, low cost and large connection. It can transmit the data in the data acquisition module to the Cloud platform of the Internet of Things. In the data acquisition module, BME680 sensor was used to detect temperature and humidity, air pressure and smoke resistance, ZPH02 dust sensor was used to collect PM2.5, and VEML6070 ultraviolet sensor was used to detect ultraviolet. The hardware PCB design of the system adopts AD20, which ensures the normal working voltage of the whole system module when the main control board is designed. In addition, the pins of the main controller are directly set out to facilitate the access of the data acquisition module. In order to ensure the small size of the intelligent weather station, the SIM card slot is welded on the back of the PCB board (Fig. 3).

Fig. 3.
figure 3

System PCB

4 Software Design

In the system software design stage, mainly including: data acquisition module design, low power design, NB-IoT wireless communication module design. On the basis of low-power design, the data acquisition module collects temperature, relative humidity, atmospheric pressure, smoke resistance, PM2.5, ultraviolet data and transmits it to the Cloud platform of the Internet of Things through the NB-IoT wireless communication module to realize data storage.

4.1 Data Collection Module

Temperature, relative humidity, atmospheric pressure, smoke resistance collection: The SDA and SCL of BME680 sensor in the data acquisition module communicate with the IIC interface of PB15 and PB13 of the master controller respectively. When PB15 and PB13 are used as the IIC bus interface, the IIC working mode needs to be configured for MCU. Turn on the GPIO Clock using the built-in firmware library function RCC_APB2Periph Clock Cmd() and set PB15 and PB13 to IIC mode with GPIO_Init struct.pin. At the same time, use GPIO_Init struct. Speed to set the transfer Speed to GPIO_SPEED_FREQ_LOW, use gpio_initstruct. Mode to set the open output Mode, and use HAL_GPIO_Init() to initialize the GPIO port. Collect environmental parameters after port configuration (Fig. 4).

Fig. 4.
figure 4

Flow chart of BME680 sensor subsystem

Collection of PM2.5 concentration: The COLLECTION of PM2.5 concentration is mainly connected to the PA2 pin of the main controller module through the RX pin of the ZPH02 dust sensor. The pin outputs electrical signals in serial port mode, which is converted into digital signals through the A/D of the main controller, and outputs the CONCENTRATION of PM2.5 after processing. PM2.5 detection procedures are as follows:

figure a

Ultraviolet parameter collection: In the design of ultraviolet data acquisition program, the VEML6070 ultraviolet sensor itself can directly convert the ultraviolet light sensitivity into digital signal. VEML6070 UV sensor detection procedures are as follows:

figure b

4.2 Low Power Solution

The main function module is the program design of the whole main controller module to control other devices, which is mainly reflected in two aspects of system power consumption processing and data processing. The program design of the main controller module mainly realizes the clock setting, the use of serial port initialization and the process of data sending and receiving. After the system is powered on, the clock and peripherals of the system are automatically initialized. After that, the low-power mode of the system exits, and RTC is used for periodic wake up. After wakeup, I/O and peripherals to be used are reconfigured to send data. After the data acquisition module obtains the environmental data from the area to be tested, data transmission is carried out through IIC communication or UART communication.

In the design of low power consumption, wireless data transmission is adopted. The single chip microcomputer turns off the power of The ZIGBEE module, sets all IO except the burning port to analog input mode, and turns off the clock of all peripherals. Then the single chip microcomputer enters the STOP mode and uses RTC to wake up at a certain time. Wake up and reconfigure IO and peripherals to be used and send data.

4.3 NB-IoT Wireless Communication Module

The NB-IoT module connects to the Cloud platform of the Internet of Things. The implementation code is as follows:

figure c

The wireless data module needs the CoAP protocol to transmit data to the cloud server, and the BC35G device is designed to register with the route T/R of the Cloud server of the Internet of Things. The CDP server subscribes to the T/D resources of the BC35G device and waits for the BC35G device to send CoAP instructions to it. If the BC35G device receives the +NMGS instruction, it transmits data to the CDP server through the CoAP instruction.

The CDP server serves as the CoAP client and the BC35G serves as the CoAP server. The CDP server sends downlink data to the T/D resource of the BC35G device through THE POST method.

5 Tests and Results

After the design and implementation of the software and hardware of the system, the design of energy capture module, data acquisition module, main controller module and wireless communication module is completed. In order to verify the feasibility and stability of the system in practical application, we need to test the data collection, NB-IoT communication and power consumption of the system.

Comparing the temperature data collected by the sensor with the readings of the traditional thermometer, it is found that the readings are basically the same, and the humidity, pressure, smoke resistance, PM2.5 and ULTRAVIOLET data are basically the same as the data obtained by the traditional weather station (Table 1).

Table 1. Part of the data

5.1 Collect Data

Before the system data acquisition test, you need to use multimeter on every pin detection circuit of the system, respectively, in order to confirm whether can normal between circuit electricity, and need to check each device in the circuit board welding in normal state, the electricity, note that each sensor, the main controller and wireless communication module if there is a fever more serious phenomenon, To ensure the normal operation of the hardware circuit, the data acquisition function of each sensor is tested.

5.2 Wireless Communication Module Data Transmission Test

As the terminal software is programmed to upload data once every minute (for the convenience of testing, usually once an hour), after testing, the data collected by the data acquisition module can be normally uploaded to the cloud platform within a certain collection time through the wireless communication module after being processed by the primary controller.

5.3 System Power Test

The solar energy capture module is connected to the data acquisition module, and the 3W9V solar panel is used to capture the electricity, and two 2.8 V 3000 F supercapacitors are used to store the electricity, so as to realize the long-term automatic power supply of the system, which has a very long battery life and low maintenance cost.

Through the current test of the whole system, the electricity situation table of the system is obtained (Table 2).

Table 2. System power usage

6 Conclusion

Through the design and development of hardware and software, the NB-IoT meteorological monitoring station is realized. The hardware is composed of standard weather sensors and interfaces with the STM32L051C8T6 master controller to detect temperature, humidity, air pressure, smoke resistance, PM2.5 and ULTRAVIOLET data in the environment, and upload the data to the cloud platform of the Internet of Things through the NB-IoT wireless transmission module. In the design, solar panels and ultracapacitors are used to build the energy capture module of the system [14], NB-IoT wireless communication module is built based on BC35 series chips, and a low-power system scheme is designed with the characteristics of low cost, low power demand, low maintenance cost and easy to use [15, 18]. Future research directions are as follows:

Solar energy capture method is adopted in this system design, and the volume of ultracapacitors is large. In addition, solar energy capture is easily affected by weather, so a more environmentally friendly power generation method can be adopted in subsequent studies.

Add the NB-IoT wireless data transmission module to the storage system to prevent the failure of data uploading to the cloud platform due to network connection failure.