Digital switching value input circuit and electronic equipment

By designing a multi-interface digital switching input circuit, using an optocouple receiving unit and a multi-interface connector, the problem of insufficient compatibility in the prior art is solved, compatibility for multiple node inputs is achieved, and the flexibility of the circuit is improved.

CN222966979UActive Publication Date: 2025-06-10GUANGDONG LEAPFIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202421896922.0
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2025-06-10
Estimated Expiration
2034-08-06

AI Technical Summary

Technical Problem

Existing digital switching input (DI) detection circuits cannot be compatible with multiple node inputs at the same time, such as dry nodes, wet nodes, NPN type sensors and PNP type sensors, resulting in insufficient compatibility.

Method used

A digital switching input circuit is designed, using an optical coupling receiving unit and a multi-interface connector to connect different node types through different interfaces to achieve compatibility with multiple node inputs.

Benefits of technology

The circuit is compatible with dry and wet nodes and is extended to support NPN and PNP sensors, improving the flexibility and compatibility of the input circuit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN222966979U_ABST
    Figure CN222966979U_ABST
Patent Text Reader

Abstract

The utility model provides a digital switching value input circuit and electronic equipment. The input circuit comprises an optocoupler receiving unit and a connector, the optocoupler receiving unit comprises a photodiode; the connector is at least provided with a first interface, a second interface, a third interface and a fourth interface; the first interface is connected with a power supply, the second interface is grounded, and the third interface and the fourth interface are connected to two ends of the photodiode; the input circuit has a first input state connected with a dry node and a second input state connected with a wet node; in a first input state, the second interface is in short circuit with the fourth interface, and the first interface and the third interface are connected to two ends of the dry node; in the second input state, the third interface is connected to the output signal end of the wet node, the second interface is connected with the grounding end of the wet node, and the fourth interface is in short circuit with the second interface; the digital switching value input circuit can be compatible with dry nodes and wet nodes, and the flexibility of the digital switching value input circuit can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of switch control, and particularly relates to a digital switch input circuit and an electronic device. Background Art

[0002] In the current fields of electronic communication and automation control, digital switch input (DI), as a basic and key signal transmission method, is widely used due to its simple structure, strong anti-interference ability and other characteristics. DI signals are mainly used for information exchange between external devices or sensors and the main control device, and transmit status information in the form of digital switch quantities (such as high level or low level), thereby triggering the main control device to execute corresponding control actions.

[0003] However, the current DI detection circuit often only supports a single type of node input and cannot be compatible with two or more nodes input at the same time.

[0004] Therefore, how to improve the compatibility of the input circuit is a problem that those skilled in the art need to solve currently. Utility Model Content

[0005] The purpose of this application is to provide a digital switch input circuit and an electronic device, aiming to solve the problem of low compatibility of the digital switch input circuit in the traditional technology.

[0006] The first aspect of the embodiment of this application proposes a digital switch input circuit, including:

[0007] An optocoupler receiving unit, the optocoupler receiving unit includes a photodiode;

[0008] A connector, at least a first interface, a second interface, a third interface and a fourth interface are arranged on the connector; wherein, the first interface is connected to a power supply, the second interface is grounded, and the third interface and the fourth interface are connected to both ends of the photodiode;

[0009] Wherein, the input circuit has a first input state for connecting a dry node and a second input state for connecting a wet node;

[0010] When the input circuit is in the first input state, the second interface is short-circuited with the fourth interface, and the first interface and the third interface are connected to both ends of the dry node;

[0011] When the input circuit is in the second input state, the third interface accesses the output signal terminal of the wet node, the second interface is connected to the grounding terminal of the wet node, and the fourth interface is short-circuited with the second interface.

[0012] In some embodiments of the present application, the input circuit further has a third input state for connecting an NPN-type sensor; when the input circuit is in the third input state, the first interface is connected to the positive power supply of the NPN-type sensor, the fourth interface is connected between the first interface and the positive power supply of the NPN-type sensor, the second interface is connected to the negative power supply of the NPN-type sensor; and the third interface is connected to the signal output terminal of the NPN-type sensor.

[0013] In some embodiments of the present application, the input circuit further has a fourth input state for connecting a PNP-type sensor; when the input circuit is in the fourth input state, the first interface is connected to the positive power supply of the PNP-type sensor, the third interface is connected to the signal output terminal of the PNP-type sensor, the second interface is connected to the negative power supply of the PNP-type sensor, and the fourth interface is short-circuited with the second interface.

[0014] In some embodiments of the present application, the photodiode is a bidirectional input diode.

[0015] In some embodiments of the present application, the input circuit further includes a first diode and a fuse, and the first diode and the fuse are connected in series between the power supply and the first interface.

[0016] In some embodiments of the present application, the input circuit further includes a first capacitor, and the first capacitor is connected between the first interface and the first diode;

[0017] And / or, the input circuit further includes a first transient voltage suppressor, and the first transient voltage suppressor is connected between the first interface and the second interface.

[0018] In some embodiments of the present application, the power supply includes an isolation unit and a second capacitor, and the isolation unit is configured to access a first voltage and output a second voltage to the first interface according to the first voltage;

[0019] The isolation unit has a first output terminal and a second output terminal, the first output terminal outputs the second voltage, the second output terminal is grounded, one end of the second capacitor is connected to the first output terminal, and the other end is connected to the second output terminal.

[0020] In some embodiments of the present application, the input circuit further includes a first resistor, and the first resistor is connected between the third interface and the photodiode;

[0021] And / or, the optocoupler receiving unit includes a second resistor, a phototransistor, and a third resistor connected in series. The other end of the second resistor is connected to a power supply voltage. The phototransistor and the photodiode form an optocoupler structure. The other end of the third resistor is grounded. Wherein, a signal output terminal is provided between the third resistor and the phototransistor, and the signal output terminal is used to output the digital signal quantity.

[0022] In some embodiments of the present application, the input circuit further includes a third capacitor, and the third capacitor is connected between the first resistor and the fourth interface.

[0023] And / or, the input circuit further includes a second transient voltage suppressor, and the second transient voltage suppressor is connected between the third interface and the fourth interface.

[0024] In a second aspect, the present application further provides an electronic device, including the above digital switch input circuit.

[0025] The beneficial effects of the embodiments of the present utility model compared with the prior art are as follows: The above digital switch input circuit includes an optocoupler receiving unit and a connector. The optocoupler receiving unit includes a photodiode. The connector is provided with at least a first interface, a second interface, a third interface, and a fourth interface. Wherein, the first interface is connected to the power supply, the second interface is grounded, and the third interface and the fourth interface are connected to both ends of the photodiode. Wherein, the input circuit has a first input state of connecting to a dry contact and a second input state of connecting to a wet contact. When the input circuit is in the first input state, the second interface is short-circuited with the fourth interface, and the first interface and the third interface are connected to both ends of the dry contact. When the input circuit is in the second input state, the third interface is connected to the output signal terminal of the wet contact, the second interface is connected to the grounding terminal of the wet contact, and the fourth interface is short-circuited with the second interface. The digital switch input circuit of the present application can be compatible with dry contacts and wet contacts, which is beneficial to increasing the flexibility of the digital switch input circuit. Description of the Drawings

[0026] Figure 1 It is a schematic diagram of the digital switch input circuit provided by an embodiment of the present application.

[0027] Figure 2 It is a schematic diagram of the circuit connection structure in the first input state provided by an embodiment of the present application.

[0028] Figure 3 It is a schematic diagram of the circuit connection structure in the second input state provided by an embodiment of the present application.

[0029] Figure 4 It is a schematic diagram of the circuit connection structure in the third input state provided by an embodiment of the present application.

[0030] Figure 5 Schematic diagram of the circuit connection structure in the fourth input state provided by an embodiment of the present application;

[0031] Figure 6 Schematic diagram of the circuit structure of the power supply provided by an embodiment of the present application.

[0032] Specific element symbol description: F1 - fuse, D1 - first diode, C1 - first capacitor, C2 - third capacitor, C3 - fourth capacitor, C4 - second capacitor, TVS1 - first transient voltage suppressor, TVS2 - second transient voltage suppressor, CON1 - connector, R1 - first resistor, R2 - second resistor, R3 - third resistor. Detailed implementation manners

[0033] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0034] It should be noted that when an element is referred to as being "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.

[0035] It should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present application.

[0036] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means two or more, unless otherwise specifically defined.

[0037] It should be noted that in the current field of electronic communication and automation control, digital switch input (DI), as a basic and crucial signal transmission method, is widely used due to its simple structure, strong anti-interference ability and other characteristics. DI signals are mainly used for information exchange between external devices or sensors and the main control device, and transmit status information in the form of digital switch quantities (such as high level or low level), so as to trigger the main control device to execute corresponding control actions.

[0038] However, with the increasing diversification of application scenarios, the requirements for DI input compatibility have gradually increased. Existing DI detection circuits often only support single-type node inputs (such as dry nodes, wet nodes) or at most two types of node inputs, and cannot be compatible with multiple node types such as dry nodes, wet nodes, NPN-type sensors, PNP-type sensors at the same time. This limitation restricts the wide application of DI detection circuits in complex and diversified application scenarios. In order to overcome the problem of insufficient compatibility, some technologies try to superimpose the processing capabilities of multiple input types by designing complex circuit structures, but this approach not only increases the complexity and cost of circuit design, but also may introduce new fault points and performance bottlenecks. Another solution is to use multiple groups of switches for manual switching to adapt to different types of node inputs, but this method is cumbersome to operate and reduces the usability and automation of the system.

[0039] Therefore, this application has improved the relevant digital switch input circuit and electronic device based on this.

[0040] Please refer to Figures 1 to 3 , Figure 1 which shows the schematic diagram of the digital switch input circuit provided in this embodiment, Figure 2 which shows the schematic diagram of the circuit connection structure in the first input state provided in this embodiment; Figure 3 which shows the schematic diagram of the circuit connection structure in the second input state provided in this embodiment.

[0041] A digital switch input circuit of this embodiment includes an optocoupler receiving unit and a connector CON1; the optocoupler receiving unit includes a photodiode; at least a first interface, a second interface, a third interface and a fourth interface are provided on the connector CON1; wherein, the first interface is connected to the power supply, the second interface is grounded, and the third interface and the fourth interface are connected to both ends of the photodiode; wherein, the input circuit has a first input state for connecting a dry node and a second input state for connecting a wet node; when the input circuit is in the first input state, the second interface is short-circuited with the fourth interface, and the first interface and the third interface are connected to both ends of the dry node; when the input circuit is in the second input state, the third interface accesses the output signal terminal of the wet node, the second interface is connected to the grounding terminal of the wet node, and the fourth interface is short-circuited with the second interface.

[0042] It should be noted that the photodiode is a key part of the optocoupler and is used to convert optical signals into electrical signals. The presence of the optocoupler receiving unit realizes the electrical isolation between the input circuit and the subsequent processing circuit, improving the anti-interference ability and safety of the circuit. A dry contact is a peripheral node that outputs two states, closed and open, with passive switch contacts internally; a dry contact (or called a passive contact) usually refers to a contact that does not directly provide power, such as a button, switch, etc. In this state, when the dry contact is closed, the power supply forms a loop through the photodiode, generating a photocurrent, which is then converted into an electrical signal for processing. A wet contact is a peripheral node that can output two states, high level and low level. A wet contact (or called an active contact) usually refers to a contact that provides power or a level, such as a PLC with transistor output, etc. In this case, the output signal terminal of the wet contact directly acts on one end of the photodiode. Digital switch input (DI, Digital Input) refers to the process of converting the on-site switch state (such as on or off, high level or low level) into a digital signal (usually 1 or 0) and inputting it into a controller (such as a PLC).

[0043] The current digital switch input circuit can only adapt to a single node, while the digital switch input circuit of this application can be compatible with dry contacts and wet contacts, which is beneficial to increasing the flexibility of the digital switch input circuit.

[0044] Specifically, please continue to refer to Figure 2 , when the input circuit is in the first input state, there are two types of passive switches for the dry contact peripherals, normally open and normally closed. The wiring methods of these two types of switches with the main control device are the same, Figure 2 The switch shown is a normally open contact. Taking the dry contact peripheral with a normally open contact as an example for introduction: Pin 1 of the peripheral passive switch is connected to the 1-pin power DPWR network of the external connector CON1 of the main control device, switch pin 2 is connected to the 3-pin DIN network of CON1, and pins 2 and 4 of CON1 are short-circuited; when the dry contact switch is open, there is no high-level input to the DIN network, and the main control device defaults to receiving a low-level signal; when the dry contact switch is closed, the DPWR voltage signal reaches the DIN network end through the switch, and the main control device receives a high-level signal through the optocoupler isolator. The dry contact peripheral with the other normally closed switch has the same wiring method as the normally closed switch, except that when the switch is open and closed, the high and low levels of the signals received by the main control device are opposite.

[0045] Please continue to refer to Figure 3When the input circuit is in the second input state, the wet node is a peripheral device that can output high and low level switching signals. The DOUT pin of the wet node's 1st foot is connected to the 3rd foot of the connector CON1 external to the main control device. The DGND pin of the wet node's 2nd foot is connected to the DCOM network of the 4th foot of CON1, and the 2nd and 4th feet of CON1 are shorted. When the DOUT signal of the wet node is at a high level, the opto-isolator of the main control device receives a high-level signal; when the DOUT signal of the wet node is at a low level, the opto-isolator of the main control device receives a low-level signal.

[0046] In some embodiments of the present application, please refer to Figure 4 , Figure 4 shows a schematic diagram of the circuit connection structure in the third input state provided by this embodiment; the input circuit further has a third input state connected to an NPN-type sensor; when the input circuit is in the third input state, the first interface is connected to the positive power supply of the NPN-type sensor, the fourth interface is connected between the first interface and the positive power supply of the NPN-type sensor, the second interface is connected to the negative power supply of the NPN-type sensor; the third interface is connected to the signal output terminal of the NPN-type sensor. In this way, the digital switching quantity input circuit of this embodiment can be applied to three types of nodes, including dry nodes, wet nodes, and NPN-type sensors.

[0047] Specifically, the positive power supply V+ of the NPN-type sensor is connected to the DPWR network of the 1st foot of the connector CON1 of the main control device, and the 4th and 1st feet of CON1 are shorted. The negative power supply V- of the sensor is connected to the DGND network of the 2nd foot of CON1, and the DOUT signal of the sensor is connected to the DIN network of the 3rd foot of CON1. When the emitter and the signal output terminal of the NPN transistor inside the sensor are in a saturated conduction state, DOUT is connected to the V- signal of the sensor. At this time, the 4th foot of CON1 is at a high level, and the photodiode inside the opto-isolator conducts, and the main control device receives a high-level signal; when the emitter and the signal output terminal of the NPN transistor are in a cut-off and disconnected state, DOUT is disconnected from the V- signal of the sensor. At this time, the 3rd foot of CON1 is in a floating state, and the photodiode inside the opto-isolator does not conduct, and the main control device receives a low-level signal.

[0048] In some embodiments of the present application, please refer to Figure 5 , Figure 5The figure shows a schematic diagram of the circuit connection structure in the fourth input state provided by this embodiment; the input circuit also has a fourth input state for connecting a PNP type sensor; when the input circuit is in the fourth input state, the first interface is connected to the positive power supply of the PNP type sensor, the third interface is connected to the signal output terminal of the PNP type sensor, the second interface is connected to the negative power supply of the PNP type sensor, and the fourth interface is short-circuited with the second interface. In this way, the digital switch input circuit of this embodiment can be applied to four types of nodes, including dry nodes, wet nodes, NPN type sensors, and PNP type sensors.

[0049] Specifically, the positive power supply V+ of the PNP type sensor is connected to the power DPWR network of pin 11 of the connector CON1 of the main control device, the negative power supply V- signal of the sensor is connected to the DGND network of pin 2 of CON1, and pins 2 and 4 of CON1 are short-circuited. The sensor DOUT signal is connected to the DIN network of pin 3 of CON1. When the emitter and signal output terminal of the PNP triode inside the sensor are in a saturated conduction state, DOUT is connected to the V+ signal of the sensor. At this time, pin 3 of CON1 is at a high level, and the photodiode inside the opto-isolator conducts, and the main control device receives a high-level signal; when the emitter and signal output terminal of the PNP triode are in a cut-off state, DOUT is disconnected from the V+ signal of the sensor. At this time, pin 3 of CON1 is in a floating state, and the photodiode inside the opto-isolator does not conduct, and the main control device receives a low-level signal.

[0050] In some embodiments of the present application, please continue to refer to Figure 1 , the photodiode is a bidirectional input diode. That is to say, the wiring of the third interface and the fourth interface can be interchanged.

[0051] In some embodiments of the present application, please continue to refer to Figure 1 , the input circuit further includes a first diode D1 and a fuse F1, and the first diode D1 and the fuse F1 are connected in series between the power supply and the first interface.

[0052] In some embodiments of the present application, please continue to refer to Figure 1 , the input circuit further includes a first capacitor C1, and the first capacitor C1 is connected between the first interface and the first diode; and / or, the input circuit further includes a first transient voltage suppressor TVS1, and the first transient voltage suppressor is connected between the first interface and the second interface.

[0053] In some embodiments of the present application, please refer to Figure 6 , Figure 6The circuit structure diagram of the power supply provided by this embodiment is shown; the power supply includes an isolation unit and a second capacitor C4. The isolation unit is used to access a first voltage and output a second voltage to a first interface according to the first voltage; the isolation unit has a first output terminal and a second output terminal. The first output terminal outputs the second voltage, and the second output terminal is grounded. One end of the second capacitor C4 is connected to the first output terminal, and the other end is connected to the second output terminal.

[0054] In some embodiments, please continue to refer to Figure 6 , the isolation unit further includes a first input terminal, a second input terminal, and a fourth capacitor C3. The first input terminal accesses the first voltage, the second input terminal is grounded, and the fourth capacitor C3 is connected between the first input terminal and the second input terminal.

[0055] Please continue to refer to Figure 1 and Figure 6 , the power supply outputs the power supply VCC1 of the master device in an isolated manner through U1 to obtain the power supply DPWR1. The power supply DPWR1 passes through the freewheeling and filtering of the capacitors C4 and C1, and then passes through the diode D1, the fuse F1, and the protection device TVS1 to the connector CON1 to provide the power supply DPWR for the external DI input node. The diode D1, F1, and TVS1 form a protection circuit to prevent power supply impact, short circuit, current backflow, etc. of external devices, and improve the reliability of circuit operation.

[0056] In some embodiments of the present application, please continue to refer to Figure 1 , the input circuit further includes a first resistor R1, and the first resistor R1 is connected between a third interface and a photodiode; and / or, the optocoupler receiving unit includes a series-connected second resistor R2, a phototransistor, and a third resistor R3. The other end of the second resistor R2 is connected to a power supply voltage. The phototransistor and the photodiode form an optocoupler structure, and the other end of the third resistor R3 is grounded; wherein, a signal output terminal is provided between the third resistor R3 and the phototransistor, and the signal output terminal is used to output a digital signal quantity.

[0057] In some embodiments, the input circuit further includes a third capacitor C2, and the third capacitor C2 is connected between the first resistor and a fourth interface; and / or, the input circuit further includes a second transient voltage suppressor TVS2, and the second transient voltage suppressor is connected between the third interface and the fourth interface.

[0058] Specifically, the optocoupler receiving unit isolates the external node input signal from the receiving end of the main control device through the optocoupler isolator U2. The optocoupler isolator U2 has bidirectional input, that is, the external node DI input can be input from pin 4 of the connector CON1 and return through pin 3, or input from pin 3 of the connector CON1 and return through pin 4. The method of input from pin 4 of the connector CON1 and return through pin 3 is introduced as follows: The external DI signal is input from pin 3 of the connector CON1, passes through the protection device TVS2, and the current limiting and filtering of R1 and C2, and then reaches the photodiodes of pins 1 and 2 of the optocoupler isolator U2, and then returns to pin 4 of the connector CON1; if the DI signal is high level (3V - 24V), the photodiode of U2 conducts, causing the signal output terminals of the photosensitive triode at the output end of U2, pin 4 and the emitter pin 3, to be saturated and conduct, and the voltage signal of the power supply VCC2 reaches the network DI-IN terminal (the network DI-IN is connected to the receiving pin of the main control device), enabling the main control device to receive the high-level signal input by DI; if the DI signal is low level (0V - 1V), the photodiode of U2 does not conduct, and there is an open state between pin 4 and pin 3 of U2. At this time, the network DI-IN terminal is at low level, enabling the main control device to receive the low-level signal input by DI.

[0059] Furthermore, in order to better implement the digital switch input circuit in any of the above embodiments, based on the digital switch input circuit in the above embodiments, the present application also provides an electronic device including the above digital switch input circuit.

[0060] In the above embodiments, the descriptions of each embodiment have their own emphases. For parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0061] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only an example and does not constitute a limitation to the present application. Although not explicitly stated here, those skilled in the art may make various modifications, improvements, and corrections to the present application. Such modifications, improvements, and corrections are proposed in the present application, so such modifications, improvements, and corrections still fall within the spirit and scope of the exemplary embodiments of the present application.

[0062] At the same time, the present application uses specific terms to describe the embodiments of the present application. Such as "one embodiment", "an embodiment", and / or "some embodiments" mean a certain feature, structure, or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that the "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more at different positions in this specification is not necessarily the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the present application can be appropriately combined.

[0063] Similarly, it should be noted that, in order to simplify the description disclosed in the present application and thus help the understanding of one or more utility model embodiments, in the foregoing description of the embodiments of the present application, sometimes multiple features are merged into one embodiment, drawing or description thereof. However, this disclosure method does not mean that the features required by the subject matter of the present application are more than those mentioned in the claims. In fact, the features of the embodiment are less than all the features of the single embodiment disclosed above.

[0064] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A digital switch input circuit, characterized in that: include: An optical coupler receiving unit, wherein the optical coupler receiving unit comprises a photodiode; A connector, wherein at least a first interface, a second interface, a third interface and a fourth interface are provided on the connector; wherein the first interface is connected to a power supply, the second interface is grounded, and the third interface and the fourth interface are connected to two ends of the photodiode; Wherein, the input circuit has a first input state connected to a dry node and a second input state connected to a wet node; When the input circuit is in the first input state, the second interface is short-circuited with the fourth interface, and the first interface and the third interface are connected to two ends of the dry node; When the input circuit is in the second input state, the third interface is connected to the output signal end of the wet node, the second interface is connected to the ground end of the wet node, and the fourth interface is short-circuited with the second interface.

2. The digital switch input circuit according to claim 1, characterized in that: The input circuit also has a third input state for connecting to the NPN sensor; when the input circuit is in the third input state, the first interface is connected to the positive power supply of the NPN sensor, the fourth interface is connected between the first interface and the positive power supply of the NPN sensor, and the second interface is connected to the negative power supply of the NPN sensor; the third interface is connected to the signal output end of the NPN sensor.

3. The digital switch input circuit according to claim 1, characterized in that: The input circuit also has a fourth input state for connecting to a PNP sensor; when the input circuit is in the fourth input state, the first interface is connected to the positive power supply electrode of the PNP sensor, the third interface is connected to the signal output end of the PNP sensor, the second interface is connected to the negative power supply electrode of the PNP sensor, and the fourth interface is short-circuited with the second interface.

4. The digital switch input circuit according to any one of claims 1 to 3, characterized in that: The photodiode is a bidirectional input diode.

5. The digital switch input circuit according to any one of claims 1 to 3, characterized in that: The input circuit further includes a first diode and a fuse, which are connected in series between the power supply and the first interface.

6. The digital switch input circuit according to claim 5, characterized in that: The input circuit further includes a first capacitor connected between the first interface and the first diode; And / or, the input circuit further includes a first transient voltage suppressor, wherein the first transient voltage suppressor is connected between the first interface and the second interface.

7. The digital switch input circuit according to claim 5, characterized in that: The power supply includes an isolation unit and a second capacitor, the isolation unit is used to access a first voltage and output a second voltage to the first interface according to the first voltage; The isolation unit has a first output terminal and a second output terminal, the first output terminal outputs the second voltage, the second output terminal is grounded, one end of the second capacitor is connected to the first output terminal, and the other end is connected to the second output terminal.

8. The digital switch input circuit according to any one of claims 1 to 3, characterized in that: The input circuit further includes a first resistor connected between the third interface and the photodiode; And / or, the optocoupler receiving unit includes a second resistor, a phototransistor and a third resistor connected in series, the other end of the second resistor is connected to a power supply voltage, the phototransistor and the photodiode form an optocoupler structure, and the other end of the third resistor is grounded; wherein a signal output end is arranged between the third resistor and the phototransistor, and the signal output end is used to output a digital signal quantity.

9. The digital switch input circuit according to claim 8, characterized in that: The input circuit further includes a third capacitor, and the third capacitor is connected between the first resistor and the fourth interface; And / or, the input circuit further includes a second transient voltage suppressor, and the second transient voltage suppressor is connected between the third interface and the fourth interface.

10. An electronic device, characterized in that: A digital switch input circuit comprising any one of claims 1 to 9.