Communication interface circuit, circuit board and gateway device

By using a communication interface circuit controlled by an MCU, the problem of fault propagation in industrial IoT gateway devices in complex environments has been solved, enabling stable operation and efficient maintenance of gateway devices and improving the security and reliability of the bus network.

CN122120059APending Publication Date: 2026-05-29GUANGZHOU ZHIYUAN ELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU ZHIYUAN ELECTRONICS CO LTD
Filing Date
2026-03-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing industrial IoT gateway devices struggle to provide effective security protection in complex and harsh environments. A single node failure can easily spread to the entire bus network, leading to system paralysis and low maintenance efficiency.

Method used

The communication interface circuit, controlled by an MCU, includes a protection module, an RS485 transceiver module, an impedance control module, and a power control module. Through software configuration, it achieves active protection and fault isolation of the interface, thereby improving the security of network communication.

Benefits of technology

It enables gateway devices to operate stably in complex environments, reduces operation and maintenance costs, enhances the security and reliability of the bus network, and meets the needs of the Industrial Internet of Things.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120059A_ABST
    Figure CN122120059A_ABST
Patent Text Reader

Abstract

The application provides a communication interface circuit, a circuit board and a gateway device, relates to the technical field of electronic circuits, and solves the technical problem that the gateway device is difficult to realize effective security protection, thereby causing high risk of bus network communication. In the circuit, the input end of the protection module is used for connecting the RS485 interface, the input end of the RS485 transceiving module is connected with the protection module, the bus communication pin of the MCU is connected with the output end of the RS485 transceiving module, the control end of the impedance control module is connected with the first control pin of the MCU, the output end of the impedance control module is connected with the input end of the RS485 transceiving module, the control end of the power supply control module is connected with the second control pin of the MCU, and the output end of the power supply control module is connected with the power supply end of the RS485 transceiving module and the power supply end of the impedance control module. The scheme can realize active protection and configuration of access to the bus network under the control of the MCU, and improves the security of bus network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic circuit technology, and in particular to a communication interface circuit, circuit board and gateway device. Background Technology

[0002] With the popularization of the Industrial Internet of Things (IIoT), more and more IIoT gateway devices are being deployed in complex and harsh environments (such as field substations and remote mountainous areas). As a data hub connecting field devices and the cloud, gateway devices integrate multiple RS485 interfaces. However, the electromagnetic environment in industrial sites is complex, and threats such as lightning strikes, surges, and ground potential differences are common. A single node's interface failure (such as a short circuit) can easily spread to the entire bus network, leading to system-level paralysis.

[0003] The existing technologies rely on manual on-site operation of DIP switches to configure terminating resistors. Furthermore, current gateway devices have weak protection and isolation capabilities. When faced with continuous abnormal voltage or permanent interface failures (such as port short circuits), the node cannot actively disconnect from the bus, thus remaining a point of failure and impacting the stability of the entire network communication. For gateway devices deployed in complex and harsh environments, these solutions struggle to provide effective security protection and suffer from low maintenance efficiency, increasing the overall risk to bus network communication. Summary of the Invention

[0004] This application provides a communication interface circuit, circuit board, and gateway device, which solves the technical problem that gateway devices are difficult to implement effective security protection, resulting in high risks in bus network communication. This solution can realize active protection and configuration for accessing the bus network under the control of MCU (Microcontroller Unit), thereby improving the security of bus network communication.

[0005] In a first aspect, this application provides a communication interface circuit, which includes a protection module, an RS485 transceiver module, an MCU, an impedance control module, and a power control module.

[0006] The input terminal of the protection module is used to connect to the RS485 interface. The protection module is used to provide input protection and protect the RS485 transceiver module in the next stage.

[0007] The input terminal of the RS485 transceiver module is connected to the protection module. The RS485 transceiver module is used to communicate with external devices via RS485 bus through the RS485 interface. The MCU's bus communication pins are connected to the output of the RS485 transceiver module; The control terminal of the impedance control module is connected to the first control pin of the MCU, and the output terminal of the impedance control module is used to connect to the input terminal of the RS485 transceiver module. The impedance control module is used to configure the impedance of the input terminal of the RS485 transceiver module according to the first control signal provided by the first control pin. The control terminal of the power control module is connected to the second control pin of the MCU, and the output terminal of the power control module is connected to the power supply terminal of the RS485 transceiver module and the power supply terminal of the impedance control module. The power control module is used to control the power supply of the RS485 transceiver module and the impedance control module according to the second control signal provided by the second control pin.

[0008] Secondly, this application also provides a circuit board that includes the communication interface circuit provided in the first aspect above.

[0009] Thirdly, this application also provides a gateway device that includes the circuit board provided in the second aspect above. Attached Figure Description

[0010] Figure 1 A logic block diagram of a communication interface circuit provided in an embodiment of this application.

[0011] Figure 2 This is a schematic diagram of the circuit structure of a protection module provided in one embodiment of this application.

[0012] Figure 3 This is a schematic diagram of the circuit structure of an impedance control module provided in an embodiment of this application.

[0013] Figure 4 This is a schematic diagram of the circuit structure of a power control module provided in an embodiment of this application.

[0014] Figure 5 A schematic diagram of the circuit structure of a communication interface circuit provided in an embodiment of this application. Detailed Implementation

[0015] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts related to the embodiments of this application are shown in the accompanying drawings, not all structures. Those skilled in the art, after reading this specification, should be able to conceive that any combination of technical features can constitute an optional implementation method, provided that the technical features do not contradict each other.

[0016] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. In the description of this application, "multiple" means two or more, and "several" means one or more.

[0017] RS-485 is a mature and reliable differential serial communication standard. With its excellent common-mode interference immunity, transmission distance of up to kilometers, and multi-point networking capabilities, it has become the "field-level" backbone communication protocol in fields such as industrial automation, smart buildings, and energy metering. With the popularization of the Industrial Internet of Things (IIoT), more and more IIoT gateway devices are deployed in complex and harsh environments (such as field substations and remote mountainous areas). As a data hub connecting field devices and the cloud, the gateway device integrates multiple RS485 interfaces. However, the electromagnetic environment in industrial fields is complex, and threats such as lightning strikes, surges, and ground potential differences are common. A single node interface failure (such as a short circuit) can easily spread to the entire bus network, leading to system-level paralysis.

[0018] The existing technologies rely on manual on-site operation of DIP switches to configure terminating resistors. Furthermore, current gateway devices have weak protection and isolation capabilities. When faced with continuous abnormal voltage or permanent interface failures (such as port short circuits), the node cannot actively disconnect from the bus, remaining a point of failure and impacting the stability of the entire network. In essence, the protection and isolation mechanisms of current solutions are passive and unidirectional. The gateway device's interface maintains a constant physical connection to the external bus, lacking a software-controlled mechanism to completely disconnect itself from the bus when encountering continuous high-voltage interference or interface failure. This means that a single node failure can paralyze the entire bus network, and the device itself cannot proactively avoid risks in extreme situations, resulting in a weakness in system reliability. For gateway devices deployed in complex and harsh environments, these technologies struggle to provide effective security protection and suffer from low maintenance efficiency, increasing the risk to the entire bus network communication.

[0019] In response, this application provides a communication interface circuit, circuit board, and gateway device. The communication interface circuit of this solution can control the state of the power consumption switch, the terminating resistor configuration switch, and the bus isolation switch through the MCU on it, providing an RS-485-based communication interface circuit with integrated intelligent power management, so that the gateway device can operate stably. Figure 1 The present application provides a logic block diagram of a communication interface circuit, which includes a protection module 110, an RS485 transceiver module 120, an MCU 130, an impedance control module 140, and a power control module 150.

[0020] The input terminal of the protection module 110 is used to connect to the RS485 interface 210. The input terminal of the RS485 transceiver module 120 is connected to the protection module 110. The bus communication pin of the MCU 130 is connected to the output terminal of the RS485 transceiver module 120. The control terminal of the impedance control module 140 is connected to the first control pin of the MCU 130. The output terminal of the impedance control module 140 is used to connect to the input terminal of the RS485 transceiver module 120. The control terminal of the power control module 150 is connected to the second control pin of the MCU 130. The output terminal of the power control module 150 is connected to the power supply terminal of the RS485 transceiver module 120 and the power supply terminal of the impedance control module 140.

[0021] It is understood that the RS485 transceiver module 120 is used to communicate with external devices via the RS485 interface 210 through the RS485 bus, and the protection module 110 is used to provide input protection and protect the downstream RS485 transceiver module 120. The impedance control module 140 is used to configure the impedance of the input terminal of the RS485 transceiver module 120 according to the first control signal provided by the first control pin. The MCU 130 can control the working state of the impedance control module 140 through its first control pin. In order to solve the signal reflection problem in the gateway device, the gateway device, as the end node of the RS485 bus, needs to connect a resistor on the bus. Different working states of the impedance control module 140 are used to control the connection and disconnection of the resistor. In this regard, the MCU 130 can realize the switching of different working states of the impedance control module 140 through the signal state of the first control signal output by the first control pin, so as to connect or disconnect the resistor connected at the end of the RS485 bus. The MCU130 can also control the operating state of the power control module 150 via its second control pin. Specifically, the power control module 150 is used to control the power supply to the RS485 transceiver module 120 and the impedance control module 140 according to the second control signal provided by the second control pin. In this regard, the MCU130 can switch between different operating states of the impedance control module 140 through the signal state of the second control signal output by the second control pin, thereby controlling the power control module 150 to supply power to the RS485 transceiver module 120 and the impedance control module 140.

[0022] The gateway device communicates based on the RS485 protocol. In the communication interface circuit, the RS485 transceiver module 120 and the RS485 interface 210 transmit data through two differential signal transmission lines. After the signal is received through the RS485 interface 210, it passes through the protection module 110 and then enters the RS485 transceiver module 120. Furthermore, the MCU 130 module can also control the working state of the power control module 150 through the second control pin, so that both the RS485 transceiver module 120 and the impedance control module 140 can be connected to the power supply voltage provided by the power control module 150. The MCU 130 module can control the impedance control module 140 through its first control pin to realize the impedance configuration of the gateway device connected on the bus.

[0023] As can be seen from the above scheme, this scheme, by introducing a software-controllable impedance control module, enables remote and automated configuration of interface operating parameters (such as terminal matching) according to changes in network topology, thereby improving the flexibility of network deployment. Furthermore, through a protection module, multi-level protection is achieved, enabling proactive fault isolation of the interface against faults or abnormal interference, enhancing system-level reliability and security. This results in an intelligent RS-485 interface system that integrates software configurability, fault isolation, and power consumption management. This upgrades the traditional static, passive, and high-maintenance-cost industrial communication interface into an intelligent network node adapted to the needs of the Industrial Internet of Things, improving the security of bus network communication.

[0024] Optionally, the protection module provides multi-level protection to prevent interference from abnormal signals received at the interface. Specifically, the protection module includes a first protection subunit, a second protection subunit, a third protection subunit, and a fourth protection subunit connected in sequence. The first protection subunit provides overcurrent protection, the second protection subunit rectifies the incoming signal and blocks reverse voltage, the third protection subunit filters common-mode interference, and the fourth protection subunit clamps voltage to prevent voltage surges and electrostatic interference. Through these sequentially connected protection subunits, the communication interface circuit can achieve input protection through the protection module to ensure the stable operation of the gateway device.

[0025] In some embodiments, overcurrent protection of the bus is achieved by configuring a self-resettable fuse to realize the first level of protection. The self-resettable fuse is an overcurrent electronic protection element based on a composite material of high molecular organic polymer and conductive particles. Through the temperature-sensitive material characteristics, it maintains low resistance conduction under normal conditions. When the circuit is overcurrent or the temperature is too high, it quickly switches to a high resistance state to cut off the current. After the fault is cleared, it automatically returns to the initial state, realizing the repeated protection function.

[0026] To address this, the first protection subunit includes a first resettable fuse and a second resettable fuse. The first and second signal terminals of the RS485 interface transmit signals to the communication interface circuit via different transmission lines. The transmission lines connecting the first and second signal terminals of the RS485 interface correspond to differential transmission lines on the bus. Therefore, the first and second resettable fuses are respectively positioned on different transmission lines for connecting the first and second signal terminals of the RS485 interface. Specifically, the first end of the first resettable fuse is connected to the first signal terminal of the RS485 interface, and the first end of the second resettable fuse is connected to the second signal terminal of the RS485 interface. The second ends of the first and second resettable fuses serve as different output terminals of the first protection subunit.

[0027] In some embodiments, the communication interface circuit further implements a second level of protection by providing reverse connection protection for the input voltage. The second protection subunit includes a bridge rectifier, a first TVS diode, a first diode, and a second diode. The bridge rectifier is a rectifier that converts AC power into pulsating DC power using the unidirectional conduction characteristic of diodes; it consists of four diodes forming a bridge structure to achieve full-wave rectification. The first TVS (Transient Voltage Suppressor) diode is an overvoltage protection device with bidirectional voltage regulation and bidirectional negative resistance characteristics. Specifically, the first and second AC input pins of the bridge rectifier are connected to different output terminals of the first protection subunit. The first end of the first TVS diode is connected to the positive output pin of the bridge rectifier, and the second end is connected to the negative output pin. The positive output pin of the bridge rectifier is also connected to the cathode of the first diode, and the negative output pin is also connected to the anode of the second diode. Both the anode of the first diode and the cathode of the second diode are grounded. In response, the second protection subunit can block reverse voltage through its bridge rectifier, preventing the RS485 transceiver module from being damaged due to reverse polarity connection of external equipment.

[0028] In some embodiments, the communication interface circuit further filters common-mode interference to achieve a third level of protection. The third protection subunit includes a common-mode choke coil, a first capacitor, and a second capacitor. Specifically, the common-mode choke coil is used to filter common-mode electromagnetic interference signals. In RS485 bus communication, the first and second transceiver terminals of the RS485 transceiver module are connected to differential transmission lines on the bus. For this purpose, the two windings of the common-mode choke coil are connected to different transmission lines. The input pin of the first winding of the common-mode choke coil serves as one input terminal of the third protection subunit, the input pin of the second winding serves as the other input terminal, the output pin of the first winding serves as one output terminal, and the output pin of the second winding serves as the other output terminal.

[0029] Specifically, the input pin of the first winding of the common-mode choke coil is connected to one output terminal of the first protection subunit, the output pin of the first winding of the common-mode choke coil is connected to the first transceiver terminal of the RS485 transceiver module, and the output pin of the first winding of the common-mode choke coil is connected to the first terminal of the first capacitor, the second terminal of the first capacitor is grounded. The input pin of the second winding of the common-mode choke coil is connected to the other output terminal of the first protection subunit, the output pin of the second winding of the common-mode choke coil is connected to the second transceiver terminal of the RS485 transceiver module, and the output pin of the second winding of the common-mode choke coil is connected to the first terminal of the second capacitor, the second terminal of the second capacitor is grounded.

[0030] It is understandable that the common-mode choke coil presents high impedance to common-mode interference and low impedance to differential-mode communication signals. The first and second capacitors are used to filter the signal. In this regard, the solution uses a third protection subunit to enable the differential transmission RS485 bus communication to operate stably, and can also filter the interference from motor start-stop and power grid fluctuations in the industrial field, which helps to ensure the stable operation of RS485 bus communication.

[0031] In some embodiments, the communication interface circuit also uses TVS diodes to provide electrostatic discharge (ESD) and surge protection functions, offering a fourth level of protection. The fourth protection subunit includes a second TVS diode and a third TVS diode. The first end of the second TVS diode is connected to the first transceiver terminal of the RS485 transceiver module, and the second end of the third TVS diode is connected to the second transceiver terminal of the RS485 transceiver module. Both the second ends of the second and third TVS diodes are grounded. It is understood that the second and third TVS diodes can form a voltage clamp when the applied ESD or surge voltage exceeds the breakdown voltage to prevent ESD or surge voltage from interfering with the RS485 transceiver module, thereby protecting the RS485 transceiver module.

[0032] Figure 2This is a schematic diagram of the circuit structure of a protection module provided in one embodiment of the present application. In one embodiment, the communication interface circuit forms four levels of protection through the protection module. Specifically, the first self-resetting fuse F1 and the second self-resetting fuse F2 in the first protection subunit 111 are respectively used to connect to the RS485 interface. The first end of the first self-resetting fuse F1 is connected to the first signal terminal of the RS485 interface, and the first end of the second self-resetting fuse F2 is connected to the second signal terminal of the RS485 interface. The second end of the first self-resetting fuse F1 is connected to the first winding input pin (corresponding to pin 3 in the figure) of the common-mode choke coil L10 in the third protection subunit 113, and the second end of the second self-resetting fuse F2 is connected to the second winding input pin (corresponding to pin 2 in the figure) of the common-mode choke coil L10.

[0033] Furthermore, a second protection subunit 112 is connected to the first winding input pin and the second winding input pin of the common-mode choke coil L10. The first AC input pin of the bridge rectifier D12 of the second protection subunit 112 is connected to the first winding input pin of the common-mode choke coil L10, and the second AC input pin of the bridge rectifier D12 is connected to the second winding input pin of the common-mode choke coil L10. The first end of the first TVS diode Ds1 in the second protection subunit 112 is connected to the positive output pin of the bridge rectifier D12, and the second end of the first TVS diode Ds1 is connected to the negative output pin of the bridge rectifier D12. The positive output pin of the bridge rectifier D12 is also connected to the cathode of the first diode D1, and the negative output pin of the bridge rectifier D12 is also connected to the anode of the second diode D2. The anode of the first diode D1 and the cathode of the second diode D2 are both grounded.

[0034] The first winding output pin (corresponding to pin 4 in the figure) of the common-mode choke coil L10 is connected to a grounded first capacitor C1, and the second winding output pin (corresponding to pin 1 in the figure) of the common-mode choke coil L10 is connected to a grounded second capacitor C2. Furthermore, the second TVS diode Ds2 in the fourth protection subunit 114 is connected to the first winding output pin of the common-mode choke coil L10, and the third TVS diode Ds3 is connected to the second winding output pin of the common-mode choke coil L10. Both the second TVS diode Ds2 and the third TVS diode Ds3 are also grounded.

[0035] In response, the communication interface circuit forms a multi-level protection through multiple protection sub-units within the protection module. This provides overcurrent protection, reverse overvoltage protection, common-mode interference protection, and electrostatic discharge protection for signals connected to the RS485 interface. As a result, the communication interface circuit can adapt to harsh working environments and effectively improve the stability of bus communication.

[0036] Figure 3This is a schematic diagram of the circuit structure of an impedance control module provided in one embodiment of the present application. In one embodiment, the impedance control module is a circuit module in the communication interface circuit that configures the impedance of the bus. After receiving the control signal provided by the MCU, it connects the terminating resistor R2 to the bus, thereby avoiding signal reflection and adapting to the impedance matching requirements of the gateway node acting as a slave device on the bus. Figure 3 As shown, the impedance control module includes an optocoupler relay U1, a first current-limiting resistor R1, and a terminating resistor R2. Specifically, the first input terminal of the optocoupler relay U1 serves as the power supply terminal of the impedance control module. The second input terminal of the optocoupler relay U1 is connected to the first terminal of the first current-limiting resistor R1, and the second terminal of the first current-limiting resistor R1 serves as the control terminal of the impedance control module. The first output terminal of the optocoupler relay U1 is connected to the first terminal of the terminating resistor R2. The second terminal of the terminating resistor R2 and the second output terminal of the optocoupler relay U1 serve as different output terminals of the impedance control module, that is, the second terminal of the terminating resistor R2 is connected to the first transceiver terminal of the RS485 transceiver module, and the second output terminal of the optocoupler relay U1 is connected to the second transceiver terminal of the RS485 transceiver module.

[0037] The optocoupler relay U1 is a semiconductor relay that uses light signals to control the on / off state of the circuit. It includes a light-emitting device (such as an LED) and a light-receiving device (such as a phototransistor). The anode of the light-emitting device serves as the first input terminal of the optocoupler relay U1, connected to the power supply voltage, and also acts as the power supply pin. The cathode of the light-emitting device serves as the second input terminal of the optocoupler relay U1, and can also act as the control pin. Furthermore, the input terminal of the light-receiving device serves as the first output terminal of the optocoupler relay U1 and can also act as a normally open pin; the output terminal of the light-receiving device serves as the second output terminal of the optocoupler relay U1 and can also act as a normally closed pin. It can be understood that when the control signal output from the first control pin of the MCU is high, the first current-limiting resistor R1 is connected to a high level, at which time the light-emitting device of the optocoupler relay U1 is not conducting, and the terminating resistor R2 is not connected to the bus. When the control signal output by the first control pin of the MCU is low, the first current limiting resistor R1 is connected to the low level, the light-emitting device of the optocoupler relay U1 is turned on, and the terminating resistor R2 is connected to the bus.

[0038] To address this, this solution uses an MCU to control the switching of the terminating resistor on the bus, adapting to the impedance matching requirements of different numbers of slave devices. This achieves impedance matching with the RS485 bus standard, reducing signal reflection and extending communication distance. Optionally, when the number of gateway devices acting as slaves is 8 or less, the control signal output from the MCU's first control pin is low to enable impedance matching, closing the internal contacts of the optocoupler relay and connecting the terminating resistor to the bus. Conversely, when the number of gateway devices acting as slaves is greater than 8, the control signal output from the MCU's first control pin is high, disabling impedance matching, opening the internal contacts of the optocoupler relay, and disconnecting the terminating resistor from the bus. This avoids multiple terminating resistors connected in parallel, which could lead to excessively low bus impedance and signal attenuation.

[0039] Figure 4 This is a schematic diagram of the circuit structure of a power control module provided in one embodiment of the present application. In one embodiment, the power control module serves as a circuit module in the communication interface circuit for supplying power to the RS485 transceiver module, the impedance control module, and the RS485 interface. The power control module is controlled by an MCU, and the second control signal output from the second control pin of the MCU is used to control the operating state of the power control module. As shown in the figure, the power control module includes a PMOS transistor Q1, an NPN transistor Q2, a second current-limiting resistor R3, a first voltage divider resistor R4, a second voltage divider resistor R5, a third capacitor C3, a fourth capacitor C4, and a fifth capacitor C5.

[0040] In this configuration, the first end of the second current-limiting resistor R3 serves as the control terminal of the power control module, the second end of the second current-limiting resistor R3 is connected to the base of the NPN transistor Q2, the first end of the first voltage-dividing resistor R4 is connected to the base of the NPN transistor Q2, the second end of the first voltage-dividing resistor R4 is connected to the emitter of the NPN transistor Q2, the first end of the third capacitor C3 is connected to the first end of the first voltage-dividing resistor R4, the second end of the third capacitor C3 is connected to the second end of the first voltage-dividing resistor R4, and the emitter of the NPN transistor Q2 is grounded.

[0041] The collector of NPN transistor Q2 is connected to the gate of PMOS transistor Q1. The source of PMOS transistor Q1 is connected to the operating voltage, which is provided by the external power supply of the device. The first terminal of the second voltage divider resistor R5 is connected to the source of PMOS transistor Q1, and the second terminal of the second voltage divider resistor R5 is connected to the gate of PMOS transistor Q1. The first terminal of the fourth capacitor C4 is connected to the source of PMOS transistor Q1, and the second terminal of the fourth capacitor C4 is connected to the gate of PMOS transistor Q1. The first terminal of the fifth capacitor C5 is connected to the drain of PMOS transistor Q1, and the second terminal of the fifth capacitor C5 is grounded. The drain of PMOS transistor Q1 serves as the output terminal of the power control module. Optionally, the third capacitor C3 and the fourth capacitor C4 can be decoupling capacitors to filter out high-frequency ripple in the power supply and prevent voltage fluctuations from affecting the operating stability of other devices.

[0042] It is understandable that the first end of the second current-limiting resistor R3 is connected to the second control pin of the MCU to receive the second control signal, while the first voltage divider resistor R4 divides the voltage at the base of the NPN transistor Q2 to adjust the base voltage of the NPN transistor Q2, and the conduction state of the PMOS transistor Q1 is controlled by the conduction state of the NPN transistor Q2. It can be inferred that when the second control signal is high, the base of NPN transistor Q2 is high due to the voltage division by the second current-limiting resistor R3 and the first voltage-dividing resistor R4. The base and emitter of NPN transistor Q2 meet the conduction condition, causing Q2 to conduct. With Q2 conducting, the gate voltage of PMOS transistor Q1 is pulled low. The second voltage-dividing resistor R5 ensures that the voltage difference between the source and gate of PMOS transistor Q1 meets the conduction condition, allowing Q1 to conduct and output its supply voltage through its drain. The RS485 transceiver module and the impedance control module can then connect to the supply voltage. Conversely, when the second control signal is low, the base of NPN transistor Q2 is low, and the base and emitter do not meet the conduction condition, causing Q2 to not conduct. Consequently, PMOS transistor Q1 also fails to meet the conduction condition, thus disconnecting the supply voltage to other modules.

[0043] In response, this solution controls the power supply to each module in the communication interface circuit by controlling the power control module. This helps to enable sleep control of the communication interface circuit, thereby reducing the power consumption of the circuit and benefiting the long-term operation of the gateway device.

[0044] Figure 5The circuit structure diagram of the communication interface circuit provided in one embodiment of this application is shown in the figure. The communication interface circuit forms multi-level protection before the RS485 transceiver module 120 through multiple protection sub-units in the protection module, thereby ensuring the stability of RS485 bus communication. Furthermore, the impedance control module 140, controlled by the MCU (not shown in the figure), matches the impedance of the RS485 bus, thereby matching the impedance requirements in the bus network. The power control module 150, controlled by the MCU, provides power supply control to the circuit modules, reducing circuit power consumption.

[0045] Specifically, the RS485 interface serves as the interface for external connection. The first signal terminal of the RS485 interface is connected to the first terminal of the first resettable fuse F1 in the first protection subunit 111, and the second signal terminal of the RS485 interface is connected to the first terminal of the second resettable fuse F2 in the first protection subunit 111. The first AC input pin of the bridge rectifier D12 in the second protection subunit 112 is connected to the second terminal of the first resettable fuse F1, and the second AC input pin of the bridge rectifier D12 is connected to the second terminal of the second resettable fuse F2. Furthermore, the positive output pin and the negative output pin of the bridge rectifier D12 are connected to a first TVS diode Ds1, that is, the first terminal of the first TVS diode Ds1 is connected to the positive output pin of the bridge rectifier D12, and the second terminal of the first TVS diode Ds1 is connected to the negative output pin of the bridge rectifier D12. In addition, the positive output pin of the bridge rectifier D12 is also connected to the cathode of the first diode D1, and the negative output pin of the bridge rectifier D12 is also connected to the anode of the second diode D2. The anode of the first diode D1 and the cathode of the second diode D2 are both grounded.

[0046] The first winding input pin (corresponding to pin 3 in the diagram) of the common-mode choke coil L10 in the third protection subunit 113 is connected to the second terminal of the first resettable fuse F1, and the second winding input pin (corresponding to pin 2 in the diagram) of the common-mode choke coil L10 is connected to the second terminal of the second resettable fuse F2. The first winding output pin (corresponding to pin 4 in the diagram) of the common-mode choke coil L10 is connected to the inverting bus pin B of the RS485 transceiver chip U2 in the RS485 transceiver module 120. The second winding output pin of the common-mode choke coil L10... (Corresponding to pin 1 in the diagram) Connect to the non-inverting bus pin BA of the RS485 transceiver chip U2. That is, the inverting bus pin B of the RS485 transceiver chip U2 serves as the first transceiver terminal of the RS485 transceiver module 120, and the non-inverting bus pin A of the RS485 transceiver chip U2 serves as the second transceiver terminal of the RS485 transceiver module 120. The first winding output pin of the common-mode choke coil L10 is also grounded through the first capacitor C1, and the second winding output pin of the common-mode choke coil L10 is also grounded through the second capacitor C2. Furthermore, one end of the second TVS diode Ds2 in the fourth protection subunit 114 is connected to the first winding output pin of the common-mode choke coil L10, and the other end of the second TVS diode Ds2 is grounded. One end of the third TVS diode Ds3 is connected to the second winding output pin of the common-mode choke coil L10, and the other end of the third TVS diode Ds3 is grounded.

[0047] The MCU connects to the first terminal of the first current-limiting resistor R1 of the impedance control module 140 via its first control pin. The second terminal of the first current-limiting resistor R1 is connected to the second input terminal of the optocoupler relay U1. The first input terminal of the optocoupler relay U1 is connected to the drain of the PMOS transistor Q1 in the power control module 150. The first output terminal of the optocoupler relay U1 is connected to the first terminal of the terminating resistor R2. The second terminal of the terminating resistor R2 is connected to the inverting bus pin B of the RS485 transceiver chip U2. The second output terminal of the optocoupler relay U1 is connected to the non-inverting bus pin A of the RS485 transceiver chip U2.

[0048] Furthermore, the MCU connects to the first end of the second current-limiting resistor R3 of the power control module 150 via its second control pin. The second end of the second current-limiting resistor R3 is connected to the base of the NPN transistor Q2. The first end of the first voltage divider resistor R4 is connected to the base of the NPN transistor Q2. The second end of the first voltage divider resistor R4 is connected to the emitter of the NPN transistor Q2. The first end of the third capacitor C3 is connected to the first end of the first voltage divider resistor R4. The second end of the third capacitor C3 is connected to the second end of the first voltage divider resistor R4. The emitter of the NPN transistor Q2 is grounded. The collector of NPN transistor Q2 is connected to the gate of PMOS transistor Q1. The source of PMOS transistor Q1 is connected to the power supply voltage. The first end of the second voltage divider resistor R5 is connected to the source of PMOS transistor Q1, and the second end of the second voltage divider resistor R5 is connected to the gate of PMOS transistor Q1. The first end of the fourth capacitor C4 is connected to the source of PMOS transistor Q1, and the second end of the fourth capacitor C4 is connected to the gate of PMOS transistor Q1. The first end of the fifth capacitor C5 is connected to the drain of PMOS transistor Q1, and the second end of the fifth capacitor C5 is grounded. The drain of PMOS transistor Q1 is connected to the power supply terminal of RS485 transceiver module 120 and the power supply terminal of impedance control module 140.

[0049] In the RS485 transceiver module 120, the power supply pin VCC of the RS485 transceiver chip U2 is connected to the drain of the PMOS transistor Q1, and the power supply pin VCC of the RS485 transceiver chip U2 is also grounded through parallel capacitors C6 and C7. The inverting bus pin B of the RS485 transceiver chip U2 serves as the first transceiver terminal of the RS485 transceiver module 120, and it is connected to the first winding output pin of the common-mode choke coil L10, and the inverting bus pin B of the RS485 transceiver chip U2 is grounded through the first pull-down resistor R6. The non-inverting bus pin A of the RS485 transceiver chip U2 serves as the second transceiver terminal of the RS485 transceiver module 120, and it is connected to the second winding output pin of the common-mode choke coil L10, and the non-inverting bus pin A of the RS485 transceiver chip U2 is connected to the drain of the PMOS transistor Q1 through the first pull-up resistor R7. The MCU's bus communication pins include a first receive pin, a first transmit pin, and a third control pin. The receiver output pin RO of the RS485 transceiver chip U2 is connected to the MCU's first receive pin, and the receiver output pin RO of the RS485 transceiver chip U2 is connected to the drain of the PMOS transistor Q1 through a second pull-up resistor R8. The driver input pin DI of the RS485 transceiver chip U2 is connected to the MCU's first transmit pin, and the driver input pin DI of the RS485 transceiver chip U2 is connected to the drain of the PMOS transistor Q1 through a third pull-up resistor R9. The driver enable pin DE and the receiver enable pin RE (active low) of the RS485 transceiver chip U2 are both connected to the MCU's third control pin to control the operating state of the RS485 transceiver chip U2. The driver enable pin DE and the receiver enable pin RE of the RS485 transceiver chip U2 are also grounded through a second pull-down resistor R10. Each pull-up resistor and each pull-down resistor is used to ensure a stable level when the bus is idle and to avoid false triggering. Capacitors C6 and C7 are used to filter out high-frequency interference from the power supply and the bus, thereby improving the anti-interference capability of communication.

[0050] To address this, in the communication interface circuit, the MCU outputs a high level through its second control pin to turn on the NPN transistor Q2. This pulls down the voltage at the collector of Q2, causing the PMOS transistor Q1 to turn on, thus providing power to other modules in the circuit. Furthermore, the MCU uses its first control pin for impedance matching to adapt to the number of slave devices in the bus network. For example, if the number of gateway devices acting as slaves is less than or equal to eight, the control signal output by the MCU's first control pin is low to connect the terminating resistor R2 to the bus. Conversely, if the number of gateway devices acting as slaves is greater than eight, the control signal output by the MCU's first control pin is high to disconnect the terminating resistor R2 from the bus, thus preventing multiple terminating resistors R2 in parallel from causing excessively low bus impedance and signal attenuation.

[0051] During the data transmission phase, the MCU can output a high level via the third control pin to switch the RS485 transceiver chip U2 to transmit mode and provide a TTL signal to the driver input pin DI of the RS485 transceiver chip U2. This causes the RS485 transceiver chip U2 to convert the TTL signal into an RS485 differential signal, which is then transmitted to the external device through the protection module 110 and the RS485 interface. During the data reception phase, the MCU can output a low level via the third control pin to switch the RS485 transceiver chip U2 to receive mode. The RS485 differential signal provided by the external device is connected to the RS485 transceiver chip U2 through the RS485 interface and the protection module. The RS485 transceiver chip U2 converts the RS485 differential signal into a TTL signal and transmits it to the MCU through the receiver output pin RO of the RS485 transceiver chip U2.

[0052] In practical applications, power stations consist of dozens to hundreds of inverters and meters connected in series via an RS-485 bus, extending for several kilometers. When a power station expands, the monitoring center issues commands through the system, and the gateway MCU automatically sets the control signal level of the new end node high to connect to the terminating resistor R2. The original end nodes remotely disable their resistors to achieve topology adaptation, and the entire process is completed within minutes without any on-site work. Furthermore, when a node detects a continuous high-voltage surge on the bus (such as lightning strike induction), it can be physically disconnected within milliseconds under the control of the MCU, limiting the damage to a single node. Moreover, at night or in the absence of light, the MCU automatically executes a sleep process, reducing the power consumption of the interface circuit to zero. This significantly reduces the capacity requirements of the energy storage battery and the system cost.

[0053] This application also provides a circuit board including the communication interface circuit provided in the above embodiments. This circuit enables remote and automated configuration of interface operating parameters (such as terminal matching) according to changes in network topology, improving the flexibility of network deployment. Furthermore, multi-level protection is achieved through a protection module, enabling proactive fault isolation of the interface from faults or abnormal interference, enhancing system-level reliability and security.

[0054] This application also provides a gateway device, which includes the circuit board provided in the above embodiments. This enables the gateway device's interface operating parameters (such as terminal matching) to be remotely and automatically configured according to changes in network topology, improving the flexibility of network deployment. Furthermore, multi-level protection is achieved through a protection module, enabling proactive fault isolation of the interface from faults or abnormal interference, enhancing system-level reliability and security. This results in a gateway device with an intelligent RS-485 interface that integrates software configurability, fault isolation, and power management, adapting to the needs of the Industrial Internet of Things and meeting the security requirements of bus network communication.

[0055] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0056] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.

Claims

1. A communication interface circuit, characterized in that, include: The protection module has an input terminal for connecting to an RS485 interface and provides input protection to protect the next-level RS485 transceiver module. An RS485 transceiver module is provided, the input of which is connected to the protection module. The RS485 transceiver module is used to communicate with external devices via the RS485 interface using an RS485 bus. The MCU's bus communication pin is connected to the output of the RS485 transceiver module; An impedance control module is provided, wherein the control terminal of the impedance control module is connected to the first control pin of the MCU, the output terminal of the impedance control module is used to connect to the input terminal of the RS485 transceiver module, and the impedance control module is used to configure the impedance of the input terminal of the RS485 transceiver module according to the first control signal provided by the first control pin. The power control module has its control terminal connected to the second control pin of the MCU, and its output terminal connected to the power supply terminal of the RS485 transceiver module and the impedance control module. The power control module is used to control the power supply of the RS485 transceiver module and the impedance control module according to the second control signal provided by the second control pin.

2. The communication interface circuit according to claim 1, characterized in that, The protection module includes a first protection subunit, a second protection subunit, a third protection subunit, and a fourth protection subunit connected in sequence. The first protection subunit is used to provide overcurrent protection, the second protection subunit is used to rectify the incoming signal and block reverse voltage, the third protection subunit is used to filter out common-mode interference, and the fourth protection subunit is used to perform voltage clamping to prevent voltage surges and electrostatic interference.

3. The communication interface circuit according to claim 2, characterized in that, The first protection subunit includes a first self-resetting fuse and a second self-resetting fuse. The first end of the first self-resetting fuse is connected to the first signal terminal of the RS485 interface, and the first end of the second self-resetting fuse is connected to the second signal terminal of the RS485 interface. The second ends of the first self-resetting fuse and the second self-resetting fuse serve as different output terminals of the first protection subunit.

4. The communication interface circuit according to claim 2, characterized in that, The second protection subunit includes a bridge rectifier, a first TVS diode, a first diode, and a second diode; The first AC input pin and the second AC input pin of the bridge rectifier are respectively connected to different output terminals of the first protection subunit. The first end of the first TVS diode is connected to the positive output pin of the bridge rectifier, and the second end of the first TVS diode is connected to the negative output pin of the bridge rectifier. The positive output pin of the bridge rectifier is also connected to the cathode of the first diode, and the negative output pin of the bridge rectifier is also connected to the anode of the second diode. The anode of the first diode and the cathode of the second diode are both grounded.

5. The communication interface circuit according to claim 2, characterized in that, The third protection subunit includes a common-mode choke coil, a first capacitor, and a second capacitor; The first winding input pin of the common mode choke coil is connected to one output terminal of the first protection subunit, the first winding output pin of the common mode choke coil is connected to the first transceiver terminal of the RS485 transceiver module, and the first winding output pin of the common mode choke coil is connected to the first terminal of the first capacitor, and the second terminal of the first capacitor is grounded. The second winding input pin of the common-mode choke coil is connected to another output terminal of the first protection subunit, the second winding output pin of the common-mode choke coil is connected to the second transceiver terminal of the RS485 transceiver module, and the second winding output pin of the common-mode choke coil is connected to the first terminal of the second capacitor, and the second terminal of the second capacitor is grounded.

6. The communication interface circuit according to claim 2, characterized in that, The fourth protection subunit includes a second TVS tube and a third TVS tube. The first end of the second TVS tube is connected to the first transceiver terminal of the RS485 transceiver module, and the second end of the third TVS tube is connected to the second transceiver terminal of the RS485 transceiver module. The second ends of both the second and third TVS tubes are grounded.

7. The communication interface circuit according to claim 1, characterized in that, The impedance control module includes an optocoupler relay, a first current-limiting resistor, and a terminating resistor; The first input terminal of the optocoupler relay serves as the power supply terminal of the impedance control module. The second input terminal of the optocoupler relay is connected to the first terminal of the first current-limiting resistor. The second terminal of the first current-limiting resistor serves as the control terminal of the impedance control module. The first output terminal of the optocoupler relay is connected to the first terminal of the terminating resistor. The second terminal of the terminating resistor and the second output terminal of the optocoupler relay serve as different output terminals of the impedance control module.

8. The communication interface circuit according to claim 1, characterized in that, The power control module includes a PMOS transistor, an NPN transistor, a second current-limiting resistor, a first voltage-dividing resistor, a second voltage-dividing resistor, a third capacitor, a fourth capacitor, and a fifth capacitor. The first end of the second current-limiting resistor serves as the control terminal of the power control module. The second end of the second current-limiting resistor is connected to the base of the NPN transistor. The first end of the first voltage-dividing resistor is connected to the base of the NPN transistor. The second end of the first voltage-dividing resistor is connected to the emitter of the NPN transistor. The first end of the third capacitor is connected to the first end of the first voltage-dividing resistor. The second end of the third capacitor is connected to the second end of the first voltage-dividing resistor. The emitter of the NPN transistor is grounded. The collector of the NPN transistor is connected to the gate of the PMOS transistor, and the source of the PMOS transistor is connected to the operating voltage. The first end of the second voltage divider resistor is connected to the source of the PMOS transistor, and the second end of the second voltage divider resistor is connected to the gate of the PMOS transistor. The first end of the fourth capacitor is connected to the source of the PMOS transistor, and the second end of the fourth capacitor is connected to the gate of the PMOS transistor. The first end of the fifth capacitor is connected to the drain of the PMOS transistor, and the second end of the fifth capacitor is grounded. The drain of the PMOS transistor serves as the output terminal of the power control module.

9. A circuit board, characterized in that, Includes the communication interface circuit as described in any one of claims 1-8.

10. A gateway device, characterized in that, Includes the circuit board as described in claim 9.