Switching quantity input circuit, system and electronic device
By introducing a first switching module and a second switching module into the digital input circuit, and utilizing opto-isolation units and switching units, the automatic switching of high and low level input effective modes is achieved, solving the problem of cumbersome rewiring operations required in the prior art and improving the applicability and reliability of the circuit.
Patent Information
- Application Number
- CN202521847974.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2035-08-28
AI Technical Summary
Existing digital input circuits require rewiring during mode switching, which is cumbersome, increases labor costs, and is prone to malfunctions due to wiring errors, making it difficult to meet the needs of flexible and efficient applications.
The design employs a digital input module, a first switching module, and a second switching module. When the input is high, it is electrically connected to an external reference ground through the first switching module; when the input is low, it is electrically connected to the power supply through the second switching module. The switching action of the module itself is achieved by using an opto-isolation unit and a switching unit, avoiding external rewiring.
The operation process for mode switching has been simplified, reducing labor costs and the risk of wiring errors, improving the applicability and reliability of the circuit, and enabling flexible switching between high and low level input effective modes.
Smart Images

Figure CN224684195U_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of digital input technology, and particularly relates to a digital input circuit, system and electronic device. Background Technology
[0002] In functional safety-related applications of digital input circuits, especially in scenarios requiring high circuit flexibility, users have a clear need for convenient switching between high-level and low-level valid input modes. Existing digital input circuit solutions typically achieve both high-level and low-level valid modes through external wiring. However, mode switching requires rewiring, connecting corresponding terminals to different power supplies or reference grounds, which is cumbersome. In scenarios requiring frequent mode switching, this not only increases labor costs but also increases the risk of circuit malfunction due to wiring errors, failing to meet the flexibility and efficiency requirements of practical applications. Utility Model Content
[0003] This application provides a digital input circuit, system, and electronic device that can solve the problem that existing circuits require rewiring during mode switching, which is a cumbersome process.
[0004] In a first aspect, embodiments of this application provide a digital input circuit, including a digital input module, a first switching module, and a second switching module, wherein the digital input module is electrically connected to the first switching module and the second switching module respectively;
[0005] When the digital input module is in a high-level input active state, the digital input module is electrically connected to an external reference ground through the first switching module;
[0006] When the digital input module is in a low-level input active state, the digital input module is electrically connected to the power supply through the second switching module.
[0007] In one possible implementation of the first aspect, the first switching module includes a first switching unit, a first opto-isolation unit, and a second switching unit. The first opto-isolation unit is electrically connected to the first switching unit, the second switching unit, and the switch input module, respectively. The second switching unit is electrically connected to the switch input module and the external reference ground, respectively.
[0008] The second switching module includes a second opto-isolation unit and a third switching unit. The third switching unit is electrically connected to the second opto-isolation unit, the switch input module, the first switching module, and the power supply.
[0009] In one possible implementation of the first aspect, the first switching unit includes a first transistor, a first resistor, and a second resistor. The base of the first transistor is electrically connected to a first terminal of the first resistor and a first terminal of the second resistor, respectively. The collector of the first transistor is electrically connected to the first opto-isolation unit. The emitter of the first transistor and the second terminal of the second resistor are both electrically connected to the external reference ground. The second terminal of the first resistor is used to receive a first signal.
[0010] The first opto-isolation unit includes a first optocoupler and a third resistor. The first end of the third resistor is used to be electrically connected to a first power supply. The first end of the first optocoupler is electrically connected to the second end of the third resistor. The second end of the first optocoupler is electrically connected to the first switching unit. The third end of the first optocoupler is electrically connected to the second switching unit. The fourth end of the first optocoupler is electrically connected to the switch input module.
[0011] The second switching unit includes a second transistor, a fourth resistor, and a fifth resistor. The base of the second transistor is electrically connected to the first end of the fourth resistor. The emitter of the second transistor and the first end of the fifth resistor are both used to be electrically connected to the external reference ground. The collector of the second transistor is electrically connected to the switch input module. The second end of the fourth resistor is electrically connected to the second end of the fifth resistor and the first opto-isolation unit, respectively.
[0012] In one possible implementation of the first aspect, the second opto-isolation unit includes a second optocoupler, a sixth resistor, a seventh resistor, an eighth resistor, and a first capacitor. The first end of the second optocoupler, the first end of the seventh resistor, and the first end of the first capacitor are all electrically connected to a second power supply. The second end of the second optocoupler is electrically connected to the second end of the seventh resistor, the first end of the first capacitor, and the first end of the sixth resistor, respectively. The third end of the second optocoupler is electrically connected to the second end of the eighth resistor. The fourth end of the second optocoupler is electrically connected to the third switching unit. The second end of the sixth resistor is used to receive a second signal, and the first end of the eighth resistor is used to be electrically connected to the external reference ground.
[0013] The third switching unit includes a third transistor, a ninth resistor, and a second capacitor. The emitter of the third transistor, the first terminal of the second capacitor, and the first terminal of the ninth resistor are all used to be electrically connected to the power supply. The base of the third transistor is electrically connected to the second terminal of the second capacitor, the second terminal of the ninth resistor, and the second opto-isolation unit, respectively. The collector of the third transistor is electrically connected to the switch input module and the first switching module, respectively.
[0014] In one possible implementation of the first aspect, the switch input module includes a third optocoupler, a tenth resistor, an eleventh resistor, a twelfth resistor, a thirteenth resistor, a third capacitor, and a fourth capacitor. The first terminal of the third optocoupler is electrically connected to the first terminal of the third capacitor and the first terminal of the twelfth resistor, respectively. The second terminal of the third optocoupler is electrically connected to the second terminal of the third capacitor, the second terminal of the twelfth resistor, and the second terminal of the tenth resistor, respectively. The third terminal of the third optocoupler is grounded. The fourth terminal of the third optocoupler is electrically connected to the second terminal of the eleventh resistor and the first terminal of the thirteenth resistor, respectively. The first terminal of the tenth resistor is electrically connected to the first switching module and the second switching module, respectively. The first terminal of the eleventh resistor is used for electrical connection to a third power supply. The first terminal of the fourth capacitor is electrically connected to the second terminal of the thirteenth resistor, and the second terminal of the fourth capacitor is grounded.
[0015] In one possible implementation of the first aspect, the third optocoupler includes a first light-emitting element, a second light-emitting element, and a photosensitive element. The negative electrode of the first light-emitting element and the positive electrode of the second light-emitting element serve as the first end of the third optocoupler, the positive electrode of the first light-emitting element and the negative electrode of the second light-emitting element serve as the second end of the third optocoupler, the input end of the photosensitive element serves as the fourth end of the third optocoupler, and the output end of the photosensitive element serves as the third end of the third optocoupler.
[0016] Secondly, embodiments of this application provide a digital input circuit system, including the digital input circuit described in any one of the first aspects, and further including a control circuit. The control circuit is electrically connected to a first switching module and a second switching module, respectively. The control circuit is used to send a first signal to the first switching module and a second signal to the second switching module. When the digital input module is in a high-level input active state, the digital input module is electrically connected to an external reference ground through the first switching module. When the digital input module is in a low-level input active state, the digital input module is electrically connected to a power supply through the second switching module.
[0017] In one possible implementation of the second aspect, the control circuit includes a pulse sending module and a pulse detection module; the pulse sending module is used to send a pulse signal to the first switching module when a high-level input is valid, and to send a pulse signal to the second switching module when a low-level input is valid; the pulse detection module is used to detect the pulse signal of the first switching module when a high-level input is valid, and to detect the pulse signal of the second switching module when a low-level input is valid.
[0018] In one possible implementation of the second aspect, the control circuit is further connected to a digital input module, which is also used to output a low level to the control circuit when a high-level input is valid and when a low-level input is valid.
[0019] Thirdly, embodiments of this application provide an electronic device including the switching input circuit system described in any one of the second aspects.
[0020] The beneficial effects of the embodiments in this application compared with the prior art are:
[0021] The digital input circuit provided in this application includes a digital input module, a first switching module, and a second switching module. When the digital input module is in a high-level input active state, it is electrically connected to an external reference ground through the first switching module. When the digital input module is in a low-level input active state, it is electrically connected to a power supply through the second switching module. Therefore, the digital input circuit provided in this application, by setting the first and second switching modules, achieves flexible switching between two operating modes: high-level input active and low-level input active. No external rewiring is required; the connection to an external reference ground or power supply is completed solely through the module's own switching action. This design simplifies the mode switching process, reduces labor costs and the risk of wiring errors, and improves the circuit's applicability and reliability. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic block diagram of a switch input circuit provided in one embodiment of this application;
[0024] Figure 2 This is a schematic block diagram of a switch input circuit provided in another embodiment of this application;
[0025] Figure 3 This is a circuit connection diagram of a switch input circuit provided in an embodiment of this application.
[0026] In the diagram: 10, switch input circuit; 101, switch input module; 102, first switching module; 1021, first switching unit; 1022, first opto-isolation unit; 1023, second switching unit; 103, second switching module; 1031, second opto-isolation unit; 1032, third switching unit. Detailed Implementation
[0027] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0028] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0029] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0030] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0031] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0032] To illustrate the technical solution described in this application, specific embodiments are provided below.
[0033] Figure 1 A schematic block diagram of a switch input circuit 10 according to an embodiment of this application is shown. See also Figure 1 As shown, the digital input circuit 10 includes a digital input module 101, a first switching module 102, and a second switching module 103. The digital input module 101 is electrically connected to the first switching module 102 and the second switching module 103, respectively.
[0034] Specifically, when the digital input module 101 is in a high-level input active state, it is electrically connected to the external reference ground through the first switching module 102. When the digital input module 101 is in a low-level input active state, it is electrically connected to the power supply through the second switching module 103. Therefore, the digital input circuit 10 provided in this embodiment, by setting the first switching module 102 and the second switching module 103, achieves flexible switching between two operating modes: high-level input active and low-level input active. No external rewiring is required; the connection to the external reference ground or power supply can be switched solely through the module's own switching action. This design simplifies the mode switching process, reduces labor costs and the risk of wiring errors, and improves the circuit's applicability and reliability.
[0035] It should be noted that a high-level input is valid when the input signal received by the digital input module 101 is high, at which point the device in the digital input module 101 is turned on. A low-level input is valid when the input signal received by the digital input module 101 is low, at which point the device in the digital input module 101 is turned on.
[0036] In one embodiment of this application, such as Figure 2 As shown, the first switching module 102 includes a first switching unit 1021, a first opto-isolation unit 1022, and a second switching unit 1023. The first opto-isolation unit 1022 is electrically connected to the first switching unit 1021, the second switching unit 1023, and the digital input module 101, respectively. The second switching unit 1023 is electrically connected to the digital input module 101 and the external reference ground, respectively.
[0037] Specifically, the first switching unit 1021 receives a first signal. When the first signal received by the first switching unit 1021 is a high-level signal, the first switching unit 1021 outputs a first switching signal to the first opto-isolation unit 1022 according to the first signal. The first opto-isolation unit 1022 outputs a first opto-isolation signal to the second switching unit 1023 according to the first switching signal and the voltage of the first node. The second switching unit 1023 is turned on according to the first opto-isolation signal, so that the first node is connected to the external reference ground, that is, the switch input module 101 is connected to the external reference ground. When the input signal is high-level, the devices in the switch input module 101 can be turned on, thereby realizing that the high-level input is valid.
[0038] When the first signal received by the first switching unit 1021 is a low-level signal, the first switching unit 1021 outputs a second switching signal to the first opto-isolation unit 1022 according to the first signal. The first opto-isolation unit 1022 outputs a second opto-isolation signal to the second switching unit 1023 according to the second switching signal and the voltage of the first node. The second switching unit 1023 turns off according to the second opto-isolation signal, thereby disconnecting the first node from the external reference ground, that is, disconnecting the digital input module 101 from the external reference ground. When the input signal is low-level, the devices in the digital input module 101 can be turned on, thereby realizing that the low-level input is valid.
[0039] It can be seen that through the coordinated work of the first switching unit 1021, the first opto-isolation unit 1022, and the second switching unit 1023, the first switching module 102 achieves precise control of the on / off state of the switch input module 101 and the external reference ground in different working modes, providing stable hardware support for the flexible switching of the switch input circuit 10 between high and low level input effective modes.
[0040] In one embodiment of this application, such as Figure 2 As shown, the second switching module 103 includes a second opto-isolation unit 1031 and a third switching unit 1032. The third switching unit 1032 is electrically connected to the second opto-isolation unit 1031, the switch input module 101, the first switching module 102, and the power supply, respectively.
[0041] Specifically, the second opto-isolation unit 1031 receives the second signal. When the second signal received by the second opto-isolation unit 1031 is a high-level signal, the second opto-isolation unit 1031 outputs a third opto-isolation signal to the third switching unit 1032 according to the second signal. The third switching unit 1032 turns off according to the third opto-isolation signal, thereby disconnecting the first node from the power supply, that is, disconnecting the switch input module 101 from the power supply. When the input signal is high-level, the devices in the switch input module 101 can be turned on, thereby realizing that the high-level input is valid.
[0042] When the second signal received by the second opto-isolation unit 1031 is a low-level signal, the second opto-isolation unit 1031 outputs a fourth opto-isolation signal to the third switching unit 1032 according to the second signal. The third switching unit 1032 is turned on according to the fourth opto-isolation signal, so that the first node is connected to the power supply, that is, the switch input module 101 is connected to the power supply. When the input signal is low-level, the devices in the switch input module 101 can be turned on, thereby realizing that the low-level input is valid.
[0043] It can be seen that, through the coordinated operation of the second opto-isolation unit 1031 and the third switching unit 1032, the second switching module 103 achieves precise control of the on / off state of the switch input module 101 and the power supply in different working modes, providing stable hardware support for the flexible switching of the switch input circuit 10 between high and low level input effective modes.
[0044] The following is combined Figure 3 The circuit diagrams provided for each unit describe in detail the working process and control principle of each unit.
[0045] In one embodiment of this application, such as Figure 3 As shown, the first switching unit 1021 includes a first transistor Q1, a first resistor R1, and a second resistor R2. The base of the first transistor Q1 is electrically connected to the first terminal of the first resistor R1 and the first terminal of the second resistor R2, respectively. The collector of the first transistor Q1 is electrically connected to the first opto-isolation unit 1022. The emitter of the first transistor Q1 and the second terminal of the second resistor R2 are both electrically connected to an external reference ground. The second terminal of the first resistor R1 is used to receive a first signal.
[0046] Specifically, the first resistor R1 and the second resistor R2 are base control resistors for the first transistor Q1, controlling its conduction. When the first signal received at the second terminal of the first resistor R1 is a high-level signal, the first resistor R1 transmits the high-level signal to the base of the first transistor Q1. At this time, the first transistor Q1 conducts, thus forming a path between its collector and emitter, grounding the common terminal of the first opto-isolation unit 1022 and the first switching unit 1021, providing a trigger condition for the subsequent generation of the opto-isolation signal. Conversely, when the first signal received at the second terminal of the first resistor R1 is a low-level signal, the first transistor Q1 is turned off.
[0047] For example, the first transistor Q1 can be an NPN transistor.
[0048] In one embodiment of this application, such as Figure 3 As shown, the first opto-isolation unit 1022 includes a first optocoupler PC1 and a third resistor R3. The first end of the third resistor R3 is electrically connected to the first power supply. The first end of the first optocoupler PC1 is electrically connected to the second end of the third resistor R3. The second end of the first optocoupler PC1 is electrically connected to the first switching unit 1021. The third end of the first optocoupler PC1 is electrically connected to the second switching unit 1023. The fourth end of the first optocoupler PC1 is electrically connected to the switch input module 101.
[0049] Specifically, the third resistor R3 is a current-limiting resistor, which can precisely limit the current flowing into the first terminal of the first optocoupler PC1, preventing damage to the first optocoupler PC1 due to overcurrent and ensuring circuit stability. The first terminal of the first optocoupler PC1 is the anode of the light-emitting diode (LED), the second terminal is the cathode of the LED, the third terminal is the emitter of the light-receiving semiconductor tube, and the fourth terminal is the collector of the light-receiving semiconductor tube. The first optocoupler PC1 achieves electrical isolation through photoelectric conversion, which not only blocks the direct electrical connection between the LED and the light-receiving semiconductor tube to improve safety, but also transmits the switching signals (first switching signal and second switching signal) output by the first switching unit 1021 to the light-receiving semiconductor tube through optical signals, realizing the effective transmission of control logic. Therefore, the third resistor R3 and the first optocoupler PC1 work together to ensure circuit isolation safety while completing reliable signal conversion and transmission, providing isolation protection and a signal path for the on / off control of the first switching module 102.
[0050] When the first signal is high, the first transistor Q1 is turned on, grounding the second terminal of the first optocoupler PC1. The LED of the first optocoupler PC1 then emits light, and the light-receiving semiconductor is turned on. Conversely, when the first signal is low, the first transistor Q1 is turned off, the LED of the first optocoupler PC1 does not emit light, and the light-receiving semiconductor is turned off.
[0051] For example, the supply voltage of the first power source can be 3.3V.
[0052] In one embodiment of this application, such as Figure 3 As shown, the second switching unit 1023 includes a second transistor Q2, a fourth resistor R4, and a fifth resistor R5. The base of the second transistor Q2 is electrically connected to the first end of the fourth resistor R4. The emitter of the second transistor Q2 and the first end of the fifth resistor R5 are both used to be electrically connected to an external reference ground. The collector of the second transistor Q2 is electrically connected to the switch input module 101. The second end of the fourth resistor R4 is electrically connected to the second end of the fifth resistor R5 and the first opto-isolation unit 1022.
[0053] Specifically, the fourth resistor R4 and the fifth resistor R5 are the base control resistors of the second transistor Q2, controlling the conduction and turn-off of the second transistor Q2. As a switching device, when the second transistor Q2 is turned on, the first node is electrically connected to the external reference ground, that is, the digital input module 101 is electrically connected to the external reference ground; when the second transistor Q2 is turned off, the first node is disconnected from the external reference ground, that is, the digital input module 101 is electrically connected to the external reference ground.
[0054] When the first signal is high, the first transistor Q1 is turned on, grounding the second terminal of the first optocoupler PC1. The LED of the first optocoupler PC1 emits light, and the light-receiving semiconductor is turned on. When the input signal is high, the second transistor Q2 is turned on, connecting the first node to the external reference ground, i.e., the digital input module 101 is electrically connected to the external reference ground. Conversely, when the first signal is low, the first transistor Q1 is turned off, the LED of the first optocoupler PC1 does not emit light, the light-receiving semiconductor is turned off, the second transistor Q2 is turned off, and the first node is disconnected from the reference ground, i.e., the digital input module 101 is electrically connected to the external reference ground.
[0055] For example, the second transistor Q2 can be an NPN transistor.
[0056] In one embodiment of this application, such as Figure 3As shown, the second opto-isolation unit 1031 includes a second optocoupler PC2, a sixth resistor R6, a seventh resistor R7, an eighth resistor R8, and a first capacitor C1. The first terminals of the second optocoupler PC2, the seventh resistor R7, and the first capacitor C1 are all used to be electrically connected to the second power supply. The second terminal of the second optocoupler PC2 is electrically connected to the second terminal of the seventh resistor R7, the first terminal of the first capacitor C1, and the first terminal of the sixth resistor R6, respectively. The third terminal of the second optocoupler PC2 is electrically connected to the second terminal of the eighth resistor R8. The fourth terminal of the second optocoupler PC2 is electrically connected to the third switching unit 1032. The second terminal of the sixth resistor R6 is used to receive the second signal, and the first terminal of the eighth resistor R8 is used to be electrically connected to an external reference ground.
[0057] Specifically, the sixth resistor R6 and the eighth resistor R8 are both current-limiting resistors. The sixth resistor R6 can safely transmit the received second signal to the primary side (light-emitting diode) of the second optocoupler PC2, preventing overcurrent damage to the device. The eighth resistor R8 provides a stable potential reference and current path for the secondary side (light-receiving semiconductor) signal. The seventh resistor R7 is connected in parallel with the primary side of the second optocoupler PC2 as a residual charge absorption resistor, which can quickly absorb the residual charge when the second optocoupler PC2 is turned off, accelerating its turn-off response speed and improving control accuracy. The first capacitor C1 is a filter capacitor, used to reduce high-frequency noise in the signal and ensure the stability of the input signal. The second optocoupler PC2, as the core isolation device, achieves electrical isolation between the primary and secondary sides through photoelectric conversion. This not only blocks the direct electrical connection between the two sides to enhance safety, but also reliably transmits the processed signal to the secondary side to drive the subsequent third switching unit 1032.
[0058] When the second signal received at the second terminal of the sixth resistor R6 is a high-level signal, the sixth resistor R6 transmits the high-level signal to the second terminal of the second optocoupler PC2. At this time, the light-emitting diode of the second optocoupler PC2 does not emit light, and the light-receiving semiconductor is turned off. Conversely, when the second signal received at the second terminal of the sixth resistor R6 is a low-level signal, the light-emitting diode of the second optocoupler PC2 emits light, and the light-receiving semiconductor is turned on.
[0059] For example, the supply voltage of the second power source can be 3.3V.
[0060] In one embodiment of this application, such as Figure 3 As shown, the third switching unit 1032 includes a third transistor Q3, a ninth resistor R9, and a second capacitor C2. The emitter of the third transistor Q3, the first terminal of the second capacitor C2, and the first terminal of the ninth resistor R9 are all used to be electrically connected to the power supply. The base of the third transistor Q3 is electrically connected to the second terminal of the second capacitor C2, the second terminal of the ninth resistor R9, and the second opto-isolation unit 1031, respectively. The collector of the third transistor Q3 is electrically connected to the switch input module 101 and the first switching module 102, respectively.
[0061] Specifically, the ninth resistor R9 is the base resistor of the third transistor Q3, controlling its on and off states. As a switching device, when the third transistor Q3 is on, the first node is connected to the power supply, meaning the digital input module 101 is electrically connected to the power supply; when the third transistor Q3 is off, the first node is disconnected from the power supply, meaning the digital input module 101 is disconnected from the power supply. The second capacitor C2 is a filter capacitor used to reduce high-frequency noise in the signal and ensure the stability of the input signal.
[0062] When the second signal is high, the LED of the second optocoupler PC2 does not emit light, the light-receiving semiconductor is turned off, the third transistor Q3 is turned off, and the first node is disconnected from the power supply, that is, the digital input module 101 is disconnected from the power supply. Conversely, when the second signal is low, the LED of the second optocoupler PC2 emits light, the light-receiving semiconductor is turned on, the third transistor Q3 is turned on, and the first node is connected to the power supply, that is, the digital input module 101 is electrically connected to the power supply.
[0063] For example, the power supply voltage can be +24V, and the third transistor Q3 can be a PNP transistor.
[0064] In one embodiment of this application, such as Figure 3 As shown, the digital input module 101 includes a third optocoupler PC3, a tenth resistor R10, an eleventh resistor R11, a twelfth resistor R12, a thirteenth resistor R13, a third capacitor C3, and a fourth capacitor C4. The first terminal of the third optocoupler PC3 is electrically connected to the first terminal of the third capacitor C3 and the first terminal of the twelfth resistor R12. The second terminal of the third optocoupler PC3 is electrically connected to the second terminal of the third capacitor C3, the second terminal of the twelfth resistor R12, and the second terminal of the tenth resistor R10. The third terminal of the third optocoupler PC3 is grounded. The fourth terminal of the third optocoupler PC3 is electrically connected to the second terminal of the eleventh resistor R11 and the first terminal of the thirteenth resistor R13. The first terminal of the tenth resistor R10 is electrically connected to the first switching module 102 and the second switching module 103. The first terminal of the eleventh resistor R11 is used to connect to the third power supply. The first terminal of the fourth capacitor C4 is electrically connected to the second terminal of the thirteenth resistor R13. The second terminal of the fourth capacitor C4 is grounded.
[0065] Specifically, the tenth resistor R10 is a current-limiting resistor. The twelfth resistor R12 is connected in parallel with the primary side of the third optocoupler PC3 as a residual charge absorption resistor, which can quickly absorb the residual charge when the third optocoupler PC3 is turned off, accelerating its turn-off response speed and improving control accuracy. The eleventh resistor R11 is a pull-up resistor, used to pull up the voltage at the fourth terminal of the third optocoupler PC3. The thirteenth resistor R13 and the fourth capacitor C4 form a low-pass filter, used to filter out high-frequency noise components in the target signal, ensuring the stability of the signal transmitted to subsequent circuits. The third capacitor C3 is a filter capacitor, used to reduce high-frequency noise in the signal, ensuring the stability of the input signal. The third optocoupler PC3, as the core isolation device, achieves electrical isolation between the primary and secondary sides through photoelectric conversion. This not only blocks the direct electrical connection between the two sides to enhance safety, but also reliably transmits the processed signal to the secondary side to output the target signal.
[0066] For example, the supply voltage of the third power source can be 3.3V.
[0067] In one embodiment of this application, such as Figure 3 As shown, the third optocoupler PC3 includes a first light-emitting element, a second light-emitting element, and a photosensitive element. The negative electrode of the first light-emitting element and the positive electrode of the second light-emitting element serve as the first end of the third optocoupler PC3, the positive electrode of the first light-emitting element and the negative electrode of the second light-emitting element serve as the second end of the third optocoupler PC3, the input end of the photosensitive element serves as the fourth end of the third optocoupler PC3, and the output end of the photosensitive element serves as the third end of the third optocoupler PC3.
[0068] Specifically, compared to traditional optocouplers that contain only a single light-emitting element (LED), where the anode voltage of the LED is higher than the cathode voltage (meaning the voltage at the first terminal of the optocoupler is higher than the voltage at the second terminal), the third optocoupler PC3 in this application incorporates two light-emitting elements (LEDs). When the switching input circuit 10 operates in a high-level input active mode, the second light-emitting element closer to the photosensitive element (light-receiving semiconductor) is turned on, and at this time, the voltage at the first terminal of the third optocoupler PC3 is higher than the voltage at the second terminal. When the switching input circuit 10 operates in a low-level input active mode, the first light-emitting element farther from the light-receiving semiconductor is turned on, and at this time, the voltage at the first terminal of the third optocoupler PC3 is lower than the voltage at the second terminal.
[0069] This application also discloses a digital input circuit system, including the aforementioned digital input circuit 10, and further including a control circuit, which is electrically connected to the first switching module 102 and the second switching module 103 respectively; for example, in this embodiment, the control circuit is an MCU.
[0070] Specifically, the control circuit is used to send a first signal to the first switching module 102 and a second signal to the second switching module 103; so that when the switch input module 101 is in a high-level input valid state, the switch input module 101 is electrically connected to the external reference ground through the first switching module 102, and when the switch input module 101 is in a low-level input valid state, the switch input module 101 is electrically connected to the power supply through the second switching module 103.
[0071] The digital input circuit system employs the aforementioned digital input circuit, which enables precise control of the first switching module 102 and the second switching module 103 via the control circuit. This allows for automatic switching of the digital input module 101 between high-level input valid and low-level input valid modes, eliminating the need for manual intervention in the wiring process. This improves the convenience and efficiency of mode switching, reduces human error, and ensures the stability and response speed of the circuit connection in both modes through the coordinated operation of the control circuit and the switching module. This enhances the controllability and reliability of the entire system in functional safety scenarios, enabling it to more flexibly meet the diverse needs of different application scenarios regarding the validity of digital input signals.
[0072] In one embodiment of this application, the control circuit includes a pulse transmission module and a pulse detection module; the pulse transmission module is electrically connected to the first switching module 102, the second switching module 103 and the pulse detection module, respectively.
[0073] Specifically, the pulse sending module sends a pulse signal to the first switching module 102 when a high-level input is valid, and sends a pulse signal to the second switching module 103 when a low-level input is valid. The pulse detection module detects the pulse signal from the first switching module 102 when a high-level input is valid, and detects the pulse signal from the second switching module 103 when a low-level input is valid. By determining the presence or absence of the pulse signal or whether its characteristics are normal, real-time monitoring of the operating status of the switch input circuit 10 is achieved. The two modules work together, providing trigger signals for circuit fault detection and determining whether the circuit is operating normally based on the pulse detection results. This effectively improves the safety and reliability of the system, ensuring timely fault detection and early warning in both operating modes.
[0074] It should be noted that when the digital input circuit 10 operates in high-level input valid mode and the input signal is high, the pulse sending module can send a narrow pulse to the first switching module 102 and determine whether the circuit is working properly by detecting the narrow pulse. Specifically, if the first switching module 102 receives a narrow pulse, combined with its own function, it will cause the on / off state of the digital input module 101 and the external reference ground to change periodically, thereby outputting a narrow pulse signal to the pulse detection module. At this time, if the pulse detection module detects the narrow pulse, it indicates that the digital input circuit 10 is working properly. Conversely, if no narrow pulse is detected, it indicates that there is an abnormality in the digital input circuit 10.
[0075] When the digital input circuit 10 operates in low-level input active mode and the input signal is low, the pulse sending module can send a narrow pulse to the second switching module 103 and determine whether the circuit is working properly by detecting the narrow pulse. Specifically, if the second switching module 103 receives a narrow pulse, it will, in conjunction with its own function, cause the on / off state of the digital input module 101 and the power supply to change periodically, thereby outputting a narrow pulse signal to the pulse detection module. At this time, if the pulse detection module detects the narrow pulse, it indicates that the digital input circuit 10 is working properly. Conversely, if no narrow pulse is detected, it indicates that there is an abnormality in the digital input circuit 10.
[0076] Therefore, compared to traditional detection methods using analog signals, this application employs narrow pulses to detect whether the switch input circuit 10 is functioning properly. This method offers stronger anti-interference capabilities, effectively reducing the impact of noise from complex electromagnetic environments or signal transmission on the detection results, and ensuring the accuracy and reliability of fault diagnosis. Furthermore, the narrow pulse signal in digital form is more stable during transmission and recognition, eliminating the need for complex analog signal processing circuits, simplifying the detection logic, and further enhancing the circuit's applicability in functional safety scenarios.
[0077] In one embodiment of this application, the control circuit is also connected to the digital input module 101, which is further configured to output a low level to the control circuit when a high-level input is valid and a low-level input is valid.
[0078] Specifically, when the digital input circuit 10 operates in the high-level input valid mode, if the input signal is high, the device in the digital input module 101 is turned on, and the signal transmitted to the control circuit is low, so the input is valid; if the input signal is low, the device in the digital input module 101 is turned off, and the signal transmitted to the control circuit is high, so the input is invalid.
[0079] When the digital input circuit 10 operates in the low-level input valid mode, if the input signal is high, the device in the digital input module 101 is turned off, the signal transmitted to the control circuit is high, and the input is invalid; if the input signal is low, the device in the digital input module 101 is turned on, the second target signal transmitted to the control circuit is low, and the input is valid.
[0080] The following is combined Figure 3 The circuit diagrams of each unit provided provide a detailed description of the working process and control principle of the switch input circuit 10 provided in the embodiments of this application.
[0081] When the digital input circuit 10 operates in high-level input valid mode, the control circuit outputs a high-level signal to the first switching module 102, turning on the first transistor Q1, which powers the LED of the first optocoupler PC1, causing it to emit light and the light-receiving semiconductor to conduct. When the input signal is high, the second transistor Q2 conducts, connecting the first node to the external reference ground, i.e., connecting the digital input module 101 to the external reference ground. Simultaneously, the control circuit outputs a high-level signal to the second switching module 103, causing the LED of the second optocoupler PC2 to turn off, turning off the light-receiving semiconductor, which in turn turns off the third transistor Q3, disconnecting the first node from the power supply, i.e., disconnecting the digital input module 101 from the power supply. At this time, if the input signal is high, the light-receiving semiconductor of the third optocoupler PC3 conducts, and the control circuit receives a low-level signal, making the input valid; if the input signal is low, the light-receiving semiconductor of the third optocoupler PC3 turns off, and the control circuit receives a high-level signal, making the input invalid.
[0082] When the digital input circuit 10 operates in low-level input active mode, the control circuit outputs a low-level signal to the first switching module 102, turning off the first transistor Q1, causing the LED of the first optocoupler PC1 to not emit light, the light-receiving semiconductor to turn off, the second transistor Q2 to turn off, and the first node to disconnect from the reference ground, i.e., the digital input module 101 to disconnect from the external reference ground. Simultaneously, the control circuit outputs a low-level signal to the second switching module 103, energizing the LED of the second optocoupler PC2, turning on the light-receiving semiconductor, and causing the third transistor Q3 to turn on, connecting the first node to the power supply, i.e., the digital input module 101 to the power supply. At this time, if the input signal is high, the light-receiving semiconductor of the third optocoupler PC3 is turned off, the control circuit receives a high-level signal, and the input is invalid; if the input signal is low, the light-receiving semiconductor of the third optocoupler PC3 is turned on, the control circuit receives a low-level signal, and the input is valid.
[0083] The detection principle of the switch input circuit 10 provided in the embodiments of this application will be described below.
[0084] When the digital input circuit 10 operates in high-level input valid mode and the input signal is high, the control circuit sends a narrow pulse to the first switching module 102. At this time, the first transistor Q1 periodically turns on and off, causing the first optocoupler PC1 to also periodically turn on and off, which in turn causes the second transistor Q2 to also periodically turn on and off, ultimately causing the third optocoupler PC3 to periodically turn on and off. The signal transmitted to the control circuit at this time is a narrow pulse. The control circuit detects the narrow pulse to determine whether the digital input circuit 10 is working properly. When the control circuit detects the narrow pulse, it indicates that the digital input circuit 10 is working properly; when the control circuit does not detect the narrow pulse, it indicates that the digital input circuit 10 is malfunctioning.
[0085] When the digital input circuit 10 operates in low-level input active mode and the input signal is low, the control circuit sends a narrow pulse to the second switching module 103. At this time, the second optocoupler PC2 periodically turns on and off, causing the third transistor Q3 to also periodically turn on and off, ultimately causing the third optocoupler PC3 to periodically turn on and off. The signal transmitted to the control circuit at this time is a narrow pulse. The control circuit detects the narrow pulse to determine whether the digital input circuit 10 is working properly. When the control circuit detects the narrow pulse, it indicates that the digital input circuit 10 is working properly; when the control circuit does not detect the narrow pulse, it indicates that the digital input circuit 10 is malfunctioning.
[0086] This application also discloses an electronic device including the aforementioned switch input circuit system. The electronic device employing this switch input circuit system can flexibly switch between two modes of electrical signals: high-level input active and low-level input active, without relying on external wiring changes. This significantly simplifies mode switching operations and reduces labor costs and the risk of wiring errors. Simultaneously, through a narrow pulse detection mechanism, it can accurately determine whether the circuit is operating normally, effectively improving the device's reliability and anti-interference capability in functional safety scenarios, making it more suitable for application scenarios with high requirements for circuit flexibility and safety.
[0087] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 this application, and should all be included within the protection scope of this application.
Claims
1. A switch input circuit, characterized in that, It includes a digital input module, a first switching module and a second switching module, wherein the digital input module is electrically connected to the first switching module and the second switching module respectively; When the digital input module is in a high-level input active state, the digital input module is electrically connected to an external reference ground through the first switching module; When the digital input module is in a low-level input active state, the digital input module is electrically connected to the power supply through the second switching module.
2. The switch input circuit according to claim 1, characterized in that, The first switching module includes a first switching unit, a first opto-isolation unit, and a second switching unit. The first opto-isolation unit is electrically connected to the first switching unit, the second switching unit, and the switch input module, respectively. The second switching unit is electrically connected to the switch input module and the external reference ground, respectively. The second switching module includes a second opto-isolation unit and a third switching unit. The third switching unit is electrically connected to the second opto-isolation unit, the switch input module, the first switching module, and the power supply.
3. The switching input circuit according to claim 2, characterized in that, The first switching unit includes a first transistor, a first resistor, and a second resistor. The base of the first transistor is electrically connected to the first end of the first resistor and the first end of the second resistor, respectively. The collector of the first transistor is electrically connected to the first opto-isolation unit. The emitter of the first transistor and the second end of the second resistor are both electrically connected to the external reference ground. The second end of the first resistor is used to receive a first signal. The first opto-isolation unit includes a first optocoupler and a third resistor. The first end of the third resistor is used to be electrically connected to a first power supply. The first end of the first optocoupler is electrically connected to the second end of the third resistor. The second end of the first optocoupler is electrically connected to the first switching unit. The third end of the first optocoupler is electrically connected to the second switching unit. The fourth end of the first optocoupler is electrically connected to the switch input module. The second switching unit includes a second transistor, a fourth resistor, and a fifth resistor. The base of the second transistor is electrically connected to the first end of the fourth resistor. The emitter of the second transistor and the first end of the fifth resistor are both used to be electrically connected to the external reference ground. The collector of the second transistor is electrically connected to the switch input module. The second end of the fourth resistor is electrically connected to the second end of the fifth resistor and the first opto-isolation unit, respectively.
4. The switch input circuit according to claim 2, characterized in that, The second opto-isolation unit includes a second optocoupler, a sixth resistor, a seventh resistor, an eighth resistor, and a first capacitor. The first end of the second optocoupler, the first end of the seventh resistor, and the first end of the first capacitor are all used to be electrically connected to a second power supply. The second end of the second optocoupler is electrically connected to the second end of the seventh resistor, the first end of the first capacitor, and the first end of the sixth resistor, respectively. The third end of the second optocoupler is electrically connected to the second end of the eighth resistor. The fourth end of the second optocoupler is electrically connected to the third switching unit. The second end of the sixth resistor is used to receive a second signal, and the first end of the eighth resistor is used to be electrically connected to the external reference ground. The third switching unit includes a third transistor, a ninth resistor, and a second capacitor. The emitter of the third transistor, the first terminal of the second capacitor, and the first terminal of the ninth resistor are all used to be electrically connected to the power supply. The base of the third transistor is electrically connected to the second terminal of the second capacitor, the second terminal of the ninth resistor, and the second opto-isolation unit, respectively. The collector of the third transistor is electrically connected to the switch input module and the first switching module, respectively.
5. The switching input circuit according to claim 1, characterized in that, The digital input module includes a third optocoupler, a tenth resistor, an eleventh resistor, a twelfth resistor, a thirteenth resistor, a third capacitor, and a fourth capacitor. The first terminal of the third optocoupler is electrically connected to the first terminal of the third capacitor and the first terminal of the twelfth resistor. The second terminal of the third optocoupler is electrically connected to the second terminal of the third capacitor, the second terminal of the twelfth resistor, and the second terminal of the tenth resistor. The third terminal of the third optocoupler is grounded. The fourth terminal of the third optocoupler is electrically connected to the second terminal of the eleventh resistor and the first terminal of the thirteenth resistor. The first terminal of the tenth resistor is electrically connected to the first switching module and the second switching module. The first terminal of the eleventh resistor is used to connect to a third power supply. The first terminal of the fourth capacitor is electrically connected to the second terminal of the thirteenth resistor. The second terminal of the fourth capacitor is grounded.
6. The switch input circuit according to claim 5, characterized in that, The third optocoupler includes a first light-emitting element, a second light-emitting element, and a photosensitive element. The negative electrode of the first light-emitting element and the positive electrode of the second light-emitting element serve as the first end of the third optocoupler. The positive electrode of the first light-emitting element and the negative electrode of the second light-emitting element serve as the second end of the third optocoupler. The input end of the photosensitive element serves as the fourth end of the third optocoupler. The output end of the photosensitive element serves as the third end of the third optocoupler.
7. A switch input circuit system, characterized in that, The system includes the digital input circuit as described in any one of claims 1-6, and further includes a control circuit, wherein the control circuit is electrically connected to a first switching module and a second switching module, and the control circuit is used to send a first signal to the first switching module and a second signal to the second switching module; such that when the digital input module is in a high-level input active state, the digital input module is electrically connected to an external reference ground through the first switching module, and when the digital input module is in a low-level input active state, the digital input module is electrically connected to a power supply through the second switching module.
8. The switch input circuit system according to claim 7, characterized in that, The control circuit includes a pulse sending module and a pulse detection module. The pulse sending module sends a pulse signal to the first switching module when a high-level input is valid, and sends a pulse signal to the second switching module when a low-level input is valid. The pulse detection module detects the pulse signal of the first switching module when a high-level input is valid, and detects the pulse signal of the second switching module when a low-level input is valid.
9. The switch input circuit system according to claim 7, characterized in that, The control circuit is also connected to a digital input module, which is used to output a low level to the control circuit when a high-level input is valid and when a low-level input is valid.
10. An electronic device, characterized in that, Includes the digital input circuit system as described in any one of claims 7-9.