Communication circuit and electric energy meter
By designing communication circuits in the power meter, using switching modules to connect to multiple communication chips, and dynamically switching data ports, the flexibility of the communication method of the power meter in different application scenarios is solved, and the operation of multiple choice of communication method is achieved is achieved. Sex and cost savings.
Patent Information
- Application Number
- CN202420985345.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2034-05-08
AI Technical Summary
Electric energy meters need to adapt to different communication methods in different application scenarios, and the existing technology is difficult to achieve flexible switching, resulting in inconvenient operation and increased costs.
Design a communication circuit, connect to multiple communication chips through switching modules, dynamically switch data transmission and reception ports according to requirements, share data serial ports, and realize the selection of multiple communication methods.
It realizes flexible switching of communication methods in different application scenarios, saves serial port and port setup costs, is convenient to operate, and improves the applicability and reliability of the equipment.
Smart Images

Figure CN222145423U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the field of communication, in particular to a communication circuit and an electric energy meter. Background Art
[0002] With the rapid development of the smart energy meter industry, energy meters have more and more functions, higher and higher precision, and support more and more data communication methods. In the application process of energy meters, it is necessary to use the communication circuit in the energy meter to read the data in the energy meter, set parameters and other data communication processes. However, under the influence of various factors such as different customer needs and different application sites, energy meters may require different communication methods in different application processes to realize data communication between other devices and energy meters. How to realize the needs of energy meters for different communication methods in different application scenarios has become a technical problem that needs to be solved urgently. Utility Model Content
[0003] The purpose of the utility model is to provide a communication circuit and an electric energy meter, wherein a switching module is respectively connected to N communication chips, and can switch the communication chip connected to its own data sending output terminal or data receiving input terminal according to different communication modes required, thereby meeting the needs of customers for different communication modes in different application scenarios. At the same time, each communication chip uses the switching module and the terminal interface to share the data serial port of the electric energy meter and the output terminal interface. There is no need to set up an additional serial port, and multiple communication modes can be selected only through the switching module, which is easy to operate.
[0004] In order to solve the above technical problems, the utility model provides a communication circuit, comprising:
[0005] Terminal interface;
[0006] N communication chips, a data transmission output end of any of the communication chips is connected to the first end of the terminal interface, and a data receiving input end is connected to the second end of the terminal interface; N is a positive integer greater than 1;
[0007] A switching module, wherein a data transmission input end is connected to a data transmission end of an electric energy meter, a data receiving output end is connected to a data receiving end of the electric energy meter, N data transmission output ends are connected one-to-one with data transmission input ends of N communication chips, and N data receiving input ends are connected one-to-one with data receiving output ends of N communication chips; and is used for switching a data transmission output end connected to its own data transmission input end when sending data, and switching a data receiving input end connected to its own data receiving output end when receiving data, so as to realize switching between the N communication chips.
[0008] Optionally, the communication circuit further includes:
[0009] The first isolation module has a first input end connected to the data sending end of the electric energy meter, a first output end connected to the data receiving end of the electric energy meter, a second input end connected to the data receiving output end of the switching module, and a second output end connected to the data sending input end of the switching module.
[0010] Optionally, the first isolation module includes:
[0011] A first resistor, a first end of which is connected to a first preset power source;
[0012] A second resistor, a first end of which is connected to a second preset power source;
[0013] a first optocoupler, wherein a first end of a light-emitting device of the first optocoupler is connected to a second end of the second resistor, a second end is connected to a data receiving output end of the switching module, a first end of a photosensitive device of the first optocoupler is respectively connected to a second end of the first resistor and a data receiving end of the electric energy meter, and a second end is grounded;
[0014] a third resistor, a first end of which is connected to the first preset power source;
[0015] a fourth resistor, a first end of which is connected to the second preset power source;
[0016] A second optocoupler, wherein the first end of the light-emitting device of the second optocoupler is connected to the second end of the third resistor, and the second end is connected to the data sending end of the electric energy meter; the first end of the photosensitive device of the second optocoupler is respectively connected to the second end of the fourth resistor and the data sending input end of the switching module, and the second end is grounded.
[0017] Optionally, the communication circuit further includes:
[0018] A first impedance matching resistor, a first end of which is grounded;
[0019] A second impedance matching resistor, a first end of which is connected to a second preset power source;
[0020] The clamping module has a first end connected to the second end of the first impedance matching resistor and the data transmission output end of the communication chip, and a second end connected to the second end of the second impedance matching resistor and the data receiving input end of the communication chip.
[0021] Optionally, the communication circuit further includes:
[0022] The first capacitor has a first end connected to the ground and a second end connected to the second preset power source and a power source end of the communication chip respectively.
[0023] Optionally, the communication circuit further includes:
[0024] a fifth resistor, a first end of which is connected to the first preset power source;
[0025] A sixth resistor, a first end of which is grounded;
[0026] A third optocoupler, wherein the first end of the light-emitting device of the third optocoupler is connected to the second end of the fifth resistor, and the second end is connected to an enable signal; the first end of the photosensitive device of the third optocoupler is connected to a second preset power supply, and the second end is respectively connected to the second end of the sixth resistor and the enable end of the communication chip.
[0027] Optionally, when N is 2, the communication chip includes a first communication chip and a second communication chip, and the switching module includes:
[0028] A first switch, a first end of which is connected to the data transmission end of the electric energy meter, and a second end of which is connected to the data transmission input end of the first communication chip, and is used for being turned on when the first communication chip is required to transmit data;
[0029] A second switch, a first end of which is connected to the data transmission end of the electric energy meter, and a second end of which is connected to the data transmission input end of the second communication chip, and is used for being turned on when the second communication chip is required to transmit data;
[0030] A third switch, a first end of which is connected to the data receiving end of the electric energy meter, and a second end of which is connected to the data receiving output end of the first communication chip, and is used to be turned on when the first communication chip is required to receive data;
[0031] A fourth switch has a first end connected to the data receiving end of the electric energy meter and a second end connected to the data receiving output end of the second communication chip, and is used to be turned on when the second communication chip is required to receive data.
[0032] Optionally, the switching module further includes:
[0033] The second isolation module has an input terminal connected to a preset control signal and an output terminal connected to the control terminal of the switching module.
[0034] Optionally, the second isolation module includes:
[0035] a seventh resistor, a first end of which is connected to the first preset power source;
[0036] an eighth resistor, a first end of which is connected to the second preset power source;
[0037] a fourth optocoupler, wherein a first end of a light-emitting device of the fourth optocoupler is connected to a second end of the seventh resistor, a second end is connected to the preset control signal, a first end of a photosensitive device of the fourth optocoupler is respectively connected to a second end of the eighth resistor and a first control end of the switching module, and a second end is grounded;
[0038] a ninth resistor, a first end of which is connected to the first preset power source;
[0039] a tenth resistor, a first end of which is connected to the second preset power source;
[0040] A fifth optocoupler, wherein the first end of the light-emitting device of the fifth optocoupler is connected to the second end of the ninth resistor, and the second end is connected to the preset control signal; the first end of the photosensitive device of the fifth optocoupler is respectively connected to the second end of the tenth resistor and the second control end of the switching module, and the second end is grounded.
[0041] In order to solve the above technical problems, the utility model further provides an electric energy meter, comprising a single chip microcomputer and the communication circuit as described above, wherein the single chip microcomputer is connected to the communication circuit.
[0042] The utility model provides a communication circuit, including a terminal interface, N communication chips and a switching module. When a communication chip is needed to send data, the switching module connects its own data sending input terminal with the data sending output terminal corresponding to the communication chip. When a communication chip is needed to receive data, the switching module connects its own data receiving output terminal with the data receiving input terminal corresponding to the communication chip. The switching module is connected to the N communication chips respectively, and can switch the communication chip connected to its own data sending output terminal or data receiving input terminal according to different communication modes required, so as to meet the needs of customers for different communication modes in different application scenarios. At the same time, each communication chip uses the switching module and the terminal interface to share the data serial port of the electric energy meter and the output terminal interface. There is no need to set up an additional serial port. Only the switching module is needed to realize multiple selections of communication modes, and the operation is convenient.
[0043] The utility model also provides an electric energy meter, which has the same beneficial effects as the above communication circuit. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the prior art and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A schematic diagram of the structure of a communication circuit provided by the utility model;
[0046] Figure 2 A schematic diagram of the structure of a communication circuit provided by the utility model when the number of communication chips is two;
[0047] Figure 3 A signal transmission schematic diagram of a communication circuit provided by the utility model when the number of communication chips is two;
[0048] Figure 4 A schematic diagram of the structure of a terminal interface provided by the utility model;
[0049] Figure 5 A schematic diagram of the structure of a first optical coupler provided by the utility model;
[0050] Figure 6 A schematic diagram of the structure of a second optical coupler provided by the utility model;
[0051] Figure 7 A schematic diagram of the structure of a first communication chip provided by the utility model;
[0052] Figure 8 A schematic diagram of the structure of a third optical coupler provided by the utility model;
[0053] Fig. 9 A schematic diagram of the structure of a second communication chip provided by the utility model;
[0054] Fig.10 A structural schematic diagram of a switching module provided by the utility model;
[0055] Fig.11 A schematic diagram of the internal circuit structure of a switching module provided by the utility model;
[0056] Fig.12 A schematic diagram of the structure of a fourth optical coupler provided by the utility model;
[0057] Fig.13 This is a structural schematic diagram of a fifth optical coupler provided by the utility model. DETAILED DESCRIPTION
[0058] The core of the utility model is to provide a communication circuit and an electric energy meter. The switching module is connected to N communication chips respectively, and can switch the communication chip connected to its own data sending output terminal or data receiving input terminal according to different communication methods required, so as to meet the customer's needs for different communication methods in different application scenarios. At the same time, each communication chip uses the switching module and the terminal interface to share the data serial port of the electric energy meter and the output terminal interface. There is no need to set up an additional serial port. Only the switching module is needed to realize multiple selection of communication methods, which is easy to operate.
[0059] In order to make the purpose, technical solution and advantages of the embodiment of the utility model clearer, the technical solution in the embodiment of the utility model will be clearly and completely described below in conjunction with the drawings in the embodiment of the utility model. Obviously, the described embodiment is a part of the embodiment of the utility model, not all of the embodiments. Based on the embodiment of the utility model, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the utility model.
[0060] Please refer to Figure 1 , Figure 1 This is a schematic diagram of a communication circuit provided by the utility model; please refer to Figure 2 , Figure 2 A schematic diagram of a communication circuit structure provided by the utility model when the number of communication chips is two; please refer to Figure 3 , Figure 3 A signal transmission diagram of a communication circuit provided by the utility model when the number of communication chips is two; please refer to Figure 4 , Figure 4 A schematic diagram of a terminal interface provided by the utility model; A is a first end of the terminal interface, B is a second end of the terminal interface, and G is a ground terminal of the terminal interface; to solve the above technical problems, the utility model provides a communication circuit, including:
[0061] Terminal interface J1;
[0062] N communication chips 1, a data transmission output end of any communication chip 1 is connected to a first end of the terminal interface J1, and a data receiving input end is connected to a second end of the terminal interface J1; N is a positive integer greater than 1;
[0063] A switching module 2, wherein a data transmission input terminal is connected to a data transmission terminal of an electric energy meter 3, a data reception output terminal is connected to a data reception terminal of an electric energy meter 3, N data transmission output terminals are connected one-to-one with data transmission input terminals of N communication chips 1, and N data reception input terminals are connected one-to-one with data reception output terminals of N communication chips 1; the switching module 2 is used to switch the data transmission output terminal connected to its own data transmission input terminal when sending data, and to switch the data reception input terminal connected to its own data reception output terminal when receiving data, so as to realize switching between N communication chips 1.
[0064] Specifically, in order to meet the needs of the electric energy meter 3 for different communication modes in different application scenarios, the switching module 2 is provided with N data sending output terminals to be connected one-to-one with the data sending input terminals of the N communication chips 1, and is provided with N data receiving input terminals to be connected one-to-one with the data receiving output terminals of the N communication chips 1. The N communication chips 1 are N different types of communication chips 1 corresponding to N different communication modes. When data communication is required, the switching module 2 switches its internal connection mode according to the communication mode currently required by the electric energy meter 3. In a communication process, the data sending input terminal of the switching module 2 will only be internally connected with one of the N data sending output terminals to output the data received by its own data sending input terminal to a certain communication chip 1, and the data receiving output terminal of the switching module 2 will only be internally connected with one of the N data receiving input terminals to transmit the data received by a certain data receiving input terminal to the electric energy meter 3 through the data receiving output terminal. The switching process of the N communication chips 1 is realized by switching the connection between the ports of the switching module 2 itself.
[0065] It is not difficult to understand that when data needs to be sent, the switching module 2 will select one of the N data sending output terminals to connect with its own data sending input terminal. At this time, the data to be sent can be transmitted to the selected data sending output terminal through the data sending input terminal of the switching module 2 and the wiring inside the switching module 2, and then transmitted to the communication chip 1 corresponding to the data sending output terminal, and then the data is sent through the communication chip 1 and the terminal interface J1; when data reception is required, the switching module 2 will select one of the N data receiving input terminals to connect with its own data receiving output terminal. At this time, the data received from the corresponding communication chip 1 can be transmitted to the data receiving output terminal through the selected data receiving input terminal of the switching module 2 and the wiring inside the switching module 2, and then transmitted to the electric energy meter 3 to realize data reception.
[0066] It should be noted that the wiring switching process of the switching module 2 can be directly implemented by the single-chip microcomputer control of the electric energy meter 3 itself, or it can be implemented by accepting external control signals. The specific internal structure of the switching module 2 and the specific implementation method of the switching port connection are not particularly limited in this application; the specific type and implementation method of each communication chip 1 are not particularly limited in this application, and can be selected and set according to the communication method corresponding to each application scenario of the electric energy meter 3. The data sending output end and the data receiving output end of each communication chip 1 are connected to the terminal interface J1, and N communication chips 1 share one terminal interface J1 to realize data communication with external devices. At the same time, N communication chips 1 share the data sending end and the data receiving end of the electric energy meter 3 through the switching module 2, which greatly saves the setting cost of the serial port and the port; the specific type and implementation method of the terminal interface J1 are not particularly limited in this application.
[0067] In actual applications, the switching module 2 can switch the communication chip 1 according to the different states of the received control signal. Usually, the microcontroller of the electric energy meter 3 defaults to an initial communication mode. When the user wants to switch the communication mode, a command can be sent through the current communication mode to tell the microcontroller to change the state of the control signal, thereby realizing the switching of the communication mode. Commands can also be sent to the switching module 2 through other communication interfaces, such as module communication, infrared communication, etc. to realize the process of switching the communication mode. The specific type and implementation method of the electric energy meter 3 are not particularly limited in this application. For ease of use, the communication circuit can be directly integrated into the electric energy meter 3, and the microcontroller of the electric energy meter 3 controls the switching module 2 to realize the switching process of the communication chip 1.
[0068] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a first optical coupler provided by the utility model; please refer to Figure 6 , Figure 6 This is a schematic diagram of the structure of a second optical coupler provided by the utility model; please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of a first communication chip provided by the utility model; please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of a third optical coupler provided by the utility model; please refer to Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a second communication chip provided by the utility model; please refer to Fig.10 , Fig.10A schematic diagram of the structure of a switching module provided by the utility model; as a specific embodiment, taking N as 2, the communication chip 1 includes a first communication chip U1 and a second communication chip U2 as an example, the switching module 2 used in the switching process of the communication mode can be implemented by a switching chip, and taking the control signal for switching received by the switching module 2 including K0 and K1 as an example, K0 and K1 can be directly output by the single-chip microcomputer of the electric energy meter 3 itself, K0 and K1 are connected to the IO pins of the single-chip microcomputer, and the single-chip microcomputer controls the switching chip by outputting K0 and K1. Taking the first communication chip U1 as an RS485 chip and the second communication chip U2 as an RS232 chip as an example, the A pin and D pin of the switching chip are used to receive the control signal K1, and the B pin and C pin are used to receive the control signal K0. It is preset that when K0=0 and K1=1, the fourth optical coupler E4 is turned on, and the fifth optical coupler E5 is not turned on. The switching chip controls the TXD terminal to be disconnected from the TXD232 terminal, the RXD terminal to be disconnected from the RXD232 terminal, and the TXD terminal to be connected to the TXD485 terminal through the internal circuit. , the RXD terminal is connected to the RXD485 terminal, and the communication mode is switched to RS485 communication; on the contrary, when K0=1, K1=0, the fourth optocoupler E4 is not conducting, the fifth optocoupler E5 is conducting, and the switching chip controls the TXD terminal to be connected to the TXD232 terminal, the RXD terminal to be connected to the RXD232 terminal, the TXD terminal to be disconnected from the TXD485 terminal, and the RXD terminal to be disconnected from the RXD485 terminal, and the communication mode is switched to RS232 communication.
[0069] When RS485 communication is selected, since RS485 communication needs to use differential signals to realize data transmission, during the process of data sending or receiving, the first connecting line between the TX end and the B pin of the RS485 chip and the second connecting line between the RX end and the A pin of the RS485 chip are required to form differential lines to realize data reception and transmission together.
[0070] When the energy meter 3 needs to send data, the RS485 communication chip connects to the DE pin and The CS signal received by the pin is enabled as the data sending state, and the data output by the single-chip microcomputer is sent through a set of serial port sending pins TXD1, and after passing through the second optical coupler E2 of the isolation device, it is output to the TXD end, that is, the A-IN pin and B-IN pin of the switching chip. At this time, since RS485 communication is selected, the TXD end is connected to the TXD485 end, so the data is output to the RS485 communication chip through the TXD end and the TXD485 end, and the data is converted into a differential signal through the RS485 communication chip, and finally sent to the host computer or other devices through the terminal interface J1 by TX and RX; when the data TXD1 sent by the single-chip microcomputer is low voltage, Normally, the second optocoupler E2 is turned on, and the output TXD is also low. After switching the chip, TXD485 is low, and the data input DI pin receives TXD485, which is low. After passing through the RS485 communication chip, RX=0, TX=1, and then outputs a low level through the terminal interface J1; when the data TXD1 sent by the microcontroller is high, the second optocoupler E2 is not turned on, and the output TXD is also high. After switching the chip, TXD485 is high. At this time, the data input DI pin is high. After passing through the RS485 communication chip, RX=1, TX=0, and then outputs a high level through the terminal interface J1.
[0071] When the energy meter 3 needs to receive data, the RS485 communication chip connects to the power supply through the DE pin and The CS signal received by the pin is enabled as a data receiving state, and the data of the external device is input to the RS485 communication chip through the terminal interface J1, and the TX and RX ends of the terminal interface J1 are output to the D-IN pin of the switching chip through the RXD485 end after passing through the RS485 communication chip. At this time, since RS485 communication is selected, the RXD end of the switching chip is connected to the RXD485 end, and the data is output to the first optical coupler E1 through the RXD port of the switching chip, and then sent to the receiving pin RXD1 of a serial port of the single-chip microcomputer through the first optical coupler E1; when the electric energy meter 3 receives a high-level signal, the external device sends a logic high level through the differential lines TX and RX, and the RO pin of the RS485 communication chip outputs a high level. After passing through the switching chip, RXD is still high, the first optical coupler E1 is not conducting, and RXD1 is pulled up to VDD1 through the first resistor R1, which is also high. At this time, the serial port of the single-chip microcomputer receives a high-level signal. When the energy meter 3 receives a low-level signal, the external device sends a logic low level through the differential lines TX and RX, and the RO pin of the RS485 communication chip outputs a low level. After switching the chip, RXD is still at a low level, the first optocoupler E1 is turned on, and RXD1 is pulled down. At this time, the serial port of the microcontroller receives a low-level signal.
[0072] When RS232 communication is selected, since RS232 communication requires three lines (TX, RX, GND), the TX end of the RS232 communication chip is shared with the B pin in the terminal interface J1, that is, the TX end of the RS485 communication chip, and the RX end of the RS232 communication chip is shared with the A pin in the terminal interface J1, that is, the TX end of the RS485 communication chip. Then, adding a grounding setting to the G pin of the terminal interface J1 can perform normal RS232 communication.
[0073] When the energy meter 3 needs to send data, the data output by the single-chip microcomputer is sent through the sending pin TXD1 of the serial port, and after passing through the second optical coupler E2 of the isolation device, it is output to the TXD terminal, that is, the A-IN pin and B-IN pin of the switching chip. At this time, since RS232 communication is selected, the TXD terminal is connected to the TXD232 terminal, so the data is output to the RS232 communication chip through the TXD terminal and the TXD232 terminal, and then the TTL level is converted into the RS232 level through the RS232 communication chip, and finally sent to the host computer or other devices through the terminal interface J1 by TX and GND2; when the single-chip microcomputer sends When the data TXD1 is at a low level, the second optocoupler E2 is turned on, and the output TXD is also at a low level. After switching the chip, TXD232 is at a low level. After the RS232 communication chip converts the level, it outputs a low level, TX=0, and the terminal interface J1 directly outputs a low level according to TX; when the data TXD1 sent by the microcontroller is at a high level, the second optocoupler E2 is not turned on, and the output TXD is also at a high level. After switching the chip, TXD232 is at a high level. After the RS232 communication chip converts the level, it outputs a high level, TX=1, and the terminal interface J1 directly outputs a high level according to TX.
[0074] When the electric energy meter 3 needs to receive data, the data of the external device is input to the RS232 communication chip through the terminal interface J1, the RX end of the terminal interface J1 and GND2, and after passing through the RS232 communication chip, it is output to the C-IN pin of the switching chip through the RXD232 end. At this time, since RS232 communication is selected, the RXD end is connected to the RXD232 end, and the data is output to the first optical coupler E1 through the RXD port of the switching chip, and then through the first optical coupler E1, the data is sent to the receiving pin RXD1 of a serial port of the single-chip microcomputer; when the electric energy meter 3 receives a high-level signal, the external device sends a logic high level through RX and GND2, and after passing through the RS232 communication chip, the R2OUT pin of the RS232 communication chip outputs a high level, RXD232 is a high level, and after passing through the switching chip, RXD is still a high level, the first optical coupler E1 is not turned on, and RXD1 is pulled up to VDD1 through the first resistor R1, which is also a high level. At this time, the serial port of the single-chip microcomputer receives a high-level signal. When the energy meter 3 receives a low-level signal, the external device sends a logic low level through RX and GND2. After passing through the RS232 communication chip, the R2OUT pin of the RS232 communication chip outputs a low level, and RXD232 is a low level. After switching the chip, RXD is still a low level, the first optocoupler E1 is turned on, and RXD1 is pulled down to a low level. At this time, the serial port of the microcontroller receives a low-level signal.
[0075] Based on the communication circuit provided by the present application, a circuit compatible with RS485 communication and RS232 communication can be designed, and the switching can be realized by means of the communication control switching module 2, so as to meet the different application scenarios of the electric energy meter 3, and it is not necessary to realize it by means of jumper wires or circuit changes, so it is very convenient to use and safer. Moreover, each communication chip 1 shares one serial port of the microcontroller, shares an isolation device, and shares an output interface; when applied, it is only necessary to send a command to switch the communication mode to the microcontroller through the host computer or other means, so as to realize the selection of one of the two communication modes, which can save more PCB space resources, and can also save one microcontroller serial port resource. The microcontroller program and the PCB board design can be compatible, which is convenient to operate, safe and reliable, and very practical.
[0076] The utility model provides a communication circuit, including a terminal interface J1, N communication chips 1 and a switching module 2. When a certain communication chip 1 is required to send data, the switching module 2 connects its own data sending input terminal with the data sending output terminal corresponding to the communication chip 1. When a certain communication chip 1 is required to receive data, the switching module 2 connects its own data receiving output terminal with the data receiving input terminal corresponding to the communication chip 1. The switching module 2 is connected to the N communication chips 1 respectively, and can switch the communication chip 1 connected to its own data sending output terminal or data receiving input terminal according to different communication modes required, so as to meet the needs of customers for different communication modes in different application scenarios. At the same time, each communication chip 1 uses the switching module 2 and the terminal interface J1 to share the data serial port of the electric energy meter 3 and the output terminal interface J1. There is no need to set an additional serial port. Only the switching module 2 is needed to realize multiple selection of communication modes, and the operation is convenient.
[0077] Based on the above embodiments:
[0078] As an optional embodiment, the communication circuit further includes:
[0079] The first isolation module has a first input end connected to the data sending end of the electric energy meter 3, a first output end connected to the data receiving end of the electric energy meter 3, a second input end connected to the data receiving output end of the switching module 2, and a second output end connected to the data sending input end of the switching module 2.
[0080] It is not difficult to understand that in the process of data communication, in order to avoid the interference and influence of the working process of the electric energy meter 3 on the switching process of the switching module 2 and the data transmission process, a first isolation module can be further set between the electric energy meter 3 and the switching module 2. The data sent by the electric energy meter 3 is output to the switching module 2 after passing through the first isolation module, and the data received by the switching module 2 is output to the electric energy meter 3 after passing through the first isolation module to avoid signal interference. The specific type and implementation method of the first isolation module are not particularly limited in this application, and it can be implemented using isolation devices such as optocouplers, capacitive couplers, and magnetic couplers.
[0081] Specifically, by adding a first isolation module between the electric energy meter 3 and the switching module 2, an effective isolation effect can be achieved, the anti-interference performance of the entire communication circuit can be improved, interference and other problems during data transmission can be avoided, and the accuracy and reliability of the data communication process can be improved.
[0082] As an optional embodiment, the first isolation module includes:
[0083] A first resistor R1, a first end of which is connected to a first preset power source;
[0084] A second resistor R2, a first end of which is connected to a second preset power source;
[0085] A first optical coupler E1, wherein a first end of a light emitting device of the first optical coupler E1 is connected to a second end of a second resistor R2, and a second end is connected to a data receiving output end of a switching module 2; a first end of a light sensitive device of the first optical coupler E1 is respectively connected to a second end of the first resistor R1 and a data receiving end of an electric energy meter 3, and a second end is grounded;
[0086] A third resistor R3, a first end of which is connected to the first preset power source;
[0087] A fourth resistor R4, a first end of which is connected to a second preset power source;
[0088] The second optocoupler E2, the first end of the light-emitting device of the second optocoupler E2 is connected to the second end of the third resistor R3, the second end is connected to the data sending end of the electric energy meter 3, the first end of the photosensitive device of the second optocoupler E2 is respectively connected to the second end of the fourth resistor R4 and the data sending input end of the switching module 2, and the second end is grounded.
[0089] It is not difficult to understand that the data transmission process and the data reception process between the switching module 2 and the electric energy meter 3 are realized through two sets of independent ports. Therefore, the first isolation module includes an isolation submodule of the data reception process composed of the first resistor R1, the second resistor R2 and the first optical coupler E1, and an isolation submodule of the data transmission process composed of the third resistor R3, the fourth resistor R4 and the second optical coupler E2. The isolation device is implemented by an optical coupler. At the same time, in order to further realize the complete isolation of the power supply, the power supplies used by the two isolated circuits are also independent of each other. The circuit on one side of the electric energy meter 3 uniformly adopts the first preset power supply, and the circuit on one side of the switching module 2 uniformly adopts the second preset power supply. At the same time, the complete isolation of grounding can be further set. The circuit on one side of the electric energy meter 3 is uniformly grounded to GND1, and the circuit on one side of the switching module 2 is uniformly grounded to GND2. The specific setting method of the first preset power supply, the second preset power supply and the two grounding points is not specifically limited in this application. The specific type and implementation method of the first resistor R1, the second resistor R2, the first optical coupler E1, the third resistor R3, the fourth resistor R4 and the second optical coupler E2 are not specifically limited in this application. Figure 5 and Figure 6 As shown, the first resistor R1, the third resistor R3, and the fourth resistor R4 can be implemented by using a 1k resistor, the second resistor R2 can be implemented by using a 2k resistor, and the first optical coupler E1 and the second optical coupler E2 can be implemented by using an optical coupler of model LTV-816S-TP-D3.
[0090] Specifically, an optocoupler can be used to provide a complete electrical isolation. On this basis, the power supply and grounding points are also completely isolated, effectively realizing one-way transmission of data and avoiding interference such as noise. The circuit structure of the entire first isolation module is simple and easy to implement. The devices used are low in cost, small in size, and light in weight, which is conducive to the simple implementation of the entire communication circuit.
[0091] As an optional embodiment, the communication circuit further includes:
[0092] A first impedance matching resistor R11, a first end of which is grounded;
[0093] A second impedance matching resistor R12, a first end of which is connected to a second preset power source;
[0094] The clamping module Z1 has a first end connected to the second end of the first impedance matching resistor R11 and the data transmission output end of the communication chip 1 , and a second end connected to the second end of the second impedance matching resistor R12 and the data receiving input end of the communication chip 1 .
[0095] It is not difficult to understand that for some communication chips 1, such as RS485 chips, the sending and receiving of data need to be implemented based on differential signals. Therefore, in order to improve the accuracy of the data communication process of this type of communication chip 1, a first impedance matching resistor R11, a second impedance matching resistor R12 and a clamping module Z1 can be further provided at the data sending output end and the data receiving input end of the communication chip 1. The voltage stabilization and clamping effects of the clamping module Z1 can be used to improve the stability and reliability of the data sent or received by the communication chip 1. The specific types and implementation methods of the first impedance matching resistor R11, the second impedance matching resistor R12 and the clamping module Z1 are not particularly limited in this application. The clamping module Z1 can be implemented using devices such as voltage regulator diodes and bidirectional TVS tubes (Transient Voltage Suppressors). Figure 7 As shown, a thermistor PTC1 can be further provided at the data receiving input end of the communication chip 1 to perform voltage stabilization and overcurrent protection, etc. The first impedance matching resistor R11 and the second impedance matching resistor R12 can both be implemented with a 20k resistor.
[0096] Specifically, the peripheral circuit of the communication chip 1 can be increased according to the specific working mode of the communication chip 1. By increasing the first impedance matching resistor R11, the second impedance matching resistor R12 and the clamping module Z1 and other devices, the accuracy and reliability of the working process of the communication chip 1 can be improved, and the circuit can be further protected. The peripheral circuit structure set in this embodiment is simple and easy to implement. The devices used are low in cost and small in size, which is conducive to the simple implementation of the entire communication circuit.
[0097] As an optional embodiment, the communication circuit further includes:
[0098] The first capacitor has a first end connected to the ground, and a second end connected to the second preset power source and the power source end of the communication chip 1 respectively.
[0099] It is not difficult to understand that a first capacitor can be added to the power supply end of the communication chip 1 to improve the stability and reliability of the power supply process of the communication chip 1. The first capacitor can not only play a role in voltage stabilization, but also play a role in power supply filtering to ensure that the second preset power supply is reliable for the communication chip 1. The specific type and implementation method of the first capacitor are not particularly limited in this application, and its capacitance can also be set according to actual application requirements, such as Figure 7 As shown, a 100nF capacitor C1 is provided as the first capacitor. Figure 8 As shown in FIG. 1 , a 100nF capacitor C2 is provided as the first capacitor. Fig. 9 As shown, for the RS232 communication chip, a peripheral circuit of the communication chip consisting of capacitors C3, C4, C5 and C6 can be further provided to ensure the normal operation of the communication chip.
[0100] Specifically, a first capacitor may be added to the power supply end of the communication chip 1 to improve the stability and reliability of the power supply process of the communication chip 1, ensure that the communication chip 1 is effectively powered and can work normally, and improve the reliability of the entire communication circuit.
[0101] As an optional embodiment, the communication circuit further includes:
[0102] A fifth resistor R5, a first end of which is connected to the first preset power source;
[0103] A sixth resistor R6, a first end of which is grounded;
[0104] The third optocoupler E3, the first end of the light-emitting device of the third optocoupler E3 is connected to the second end of the fifth resistor R5, and the second end is connected to the enable signal. The first end of the photosensitive device of the third optocoupler E3 is connected to the second preset power supply, and the second end is respectively connected to the second end of the sixth resistor R6 and the enable end of the communication chip 1.
[0105] It should be noted that for some communication chips 1, the two states of data transmission or data reception need to be switched by an enable signal, so it is necessary to set up an enable circuit composed of a fifth resistor R5, a sixth resistor R6 and a third optical coupler E3. The third optical coupler E3 plays an isolation role while receiving the enable signal, and effectively outputs the enable signal to the communication chip 1 while avoiding interference of external signals on the working process of the communication chip 1. When the communication chip 1 needs to work, the corresponding state of the communication chip 1 is enabled to ensure the accurate working process of the communication chip 1. The specific types and implementation methods of the fifth resistor R5, the sixth resistor R6 and the third optical coupler E3 are not particularly limited in this application. The fifth resistor R5 and the sixth resistor R6 can be implemented by a 1k resistor, and the third optical coupler E3 can be implemented by an optical coupler of the LTV-816S-TP-D3 model.
[0106] It is not difficult to understand that, taking the RS485 communication chip as an example, Figure 7 As shown, the two states of data transmission or data reception need to be switched according to the enabling status of the enable signal. The CS signal can be used to control the transmission and reception enable of the RS485 communication chip. When the CS signal is at a high level by default, the third optical coupler E3 is not turned on, and the DE pin of the RS485 communication chip is The pin is pulled down to ground by the sixth resistor R6, and the RS485 communication chip is in data receiving state; when data is to be sent, the CS signal needs to be pulled low, the third optocoupler E3 is turned on, and the DE pin and The pin is high level, the RS485 communication chip is in the data sending state, and can control the CS signal to return to the high level after the data sending is completed, or can control the CS signal to change only when the mode switching is required. Considering that the communication process of the energy meter 3 is not very frequent, the default CS signal can be designed to be high level, and the third optical coupler E3 is not turned on, which increases the life of the device.
[0107] Specifically, the third optical coupler E3 and its peripheral circuit are used to realize the enable control of the communication chip 1, ensuring that the communication chip 1 that requires an enable signal to switch the working state can accurately work in the corresponding working state. The structure of the entire circuit is simple, easy to implement, and has good isolation, which prevents the communication chip 1 from being interfered with. The devices used are low in cost and small in size, which is conducive to the simple implementation of the communication chip 1 and the entire communication circuit.
[0108] Please refer to Fig.11 , Fig.11 The schematic diagram of the internal circuit structure of a switching module 2 provided by the utility model; as an optional embodiment, when N is 2, the communication chip 1 includes a first communication chip U1 and a second communication chip U2, and the switching module 2 includes:
[0109] A first switch K1, a first end of which is connected to the data transmission end of the electric energy meter 3, and a second end of which is connected to the data transmission input end of the first communication chip U1, and is used to be turned on when the first communication chip U1 needs to send data;
[0110] A second switch K2, a first end of which is connected to the data transmission end of the electric energy meter 3, and a second end of which is connected to the data transmission input end of the second communication chip U2, and is used to be turned on when the second communication chip U2 needs to send data;
[0111] A third switch K3, a first end of which is connected to the data receiving end of the electric energy meter 3, and a second end of which is connected to the data receiving output end of the first communication chip U1, and is used to be turned on when the first communication chip U1 needs to receive data;
[0112] The fourth switch K4 has a first end connected to the data receiving end of the electric energy meter 3 and a second end connected to the data receiving output end of the second communication chip U2, and is used to be turned on when the second communication chip U2 needs to receive data.
[0113] It is not difficult to understand that the switching process of the switching module 2 can be realized by the first switch K1, the second switch K2, the third switch K3 and the fourth switch K4 set therein, the first switch K1 is turned on or off to realize the connection or disconnection between its own data transmission input terminal and the data transmission output terminal corresponding to the first communication chip U1, the second switch K2 is turned on or off to realize the connection or disconnection between its own data transmission input terminal and the data transmission output terminal corresponding to the second communication chip U2, the third switch K3 is turned on or off to realize the connection or disconnection between its own data reception output terminal and the data reception input terminal corresponding to the first communication chip U1, and the fourth switch K4 is turned on or off to realize the connection or disconnection between its own data reception output terminal and the data reception input terminal corresponding to the first communication chip U1; the specific types and implementation methods of the first switch K1, the second switch K2, the third switch K3 and the fourth switch K4 are not particularly limited in this application, and various types of controllable switches can be used for implementation, such as Fig.11 As shown, considering that the on or off of the switch inside the switching module 2 requires different control processes, the switching module 2 also sets four ports A, B, C, and D as control terminals to receive preset control signals for switching. Fig.10 As shown, the switch module 2 may further include a peripheral circuit including a capacitor C7 to ensure the normal operation of the switch module 2 .
[0114] Specifically, the process of switching the communication chip 1 by the switching module 2 can be realized by connecting or disconnecting the connection between the internal ports. Therefore, the first switch K1, the second switch K2, the third switch K3 and the fourth switch K4 can be set inside the switching module 2 to respectively realize the process of connecting or disconnecting the data path of the data sending or receiving process of the two communication chips 1. The entire circuit structure is simple and easy to implement. The devices used are low in cost and small in size, which is conducive to the simple implementation of the switching module 2 and the entire communication circuit.
[0115] As an optional embodiment, the switching module 2 further includes:
[0116] The second isolation module has an input terminal connected to a preset control signal, and an output terminal connected to a control terminal of the switching module 2 .
[0117] It is not difficult to understand that, considering that there may also be interference signals in the process of the switching module 2 receiving the preset control signal, a second isolation module can be added to the process of the switching module 2 receiving the preset control signal to play a role in signal isolation. The preset control signal passes through the second isolation module and then is output to the switching module 2. The specific type and implementation method of the second isolation module are not particularly limited in this application, and it can be implemented using isolation devices such as optocouplers, capacitive couplers, and magnetic couplers.
[0118] Specifically, by adding a second isolation module between the preset control signal and the switching module 2, an isolation effect can be effectively achieved, the anti-interference performance of the entire communication circuit can be improved, interference and other problems during data transmission can be avoided, and the accuracy and reliability of the data communication process can be improved.
[0119] Please refer to Fig.12 , Fig.12 This is a schematic diagram of the structure of a fourth optical coupler E4 provided by the utility model; please refer to Fig.13 , Fig.13 Schematic diagram of the structure of a fifth optical coupler E5 provided by the utility model. As an optional embodiment, the second isolation module includes:
[0120] A seventh resistor R7, a first end of which is connected to the first preset power source;
[0121] An eighth resistor R8, a first end of which is connected to the second preset power source;
[0122] A fourth optical coupler E4, a first end of a light-emitting device of the fourth optical coupler E4 is connected to a second end of a seventh resistor R7, a second end is connected to a preset control signal, a first end of a light-sensitive device of the fourth optical coupler E4 is respectively connected to a second end of an eighth resistor R8 and a first control end of the switching module 2, and a second end is grounded;
[0123] A ninth resistor R9, a first end of which is connected to the first preset power source;
[0124] a tenth resistor R10, a first end of which is connected to the second preset power source;
[0125] The fifth optocoupler E5, the first end of the light-emitting device of the fifth optocoupler E5 is connected to the second end of the ninth resistor R9, the second end is connected to the preset control signal, the first end of the photosensitive device of the fifth optocoupler E5 is respectively connected to the second end of the tenth resistor R10 and the second control end of the switching module 2, and the second end is grounded.
[0126] It is not difficult to understand that in this embodiment, the switching module 2 needs to receive preset control signals K0 and K1 to realize a controllable switching process. Therefore, the switching module 2 and the preset control signal are realized through two sets of independent ports. Therefore, the second isolation module includes an isolation submodule of the K0 signal composed of the seventh resistor R7, the eighth resistor R8 and the fourth optocoupler E4, and an isolation submodule of the K1 signal composed of the ninth resistor R9, the tenth resistor R10 and the fifth optocoupler E5. The isolation device is implemented by an optocoupler. At the same time, in order to further realize the complete isolation of the power supply, the power supplies used by the two isolated circuits are also independent of each other. The circuit on the side of the preset control signal uniformly adopts the first preset power supply, and the circuit on the side of the switching module 2 uniformly adopts the second preset power supply. At the same time, complete isolation of grounding can be further set. The circuit on the side of the preset control signal is uniformly grounded to GND1, and the circuit on the side of the switching module 2 is uniformly grounded to GND2. The present application does not specifically limit the specific configuration of the first preset power supply, the second preset power supply, and the two grounding points, and the present application does not specifically limit the specific types and implementations of the seventh resistor R7, the eighth resistor R8, the fourth optical coupler E4, the ninth resistor R9, the tenth resistor R10, and the fifth optical coupler E5. Fig.12 and Fig.13 As shown, the seventh resistor R7, the eighth resistor R8, the ninth resistor R9, and the tenth resistor R10 can all be implemented by 1k resistors, and the fourth optical coupler E4 and the fifth optical coupler E5 can be implemented by optical couplers of the LTV-816S-TP-D3 model.
[0127] Specifically, an optocoupler can be used to provide a complete electrical isolation. On this basis, the power supply and grounding points are also completely isolated, effectively realizing one-way transmission of data and avoiding interference such as noise. The circuit structure of the entire first isolation module is simple and easy to implement. The devices used are low in cost, small in size, and light in weight, which is conducive to the simple implementation of the entire communication circuit.
[0128] In order to solve the above technical problems, the utility model further provides an electric energy meter 3, comprising a single chip microcomputer and the aforementioned communication circuit, wherein the single chip microcomputer is connected to the communication circuit.
[0129] It is not difficult to understand that the single-chip microcomputer refers to the central processing unit required for the operation of the electric energy meter 3 itself. In the process of data communication with external devices, the single-chip microcomputer sends or receives data with external devices based on different types of communication methods through the communication circuit provided by this application. This application does not make any special restrictions on the specific types and implementation methods of external devices and single-chip microcomputers.
[0130] For an introduction to an electric energy meter provided by the present invention, please refer to the above-mentioned embodiment of the communication circuit, and the present invention will not be described in detail here.
[0131] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0132] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0133] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A communication circuit, characterized in that: include: Terminal interface; N communication chips, a data transmission output end of any of the communication chips is connected to the first end of the terminal interface, and a data receiving input end is connected to the second end of the terminal interface; N is a positive integer greater than 1; A switching module, wherein a data transmission input terminal is connected to a data transmission terminal of an electric energy meter, a data receiving output terminal is connected to a data receiving terminal of the electric energy meter, N data transmission output terminals are connected to N data transmission input terminals of the communication chips in a one-to-one correspondence, and N data receiving input terminals are connected to N data receiving output terminals of the communication chips in a one-to-one correspondence; It is used to switch the data transmission output end connected to its own data transmission input end when sending data, and to switch the data reception input end connected to its own data reception output end when receiving data, so as to realize the switching between N communication chips.
2. The communication circuit according to claim 1, characterized in that: The communication circuit also includes: The first isolation module has a first input end connected to the data sending end of the electric energy meter, a first output end connected to the data receiving end of the electric energy meter, a second input end connected to the data receiving output end of the switching module, and a second output end connected to the data sending input end of the switching module.
3. The communication circuit according to claim 2, characterized in that: The first isolation module comprises: A first resistor, a first end of which is connected to a first preset power source; A second resistor, a first end of which is connected to a second preset power source; a first optocoupler, wherein a first end of a light-emitting device of the first optocoupler is connected to a second end of the second resistor, a second end is connected to a data receiving output end of the switching module, a first end of a photosensitive device of the first optocoupler is respectively connected to a second end of the first resistor and a data receiving end of the electric energy meter, and a second end is grounded; a third resistor, a first end of which is connected to the first preset power source; a fourth resistor, a first end of which is connected to the second preset power source; A second optocoupler, wherein the first end of the light-emitting device of the second optocoupler is connected to the second end of the third resistor, and the second end is connected to the data sending end of the electric energy meter; the first end of the photosensitive device of the second optocoupler is respectively connected to the second end of the fourth resistor and the data sending input end of the switching module, and the second end is grounded.
4. The communication circuit according to claim 1, wherein: The communication circuit also includes: A first impedance matching resistor, a first end of which is grounded; A second impedance matching resistor, a first end of which is connected to a second preset power source; The clamping module has a first end connected to the second end of the first impedance matching resistor and the data transmission output end of the communication chip, and a second end connected to the second end of the second impedance matching resistor and the data receiving input end of the communication chip.
5. The communication circuit according to claim 4, characterized in that: The communication circuit also includes: The first capacitor has a first end connected to the ground and a second end connected to the second preset power source and a power source terminal of the communication chip respectively.
6. The communication circuit according to claim 1, characterized in that: The communication circuit also includes: a fifth resistor, a first end of which is connected to the first preset power source; A sixth resistor, a first end of which is grounded; A third optocoupler, wherein the first end of the light-emitting device of the third optocoupler is connected to the second end of the fifth resistor, and the second end is connected to an enable signal; the first end of the photosensitive device of the third optocoupler is connected to a second preset power supply, and the second end is respectively connected to the second end of the sixth resistor and the enable end of the communication chip.
7. The communication circuit according to any one of claims 1 to 6, characterized in that: When N is 2, the communication chip includes a first communication chip and a second communication chip, and the switching module includes: A first switch, a first end of which is connected to the data transmission end of the electric energy meter, and a second end of which is connected to the data transmission input end of the first communication chip, and is used for being turned on when the first communication chip is required to transmit data; A second switch, a first end of which is connected to the data transmission end of the electric energy meter, and a second end of which is connected to the data transmission input end of the second communication chip, and is used for being turned on when the second communication chip is required to transmit data; A third switch, a first end of which is connected to the data receiving end of the electric energy meter, and a second end of which is connected to the data receiving output end of the first communication chip, and is used to be turned on when the first communication chip is required to receive data; A fourth switch has a first end connected to the data receiving end of the electric energy meter and a second end connected to the data receiving output end of the second communication chip, and is used to be turned on when the second communication chip is required to receive data.
8. The communication circuit according to claim 7, characterized in that: The switching module also includes: The second isolation module has an input terminal connected to a preset control signal and an output terminal connected to the control terminal of the switching module.
9. The communication circuit according to claim 8, characterized in that: The second isolation module comprises: a seventh resistor, a first end of which is connected to the first preset power source; an eighth resistor, a first end of which is connected to the second preset power source; a fourth optocoupler, wherein a first end of a light-emitting device of the fourth optocoupler is connected to a second end of the seventh resistor, a second end is connected to the preset control signal, a first end of a light-sensitive device of the fourth optocoupler is respectively connected to a second end of the eighth resistor and a first control end of the switching module, and a second end is grounded; a ninth resistor, a first end of which is connected to the first preset power source; a tenth resistor, a first end of which is connected to the second preset power source; A fifth optocoupler, wherein the first end of the light-emitting device of the fifth optocoupler is connected to the second end of the ninth resistor, and the second end is connected to the preset control signal; the first end of the photosensitive device of the fifth optocoupler is respectively connected to the second end of the tenth resistor and the second control end of the switching module, and the second end is grounded.
10. An electric energy meter, characterized in that: It comprises a single chip microcomputer and a communication circuit as claimed in any one of claims 1 to 9, wherein the single chip microcomputer is connected to the communication circuit.
