Multiplexing type multifunction interface circuit

By reusing I/O ports and optimizing peripheral circuit design, multi-functional integration in traditional interface circuits is achieved, solving the problems of complex design, high cost, and weak anti-interference capability of traditional interface circuits. It provides a multi-functional interface circuit with compact structure, low cost, and strong anti-interference capability, which is suitable for industrial automation and intelligent control.

CN224583174UActive Publication Date: 2026-07-31DEMING COMM SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
DEMING COMM SHANGHAI CO LTD
Filing Date
2025-07-03
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional interface circuits are complex, costly, and have weak anti-interference capabilities, making it difficult to simultaneously meet the needs of digital signal output, frequency signal driving, and relay control. They also suffer from insufficient driving capability, slow response speed, and inadequate protection measures.

Method used

A multiplexed multi-functional interface circuit is adopted. By multiplexing I/O ports and optimizing the peripheral circuit design, including GPIO output circuit, frequency output circuit and relay drive circuit, and using components such as pull-up resistors, current limiting resistors, filter capacitors, MOSFETs and freewheeling diodes, stable signal transmission and protection are achieved.

Benefits of technology

A multi-functional interface circuit with compact structure, low cost and strong anti-interference capability has been realized, which can simultaneously meet the requirements of digital signal output, frequency signal drive and relay control, thereby improving the reliability and response speed of the circuit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224583174U_ABST
    Figure CN224583174U_ABST
Patent Text Reader

Abstract

This invention provides a multiplexed multifunctional interface circuit, including a microcontroller control unit, a GPIO output circuit, a frequency output circuit, a relay drive circuit, and a relay drive circuit; wherein the microcontroller control unit is provided with a first I / O port and a second I / O port. This invention's interface, through multiplexing I / O ports and optimizing peripheral circuit design, can simultaneously meet multiple functional requirements such as digital signal output, frequency signal drive, and relay control, and has advantages such as compact structure, low cost, and strong anti-interference capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model belongs to the field of interface circuit design technology, and relates to a multiplexed multifunctional interface circuit. Background Technology

[0002] In fields such as industrial automation, intelligent control, and embedded systems, the design of interface circuits directly affects the stability and functional expandability of equipment. Traditional interface circuits typically employ discrete designs; for example, GPIO output, PWM signal driving, and relay control require separate circuits, resulting in complex hardware structures, large PCB space requirements, high costs, and susceptibility to signal interference. Especially in applications requiring simultaneous control of digital signal output and power loads (such as relays), existing solutions often suffer from insufficient driving capability, slow response speed, and poor anti-interference performance. For instance, ordinary GPIO output circuits, when driving high-current loads, often lack effective current limiting and reverse voltage protection measures, leading to damage to the microcontroller's I / O ports. Traditional relay driver circuits often use direct transistor driving, lacking freewheeling protection, and are prone to generating high-voltage reverse electromotive force when the relay is disconnected, affecting circuit stability and potentially damaging the control chip. Furthermore, the output of frequency signals (such as PWM) usually requires additional signal amplification circuits, increasing system complexity and power consumption.

[0003] While some existing solutions attempt to reduce external components through integrated design, the following problems remain: First, the I / O port multiplexing capability is limited, making it difficult to simultaneously meet the needs of digital signal output and power drive; second, the circuit's anti-interference capability is weak, especially in industrial environments where high-frequency noise and electromagnetic interference can easily lead to signal distortion or false triggering; third, the protection measures for the relay drive section are insufficient, and long-term use can easily cause device failure due to voltage spikes. Furthermore, traditional designs lack optimization in filtering and reverse connection protection, making it difficult to guarantee signal quality and affecting control accuracy. Therefore, there is an urgent need for a highly integrated, reliable, and low-cost multifunctional interface circuit that can achieve multiple functions such as GPIO output, frequency signal drive, and relay control under a single hardware architecture, while possessing good anti-interference and circuit protection capabilities to meet the high-performance requirements of modern automation equipment for interface circuits.

[0004] In view of the above, this utility model is hereby proposed. Utility Model Content

[0005] The purpose of this utility model is to provide a multiplexed multi-functional interface circuit that can simultaneously meet multiple functional requirements such as digital signal output, frequency signal driving, and relay control by multiplexing I / O ports and optimizing peripheral circuit design. It has the advantages of compact structure, low cost, and strong anti-interference ability.

[0006] In order to achieve the above-mentioned objectives of this utility model, the following technical solution is adopted: A multiplexed multi-functional interface circuit includes a microcontroller control unit, a GPIO output circuit, a frequency output circuit, a relay drive circuit, and a relay drive circuit; wherein the microcontroller control unit is provided with a first I / O port and a second I / O port; The GPIO output circuit includes a pull-up resistor R123, a current-limiting resistor R128, a filter capacitor C105, a bidirectional trigger diode VD110, an anti-reverse diode D207, and an external interface. The Relay drive circuit and frequency output circuit include a parallel current-limiting resistor R118 and a pull-up resistor R117, an NPN transistor Q101, a current-limiting resistor R116, a current-limiting resistor R122, a MOSFET Q208, a filter capacitor C111, and an external interface. The relay drive circuit includes a current-limiting resistor R118 and a pull-up resistor R117 connected in parallel, an NPN transistor Q101, a current-limiting resistor R116, a current-limiting resistor R122, a MOSFET Q208, a filter capacitor C111, a freewheeling diode D208, and a filter capacitor C114.

[0007] Preferably, as a further embodiment, in the GPIO output circuit, one end of the pull-up resistor R123 is connected to the power supply voltage, and the other end is connected to the first IO port through the current limiting resistor R128; one end of the filter capacitor C105 is grounded, and the other end is connected between the current limiting resistor R128 and the external interface; the positive terminal of the anti-reverse diode D207 is grounded through the bidirectional trigger diode VD110, and the negative terminal is connected to the external interface.

[0008] Preferably, as a further embodiment, in the Relay drive circuit and the frequency output circuit, the pull-up resistor R117 and the current-limiting resistor R118 are connected in parallel, with one end connected to the second IO port and the other end connected to the current-limiting resistor R116.

[0009] Preferably, as a further embodiment, one end of the pull-up resistor R117 is connected to the power supply voltage, and the other end is connected to the second IO port.

[0010] Preferably, as a further embodiment, the base of the NPN transistor Q101 is connected to the second IO port through a current-limiting resistor R118, the emitter is grounded through the current-limiting resistor R122, and the collector and the pull-up resistor R117 are connected to the power supply voltage.

[0011] Preferably, as a further embodiment, one end of the current-limiting resistor R116 is connected between the emitter of the NPN transistor Q101 and the current-limiting resistor R122, and the other end is connected to the gate of the MOSFET Q208; the drain of the MOSFET Q208 is grounded, and the source is connected to the external interface; one end of the filter capacitor C111 is grounded, and the other end is connected between the source of the MOSFET Q208 and the external interface.

[0012] Preferably, as a further embodiment, in the relay driving circuit, the anode of the freewheeling diode D208 is connected to the source of the MOSFET Q208 through the filter capacitor C114, and the cathode is connected to the external power supply voltage; one end of the filter capacitor C111 is grounded, and the other end is connected between the filter capacitor C114 and the source of the MOSFET Q208.

[0013] Preferably, as a further embodiment, one end of the bidirectional trigger diode VD110 is connected to the positive terminal of the anti-reverse diode D207, and the other end is grounded.

[0014] Preferably, as a further embodiment, in the relay driving circuit, the freewheeling diode D208 is a fast recovery diode with a reverse breakdown voltage greater than 50V; the capacitance of the filter capacitor C114 is 100nF.

[0015] The core function of the GPIO output circuit of this invention is to control the level state of the external interface through the microcontroller's I / O port, thereby achieving high-level or low-level output of digital signals. This GPIO circuit mainly consists of a pull-up resistor R123, a current-limiting resistor R128, a filter capacitor C105, a bidirectional trigger diode VD110, a reverse protection diode D207, and an external interface. Its workflow is as follows: When the microcontroller's I / O port (OUTPUT1_EN_P5) is not actively controlled, the pull-up resistor R123 pulls the external interface high to 3.3V by default. At this time, the external device receives a high-level signal. The resistance of the pull-up resistor R123 is 10KΩ. Its function is to ensure that the circuit outputs a stable high level in the default state and avoid interference caused by the signal floating. The current-limiting resistor R128 is connected in series between the first I / O port and the external interface to limit the current and prevent excessive current from damaging the microcontroller or external device. The filter capacitor C105 is connected between the external interface and ground to filter out high-frequency noise and ensure the stability of the output signal. The negative terminal of the anti-reverse diode D207 is connected to the external interface, and the positive terminal is grounded through the bidirectional trigger diode VD110. Its function is to prevent the circuit from being damaged when the external interface is connected to a reverse voltage. The bidirectional trigger diode VD110 is used to quickly turn on in case of voltage abnormalities, protecting subsequent circuits. When the microcontroller needs to output a low level, the first I / O port is pulled low, and current flows to the microcontroller through the current-limiting resistor R128. The external interface voltage is pulled down to 0V, thus achieving a low-level output. Throughout this process, the filter capacitor C105 and the reverse protection diode D207 work together to ensure signal purity and circuit safety. This design not only simplifies the circuit structure but also improves anti-interference capabilities, making it suitable for various digital signal control scenarios. The frequency output circuit of this invention generates a square wave signal of a fixed frequency through the second IO port of the microcontroller. Its core components include a pull-up resistor R117, a current-limiting resistor R118, an NPN transistor Q101, a current-limiting resistor R116, a MOSFET Q208, and a filter capacitor C111. The circuit's workflow is as follows: The microcontroller's second I / O port (BLE_P22_EXT_BUZZER1) is pulled high to 3.3V by default through pull-up resistor R117. At this time, transistor Q101 is in the off state, and the gate voltage of MOSFET Q208 is pulled low by current-limiting resistor R116, turning off the MOSFET and outputting a high level from the external interface. When the microcontroller's second I / O port outputs a low level, current flows into the base of transistor Q101 through current-limiting resistor R118, turning it on. The collector current of transistor Q101 is grounded through current-limiting resistor R122, and its emitter voltage is pulled low, causing the gate voltage of MOSFET Q208 to rise, turning on the MOSFET and pulling the external interface low. By controlling the high and low level switching frequency of the microcontroller's second I / O port, a square wave signal of the corresponding frequency can be generated on the external interface. The filter capacitor C111 is connected between the source of the MOSFET and ground to filter out high-frequency noise during the switching process and ensure the purity of the output signal. The high switching speed and low on-resistance of the MOSFET Q208 enable it to respond quickly to frequency changes and ensure the accuracy of the output waveform. The purpose of the Relay drive circuit of this utility model is to control the on / off of a high-current load through the second IO port of the microcontroller. Its core components include a pull-up resistor R117, a current-limiting resistor R118, an NPN transistor Q101, a current-limiting resistor R116, a MOSFET Q208, and a filter capacitor C111. The circuit's operation is as follows: In the default state, the microcontroller's second I / O port (BLE_P22_EXT_BUZZER1) is kept high through pull-up resistor R117, transistor Q101 is cut off, and the gate voltage of MOSFET Q208 is pulled low by current-limiting resistor R116, turning off the MOSFET and preventing current from flowing through the external load. When the microcontroller's second I / O port outputs a low level, current flows through current-limiting resistor R118 to drive transistor Q101 to conduct, pulling its emitter voltage low. This causes the gate voltage of MOSFET Q208 to rise, turning on the MOSFET and forming a loop with the external load, with a current up to 3A. Simultaneously, the high current handling capacity and low conduction loss of MOSFET Q208 make it very suitable for driving high-power loads. Filter capacitor C111 is used to absorb voltage spikes during the switching process, protecting the MOSFET from damage. Therefore, the Relay circuit of this invention has a fast dynamic response speed, can follow the control signals of the microcontroller's I / O port in real time, and is suitable for applications requiring rapid switching. Through this design, the Relay drive circuit not only achieves efficient energy transmission, but also has good anti-interference and self-protection capabilities; The relay drive circuit of this invention adds a freewheeling protection function to the existing relay drive circuit. The core components include a freewheeling diode D208 and a filter capacitor C114. Its working process is as follows: When the microcontroller's second IO port (BLE_P22_EXT_BUZZER1) outputs a low level, transistor Q101 is turned on, the gate voltage of MOSFET Q208 increases, the MOSFET is turned on, the relay coil is energized, and the contacts are closed. At this point, the freewheeling diode D208 is in reverse cutoff mode and has no effect on the circuit. When the microcontroller's second I / O port suddenly switches to a high level, transistor Q101 is cut off, MOSFET Q208 is turned off, and the relay coil is de-energized. Due to the inductive characteristics of the relay, the coil generates a reverse electromotive force. The freewheeling diode D208 (a fast recovery diode with a reverse breakdown voltage greater than 50V) is forward-biased at this time, providing a discharge path for the reverse current and preventing high voltage from damaging the MOSFET or other components. The filter capacitor C114 is connected in parallel across the relay coil to further absorb high-frequency noise and voltage fluctuations, ensuring circuit stability. This design effectively solves the voltage spike problem during relay switching, significantly improving the reliability and lifespan of the circuit. When driving the relay, the reverse voltage is limited to a safe range, and the MOSFET and microcontroller I / O port are not damaged. Furthermore, the synergistic effect of the filter capacitor C114 and the freewheeling diode D208 allows the circuit to maintain stable performance even in harsh environments, making it very suitable for demanding scenarios such as industrial automation.

[0016] Compared with the prior art, the beneficial effects of this utility model are as follows: (1) This utility model provides a multiplexed multi-functional interface circuit. By multiplexing the IO port and optimizing the peripheral circuit design, it can simultaneously meet multiple functional requirements such as digital signal output, frequency signal driving and relay control. It has the advantages of compact structure, low cost and strong anti-interference ability.

[0017] (2) This utility model realizes the function that traditionally required three independent circuits by using a single hardware platform through the reconfiguration capability of the microcontroller's IO port and the optimized design of the peripheral circuit.

[0018] (3) This utility model uses dynamic impedance matching technology to automatically adjust the output impedance in different working modes to ensure maximum signal transmission efficiency. Attached Figure Description

[0019] Figure 1 This is a structural diagram of a reusable multifunctional interface circuit according to the present invention; Figure 2 This is a standard digital signal diagram of the GPIO output control of this utility model; Figure 3 This is a waveform diagram of the frequency output of this utility model; Figure 4 This represents the maximum conduction current that the MOS transistor Q208 in this invention can withstand. Figure 5 This is a waveform diagram of the output of the Relay circuit in this invention; Figure 6 The image shows an actual test image of the Relay circuit in this invention.

[0020] The following are the labels in the diagram: 1. First I / O port (OUTPUT1_EN_P5); 2. Second I / O port (BLE_P22_EXT_BUZZER1); 3. Pull-up resistor R123; 4. Current-limiting resistor R128; 5. Filter capacitor C105; 6. Anti-reverse diode D207; 7. Pull-up resistor R117; 8. NPN transistor Q101; 9. MOSFET Q208; 10. Filter capacitor C114; 11. External interface; 12. Freewheeling diode D208; 13. External power supply voltage VIN-12V0; 14. Power supply voltage VCC-I0 of R177; 15. Power supply voltage VCC-I0 of R123; 16. Filter capacitor C111; 17. Current-limiting resistor R116; 18. Current-limiting resistor R122; 19. Current-limiting resistor R118; 20. Bidirectional trigger diode VD110. Detailed Implementation

[0021] The technical solution of this utility model will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. However, those skilled in the art will understand that the embodiments described below are some embodiments of this utility model, but not all embodiments, and are only used to illustrate this utility model, and should not be regarded as limiting the scope of this utility model. Based on the embodiments of this utility model, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this utility model.

[0022] In the description of this utility model, it should be understood that the terms "top", "bottom", "inner", "side wall", etc., which indicate orientation or positional relationship, are only for the convenience of describing this utility model and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this utility model.

[0023] To more clearly illustrate the technical solution of this utility model, the following description is provided in the form of specific embodiments.

[0024] Example 1 Please see Figure 1 ,Depend on Figure 1As can be seen, this utility model is a multiplexed multi-functional interface circuit, including a microcontroller control unit, a GPIO output circuit, a frequency output circuit, a relay drive circuit, and a relay drive circuit; wherein the microcontroller control unit is provided with 1 first IO port (OUTPUT1_EN_P5) and 2 second IO ports (BLE_P22_EXT_BUZZER1). The GPIO output circuit includes 3 pull-up resistors R123, 4 current-limiting resistors R128, 5 filter capacitors C105, 20 bidirectional trigger diodes VD110, 6 reverse protection diodes D207, and 11 external interfaces. In this GPIO output circuit, one end of the 3 pull-up resistors R123 is connected to the 15R123 power supply voltage VCC-I0, and the other end is connected to the 1st I / O port (OUTPUT1_EN_P5) through the 4 current-limiting resistors R128. One end of the 5 filter capacitors C105 is grounded, and the other end is connected between the 4 current-limiting resistors R128 and the 11 external interface. The positive terminal of the 6 reverse protection diodes D207 is grounded through the 20 bidirectional trigger diodes VD110, and the negative terminal is connected to the 11 external interface. One end of the 20 bidirectional trigger diodes VD110 is connected to the positive terminal of the 6 reverse protection diodes D207, and the other end is grounded. The specific working process of the GPIO output circuit of this utility model is as follows: When the output circuit outputs a high level and the first IO port (OUTPUT1_EN_P5) of the microcontroller is not actively controlled, the pull-up resistor R123 pulls the external interface of the microcontroller high to 3.3V by default, and the external device receives a high-level signal at this time; when the microcontroller needs to output a low level, the first IO port is pulled low, the current flows to the microcontroller through the current-limiting resistor R128, and the external interface voltage is pulled low to 0V, thereby realizing the low-level output. The final standard digital signal diagram of GPIO output control is shown in Figure 1. Figure 2 As shown; at this time, the pull-up resistor R123 on the GPIO circuit has a resistance of 10KΩ. Its function is to ensure a stable high level output in the default state and avoid interference caused by floating signals. The current-limiting resistor R128 is connected in series between the first IO port 1 and the external interface 11 to limit the current and prevent excessive current from damaging the microcontroller or external devices. The filter capacitor C105 is connected between the external interface 11 and ground to filter out high-frequency noise and ensure the stability of the output signal. The negative terminal of the anti-reverse diode D207 is connected to the external interface 11, and the positive terminal is grounded through the 20-bit bidirectional trigger diode VD110. Its function is to prevent the circuit from being damaged when the external interface 11 is connected to a reverse voltage. The 20-bit bidirectional trigger diode VD110 is used to quickly conduct in case of abnormal voltage to protect the subsequent circuits. The Relay drive circuit and frequency output circuit of this utility model both include a parallel current-limiting resistor R118 and a pull-up resistor R117, an NPN transistor Q101, a current-limiting resistor R116, a current-limiting resistor R122, a MOS transistor Q208, a filter capacitor C111, and an external interface. In the relay drive circuit and frequency output circuit, the 7 pull-up resistor R117 and the 19 current-limiting resistor R118 are connected in parallel, with one end connected to the second I / O port 2 and the other end connected to the 17 current-limiting resistor R116; one end of the 7 pull-up resistor R117 is connected to the power supply voltage VCC-I0 of the 14 R177, and the other end is connected to the second I / O port 2; the base of the 8 NPN transistor Q101 is connected to the second I / O port 2 through the 19 current-limiting resistor R118, and the emitter is connected to the 18 current-limiting resistor R12. 2 is grounded, and the collector and pull-up resistor R117 are connected together to the power supply voltage VCC-I0 of R177. One end of current limiting resistor R116 is connected between the emitter of NPN transistor Q101 and current limiting resistor R122, and the other end is connected to the gate of MOS transistor Q208. The drain of MOS transistor Q208 is grounded, and the source is connected to the external interface at 11. One end of filter capacitor C111 is grounded, and the other end is connected between the source of MOS transistor Q208 and the external interface at 11. When the multiplexed multi-functional interface circuit of this utility model is in the frequency output circuit, it generates a square wave signal of a fixed frequency through the second IO port of the microcontroller 2. The second IO port of the microcontroller 2 (BLE_P22_EXT_BUZZER1) is pulled up to 3.3V by default through the pull-up resistor R117. At this time, the 8 NPN transistor Q101 is in the off state, and the gate voltage of the 9 MOS transistor Q208 is pulled down by the current limiting resistor R116, the MOS transistor is turned off, and the 11 external interface outputs a high level. When the second IO port of the microcontroller 2 outputs a low level, the current flows into the base of the 8 NPN transistor Q101 through the current limiting resistor R118, turning it on. The collector current of the 8 NPN transistor Q101 is grounded through the current limiting resistor R122, and its emitter voltage is pulled down, causing the gate voltage of the 9 MOS transistor Q208 to rise, the MOS transistor to turn on, and the 11 external interface is pulled down to a low level. By controlling the high / low level switching frequency of the second I / O port of the microcontroller 2, a square wave signal of the corresponding frequency can be generated at the external interface of I / O 11. The filter capacitor C111 (I / O 16) is connected between the source and ground of the 9-MOSFET Q208 to filter out high-frequency noise during the switching process, ensuring the purity of the output signal. The high switching speed and low on-resistance of the 9-MOSFET Q208 enable it to respond quickly to frequency changes, ensuring the accuracy of the output waveform. The final output frequency waveform is shown below. Figure 4 As shown; When the multiplexed multi-functional interface circuit of this utility model is in the Relay drive circuit, it controls the on / off state of the high-current load through the second IO port of the microcontroller 2. In the default state, the second IO port of the microcontroller 2 (BLE_P22_EXT_BUZZER1) is kept at a high level through the pull-up resistor R117, the 8 NPN transistor Q101 is cut off, and the gate voltage of the 9 MOSFET Q208 is pulled low by the current-limiting resistor R116, the MOSFET is turned off, and no current flows through the external load. When the second IO port of the microcontroller 2 outputs a low level, the current drives the 8 NPN transistor Q101 to conduct through the current-limiting resistor R118, its emitter voltage is pulled low, which raises the gate voltage of the 9 MOSFET Q208, the MOSFET conducts, and the external load forms a loop, with a current of up to 3A. At the same time, the high current carrying capacity and low conduction loss of the 9 MOSFET Q208 make it very suitable for driving high-power loads. The filter capacitor C111 is used to absorb voltage spikes during the switching process and protect the MOSFET from damage. Therefore, the Relay circuit of this invention has a fast dynamic response speed and can follow the control signals of the microcontroller's I / O port in real time, making it suitable for applications requiring rapid switching. Through this design, the Relay driver circuit not only achieves efficient energy transfer but also possesses good anti-interference and self-protection capabilities. The output waveform of the Relay circuit is shown in the figure below. Figure 5 As shown, the actual test image of the Relay circuit is as follows. Figure 6 As shown, the maximum on-state current that MOSFET Q208 can withstand is as follows: Figure 3 As shown; The relay drive circuit of this utility model includes a parallel current-limiting resistor R118 (19), a pull-up resistor R117 (7), an NPN transistor Q101 (8), a current-limiting resistor R116 (17), a current-limiting resistor R122 (18), a MOSFET Q208 (9), a filter capacitor C111 (16), a freewheeling diode D208 (12), and a filter capacitor C114 (10). The relay drive circuit of this invention utilizes a relay drive circuit and a frequency output circuit. The difference lies in the addition of a 12-cell freewheeling diode D208 and a 10-cell filter capacitor C114. The anode of the 12-cell freewheeling diode D208 is connected to the source of a 9-cell MOSFET Q208 via the 10-cell filter capacitor C114, while the cathode is connected to an external power supply voltage VIN-12V0. One end of the 16-cell filter capacitor C111 is grounded, and the other end is connected between the 10-cell filter capacitor C114 and the source of the 9-cell MOSFET Q208. The 12-cell freewheeling diode D208 is a fast recovery diode with a reverse breakdown voltage greater than 50V. The capacitance of the 10-cell filter capacitor C114 is 100nF. When the multiplexed multi-functional interface circuit of this utility model is in the relay driving circuit, it adds a freewheeling protection function on the basis of the relay driving circuit. When the second IO port (BLE_P22_EXT_BUZZER1) of the microcontroller 2 outputs a low level, the 8NPN transistor Q101 is turned on, the gate voltage of the 9MOS transistor Q208 increases, the MOS transistor is turned on, the relay coil is energized, and the contacts are closed. At this point, the 12-gauge freewheeling diode D208 is in reverse cutoff mode and has no effect on the circuit. When the second I / O port of the microcontroller 2 suddenly switches to a high level, the 8-NPN transistor Q101 is cut off, the 9-MOSFET Q208 is turned off, and the relay coil is de-energized. Due to the inductive characteristics of the relay, the coil will generate a reverse electromotive force. The 12-gauge freewheeling diode D208 (fast recovery diode, reverse breakdown voltage greater than 50V) is forward conducting at this time, providing a discharge path for the reverse current and preventing high voltage from damaging the MOSFET or other components. The 10-gauge filter capacitor C114 is connected in parallel across the relay coil to further absorb high-frequency noise and voltage fluctuations, ensuring the stability of the circuit. This design effectively solves the voltage spike problem during relay switching, significantly improving the reliability and lifespan of the circuit. When driving the relay, the reverse voltage is limited to a safe range, and the MOSFET and the microcontroller I / O port are not damaged. In addition, the synergistic effect of the 10-gauge filter capacitor C114 and the 12-gauge freewheeling diode D208 allows the circuit to maintain stable performance even in harsh environments, making it very suitable for high-requirement scenarios such as industrial automation.

[0025] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this utility model, and are not intended to limit it. Although the utility model has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this utility model.

Claims

1. A multiplexed multi-functional interface circuit, characterized by comprising: It includes a microcontroller control unit, a GPIO output circuit, a frequency output circuit, a relay drive circuit, and a relay drive circuit; wherein the microcontroller control unit is provided with a first IO port and a second IO port; The GPIO output circuit includes a pull-up resistor R123, a current-limiting resistor R128, a filter capacitor C105, a bidirectional trigger diode VD110, an anti-reverse diode D207, and an external interface. The relay drive circuit and frequency output circuit include a parallel current-limiting resistor R118 and a pull-up resistor R117, an NPN transistor Q101, a current-limiting resistor R116, a current-limiting resistor R122, a MOSFET Q208, a filter capacitor C111, and an external interface. The relay drive circuit includes a current-limiting resistor R118 and a pull-up resistor R117 connected in parallel, an NPN transistor Q101, a current-limiting resistor R116, a current-limiting resistor R122, a MOSFET Q208, a filter capacitor C111, a freewheeling diode D208, and a filter capacitor C114.

2. The multiplexed multi-functional interface circuit according to claim 1, characterized in that, In the GPIO output circuit, one end of the pull-up resistor R123 is connected to the power supply voltage, and the other end is connected to the first IO port through the current limiting resistor R128; one end of the filter capacitor C105 is grounded, and the other end is connected between the current limiting resistor R128 and the external interface; the positive terminal of the anti-reverse diode D207 is grounded through the bidirectional trigger diode VD110, and the negative terminal is connected to the external interface.

3. The multiplexed multi-functional interface circuit according to claim 1, wherein, In the relay drive circuit and frequency output circuit, the pull-up resistor R117 and the current-limiting resistor R118 are connected in parallel, with one end connected to the second IO port and the other end connected to the current-limiting resistor R116.

4. The multiplexed multi-functional interface circuit according to claim 3, wherein, One end of the pull-up resistor R117 is connected to the power supply voltage, and the other end is connected to the second IO port.

5. The multiplexed multi-functional interface circuit according to claim 4, wherein, The base of the NPN transistor Q101 is connected to the second IO port through the current-limiting resistor R118, the emitter is grounded through the current-limiting resistor R122, and the collector and the pull-up resistor R117 are connected to the power supply voltage.

6. The multiplexed multi-functional interface circuit according to claim 3, wherein, One end of the current-limiting resistor R116 is connected between the emitter of the NPN transistor Q101 and the current-limiting resistor R122, and the other end is connected to the gate of the MOSFET Q208; the drain of the MOSFET Q208 is grounded, and the source is connected to the external interface; one end of the filter capacitor C111 is grounded, and the other end is connected between the source of the MOSFET Q208 and the external interface.

7. The multiplexed multi-functional interface circuit according to claim 1, wherein, In the relay driving circuit, the anode of the freewheeling diode D208 is connected to the source of the MOS transistor Q208 through the filter capacitor C114, and the cathode is connected to the external power supply voltage; one end of the filter capacitor C111 is grounded, and the other end is connected between the filter capacitor C114 and the source of the MOS transistor Q208.

8. The multiplexed multi-functional interface circuit according to claim 2, wherein, One end of the bidirectional trigger diode VD110 is connected to the positive terminal of the anti-reverse diode D207, and the other end is grounded.

9. The multiplexed multi-functional interface circuit according to claim 1, wherein, In the relay driving circuit, the freewheeling diode D208 is a fast recovery diode, and its reverse breakdown voltage is greater than 50V; the filter capacitor C114 has a capacitance of 100nF.