Infrared sensor relay system based on Lora

文档序号:1893003 发布日期:2021-11-26 浏览:18次 中文

阅读说明:本技术 一种基于Lora的红外传感器中继系统 (Infrared sensor relay system based on Lora ) 是由 时峰 陈宣林 毛家旺 袁齐坤 湛留洋 张海东 张宇雄 刘有胜 邓中原 秦红湖 李 于 2021-07-26 设计创作,主要内容包括:本发明是一种基于Lora的红外传感器中继系统,包括中继器、若干温度检测装置和后台服务器;若干温度检测装置与后台服务器之间通过中继器组网进行通讯连接;其中,所述中继器包括MCU微控制单元、NAND存储模块、Lora无线通讯模块和电源模块;MCU微控制单元与Lora无线通讯模块双向电连接,MCU微控制单元的数据IO口双向连接有NAND存储模块,MCU微控制单元的供电端与电源模块连接;MCU微控制单元的输入端与若干温度检测装置的输出端连接。本发明能耗低,传输速度快,发热低,特别适用于高压电场环境;本发明外接多种协议模块与接口,具有各种传感器数据的接入和其他设备与网络云端通信的功能。(The invention relates to an infrared sensor relay system based on Lora, which comprises a relay, a plurality of temperature detection devices and a background server; the temperature detection devices are in communication connection with the background server through a repeater network; the repeater comprises an MCU (microprogrammed control unit), an NAND storage module, a Lora wireless communication module and a power module; the MCU micro control unit is in bidirectional electric connection with the Lora wireless communication module, a NAND storage module is bidirectionally connected with a data IO port of the MCU micro control unit, and a power supply end of the MCU micro control unit is connected with the power supply module; the input end of the MCU micro control unit is connected with the output ends of the plurality of temperature detection devices. The invention has low energy consumption, high transmission speed and low heat emission, and is particularly suitable for the high-voltage electric field environment; the invention is externally connected with a plurality of protocol modules and interfaces and has the functions of accessing various sensor data and communicating other equipment with a network cloud.)

1. The utility model provides an infrared sensor relay system based on Lora which characterized in that: the infrared sensor relay system based on the Lora comprises a relay, a plurality of temperature detection devices and a background server; the temperature detection devices are in communication connection with the background server through a repeater network; the repeater comprises an MCU (microprogrammed control unit), an NAND storage module, a Lora wireless communication module and a power module; the MCU micro control unit is in bidirectional electric connection with the Lora wireless communication module, a NAND storage module is bidirectionally connected with a data IO port of the MCU micro control unit, and a power supply end of the MCU micro control unit is connected with the power supply module; the input end of the MCU micro control unit is connected with the output ends of the plurality of temperature detection devices.

2. The Lora-based infrared sensor relay system of claim 1, wherein: the IO port of the MCU is further connected with a 4G wireless module and a Bluetooth module, and the repeater can enable the temperature detection devices, the handheld terminal and the background server to be in communication connection through the repeater network through the 4G wireless module and the Bluetooth module.

3. The Lora-based infrared sensor relay system of claim 2, wherein: the work of the infrared sensor relay system based on the Lora comprises the following steps:

step 1, initializing a system;

step 2, relay configuration, namely confirming the configuration information of the relay after the system is initialized, if the configuration information is not configured, clearing data in the EEPROM, detecting the SD card, and printing the related SD card information; reporting data every 5s, checking whether the data is in a state of waiting for the response of the background server before reporting the data, returning to continue waiting if the data is in the state of waiting for the response of the background server, and sending the data in the queue or the SD card to the background server if the data is not in the state of waiting for the response of the background server; when the repeater is in a state of waiting for background response, if 5s does not receive a background server response frame, judging that the time is out, storing data into a queue, and if the queue is full, storing the data into an SD (secure digital);

step 3, judging the data type, namely judging whether the frame is a 4G frame or a Bluetooth frame when the relay receives the frame sent by the background server or the Bluetooth module so as to respond by using a corresponding serial port; processing the received frame, firstly detecting whether the frame format is correct or not, reporting an error if the frame format is incorrect, if the relay address is not configured, reporting an error if the relay address is not configured, ensuring that the relay address is configured firstly for other operations, and after the relay address is configured, responding different operations according to different function codes of the information frame;

step 4, data reporting, namely after the repeater receives the data frame sent by the temperature detection device, changing the reporting period of the front end according to the temperature in the data frame; when the temperature is lower than 30 ℃, the reporting period is 30min, when the temperature is higher than 30 ℃ and lower than 50 ℃, the reporting period is changed to 15min, and when the temperature exceeds 50 ℃, the reporting period is changed to 1 min.

4. The Lora-based infrared sensor relay system of claim 3, wherein: the function code in step 3 comprises: 0x21H configuration relay address pool, 0x22H timing, 0x23H data response frame, 0x24H configuration temperature detection device command frame, 0x25H read relay address, 0x26H read configured temperature detection device information, 0x27H read relay time, 0x28H delete temperature detection device configuration information, 0x2FH initialization.

5. The Lora-based infrared sensor relay system of claim 2, wherein: the handheld terminal adopts a smart phone and a pad which are provided with corresponding APPs; the handheld terminal completes interaction with the repeater through a protocol, and the 4G module on the repeater is configured, so that data of the temperature detection device received by the repeater can be forwarded to a background server and a server designated on a network through the 4G module; the repeater may also accept data from a designated server on the network and forward the information to the handheld terminal.

6. The Lora-based infrared sensor relay system of claim 1, wherein: the infrared sensor relay system based on the Lora comprises an application layer, a service logic layer, a function module layer, a system kernel layer and a hardware layer, wherein the application layer has functions of data acquisition, relay communication, real-time temperature monitoring and real-time rainfall data monitoring; the service logic layer comprises a system initialization service, an MQTT communication service, an MESH communication service and a data acquisition service; the functional module layer comprises a system initialization module, an AT module, an MESH module and a data acquisition module; the system kernel layer comprises the line layer management, the interruption management, the memory management, the clock management, the synchronization and the communication; the hardware layer comprises a URAT serial port, an I2C bus and an SPI bus.

7. The Lora-based infrared sensor relay system of claim 1, wherein: the power supply module adopts a 5V storage battery for power supply and adopts a solar charging module for charging.

8. The Lora-based infrared sensor relay system of claim 1, wherein: the temperature detection device comprises a sensor, a temperature difference power generation device and an AD conversion module; wherein the sensor comprises a rainfall sensor and a temperature sensor; the output end of the temperature difference power generation device is connected with the power supply end of the sensor, and the temperature difference power generation device adopts liquid metal as a heat-conducting medium; the AD conversion module adopts a high-precision 16-bit AD conversion module.

9. The Lora-based infrared sensor relay system of claim 1, wherein: the infrared sensor relay system based on the Lora comprises an application layer, a service logic layer, a function module layer, a system kernel layer and a hardware layer, wherein the application layer has functions of data acquisition, relay communication, real-time temperature monitoring and real-time rainfall data monitoring; the service logic layer comprises a system initialization service, an MQTT communication service, an MESH communication service and a data acquisition service; the functional module layer comprises a system initialization module, an AT module, an MESH module and a data acquisition module; the system kernel layer comprises the line layer management, the interruption management, the memory management, the clock management, the synchronization and the communication; the hardware layer comprises a URAT serial port, an I2C bus and an SPI bus.

Technical Field

The invention belongs to the technical field of communication, and particularly relates to an infrared sensor relay system based on Lora.

Background

Relaying is an efficient data transmission technique that can quickly and inexpensively transmit digital information in one-to-one or one-to-many applications. It can be used for voice, data communications, both for Local Area Network (LAN) and Wide Area Network (WAN) communications. Each relay user will get a dedicated line to the relay node. A relay network handles data transmission with other users for the end user through a channel that changes frequently and is not visible to the user.

The existing sensor relay circuit protocol module and the interface are single, cannot be matched with the access of various sensor data, and cannot realize the function of communication between equipment and a network cloud; the functions of multi-node and multi-protocol communication, data preprocessing and the like cannot be met; therefore, the high-voltage electric field environment is not applicable.

Disclosure of Invention

In order to solve the problems, the invention provides an infrared sensor relay system based on Lora.

The technical scheme adopted by the invention is as follows:

an infrared sensor relay system based on Lora comprises a relay, a plurality of temperature detection devices and a background server; the temperature detection devices are in communication connection with the background server through a repeater network; the repeater comprises an MCU (microprogrammed control unit), an NAND storage module, a Lora wireless communication module and a power module; the MCU micro control unit is in bidirectional electric connection with the Lora wireless communication module, a NAND storage module is bidirectionally connected with a data IO port of the MCU micro control unit, and a power supply end of the MCU micro control unit is connected with the power supply module; the input end of the MCU micro control unit is connected with the output ends of the plurality of temperature detection devices.

Furthermore, the IO port of the MCU micro control unit is also connected with a 4G wireless module and a Bluetooth module, and the repeater can enable the temperature detection devices, the handheld terminal and the background server to be in communication connection through the repeater network through the 4G wireless module and the Bluetooth module.

Further, the work of the infrared sensor relay system based on the Lora comprises the following steps:

step 1, initializing a system;

step 2, relay configuration, namely confirming the configuration information of the relay after the system is initialized, if the configuration information is not configured, clearing data in the EEPROM, detecting the SD card, and printing the related SD card information; reporting data every 5s, checking whether the data is in a state of waiting for the response of the background server before reporting the data, returning to continue waiting if the data is in the state of waiting for the response of the background server, and sending the data in the queue or the SD card to the background server if the data is not in the state of waiting for the response of the background server; when the repeater is in a state of waiting for background response, if 5s does not receive a background server response frame, judging that the time is out, storing data into a queue, and if the queue is full, storing the data into an SD (secure digital);

step 3, judging the data type, namely judging whether the frame is a 4G frame or a Bluetooth frame when the relay receives the frame sent by the background server or the Bluetooth module so as to respond by using a corresponding serial port; processing the received frame, firstly detecting whether the frame format is correct or not, reporting an error if the frame format is incorrect, if the relay address is not configured, reporting an error if the relay address is not configured, ensuring that the relay address is configured firstly for other operations, and after the relay address is configured, responding different operations according to different function codes of the information frame;

step 4, data reporting, namely after the repeater receives the data frame sent by the temperature detection device, changing the reporting period of the front end according to the temperature in the data frame; when the temperature is lower than 30 ℃, the reporting period is 30min, when the temperature is higher than 30 ℃ and lower than 50 ℃, the reporting period is changed to 15min, and when the temperature exceeds 50 ℃, the reporting period is changed to 1 min.

Further, the function code in step 3 includes: 0x21H configuration relay address pool, 0x22H timing, 0x23H data response frame, 0x24H configuration temperature detection device command frame, 0x25H read relay address, 0x26H read configured temperature detection device information, 0x27H read relay time, 0x28H delete temperature detection device configuration information, 0x2FH initialization.

Furthermore, the handheld terminal adopts a smart phone and a pad which are provided with corresponding APPs; the handheld terminal completes interaction with the repeater through a protocol, and the 4G module on the repeater is configured, so that data of the temperature detection device received by the repeater can be forwarded to a background server and a server designated on a network through the 4G module; the repeater may also accept data from a designated server on the network and forward the information to the handheld terminal.

Further, the infrared sensor relay system based on the Lora comprises an application layer, a service logic layer, a function module layer, a system kernel layer and a hardware layer, wherein the application layer has functions of data acquisition, relay communication, real-time temperature monitoring and real-time rainfall data monitoring; the service logic layer comprises a system initialization service, an MQTT communication service, an MESH communication service and a data acquisition service; the functional module layer comprises a system initialization module, an AT module, an MESH module and a data acquisition module; the system kernel layer comprises the line layer management, the interruption management, the memory management, the clock management, the synchronization and the communication; the hardware layer comprises a URAT serial port, an I2C bus and an SPI bus.

Furthermore, the power module adopts a 5V storage battery for power supply and adopts a solar charging module for charging.

Further, the temperature detection device comprises a sensor, a temperature difference power generation device and an AD conversion module; wherein the sensor comprises a rainfall sensor and a temperature sensor; the output end of the temperature difference power generation device is connected with the power supply end of the sensor, and the temperature difference power generation device adopts liquid metal as a heat-conducting medium; the AD conversion module adopts a high-precision 16-bit AD conversion module.

Further, the infrared sensor relay system based on the Lora comprises an application layer, a service logic layer, a function module layer, a system kernel layer and a hardware layer, wherein the application layer has functions of data acquisition, relay communication, real-time temperature monitoring and real-time rainfall data monitoring; the service logic layer comprises a system initialization service, an MQTT communication service, an MESH communication service and a data acquisition service; the functional module layer comprises a system initialization module, an AT module, an MESH module and a data acquisition module; the system kernel layer comprises the line layer management, the interruption management, the memory management, the clock management, the synchronization and the communication; the hardware layer comprises a URAT serial port, an I2C bus and an SPI bus.

The invention has the beneficial effects that:

the infrared sensor relay system based on Lora has low energy consumption, high transmission speed and low heat emission, and is particularly suitable for high-voltage electric field environment; the infrared sensor relay system based on the Lora is externally connected with various protocol modules and interfaces, and has the functions of data access of various sensors and communication between other equipment and a network cloud. This infrared sensor relay system based on Lora can be effective many improvement data transmission efficiency, has realized data transmission's low delay and high-fidelity, data acquisition and transmission when having realized many access ports.

Drawings

FIG. 1 is a networking diagram of the present invention;

FIG. 2 is a block diagram of the repeater of the present invention;

FIG. 3 is a flow chart of the working principle of the repeater of the present invention;

FIG. 4 is a circuit diagram of a Lora wireless communication module according to the present invention;

FIG. 5 is a circuit diagram of the MCU micro control unit of the present invention;

FIG. 6 is a circuit diagram of a 4G module of the present invention;

in fig. 1, 1-repeater, 2-temperature detection device, 3-background server, 4-handheld terminal, 5-4G wireless module, 6-bluetooth module, and 7-designated server on the network.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.

As shown in fig. 1, the present invention is an infrared sensor relay system based on Lora, which includes a relay 1, a plurality of temperature detection devices 2, and a background server 3. The temperature detection devices 2 and the background server 3 are in communication connection through the repeater 1 in a networking mode. As shown in fig. 2, the repeater 1 includes an MCU micro control unit, a NAND memory module, a Lora wireless communication module, and a power module; the MCU micro control unit is in bidirectional electric connection with the Lora wireless communication module, a NAND storage module is bidirectionally connected with a data IO port of the MCU micro control unit, and a power supply end of the MCU micro control unit is connected with the power supply module; the input end of the MCU micro control unit is connected with the output ends of the temperature detection devices, and the MCU micro control unit can provide a data preprocessing function.

MCU microcontrol unit: the micro control unit STM32F103RCT6 is an embedded-microcontroller Integrated Circuit (IC), the core specification is 32 bits, the speed is 72MHz, the program memory capacity is 256KB, the program memory type is FLASH, the RAM capacity is 48K, the voltage-power supply (Vcc/Vdd) is 2V to 3.6V, the operating temperature is-40 ℃ to 85 ℃, and the circuit diagram is shown in FIG. 5.

A NAND memory module: complex I/O ports are used to access data serially, with 8 pins used to carry control, address and data information. The read and write operations of the NAND memory module adopt 512 byte blocks, and the NAND-Flash based memory can replace a hard disk or other block devices. The maximum erasing and writing frequency of each block of the NAND memory module is 100 ten thousand, while the erasing and writing frequency of the conventional Nor-Flash memory is 10 ten thousand, and the NAND memory module can effectively improve the storage time of data so as to be suitable for a high-voltage electric field environment and prolong the service life of a system.

Lora wireless communication module: the E22-400T22S module and the E22-400T22S module are new-generation Lora wireless modules, have multiple transmission modes, work in a 410.125-493.125MHz frequency band, default is 43.125MHz, and a circuit diagram is shown in FIG. 4. Has 4 working modes, which are respectively as follows: the system comprises a transmission mode, a WOR mode, a configuration mode and a deep sleep mode, wherein based on the four working modes, the working modes can be automatically selected to be switched, when data transmission is needed, the data transmission is carried out by switching to the transmission mode, and when no data transmission is carried out, the system can be automatically switched to the deep sleep mode to carry out sleep, so that the energy consumption of the system is reduced, and the effect of low energy consumption is achieved.

A power supply module: the solar charging module is adopted for charging, the battery module is powered by the 5V storage battery, and the storage battery can be charged by the solar charging module due to the fact that the storage battery is installed in a field working environment and is used under sufficient illumination conditions, so that energy can be recycled, and the purpose of saving energy is achieved.

A sensor module: the device comprises a sensor, a temperature difference power generation device and an AD conversion module. The sensor includes rainfall sensor and temperature sensor, and the rainfall sensor is used for gathering the rainfall size of open-air environment, and temperature sensor is used for gathering power line temperature data. The output end of the temperature difference power generation device is connected with the power supply end of the sensor, the temperature difference power generation device adopts liquid metal as a heat-conducting medium, and the liquid metal can effectively improve the heat transfer efficiency compared with the traditional heat transfer medium. The AD conversion module can be with the analog signal conversion digital signal that the sensor gathered, and it adopts 16 bit AD conversion modules of high accuracy, can guarantee the quick and accurate of AD conversion data, and the AD conversion module owing to be 16 bits, can cooperate the access of various sensor data.

In order to further enable the repeater to be capable of networking among the plurality of temperature detection devices 2, the handheld terminal 4 and the background server 3, as shown in fig. 2, an IO port of the MCU micro control unit is further connected with a 4G wireless module and a bluetooth module, wherein a circuit diagram of the 4G wireless module is shown in fig. 6, and the 4G wireless module and the bluetooth module can implement a function of communication between the device and the internet cloud; multi-node, multi-protocol communication is achieved. As shown in fig. 1, the repeater 1 enables a plurality of temperature detection devices 2, the handheld terminal 4 and the background server 3 to be in communication connection through the repeater 1 via a 4G wireless module 5 and a bluetooth module 6. The handheld terminal 4 adopts a smart phone and a pad which are provided with corresponding APPs; the handheld terminal 4 completes interaction with the repeater 1 through a protocol, and configures a 4G wireless module 5 on the repeater 1, so that data of the temperature detection device 2 received by the repeater 1 can be forwarded to a background server 3 and a server 7 designated on a network through the 4G wireless module 5; the repeater 1 may also accept data from a designated server 7 on the network and forward the information to the hand-held terminal 4.

The working flow of the Lora-based infrared sensor relay system is shown in fig. 3, and comprises the following steps:

step 1, initializing a system.

Step 2, relay configuration, namely confirming the configuration information of the relay after the system is initialized, if the configuration information is not configured, clearing the data of the EEPROM in the NAND storage module, detecting the SD card of the NAND storage module, and printing the related SD card information; reporting data every 5s, checking whether the data is in a state of waiting for the response of the background server before reporting the data, returning to continue waiting if the data is in the state of waiting for the response of the background server, and sending the data in the queue or the SD card to the background server if the data is not in the state of waiting for the response of the background server; and when the repeater is in a state of waiting for background response, if 5s does not receive the response frame of the background server, judging that the time is overtime, storing the data into a queue, and if the queue is full, storing the data into the SD.

Step 3, judging the data type, namely judging whether the frame is a 4G frame or a Bluetooth frame when the relay receives the frame sent by the background server or the Bluetooth module so as to respond by using a corresponding serial port; processing the received frame, firstly detecting whether the frame format is correct, reporting an error if the format is incorrect, if the relay address is not configured, reporting an error, ensuring that the relay address is configured firstly to perform other operations, and after the relay address configuration is completed, responding to different operations according to different function codes of the information frame.

Wherein, the function code includes: 0x21H configuration relay address pool, 0x22H timing, 0x23H data response frame, 0x24H configuration temperature detection device command frame, 0x25H read relay address, 0x26H read configured temperature detection device information, 0x27H read relay time, 0x28H delete temperature detection device configuration information, 0x2FH initialization.

Step 4, data reporting, namely after the repeater receives the data frame sent by the temperature detection device, changing the reporting period of the front end according to the temperature in the data frame; when the temperature is lower than 30 ℃, the reporting period is 30min, when the temperature is higher than 30 ℃ and lower than 50 ℃, the reporting period is changed to 15min, and when the temperature exceeds 50 ℃, the reporting period is changed to 1 min.

When the infrared sensor relay system based on Lora works in a sensor module, the MCU can store temperature data acquired by the sensor module in real time in the NAND storage module; when the time in the NAND storage module is stored to a certain amount or the system appoints the data transmission time, the MCU micro control unit wakes up the transmission mode of the Lora wireless module, and the MCU micro control unit transmits the temperature data stored in the NAND storage module to the rear-end server through the Lora wireless communication module. When the data transmission is not carried out by the Lora wireless communication module, the Lora wireless communication module is in a deep sleep mode.

The infrared sensor relay system based on the Lora comprises an application layer, a service logic layer, a function module layer, a system kernel layer and a hardware layer, wherein the application layer has functions of data acquisition, relay communication, real-time temperature monitoring and real-time rainfall data monitoring. The data acquisition is to acquire temperature data through a temperature sensor, relay communication is carried out through a repeater and a wireless communication module, and real-time temperature detection and real-time rainfall data monitoring are carried out through an MCU. The service logic layer comprises a system initialization service, an MQTT communication service, an MESH communication service and a data acquisition service; the functional module layer comprises a system initialization module, an AT module, an MESH module and a data acquisition module; the system kernel layer comprises the line layer management, the interruption management, the memory management, the clock management, the synchronization and the communication; the service logic, the function module layer and the system kernel layer are software layer modules, wherein the service logic and the function module layer are mainly used for system initialization of the whole system software layer and driving the work of other hardware modules; and the system kernel layer is used for managing the normal work of each module and is integrated in the MCU micro-control module. The hardware layer comprises a URAT serial port, an I2C bus, an SPI bus, a URAT serial port, an I2C bus and an SPI bus which are connected with the MCU for data transmission.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:卫星波束的发射方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!