Interface circuits and electronic devices

By integrating the interface circuit design of DI and DO circuits, sharing the device connection terminal and common selection terminal, the problem of the complexity of independent wiring of DI and DO circuits is solved, realizing high integration and flexible adaptation of the circuit, which is suitable for miniaturized devices.

CN224289780UActive Publication Date: 2026-05-26NANJING HUICHUAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
NANJING HUICHUAN TECH CO LTD
Filing Date
2025-04-14
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The existing DI and DO circuits are independent circuits that require separate wiring, which increases the complexity of wiring and the risk of incorrect wiring, and is not conducive to the needs of miniaturized devices.

Method used

Design a highly integrated interface circuit that integrates the functions of DI and DO circuits by sharing the device connection terminal and common selection terminal between the input and output interface units. It is compatible with source and sink wiring methods and is equipped with overvoltage protection, short circuit protection, filtering modules, etc., simplifying the wiring process.

Benefits of technology

It simplifies the independent wiring complexity of DI and DO circuits, reduces the risk of incorrect wiring, improves circuit integration, adapts to the needs of miniaturized devices, is compatible with multiple wiring methods, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224289780U_ABST
    Figure CN224289780U_ABST
Patent Text Reader

Abstract

This application relates to an interface circuit and an electronic device. The interface circuit includes an input interface unit, an output interface unit, an input connection terminal, an output connection terminal, a device connection terminal, and a common selection terminal. The input and output connection terminals are used to connect to a controller, the device connection terminal is used to connect to an external device, and the common selection terminal is used to receive a preset voltage signal. The input interface unit is connected to the input connection terminal, the device connection terminal, and the common selection terminal, and is used to receive the signal to be transmitted received at the device connection terminal and the preset voltage received at the common selection terminal, and outputs a signal corresponding to the signal to be transmitted through the input connection terminal. The output interface unit is connected to the output connection terminal, the device connection terminal, and the common selection terminal, and is used to receive the output signal received at the output connection terminal and the preset voltage received at the common selection terminal, and outputs a signal corresponding to the output signal through the device connection terminal. This interface circuit integrates the functions of a DI circuit and a DO circuit, exhibiting high integration.
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 an interface circuit and electronic device. Background Technology

[0002] In the field of industrial automation and control, digital input (DI) and digital output (DO) circuits serve as a bridge between equipment and control systems, enabling reliable signal transmission.

[0003] The DI circuit is mainly used to receive status signals from external devices such as sensors and switches, convert these external signals into digital signals, and then transmit them to the control system for processing. The DO circuit sends corresponding digital signals to external devices based on the control signals output by the control system to control the external devices.

[0004] In related technologies, DI and DO circuits are designed as two independent circuits, typically implemented using different modules in industrial settings. However, each DI and DO circuit requires separate wiring, increasing wiring complexity, the risk of incorrect wiring, and hindering the need for miniaturized devices. Utility Model Content

[0005] Therefore, it is necessary to provide a highly integrated interface circuit and electronic device to address the above problems.

[0006] An interface circuit includes: an input interface unit, an output interface unit, an input connection terminal, an output connection terminal, a device connection terminal, and a common selection terminal. The input connection terminal and the output connection terminal are used to connect to a controller, the device connection terminal is used to connect to an external device, and the common selection terminal is used to receive a preset voltage signal. The input interface unit is connected to the input connection terminal, the device connection terminal, and the common selection terminal respectively. The output interface unit is connected to the output connection terminal, the device connection terminal, and the common selection terminal respectively.

[0007] If the interface circuit is configured in input mode, the input interface unit is used to receive the signal to be transmitted received by the device connection terminal and the preset voltage received by the common selection terminal, and outputs a signal corresponding to the signal to be transmitted through the input connection terminal;

[0008] If the interface circuit is configured in output mode, the output interface unit is used to receive the output signal received by the output connection terminal and the preset voltage received by the common selection terminal, and output a signal corresponding to the output signal through the device connection terminal.

[0009] In one embodiment, the output interface unit includes a first optocoupler, a first rectifier unit, and a second rectifier unit; the first rectifier unit is connected to the second rectifier unit.

[0010] The first terminal of the input side of the first optocoupler is connected to the output terminal, and the second terminal of the input side of the first optocoupler is grounded.

[0011] The first end of the output side of the first optocoupler is connected to the device connection terminal through the first rectifier unit, and the second end of the output side of the first optocoupler is connected to the common selection terminal through the second rectifier unit.

[0012] In one embodiment, the first rectifier unit includes a first diode and a second diode; the second rectifier unit includes a third diode and a fourth diode;

[0013] The cathode of the first diode and the anode of the second diode are connected, and the common terminal of the connection between the first diode and the second diode is connected to the device connection terminal; the anode of the first diode and the anode of the third diode are both connected to the second terminal of the output side of the first optocoupler; the cathode of the third diode and the anode of the fourth diode are connected, and the common terminal of the connection between the third diode and the fourth diode is connected to the common selection terminal; the cathode of the fourth diode and the cathode of the second diode are both connected to the first terminal of the output side of the first optocoupler.

[0014] In one embodiment, the output interface unit further includes a drive amplification unit; the drive amplification unit is connected to the output side of the first optocoupler.

[0015] In one embodiment, the driving amplification unit includes a first resistor and a transistor; the control terminal of the transistor is connected to the second terminal of the output side of the first optocoupler, the first terminal of the transistor is connected to the first terminal of the output side of the first optocoupler, and the second terminal of the transistor is connected to the control terminal of the transistor through the first resistor.

[0016] In one embodiment, the output interface unit further includes a first overvoltage protection module; the first overvoltage protection module is connected between the device connection terminal and the common selection terminal.

[0017] In one embodiment, the first overvoltage protection module includes a first transient voltage suppressor; the first transient voltage suppressor is connected between the device connection terminal and the common selection terminal.

[0018] In one embodiment, the output interface unit further includes a short-circuit protection module; the short-circuit protection module is disposed between the output side of the first optocoupler and the first rectifier unit.

[0019] In one embodiment, the short-circuit protection module includes a fuse; a first end of the fuse is connected to the first rectifier unit, and a second end of the fuse is connected to the first end of the output side of the first optocoupler.

[0020] In one embodiment, the output interface unit further includes a first filtering module; a first end of the first filtering module is connected to the device connection terminal, and a second end of the first filtering module is connected to the common selection terminal.

[0021] In one embodiment, the first filtering module includes a first capacitor; a first end of the first capacitor is connected to the device connection terminal, and a second end of the first capacitor is connected to the common selection terminal.

[0022] In one embodiment, the input interface unit includes a second optocoupler, a pull-up unit, a third rectifier unit, and a fourth rectifier unit; the third rectifier unit and the fourth rectifier unit are connected to each other.

[0023] The first end of the input side of the second optocoupler is connected to the device connection terminal through the third rectifier unit, and the second end of the input side of the second optocoupler is connected to the common selection terminal through the fourth rectifier unit;

[0024] The first end of the output side of the second optocoupler is connected to the input connection terminal and the pull-up unit, and the second end of the output side of the second optocoupler is grounded.

[0025] In some embodiments, the third rectifier unit includes a fifth diode and a sixth diode; the fourth rectifier unit includes a seventh diode and an eighth diode.

[0026] The cathode of the fifth diode is connected to the anode of the sixth diode, and the common terminal of the connection between the fifth and sixth diodes is connected to the device connection terminal; the anode of the fifth diode is connected to the anode of the seventh diode and the first terminal of the input side of the second optocoupler; the cathode of the seventh diode is connected to the anode of the eighth diode, and the common terminal of the connection between the seventh and eighth diodes is connected to the common selection terminal; the cathode of the eighth diode is connected to the cathode of the sixth diode and the second terminal of the input side of the second optocoupler.

[0027] In one embodiment, the pull-up unit includes a pull-up resistor, the first end of which is connected to a power supply voltage, and the second end of which is connected to the first end of the output side of the second optocoupler.

[0028] In one embodiment, the input interface unit further includes a second overvoltage protection module; the second overvoltage protection module is connected between the device connection terminal and the common selection terminal.

[0029] In one embodiment, the second overvoltage protection module includes a second transient voltage suppressor; the second transient voltage suppressor is connected between the device connection terminal and the common selection terminal.

[0030] In one embodiment, the input interface unit further includes a current limiting module; the current limiting module is disposed between the input side of the second optocoupler and the third rectifier unit.

[0031] In one embodiment, the current limiting module includes a current limiting resistor; the current limiting resistor is disposed between a first end of the input side of the second optocoupler and the third rectifier unit.

[0032] In one embodiment, the input interface unit further includes a second filtering module; a first end of the second filtering module is connected to the device connection terminal, and a second end of the second filtering module is connected to the common selection terminal.

[0033] In one embodiment, the second filtering module includes a second capacitor; a first end of the second capacitor is connected to the device connection terminal, and a second end of the second capacitor is connected to the common selection terminal.

[0034] An electronic device includes: a controller, an external device, and at least one interface circuit; wherein the interface circuit is as described above.

[0035] In one embodiment, the number of interface circuits is two or more, and the common selection terminal of each interface circuit is connected to each other.

[0036] The aforementioned interface circuit and electronic device include an input interface unit, an output interface unit, and input, output, device, and common selection terminals. The input and output terminals are used to connect to a controller, the device connection terminal is used to connect to external devices, and the common selection terminal is used to receive a preset voltage signal. The input interface unit connects to the input, device, and common selection terminals respectively, receiving the signal to be transmitted from the device connection terminal and the preset voltage from the common selection terminal, and outputs a signal corresponding to the signal to be transmitted through the input terminal. The output interface unit connects to the output, device, and common selection terminals respectively, receiving the output signal from the output connection terminal and the preset voltage from the common selection terminal, and outputs a signal corresponding to the output signal through the device connection terminal. Therefore, this interface circuit integrates the functions of both DI and DO circuits, simplifying the complexity of separate wiring required for traditional DI and DO circuits and reducing the risk of incorrect wiring. Furthermore, this interface circuit improves circuit integration, which is beneficial for meeting the needs of miniaturized devices. Attached Figure Description

[0037] Figure 1 This is a schematic diagram of an interface circuit module in one embodiment;

[0038] Figure 2 This is a schematic diagram of the circuit structure of the interface circuit in one embodiment;

[0039] Figure 3 This is a schematic diagram of the modules of an electronic device in one embodiment. Detailed Implementation

[0040] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of this application will be thorough and complete.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0042] It is understood that the terms "first," "second," etc., used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first resistor may be referred to as a second resistor, and similarly, a second resistor may be referred to as a first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.

[0043] It is understood that the term "connection" in the following embodiments should be understood as "electrical connection," "communication connection," etc., if the connected circuits, modules, units, etc., have electrical signal or data transmission with each other.

[0044] It is understandable that "at least one" refers to one or more, and "multiple" refers to two or more. "At least a part of an element" refers to part or all of an element.

[0045] When used herein, the singular forms of “a,” “an,” and “the” may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having,” etc., specify the presence of the stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.

[0046] In one embodiment, an interface circuit is provided. For example... Figure 1 As shown, the interface circuit includes an input interface unit 100, an output interface unit 200, and input connection terminals GPI, GPO, DIO, and a common selection terminal COM. The input interface unit 100 is connected to the input connection terminal GPI, the device connection terminal DIO, and the common selection terminal COM. The output interface unit 200 is connected to the output connection terminal GPO, the device connection terminal DIO, and the common selection terminal COM.

[0047] The input terminal GPI and the output terminal GPO are used to connect to the controller. The device connection terminal DIO is used to connect external devices. The common selection terminal COM is used to connect a preset voltage signal.

[0048] The types of controllers and external devices can be selected based on specific application requirements. For example, controllers can be devices or modules such as microcontrollers and embedded systems. External devices can be devices such as sensors and programmable logic controllers.

[0049] The preset voltage signal can be either a first preset voltage signal or a second preset voltage signal. In actual implementation, a jumper assembly can be set on the circuit board to switch the connection of the common selection terminal COM to the first preset voltage signal or the second preset voltage signal.

[0050] When different voltage signals are connected to the common selection terminal COM, the wiring method of the interface circuit can be switched. For example, when the common selection terminal COM is connected to a first preset voltage signal (such as 24V), the interface circuit is in source wiring mode; when the common selection terminal COM is connected to a second preset voltage signal (such as 0V), the interface circuit is in sink wiring mode.

[0051] If the interface circuit is configured in input mode, the input interface unit 100 is used to connect the signal to be transmitted received by the device connection terminal DIO and the preset voltage received by the common selection terminal COM, and outputs the signal corresponding to the signal to be transmitted through the input connection terminal GPI.

[0052] If the interface circuit is configured in output mode, the output interface unit 200 is used to connect the output signal received by the output connection terminal GPO and the preset voltage received by the common selection terminal COM, and outputs the signal corresponding to the output signal through the device connection terminal DIO.

[0053] The interface circuit can be configured as either an input or output mode, depending on the specific circumstances. For example, when an external device needs to transmit a signal to the controller, the interface circuit is configured as an input mode. In input mode, the external device can send a signal to be transmitted via the device connection terminal DIO. The input interface unit 100 receives the signal via the device connection terminal DIO, converts it into a signal suitable for the controller, and then transmits it to the controller via the input connection terminal GP1.

[0054] When the controller needs to output a signal to control an external device, the interface circuit is configured in output mode. In output mode, the controller outputs a signal, and the output interface unit 200 receives the output signal from the controller through the output connection terminal GPO, converts the output signal into a signal that matches the external device, and outputs it to the external device through the device connection terminal DIO.

[0055] Therefore, this interface circuit can realize the functions of the DI circuit and the DO circuit respectively, achieving the integration of the functions of the DI circuit and the DO circuit. The input interface unit 100 and the output interface unit 200 reuse the same device connection terminal DIO and common selection terminal COM, which can reduce the number of ports that need to be set up independently, thereby reducing wiring complexity and simplifying the wiring process.

[0056] The aforementioned interface circuit includes an input interface unit 100, an output interface unit 200, and input connection terminals GPI, GPO, DIO, and a common selection terminal COM. Input connection terminals GPI and GPO are used to connect to the controller, DIO is used to connect to external devices, and COM is used to receive a preset voltage signal. Specifically, the input interface unit 100 is connected to the input connection terminals GPI, DIO, and COM, respectively, to receive the output signal received at the output connection terminal GPO and the preset voltage received at the common selection terminal COM, and outputs a signal corresponding to the output signal through the device connection terminal DIO. Similarly, the output interface unit 200 is connected to the output connection terminals GPO, DIO, and COM, respectively, to receive the output signal received at the output connection terminal GPO and the preset voltage received at the common selection terminal COM, and outputs a signal corresponding to the output signal through the device connection terminal DIO. Therefore, this interface circuit integrates the functions of both DI and DO circuits, simplifying the complexity of separate wiring required for traditional DI and DO circuits and reducing the risk of incorrect wiring. Moreover, this interface circuit improves the integration of the circuit, which is beneficial for meeting the needs of miniaturized devices.

[0057] In some embodiments, such as Figure 2 As shown, the output interface unit 200 includes a first optocoupler U1, a first rectifier unit 210, and a second rectifier unit 220; the first rectifier unit 210 and the second rectifier unit 220 are connected to each other.

[0058] The first terminal of the input side of the first optocoupler U1 is connected to the output terminal GPO, and the second terminal of the input side of the first optocoupler U1 is grounded.

[0059] The first end of the output side of the first optocoupler U1 is connected to the device connection terminal DIO through the first rectifier unit 210, and the second end of the output side of the first optocoupler U1 is connected to the common selection terminal COM through the second rectifier unit 220.

[0060] In practical implementation, the first optocoupler U1 can be selected based on parameters such as the operating frequency and drive current of the output interface unit 200. The first and second terminals on the input side of the first optocoupler U1 can be the positive and negative terminals, respectively. The first and second terminals on the output side of the first optocoupler U1 can be the collector and emitter, respectively.

[0061] When the controller outputs a signal through the output connection terminal GPO, the output signal drives the diode on the input side of the first optocoupler U1 to turn on or off, thereby controlling the transistor on the output side to turn on or off through the optical signal.

[0062] The first rectifier unit 210 and the second rectifier unit 220 have the function of rectification. When the first optocoupler U1 outputs a signal, it can form a corresponding wiring method according to the preset voltage signal connected to the common selection terminal COM, so that a loop is formed between the device connection terminal DIO and the common selection terminal COM, so that the signal is transmitted to the device connection terminal DIO with appropriate polarity, thereby achieving stable transmission of the output signal.

[0063] In this embodiment, the output interface unit 200 has a simple circuit structure, is easy to implement, and is compatible with both source and sink wiring methods, making it highly flexible in use.

[0064] In some embodiments, the first rectifier unit 210 includes a first diode D1 and a second diode D2; the second rectifier unit 220 includes a third diode D3 and a fourth diode D4.

[0065] The cathode of the first diode D1 and the anode of the second diode D2 are connected, and the common terminal of the first diode D1 and the second diode D2 is connected to the device connection terminal DIO; the anode of the first diode D1 is connected to the anode of the third diode D3 and the second terminal of the output side of the first optocoupler U1; the cathode of the third diode D3 and the anode of the fourth diode D4 are connected, and the common terminal of the third diode D3 and the fourth diode D4 is connected to the common selection terminal COM; the cathode of the fourth diode D4 is connected to the cathode of the second diode D2 and the first terminal of the output side of the first optocoupler U1.

[0066] Thus, the first rectifier unit 210 and the second rectifier unit 220 form a rectifier circuit on the output side of the first optocoupler U1, making the output interface unit 200 compatible with both source and sink wiring methods.

[0067] For example, when the common selection terminal COM is connected to a second preset voltage signal (e.g., 0V), when the controller outputs a high-level signal, the first optocoupler U1 conducts. The high-level signal at the device connection terminal DIO can form a loop through the second diode D2, the transistor on the output side of the first optocoupler U1, the third diode D3, and the common selection terminal COM, resulting in a corresponding high-level signal at the device connection terminal DIO. This forms a sinking DO circuit. Based on a similar principle, when the common selection terminal COM is connected to a first preset voltage signal (e.g., 24V), a source DO circuit can be formed.

[0068] In this embodiment, by setting four diodes to form a rectifier circuit, the output interface unit 200 can be compatible with both source and sink wiring methods, thereby improving the adaptability of the interface circuit and making the circuit more flexible.

[0069] In some embodiments, the output interface unit 200 further includes a drive amplification unit 230, which is connected to the output side of the first optocoupler U1.

[0070] In this embodiment, a drive amplification unit 230 is also provided. The drive amplification unit 230 amplifies the output current of the first optocoupler U1, which can improve the driving capability of the first optocoupler U1 to the back-end circuit.

[0071] In some embodiments, the drive amplifier unit 230 includes a first resistor R1 and a transistor Q1. The control terminal of the transistor Q1 is connected to the second terminal of the output side of the first optocoupler U1, the first terminal of the transistor Q1 is connected to the first terminal of the output side of the first optocoupler U1, and the second terminal of the transistor Q1 is connected to the control terminal of the transistor Q1 through the first resistor R1.

[0072] The type of transistor Q1 can be selected according to specific needs. For example, transistor Q1 is an NPN transistor, with the base as the control terminal, the collector as the first terminal, and the emitter as the second terminal. The first resistor R1 serves as the bias resistor for transistor Q1, and its value can be set according to specific circumstances.

[0073] In this embodiment, the drive amplifier unit 230 can amplify the output current of the first optocoupler U1 through the transistor Q1, thereby improving its driving capability. The drive amplifier unit 230 has a simple circuit structure and low cost.

[0074] In some embodiments, the output interface unit 200 further includes a first overvoltage protection module 240; the first overvoltage protection module 240 is connected between the device connection terminal DIO and the common selection terminal COM.

[0075] The first overvoltage protection module 240 provides a protection path between the device connection terminal DIO and the common selection terminal COM. When an overvoltage occurs in the circuit, the first overvoltage protection module 240 can respond quickly and limit the overvoltage to a safe voltage level, thereby protecting the circuit from damage due to overvoltage and improving the safety of the entire circuit.

[0076] In some embodiments, the first overvoltage protection module 240 includes a first transient voltage suppressor TVS1; the first transient voltage suppressor TVS1 is connected between the device connection terminal DIO and the common selection terminal COM.

[0077] The first transient voltage suppressor, TVS1, is a component specifically designed to protect circuits from transient overvoltage surges. It features extremely fast response time and high clamping voltage, enabling it to limit overvoltages to a safe level within nanoseconds.

[0078] In this embodiment, the circuit is protected against overvoltage and electrostatic discharge by setting a first transient voltage suppressor TVS1, thus improving the circuit's safety.

[0079] In some embodiments, the output interface unit 200 further includes a short-circuit protection module 250; the short-circuit protection module 250 is disposed between the output side of the first optocoupler U1 and the first rectifier unit 210.

[0080] Specifically, the short-circuit protection module 250 is located between the first terminal of the first optocoupler U1 output side and the first rectifier unit 210. When an overcurrent occurs in the circuit, the short-circuit protection module 250 can disconnect in time, so that the circuit is not affected by the overcurrent and further improves the safety of the circuit.

[0081] In some embodiments, the short-circuit protection module 250 includes a fuse R0. The first end of the fuse R0 is connected to the first rectifier unit 210, and the second end of the fuse R0 is connected to the first end of the output side of the first optocoupler U1.

[0082] A fuse is a current-sensitive element that heats up and eventually melts when the current exceeds its rated value, thus breaking the circuit. For example, fuse R0 can be a resettable fuse.

[0083] In this embodiment, the first end of the fuse R0 is connected to the first rectifier unit 210, and the second end is connected to the first end of the output side of the first optocoupler U1. When a short circuit occurs on the output side, an excessive current will flow through the fuse R0, causing it to melt and thus protecting the circuit from damage.

[0084] In some embodiments, the output interface unit 200 further includes a first filtering module 260; the first end of the first filtering module 260 is connected to the device connection terminal DIO, and the second end of the first filtering module 260 is connected to the common selection terminal COM.

[0085] By setting the first filtering module 260, it is helpful to filter the signals transmitted to the device connection terminal DIO and the signals output to the device connection terminal DIO, thereby reducing the impact of interference signals on the circuit.

[0086] In some embodiments, the first filtering module 260 includes a first capacitor C1; the first end of the first capacitor C1 is connected to the device connection terminal DIO, and the second end of the first capacitor C1 is connected to the common selection terminal COM.

[0087] The parameters of the first capacitor C1 can be set according to actual conditions. The first capacitor C1 can filter the signal entering from the device connection terminal DIO. Using the first capacitor C1 for filtering results in a simple circuit structure and low cost.

[0088] In some embodiments, the input interface unit 100 includes a second optocoupler U2, a pull-up unit 110, a third rectifier unit 120, and a fourth rectifier unit 130; the third rectifier unit 120 and the fourth rectifier unit 130 are connected to each other.

[0089] The first end of the input side of the second optocoupler U2 is connected to the device connection terminal DIO through the third rectifier unit 120, and the second end of the input side of the second optocoupler U2 is connected to the common selection terminal COM through the fourth rectifier unit 130.

[0090] The first terminal of the output side of the second optocoupler U2 is connected to the input terminal GPI and the pull-up unit 110, and the second terminal of the output side of the second optocoupler U2 is grounded.

[0091] In practical implementation, the second optocoupler U2 can be selected based on parameters such as the operating frequency and drive current of the input interface unit 100. The first and second terminals of the input side of the second optocoupler U2 can be the positive and negative terminals of the input side, respectively. The first and second terminals of the output side of the second optocoupler U2 can be the collector and emitter of the output side, respectively.

[0092] When an external device transmits a signal through the device connection terminal DIO, the signal drives the diode on the input side of the second optocoupler U2 to turn on or off, thereby controlling the transistor on the output side to turn on or off through the optical signal, so that the level of the input connection terminal GPI is low or high.

[0093] The third rectifier unit 120 and the fourth rectifier unit 130 have a rectification function. When external devices transmit signals, they can form a corresponding wiring method according to the preset voltage signal connected to the common selection terminal COM, so that a loop is formed between the device connection terminal DIO and the common selection terminal COM, so that the signal is transmitted to the controller with the correct polarity, and the output signal is stably transmitted.

[0094] In this embodiment, the circuit structure of the input interface unit 100 is simple and easy to implement, and it is compatible with both source and sink wiring methods, making it highly flexible in use.

[0095] In some embodiments, the third rectifier unit 120 includes a fifth diode D5 and a sixth diode D6; the fourth rectifier unit 130 includes a seventh diode D7 and an eighth diode D8.

[0096] The cathode of the fifth diode D5 and the anode of the sixth diode D6 are connected, and the common terminal of the connection between the fifth diode D5 and the sixth diode D6 is connected to the device connection terminal DIO; the anode of the fifth diode D5 is connected to the anode of the seventh diode D7 and the first terminal of the input side of the second optocoupler U2; the cathode of the seventh diode D7 and the anode of the eighth diode D8 are connected, and the common terminal of the connection between the seventh diode D7 and the eighth diode D8 is connected to the common selection terminal COM; the cathode of the eighth diode D8 is connected to the cathode of the sixth diode D6 and the second terminal of the input side of the second optocoupler U2.

[0097] Thus, the third rectifier unit 120 and the fourth rectifier unit 130 form a rectifier circuit on the input side of the second optocoupler U2, making the input interface unit 100 compatible with both source and sink wiring methods.

[0098] For example, when the common selection terminal COM is connected to a second preset voltage signal (e.g., 0V), and an external device transmits a high-level signal (e.g., a 24V signal), the second optocoupler U2 is turned on. The high-level signal at the device connection terminal DIO can form a loop through the sixth diode D6, the diode on the input side of the second optocoupler U2, the seventh diode D7, and the common selection terminal COM. At this time, the transistor on the output side of the second optocoupler U2 is turned on, and the input connection terminal GPI is pulled low, outputting a low level to the controller. When an external device transmits a low-level signal (e.g., 0V), the input side of the second optocoupler U2 is turned off. At this time, the transistor on the output side of the second optocoupler U2 is turned off, and the input connection terminal GPI is pulled high by the pull-up unit, outputting a high level to the controller. This forms a sinking DI circuit. Based on a similar principle, when the common selection terminal COM is connected to a first preset voltage signal (e.g., 24V), a source DI circuit can be formed.

[0099] In this embodiment, by setting four diodes to form a rectifier circuit, the input interface unit 100 can be compatible with both source and sink wiring methods, thereby improving the adaptability of the interface circuit and making the circuit more flexible.

[0100] In some embodiments, the pull-up unit 110 includes a pull-up resistor R2, the first end of which is connected to the power supply voltage VDD, and the second end of which is connected to the first end of the output side of the second optocoupler U2.

[0101] The power supply voltage VDD can be set according to specific circumstances, such as the parameters of the controller. The value of the pull-up resistor R2 needs to be determined in conjunction with the power supply voltage VDD and the controller selection, etc., but this embodiment does not impose any limitations on this. The pull-up unit 110 constructed using the pull-up resistor R2 has a simple circuit structure and low cost.

[0102] In some embodiments, the input interface unit 100 further includes a second overvoltage protection module 140; the second overvoltage protection module 140 is connected between the device connection terminal DIO and the common selection terminal COM.

[0103] When an overvoltage occurs in the circuit, the second overvoltage protection module 140 can respond quickly and limit the overvoltage to a safe voltage level, thereby protecting the circuit from damage due to the overvoltage and improving the circuit safety of the input interface unit 100.

[0104] In some embodiments, the second overvoltage protection module 140 includes a second transient voltage suppressor TVS2; the second transient voltage suppressor TVS2 is connected between the device connection terminal DIO and the common selection terminal COM.

[0105] By setting a second transient voltage suppressor TVS2 to provide overvoltage protection and prevent overshoot electrostatic discharge, the electrical safety of the input interface unit 100 is improved.

[0106] In some embodiments, the input interface unit 100 further includes a current limiting module 150; the current limiting module 150 is disposed between the input side of the second optocoupler U2 and the third rectifier unit 120.

[0107] In practical applications, the current of signals transmitted by external devices is often large. By setting a current limiting module 150 on the input side of the second optocoupler U2, the second optocoupler U2 can be effectively protected, and the circuit safety of the input interface unit 100 can be further improved.

[0108] In some embodiments, the current limiting module 150 includes a current limiting resistor R3; the current limiting resistor R3 is disposed between the first end of the input side of the second optocoupler U2 and the third rectifier unit 120.

[0109] The resistance value of the current-limiting resistor R3 can be set according to the actual application. By using the current-limiting resistor R3 to form a current-limiting module, the current flowing into the second optocoupler U2 can be effectively limited, thereby protecting the second optocoupler U2. This circuit structure is simple and easy to implement.

[0110] In some embodiments, the input interface unit 100 further includes a second filtering module 160; the first end of the second filtering module 160 is connected to the device connection terminal DIO, and the second end of the second filtering module 160 is connected to the common selection terminal COM.

[0111] By setting up the second filtering module 160, it is helpful to filter the signal entering from the device connection terminal DIO and reduce the impact of interference signals on the circuit.

[0112] In some embodiments, the second filtering module 160 includes a second capacitor C2; the first end of the second capacitor C2 is connected to the device connection terminal DIO, and the second end of the second capacitor C2 is connected to the common selection terminal COM.

[0113] The parameters of the second capacitor C2 can be set according to actual conditions. The second capacitor C2 can filter the signal entering from the device connection terminal DIO. Using the second capacitor C2 for filtering results in a simple circuit structure and low cost.

[0114] To better understand the above embodiments, an optional embodiment will be explained in detail below.

[0115] In one embodiment, such as Figure 2 As shown, the interface circuit includes an input interface unit 100, an output interface unit 200, an input connection terminal GPI, an output connection terminal GPO, a device connection terminal DIO, and a common selection terminal COM. The input interface unit 100 is connected to the input connection terminal GPI, the device connection terminal DIO, and the common selection terminal COM. The output interface unit 200 is connected to the output connection terminal GPO, the device connection terminal DIO, and the common selection terminal COM.

[0116] In a specific scenario, the device connection terminal DIO connects to an external sensor, and the connection method of the common selection terminal COM is determined according to the sensor type. For example, when the sensor is source-type, the common selection terminal COM is connected to 0V; when the sensor is sink-type, the common selection terminal COM is connected to 24V. The input connection terminal GPI and the output connection terminal GPO connect to the controller, such as an MCU (Microcontroller Unit).

[0117] This interface circuit can implement DIO circuit functions. Specifically, it can be flexibly selected to implement either DI circuit function or DO circuit function through internal software configuration: when the DI circuit function is selected, the MCU no longer controls the DO output GPIO port, but configures it as the input function GPIO port, and only enables the detection of the DI function's corresponding GPIO port; similarly, when the DO function is selected, the MCU no longer detects the DI function's corresponding GPIO port, and only controls the DO function's corresponding GPIO port.

[0118] When the interface circuit is used as a DI circuit (i.e., the interface circuit is configured in input mode): the DI circuit uses a second transient voltage suppressor TVS2 and a second capacitor C2 for protection and filtering, a second optocoupler U2 for isolation, and a current-limiting resistor R3 to limit the current of externally transmitted signals. A rectifier circuit consisting of four diodes is added between the terminals (device connection terminal DIO and common selection terminal COM) and the second optocoupler U2. At this time, when the common selection terminal COM is connected to 0V, it is a sinking connection; when the common selection terminal COM is connected to 24V, it is a sourcing connection.

[0119] When the interface circuit is used as a DO circuit (i.e., the interface circuit is configured in output mode): the DO circuit uses a first transient voltage suppressor TVS1 and a first capacitor C1 for protection and filtering, and a first optocoupler U1 for isolation. A self-resetting fuse R0 is also included in the circuit for protection against external short circuits. A rectifier circuit consisting of four diodes positioned between the terminals (DIO and COM) and the first optocoupler U1 is compatible with both source and sink connection methods.

[0120] It is understandable that, in practical applications, the input interface unit 100 and output interface unit 200 of this interface circuit can be separated into separate DI circuits or DO circuits. The common selection terminal COM of the DI circuit and the DO circuit can be connected to the corresponding power supply respectively (both can be connected to 0V, or both can be connected to 24V, or one can be connected to 0V and the other to 24V), so that the DI circuit and the DO circuit can be configured as source type or sink type respectively.

[0121] In this embodiment, the DI circuit and DO circuit are integrated and share a common selection terminal COM. This allows the DI circuit and DO circuit to be configured as source or sink simultaneously, reducing the number of external interfaces. In practical applications, electronic devices typically have multiple interface circuits. The design of sharing the common selection terminal COM between the DI circuit and DO circuit can significantly reduce the number of external interfaces of the electronic device, thereby improving circuit integration.

[0122] The aforementioned interface circuit integrates the functions of both DI and DO circuits, simplifying the complexity of separate wiring required when traditional DI and DO circuits are configured separately, and reducing the risk of incorrect wiring. This interface circuit improves circuit integration, which is beneficial for meeting the needs of miniaturized devices; it also supports both source and sink wiring, broadening its application range. Since this interface circuit does not require integrated chips and can be implemented using discrete components, it is cost-effective; furthermore, the load capacity and frequency requirements can be adjusted by modifying the resistor and capacitor parameters in the circuit, adapting to different industrial field requirements.

[0123] Based on the same concept, embodiments of this application also provide an electronic device. In one embodiment, such as Figure 3 As shown, the electronic device includes a controller, an external device, and at least one interface circuit. The interface circuit can be any of the interface circuits provided in the above embodiments.

[0124] Since the electronic device includes the interface circuit provided in the embodiments of this application, it also has the beneficial effects of the interface circuit in the above embodiments. The similarities can be understood by referring to the explanation of the interface circuit above, and will not be repeated here.

[0125] The type of electronic device mentioned above is not limited; for example, it can be a miniaturized device such as a smart camera.

[0126] In some embodiments, the electronic device has two or more interface circuits, and the common selection terminal of each interface circuit is connected to each other.

[0127] It is understandable that when an electronic device has multiple interface circuits, the input and output terminals of each interface circuit are connected to the controller, and the device connection terminals of each interface circuit can be connected to different external devices, such as different sensors.

[0128] By connecting the common selection terminals of each interface circuit, the number of external ports can be effectively reduced, simplifying the circuit and wiring complexity.

[0129] In other embodiments, depending on the specific circumstances, it may be possible to connect the common selection terminals of some interface circuits together, or to make the common selection terminals of each interface circuit unconnected to each other, so as to access the corresponding preset voltage signal respectively, thereby improving the flexibility of each interface circuit.

[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0131] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the utility model patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An interface circuit, characterized in that, include: The system includes an input interface unit, an output interface unit, an input connection terminal, an output connection terminal, a device connection terminal, and a common selection terminal. The input and output connection terminals are used to connect to a controller, the device connection terminal is used to connect to an external device, and the common selection terminal is used to receive a preset voltage signal. The input interface unit is connected to the input connection terminal, the device connection terminal, and the common selection terminal. The output interface unit is connected to the output connection terminal, the device connection terminal, and the common selection terminal. If the interface circuit is configured in input mode, the input interface unit is used to receive the signal to be transmitted received by the device connection terminal and the preset voltage received by the common selection terminal, and outputs a signal corresponding to the signal to be transmitted through the input connection terminal; If the interface circuit is configured in output mode, the output interface unit is used to receive the output signal received by the output connection terminal and the preset voltage received by the common selection terminal, and output a signal corresponding to the output signal through the device connection terminal.

2. The interface circuit according to claim 1, characterized in that, The output interface unit includes a first optocoupler, a first rectifier unit, and a second rectifier unit; the first rectifier unit is connected to the second rectifier unit. The first terminal of the input side of the first optocoupler is connected to the output terminal, and the second terminal of the input side of the first optocoupler is grounded. The first end of the output side of the first optocoupler is connected to the device connection terminal through the first rectifier unit, and the second end of the output side of the first optocoupler is connected to the common selection terminal through the second rectifier unit.

3. The interface circuit according to claim 2, characterized in that, The first rectifier unit includes a first diode and a second diode; the second rectifier unit includes a third diode and a fourth diode; The cathode of the first diode and the anode of the second diode are connected, and the common terminal of the connection between the first diode and the second diode is connected to the device connection terminal; the anode of the first diode and the anode of the third diode are both connected to the second terminal of the output side of the first optocoupler; the cathode of the third diode and the anode of the fourth diode are connected, and the common terminal of the connection between the third diode and the fourth diode is connected to the common selection terminal; the cathode of the fourth diode and the cathode of the second diode are both connected to the first terminal of the output side of the first optocoupler.

4. The interface circuit according to claim 2, characterized in that, The output interface unit further includes a drive amplification unit; the drive amplification unit is connected to the output side of the first optocoupler.

5. The interface circuit according to claim 2, characterized in that, The output interface unit further includes a first overvoltage protection module; the first overvoltage protection module is connected between the device connection terminal and the common selection terminal.

6. The interface circuit according to claim 2, characterized in that, The output interface unit further includes a short-circuit protection module; the short-circuit protection module is disposed between the output side of the first optocoupler and the first rectifier unit.

7. The interface circuit according to claim 2, characterized in that, The output interface unit further includes a first filtering module; the first end of the first filtering module is connected to the device connection terminal, and the second end of the first filtering module is connected to the common selection terminal.

8. The interface circuit according to claim 1, characterized in that, The input interface unit includes a second optocoupler, a pull-up unit, a third rectifier unit, and a fourth rectifier unit; the third rectifier unit and the fourth rectifier unit are connected. The first end of the input side of the second optocoupler is connected to the device connection terminal through the third rectifier unit, and the second end of the input side of the second optocoupler is connected to the common selection terminal through the fourth rectifier unit; The first end of the output side of the second optocoupler is connected to the input connection terminal and the pull-up unit, and the second end of the output side of the second optocoupler is grounded.

9. The interface circuit according to claim 8, characterized in that, The input interface unit further includes a second overvoltage protection module; the second overvoltage protection module is connected between the device connection terminal and the common selection terminal.

10. The interface circuit according to claim 8, characterized in that, The input interface unit further includes a current limiting module; the current limiting module is disposed between the input side of the second optocoupler and the third rectifier unit.

11. The interface circuit according to claim 8, characterized in that, The input interface unit further includes a second filtering module; the first end of the second filtering module is connected to the device connection terminal, and the second end of the second filtering module is connected to the common selection terminal.

12. An electronic device, characterized in that, include: A controller, an external device, and at least one interface circuit; wherein the interface circuit is the interface circuit according to any one of claims 1-11.

13. The electronic device according to claim 12, characterized in that, The number of interface circuits is two or more, and the common selection terminal of each interface circuit is connected to each other.