A power metering device based on wireless communication
By designing a power metering device based on wireless communication, using the nRF24L01 module to realize wireless communication and cluster management, the existing power meter communication lines and difficult maintenance problems are solved, and efficient wireless communication and cluster management of the power metering device are realized.
Patent Information
- Application Number
- CN201911314381.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2039-12-19
AI Technical Summary
The existing power meters mainly use RS485 communication method, which has problems such as inconvenient line elicitation, many communication lines and troublesome construction, high development costs and limited number of slaves.
A power metering device based on wireless communication is designed, consisting of a controller, a metering module and a wireless module. Wireless communication and cluster management are realized through nRF24L01 module, and a primary and secondary addresses are configured to realize a star network.
The wireless communication and cluster management of power metering devices are realized, the number of slave management is expanded, the cost is reduced, practicality is simplified, and the problems of many communication lines and maintenance are solved in the prior art are numerous.
Smart Images

Figure CN110850132B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power management, and in particular to an electric power metering device based on wireless communication. Background Art
[0002] Power measurement and metering instruments are the most important basic equipment for power information collection. They can detect current, voltage, power and other information. With the advent of the digital age, it is increasingly important to obtain data information from power meters in a timely manner and improve power management. Currently, power meters mainly use RS485 communication. This communication method has several shortcomings in some industrial occasions:
[0003] 1. It is necessary to lead out the communication line of the meter in the equipment where the meter is installed, and the communication line needs to be protected from interference from the equipment. However, it is not convenient to lead out the communication line in some equipment.
[0004] 2. When there are many power meters that need to collect power information, there are many communication lines and the construction and wiring are troublesome, the flexibility is insufficient, and the communication lines need to be protected, and the subsequent maintenance is also difficult.
[0005] 3. The instrument needs to isolate RS485, and the development cost is high.
[0006] nRF24L01 is a low-cost, simple and practical module, but the number of slaves supported by this module is low and it is not suitable for cluster management of power measurement and metering instruments. Summary of the invention
[0007] In view of the above-mentioned defects in the prior art, an object of the present invention is to provide an electric power metering device based on wireless communication to realize data collection and unified management of the electric power metering device.
[0008] To achieve the above object, the present invention provides an electric power metering device based on wireless communication, comprising a controller, a metering module and a wireless module;
[0009] The metering module is a three-phase metering module, which is used to periodically collect and measure power parameters and send the metering information to the controller;
[0010] The controller is used to package the metering information and periodically send it to the wireless module;
[0011] The wireless module is used to communicate with the concentrator. A plurality of the wireless modules and the concentrator form a star network, and the metering information is uploaded to the management end through the concentrator. The wireless module is an nRF24L01 module.
[0012] The power metering device also includes an address configuration module, which is used to configure a primary address and a secondary address; through the address configuration module, in the same star network, the primary address set in the nRF24L01 module is configured as the same address; in the same star network, the secondary address set in the controller is uniquely configured.
[0013] Furthermore, the power metering device exchanges data with the concentrator in a polling manner; the data packet format of the data exchange includes: a preamble, an address, a flag bit, a data area, and a check bit, wherein the address is defined as a primary address, and the data area is redefined to include a secondary address, a subpacket sequence number, and data; in polling, the power metering device performs the following steps:
[0014] S1, configure the working mode of the wireless module to the receiving mode, and wait for receiving data packets;
[0015] S2, when receiving a data packet, it is determined that if the primary address in the data packet is the primary address of the power metering device, the wireless module sends the data in the data packet to the controller for analysis;
[0016] S3, if the resolved secondary address is the secondary address of the power metering device, the controller returns the measurement data or the execution result of the control command to the wireless module;
[0017] S4, configuring the working mode of the wireless module to the sending mode, the wireless module transmits the measurement data back to the concentrator, completing the uploading of the measurement data, or the uploading of the execution result of the control command;
[0018] S5, repeating steps S1-S4 to upload the measurement data or the execution result of the control command.
[0019] Furthermore, the nRF24L01 module is configured as an enhanced ShockBurst™ transceiver mode.
[0020] Furthermore, the metering module is a three-phase metering module, and the metering chip of the metering module is RN8302 or RN7302, which is used for measuring three-phase three-wire or three-phase four-wire alternating current.
[0021] Furthermore, the power metering device further comprises a display module, and the display module is used to display status information and metering information of the power metering device.
[0022] The present invention achieves the following technical effects:
[0023] The present invention realizes wireless communication and cluster management of power metering equipment based on wireless communication of nRF24L01 module, greatly expands the number of slave management of nRF24L01, has low cost, is simple and practical. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a functional block diagram of a power metering device according to a preferred embodiment of the present invention;
[0025] Figure 2 It is the principle diagram of the controller and peripheral circuits used in the present invention;
[0026] Figure 3 It is a circuit schematic diagram of the metering module used in the present invention;
[0027] Figure 4 It is a circuit schematic diagram of the display module and the indication module adopted by the present invention;
[0028] Figure 5 It is the pin diagram of the wireless module nRF24L01 used in the present invention;
[0029] Figure 6 This is a comparison diagram of the transmission distance between nRF24L01 and Bluetooth;
[0030] Figure 7 This is a comparison diagram of the data rates of nRF24L01 and Zigbee;
[0031] Figure 8 It is a data uploading flow chart of the present invention. DETAILED DESCRIPTION
[0032] To further illustrate the various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, a person of ordinary skill in the art should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0033] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0034] The present invention discloses a power metering device based on wireless communication, such as Figure 1 As shown, it includes a controller, a metering module, a wireless module, an indication module, a switch module and a display module. Multiple power metering devices and a wireless concentrator are star-shaped networked. The metering module periodically collects and measures power parameters and sends the metering information to the controller; the controller packages the metering information and periodically sends it to the wireless module; the wireless module communicates with the concentrator and periodically uploads the packet data received from the controller to the management end through the concentrator.
[0035] like Figure 2As shown, in this embodiment, the controller adopts the stm32f070cbt6 chip, the main frequency can reach 48MHz, can connect two SPI, two I2C and four serial communication peripherals, and has 37 I / O ports. The reason for choosing this controller is that the main frequency, flash, RAM and I / 0 are sufficient to complete the meter function, the chip model is cheap and has good stability, and has been widely used in other fields.
[0036] like Figure 3 As shown, in this embodiment, the metering module adopts RN7302, which provides the measurement and metering functions of power parameters. RN7302 is a multifunctional and high-precision three-phase metering dedicated chip, suitable for three-phase four-wire and three-phase three-wire applications. RN7302 integrates 7-channel Σ-ΔADC, reference voltage, digital signal processing and other circuits, which can measure the active, reactive, PQS and RMS apparent power and electric energy of each phase, and provide 7-channel effective value, voltage and current vector and effective value, 6-channel phase angle, power factor, voltage line frequency, zero-crossing risk detection, voltage phase sequence detection and other metering parameters or metering information. RN7302 provides an SPI interface for convenient communication and connection with the controller. The power monitoring circuit inside RN7302 can ensure the reliable operation of the chip when powering on and off.
[0037] Figure 4 The display module and the indication module of the device are shown. In this embodiment, 3 4-bit digital tubes form 12-bit characters to display information such as power parameters, and multiple LED indicators are used for indication. The switch quantity module includes binary input and binary output. The binary input uses conventional optocoupler isolation input, and the binary output uses conventional relay isolation output. In this device, there are also some peripheral circuits, which will not be further described here.
[0038] like Figure 5 As shown, in this embodiment, the wireless module uses the nRF24L01 module as the wireless transceiver chip, and the operating frequency band of the nRF24L01 module is 2.4GHz (unregulated radio frequency band) which can meet the wireless networking requirements. Figure 6 , Figure 7 As shown in the figure, its wireless transmission distance in open areas can reach more than 100m, and the air rate range is 250k~2Mbps. It is cheap and has low power consumption, and can be used in low-power and high-rate occasions. Compared with common Bluetooth modules and Zigbee modules, nRF24L01 has greater advantages in transmission distance and data rate. Therefore, nRF24L01 is the preferred wireless module of the present invention.
[0039] The power metering device and the concentrator of this embodiment are wirelessly networked in a star configuration through nRF24L01.
[0040] like Figure 5 As shown in the figure, the communication between nRF24L01 and the controller is mainly completed through the 4-pin SPI interface, where CSN is the chip select signal, SCK is the clock signal, MOSI is the direction of data flow, which is from the master device to the slave device, and the MISO and MOSI data flow directions are opposite. In addition, the IRQ pin (interrupt request) is a set signal after the data is successfully received or sent. The IRQ can be used to determine whether the data is sent or received successfully. The CE pin is an enable pin, which is mainly used to stimulate the transceiver working mode.
[0041] The nRF24L01 module has three transceiver modes: enhanced ShockBurstTM transceiver mode, ShockBurstTM transceiver mode and direct transceiver mode. The transceiver mode is determined by software configuration.
[0042] When using the enhanced ShockBurstTM transceiver mode, the data packet format is shown in Table 1.
[0043] Table 1
[0044] Preamble Address (primary address) Flags Data Area CRC Check 3-5 bytes 9-digit 1-32 bytes 0 / 1 / 2 bytes
[0045] The enhanced ShockBurstTM transceiver mode uses the on-chip FIFO stack area. Data is sent from the microcontroller at a low speed, but is transmitted at a high speed (1Mbps). This can save energy as much as possible. Therefore, a high RF data transmission rate can be obtained using a low-speed microcontroller.
[0046] In this embodiment, nRF24L01 is used to realize a one-to-many ad hoc network, in which the power metering device is used as a slave, and the remote concentrator (the concentrator also uses the nRF24L01 wireless module) is used as the host. nRF24L01 itself is provided with 6 communication channels, which can support communication between 6 slaves and the host. In order to ensure that the number of slaves is not limited by the number of communication channels 6, and the length of the data packet to be sent is limited by the length of the data packet, in this embodiment, an area is divided out in the data area of the data packet for setting the slave address and the sub-packet number. The specific division of the data area is shown in Table 2. In Table 2, a 1-byte slave address (i.e., secondary address) and a 1-byte sub-packet number are set. Preferably, a reserved byte is also set, which can be used for the expansion of the slave address or sub-packet number or other applications. As for the address following the preamble (defined as the primary address), each slave uses the same primary address, so that each slave and the host are in the same communication channel. When the host and the slave communicate, all slaves receive at the same time and send the data in the data area to the controller for parsing. If the controller parses the secondary address from the data area and the secondary address of the power metering device matches, the slave responds to the host's command, sets itself to the sending state, replies information to the host, and immediately sets the slave to the receiving state again after completing the information sending.
[0047] After sending out the polling signal, the host will immediately set itself to the receiving state and wait for the slave to reply. The host is set with a timeout exit mechanism.
[0048] The specific steps are as follows:
[0049] Figure 8 For the data upload process of the power metering device, the power metering device performs the following steps:
[0050] S1, configure the working mode of the wireless module (i.e. nRF24L01 module) to receive mode, and wait for receiving data packets;
[0051] S2, upon receiving a data packet, a judgment is made, and when the primary address in the data packet is the primary address of the power metering device, the wireless module sends the data in the data packet to the controller for analysis;
[0052] S3, the controller parses the data in the data packet; when the parsed secondary address is the secondary address of the power metering device, the controller returns the measurement data or the execution result of the control command to the wireless module;
[0053] S4, configuring the working mode of the wireless module to the sending mode, the wireless module transmits the measurement data back to the concentrator, completing the uploading of the measurement data, or the uploading of the execution result of the control command;
[0054] S5, repeatedly executing S1-S4 to upload the measurement data or the execution result of the control command.
[0055] Each slave station determines whether the target address (primary address and secondary address) polled by the master station matches its own address. If so, it reports the measurement data and / or the execution result of the control command; if the target address polled by the master station does not match the address of the slave station, the slave station continues to wait.
[0056] The polling method provides a safe and reliable data transmission method. All slaves will not actively send messages. Only when the host sends a query command to a slave, the slave will immediately reply with a message and then immediately set to the receiving state. This avoids the frequent collision problem caused by multiple modules sending randomly, making each communication safe and reliable.
[0057] The polling method will produce a certain data transmission delay. Since the function of the power metering device is to collect grid parameters, the data transmission delay has no effect on the work of the power metering device. Therefore, this polling mechanism is suitable for the networking application of power metering devices.
[0058] By adding secondary addresses and packet numbers in the data area, the slave addresses can be expanded from 6 to 254, and the length of the data frame can reach 29*255=7395 bytes. The length of such a data packet can be considered as unlimited.
[0059] Table 2
[0060]
[0061] The nRF24L01 on this device is the slave, and the remote data acquisition device (concentrator) is the host.
[0062] As shown in Table 2, in order to ensure the reliability of data transmission in the enhanced ShockBurstTM transceiver mode and realize long data transmission, in this embodiment, a data packet header is added to the data area as a simple star topology structure, and the modbus protocol is added to the subsequent data. Among them, the target address is used to determine the object to which the data packet is sent, and the packet sequence number is mainly used to divide the data larger than 29 bytes into multiple data packets for transmission.
[0063] To implement the above-mentioned polling mechanism, the power metering device needs to perform address configuration, configuring the primary address and the secondary address; through the address configuration module, in the same star network, the primary address set in the nRF24L01 module is configured as the same address; in the same star network, the secondary address set in the controller is uniquely configured.
[0064] The present invention realizes wireless communication and cluster management of the power metering device based on the wireless communication of the nRF24L01 module, and greatly expands the number of slave management of the nRF24L01, with low cost, simplicity and practicality.
[0065] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. An electric power metering device based on wireless communication, characterized in that: Including controller, metering module and wireless module; The metering module is a three-phase metering module, which is used to periodically collect and measure power parameters and send the metering information to the controller; The controller is used to package the metering information and periodically send it to the wireless module; The wireless module is used to communicate with the concentrator. A plurality of the wireless modules and the concentrator form a star network, and the metering information is uploaded to the management end through the concentrator. The wireless module is an nRF24L01 module; the nRF24L01 module is configured as an enhanced ShockBurstTM transceiver mode; The power metering device further includes an address configuration module, which is used to configure a primary address and a secondary address; through the address configuration module, in the same star network, the primary address set in the nRF24L01 module is configured as the same address; in the same star network, the secondary address set in the controller is uniquely configured; The power metering device exchanges data with the concentrator in a polling manner; The data packet format of the data interaction includes: a preamble, an address, a flag bit, a data area and a check bit, wherein the address is defined as the primary address, and the data area is redefined to include a secondary address, a subpacket sequence number and data; the secondary address is 1 byte, the subpacket sequence number is 1 byte, and the data is 1-29 bytes; and 1 byte is reserved between the secondary address and the subpacket sequence number; During polling, the power metering device performs the following steps: S1, configure the working mode of the wireless module to the receiving mode, and wait for receiving data packets; S2, when receiving a data packet, it is determined that if the primary address in the data packet is the primary address of the power metering device, the wireless module sends the data in the data packet to the controller for analysis; S3, if the resolved secondary address is the secondary address of the power metering device, the controller returns the measurement data or the execution result of the control command to the wireless module; S4, configuring the working mode of the wireless module to the sending mode, the wireless module transmits the measurement data back to the concentrator, completing the uploading of the measurement data, or the uploading of the execution result of the control command; S5, repeating steps S1-S4 to upload the measurement data or the execution result of the control command.
2. The wireless communication-based power metering device according to claim 1, characterized in that: The metering module is a three-phase metering module, and the metering chip of the metering module is RN8302 or RN7302, which is used for measuring three-phase three-wire or three-phase four-wire alternating current.
3. The wireless communication-based power metering device according to claim 1, characterized in that: The power metering device further comprises a display module, and the display module is used to display status information and metering parameter information of the power metering device.
Citation Information
Patent Citations
Electrical energy data acquiring system based on wireless mesh ad hoc network
CN101701972A
Three-phase intelligent electric energy meter wireless communication collection device and method
CN107064622A
Electric power metering device based on wireless communication
CN211826186U