Switching value detection circuit and design method
By designing a switch quantity detection circuit that includes an internal power supply, a line switching unit, and a sampling resistor, the problem of incompatibility between passive and active switch quantity signals in the prior art is solved, achieving a simple, low-cost, and accurate detection effect.
Patent Information
- Application Number
- CN202511452811.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2025-12-12
AI Technical Summary
Existing switch signal detection circuits are incompatible with both passive and active switch signals, and are sensitive to the polarity of active switch signals, resulting in complex circuit structures and high hardware costs.
Design a switching quantity detection circuit, which includes an internal power supply, a line switching unit, a sampling resistor, and a signal detection unit. By cooperating with the sampling resistor in the line switching unit, three current loops are constructed to generate corresponding sampling voltage values, thereby realizing the distinction between passive and active signals, and eliminating the need for transistors or MOSFETs for circuit on/off control.
It achieves simple and low-cost switch quantity detection, is compatible with both passive and active switch quantity signal detection, and does not require consideration of the polarity of the active switch quantity signal, with accurate and reliable output results.
Smart Images

Figure CN121114558A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of electrical signal measurement, further relates to passive and active switching quantity signal detection technology, and specifically provides a switching quantity detection circuit and a design method. BACKGROUND
[0002] Switching quantity signals are common discrete state signals in the field of industrial control and automation technology, and are usually used to monitor the running state of equipment. According to the input type, they can be divided into passive switching quantity signals (dry contact points) and active switching quantity signals (wet contact points). The passive switching quantity signal is represented by two passive contact points, which do not have a power supply by itself and are usually not polarized. The “on” and “off” states are represented by whether the two passive contact points are directly connected (closed for “on” and disconnected for “off”). When detecting the passive switching quantity signal, a detection current or bias voltage needs to be provided to determine the state. The active switching quantity signal has a power supply and a clear polarity. The “on” and “off” states are usually represented by a certain voltage / current threshold. When the input end detects a voltage (or current) with the specified polarity and level, it is determined as “on”, and vice versa. Such signals are commonly seen in DC 24V industrial control levels, NPN / PNP collector open circuit outputs, and voltage type outputs of relay drivers / sensors.
[0003] There are many industrial control field devices with different models, and the types of switching quantity signals used by various devices are different. It cannot be guaranteed that all devices to be measured have a clear switching quantity signal type / active switching quantity signal polarity identification. Therefore, a detection circuit is needed that can detect passive switching quantity signals and active switching quantity signals, and is not sensitive to the polarity of active switching quantity signals.
[0004] Existing circuits that can achieve the above functions, such as the active and passive input compatible switching quantity acquisition circuit disclosed in Chinese invention patent CN118884205A, use two parallel conversion modules, involving multiple transistors, power devices, Schottky diodes, and internal power supplies. The circuit structure is complex and the hardware cost is high. SUMMARY
[0005] The present application provides a simple and low-cost switching quantity detection circuit through an embodiment, which can detect active switching quantity signals and passive switching quantity signals without limiting the positive and negative polarity of active switching quantity signals. The switching quantity detection circuit has two signal input ends and two signal output ends, and further includes: an internal power supply; The circuit switching unit is connected between the positive pole of the internal power supply and the ground terminal, and is used to switch on the first loop when the two signal input terminals are disconnected, switch on the second loop when the two signal input terminals are short-circuited, and switch on the third loop when the two signal input terminals are connected with the external power supply, wherein the voltage of the external power supply is greater than the voltage of the internal power supply, and the current of the first loop is less than the currents of the second loop and the third loop; The sampling resistor is used to output a corresponding sampling voltage based on the current flowing through the sampling resistor, wherein the first loop, the second loop and the third loop are switched on, and the current flows through the sampling resistor; The signal detection unit is used to switch the level of the signal output terminal based on whether the sampling voltage exceeds a preset threshold voltage.
[0006] The application further provides a design method for designing the foregoing switch quantity detection circuit, and the design method comprises the following steps: The voltage of the external power supply is determined, and the external power supply is used to supply power for the active switch to be detected; The model specifications of the internal power supply, the circuit switching unit, the sampling resistor and the signal detection unit are determined, wherein the specifications of the internal power supply, the external power supply, the circuit switching unit, the sampling resistor and the signal detection unit satisfy the following relationship: , , wherein, the sampling voltage across the sampling resistor is V, the threshold voltage of the signal detection unit is Vth, the voltage of the internal power supply is Vint, and the voltage of the external power supply is Vext.
[0007] The switch quantity detection circuit provided by the application can effectively distinguish the three current loops of disconnection, connection of passive signal and connection of active signal, and generate a corresponding sampling voltage value without using a transistor or a MOS tube for circuit on-off control, by the cooperation of the switching resistor in the circuit switching unit and the sampling resistor and the line switching characteristics of the switching module. Compared with the existing circuit for detecting passive and active switch quantities, the switch quantity detection circuit provided by the application has a simple structure, is easy to implement, and has accurate and reliable output results. BRIEF DESCRIPTION OF DRAWINGS
[0008] Figure 1 FIG. 1 is a schematic diagram of an existing passive switch quantity detection circuit; Figure 2 FIG. 2 is a schematic diagram of an existing active switch quantity detection circuit; Figure 3A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 4 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 3 A current schematic diagram of the switch quantity detection circuit shown in FIG. 1 when the first loop is turned on; Figure 5 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 3 A current schematic diagram of the switch quantity detection circuit shown in FIG. 1 when the second loop is turned on; Figure 6 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 3 A current schematic diagram of the switch quantity detection circuit shown in FIG. 1 when the third loop is turned on; Figure 7 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 3 Another current schematic diagram of the switch quantity detection circuit shown in FIG. 1 when the third loop is turned on; Figure 8 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 9 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 8 A current schematic diagram of the switch quantity detection circuit shown in FIG. 1 when the first loop is turned on; Figure 10 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 8 A current schematic diagram of the switch quantity detection circuit shown in FIG. 1 when the second loop is turned on; Figure 11 A schematic diagram of a switch quantity detection circuit according to some embodiments of the application; Figure 12 A flow chart of a design method of a switch quantity detection circuit according to some embodiments of the application.
[0009] Reference numerals in the drawings 1: circuit switching unit, 11: switching module, 2: signal detection unit, 3: external power supply. DETAILED DESCRIPTION
[0010] The application will be further described below based on preferred embodiments and with reference to the drawings.
[0011] In addition, various components on the drawings are enlarged or reduced for the convenience of understanding, but such practice is not intended to limit the protection scope of the application.
[0012] In the description in the embodiments of the present application, it should be noted that if the terms "upper", "lower", "inner", "outer" and the like indicate the orientation or position relationship shown in the drawings, or the orientation or position relationship in which the products of the embodiments of the present application are usually placed, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, in the description of the present application, in order to distinguish different units, the first, second and the like are used in the specification, but these are not limited by the order of manufacture, and cannot be understood as indicating or implying relative importance, and the names in the detailed description and claims of the present application may be different.
[0013] The terms in the specification are used to illustrate the embodiments of the present application, but are not intended to limit the present application. It should be noted that unless otherwise specified and limited, if the terms "provided", "connected", "connected" appear, they should be understood in a broad sense, for example, they can be fixedly connected, or can be detachably connected, or integrally connected; can be mechanically connected, can be directly connected, or indirectly connected through an intermediate medium, can be connected inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood specifically.
[0014] Figure 1 An existing circuit for detecting passive switch quantity signal is shown, two signal input terminals SIGNAL_IN of the circuit are used to connect two terminals of the passive switch, and an optocoupler OCl is used to detect whether the passive switch is closed, i.e. whether the two signal input terminals SIGNAL_IN are closed. Since the passive switch is not connected to a power supply, the terminal B1 of the optocoupler needs to be powered by a VCC_5V power supply. Thus, when the signal input terminal has a signal input (the passive switch is closed), the two signal input terminals SIGNAL_IN are directly connected, there is a current passing between the terminal B1 and the terminal B2 and the light-emitting diode is lit, triggering the terminal B4 and the terminal B3 to be turned on. Since the resistance of R13 is much greater than that of R12, after voltage division, the signal output terminal SIGNAL_OUT connected to the terminal B3 will output a high-level signal. When the signal input terminal has no signal input (the passive switch is open), the two signal input terminals SIGNAL_IN are disconnected, and there is no current passing between the terminal B1 and the terminal B2, the light-emitting diode is extinguished, so that the terminal B4 and the terminal B3 are disconnected, and the signal output terminal SIGNAL_OUT connected to the terminal B3 outputs a low-level signal.
[0015] In addition, preferably, a capacitor CA1 is also connected between the two signal output terminals SIGNAL_OUT, which is used to eliminate jitter and suppress signal interference during level switching.
[0016] Figure 2 An existing circuit for detecting active switch quantity signal is shown. Since the active switch has its own power supply (generally, the positive and negative electrode voltage difference of the active switch quantity power supply is DC 24V), the signal input end SIGNAL_IN+ needs to be connected to the positive electrode of the active switch, and the signal input end SIGNAL_IN- needs to be connected to the negative electrode of the active switch. When the signal input end has a signal input (i.e., SIGNAL_IN+ and SIGNAL_IN- are respectively connected to the positive and negative electrodes of the DC 24V power supply), there is a current passing between the terminal B1 and the terminal B2 of the optocoupler OC3 and the light-emitting diode is lighted, triggering the conduction of the terminal B4 and the terminal B3. Similarly, since the resistance R13 has a resistance much greater than R12, after voltage division, the signal output end SIGNAL_OUT connected to the terminal B3 will output a high-level signal. When the signal input end has no signal input (i.e., there is no voltage difference between SIGNAL_IN+ and SIGNAL_IN-), there is no current passing between the terminal B1 and the terminal B2, and the terminal B4 and the terminal B3 are disconnected, so the signal output end SIGNAL_OUT connected to the terminal B3 outputs a low-level signal. Obviously, Figure 2 The active switch quantity detection circuit shown needs to pay attention to the polarity of SIGNAL_IN+ and SIGNAL_IN- when in use, to avoid the optocoupler OC3 being burned out due to reverse connection.
[0017] As analyzed in the background, since the types of switch quantity signals used by various devices in industrial control sites are different, and it cannot be guaranteed that the devices to be measured all have clear switch quantity signal type / active switch quantity signal polarity identification, it is necessary to have a detection circuit that can detect passive switch quantity signals and active switch quantity signals, and is not sensitive to the polarity of active switch quantity signals.
[0018] Therefore, the present application provides a switch quantity detection circuit compatible with passive / active switch quantity signals, which can meet the detection requirements of active and passive switch quantity signals, and has no special requirements for the polarity of the active switch connected when detecting the active switch quantity.
[0019] Figure 3 A principle schematic diagram of the switch quantity detection circuit provided according to some embodiments of the present application is shown. As shown in Figure 3 The switch quantity detection circuit has two signal input ends SIGNAL_IN and two signal output ends SIGNAL_OUT. The signal input end SIGNAL_IN is used to connect a passive switch or an active switch. One of the two signal output ends SIGNAL_OUT is grounded, and the other one switches high and low level signals according to whether a closed passive switch or an active switch is connected.
[0020] Furthermore, the switch quantity detection circuit also includes an internal power supply, a line switching unit 1, a sampling resistor R5, and a signal detection unit 2.
[0021] The internal power supply has a positive terminal VCC1 and a ground terminal. The line switching unit 1 is connected between the positive terminal VCC1 of the internal power supply and the ground terminal. Its function is to switch different current loops according to the switching state of the two signal input terminals SIGNAL_IN. Specifically, the first loop is turned on when the two signal input terminals SIGNAL_IN are open, the second loop is turned on when the two signal input terminals SIGNAL_IN are short-circuited, and the third loop is turned on when the two signal input terminals SIGNAL_IN are connected to the external power supply. The voltage of the external power supply is greater than the voltage of the internal power supply (i.e., the voltage between the positive terminal VCC1 of the internal power supply and the ground terminal), and the current of the first loop is less than the current of the second and third loops.
[0022] When the first, second, and third circuits are turned on, current flows through the sampling resistor R5. Different current magnitudes will generate different voltage drops across the sampling resistor R5. In the embodiments of this application, the voltage drops generated across the sampling resistor R5 when the first, second, and third circuits are turned on are called sampling voltages.
[0023] Signal detection unit 2 is connected to sampling resistor R5. Based on whether the sampling voltage exceeds a preset threshold voltage, it switches the level of the signal output terminal. In some optional embodiments, signal detection unit 2 can be selected as... Figure 1 or Figure 2 In existing technologies, optocouplers have two input terminals connected to the two ends of sampling resistor R5, and two output terminals connected to the two signal output terminals SIGNAL_OUT of the switch quantity measurement circuit. One signal output terminal SIGNAL_OUT is grounded, and the other signal output terminal SIGNAL_OUT outputs a corresponding high or low level according to the sampling voltage across sampling resistor R5, thereby realizing the detection of the switch quantity. In other optional embodiments, the signal detection unit 2 can also be selected from other electronic modules or components that can switch between high and low levels according to the sampling voltage across sampling resistor R5, such as digital isolators, power switching transistors, comparators, relays, and transistors. Those skilled in the art can adaptively design a suitable circuit according to the input-output characteristics of the selected electronic module or component.
[0024] Back Figure 3The line switching unit 1 includes a switching module 11 and a switching resistor R3. The switching module 11 has four terminals: a first terminal A1, a second terminal A2, a third terminal A3, and a fourth terminal A4. The first terminal A1 is connected to the lower signal input terminal SIGNAL_IN, and the second terminal A2 is connected to the upper signal input terminal SIGNAL_IN. The signal input terminal SIGNAL_IN connected to the first terminal A1 is also connected to the ground terminal of the internal power supply. The switching resistor R3 is connected in series between the signal input terminal SIGNAL_IN and the first terminal A1. The third terminal A3 is connected to the positive terminal VCC1 of the internal power supply, and the sampling resistor R5 is connected in series between the third terminal A3 and the fourth terminal A4.
[0025] Figure 4 , Figure 5 They are shown respectively Figure 3 The circuit states of the switch quantity detection circuit shown are displayed when the first and second loops are turned on. Figure 6 , Figure 7 They are shown respectively Figure 3 The following describes the two circuit states when the third loop of the switch quantity detection circuit shown is turned on, in conjunction with... Figures 3 to 7 The working principle of this switch quantity detection circuit is explained.
[0026] 1) such as Figure 4 As shown, when the switch quantity detection circuit is not connected to any passive / active switch, or is connected to a passive / active switch but the switch is not closed, the two signal input terminals SIGNAL_IN of the switch quantity detection circuit are in an open circuit state, corresponding to no passive or active switch quantity signal input. At this time, it is powered by the internal power supply, and the current loop from the positive terminal VCC1 of the internal power supply, through the sampling resistor R5, the fourth terminal A4, the switching resistor R3 to the ground terminal of the internal power supply is conducted. In this application, as shown... Figure 4 The current loop shown by the red line in the middle, which connects the positive terminal of the internal power supply, sampling resistor R5, fourth terminal A4, switching resistor R3, and the ground terminal of the internal power supply, is called the first loop.
[0027] 2) such as Figure 5 As shown, when the switch detection circuit is connected to a passive switch and the passive switch is closed, the two signal input terminals SIGNAL_IN are directly turned on, corresponding to the passive switch signal input. At this time, the circuit is powered by the internal power supply. The current loop from the positive terminal VCC1 of the internal power supply, through the sampling resistor R5, the fourth terminal A4, to the ground terminal of the internal power supply is turned on. In this application, as shown... Figure 5 The current loop shown by the red line in the middle, which connects the positive terminal of the internal power supply, the sampling resistor R5, the fourth terminal A4, and the ground terminal of the internal power supply, is called the second loop.
[0028] 3) such as Figure 6 As shown, when the two signal input terminals SIGNAL_IN of the switch quantity detection circuit are connected to a closed active switch powered by external power supply 3 (i.e., the two signal input terminals are connected to external power supply 3), and the positive terminal of external power supply 3 is connected to the upper signal input terminal SIGNAL_IN and the negative terminal is connected to the lower signal input terminal SIGNAL_IN, the current loop from the positive terminal of external power supply 3 through the second terminal A2, the third terminal A3, the sampling resistor R5, the fourth terminal A4, the switching resistor R3 to the negative terminal of external power supply 3 is turned on. like Figure 7 As shown, when the two signal input terminals SIGNAL_IN of the switch quantity detection circuit are connected to a closed active switch powered by external power supply 3, and the positive terminal of external power supply 3 is connected to the lower signal input terminal SIGNAL_IN and the negative terminal is connected to the upper signal input terminal SIGNAL_IN, the current loop from the positive terminal of external power supply 3 through the switching resistor R3, the first terminal A1, the third terminal A3, the sampling resistor R5, the fourth terminal A4 to the negative terminal of external power supply 3 is turned on. pass Figure 6 and Figure 7 It can be observed that when the two signal input terminals SIGNAL_IN are connected to a closed active switch, regardless of how the two signal input terminals SIGNAL_IN are connected to the positive and negative terminals of the external power supply, the current will flow from the positive terminal of the external power supply 3 to the third terminal A3, and then flow back to the negative terminal of the external power supply 3 through the fourth terminal A4. Furthermore, the potential of the third terminal A3 is always higher than the potential of the fourth terminal A4. In this application, Figure 6 , Figure 7 The current loop shown, which connects the positive terminal of the external power supply, the third terminal A3, the sampling resistor R5, the fourth terminal A4, the switching resistor R3, and the negative terminal of the external power supply, is called the third loop.
[0029] Obviously, when the first, second, and third circuits are turned on, current will flow through the sampling resistor R3 and generate a sampling voltage across it. Generally, the voltage of the external power supply 3 supplying power to the active switch (as shown in the figure) is... (Indicated) is a fixed value such as 24V, used to control the threshold voltage (in terms of) the switching of the output signal level. The representation (of which) depends on the conduction characteristics of the selected signal detection unit. Based on what has been determined, by selecting those with specific... The signal detection unit 2 is constructed using modules such as optical couplers, and the voltage of the internal power supply is adaptively set (to...). By selecting resistors with appropriate resistance values as switching resistor R3 and sampling resistor R5, it can be ensured that when the two signal input terminals SIGNAL_IN are not connected to a passive switch / active switch, or when the connected passive switch / active switch is not closed, a level signal of one potential (such as a low level signal) is output, and when the two signal input terminals SIGNAL_IN are connected to a closed passive switch, or to an active switch of any polarity, a level signal of another potential (such as a high level signal) is output.
[0030] Specifically, since the second circuit is not divided by the switching resistor R3 when it is turned on, the sampling voltage when the second circuit is turned on (using...) The voltage (indicated by the circuit) must be greater than the sampling voltage when the first circuit is on. Simultaneously, since current flows through both the switching resistor R3 and the sampling resistor R5 when the third circuit and the first circuit are on, to ensure that one level signal is output when the first circuit is on, and another level signal is output when the third circuit and the second circuit are on, the voltage of the internal power supply... The voltage of external power supply 3 The threshold voltage of signal sampling unit 2 and the sampling voltage across sampling resistor R5 The following relationship should be satisfied: (1), (2).
[0031] Using equations (1) and (2), components can be selected for active switches of any specification, and a switching quantity detection circuit can be constructed that can detect passive switches and active switches of the same specification without considering the polarity of the active switch.
[0032] The switch quantity detection circuit provided in this application, through the cooperation of the switching resistor and the sampling resistor in the line switching unit and combined with the line switching characteristics of the switching module, can conduct different current loops and generate corresponding sampling voltage values across the sampling resistor when the signal input terminal is in three different states: open circuit, passive signal on, and active signal on. Compared with existing circuits compatible with passive and active switch quantity detection, the switch quantity detection circuit provided in this application has a simple structure, does not require the use of switching devices such as transistors and MOSFETs for circuit on / off control, is easy to implement, and provides accurate and reliable output results.
[0033] Figure 8 This illustrates yet another embodiment of the switch quantity detection circuit proposed in this application, which is similar to... Figure 3The difference in the illustrated embodiment is that the signal input terminal SIGNAL_IN, which is connected to the first terminal A2, is also connected to the ground terminal of the internal power supply, and the switching resistor R3 is connected in series between the signal input terminal SIGNAL_IN and the second terminal A1. Figure 9 , Figure 10 The states of the switching quantity detection circuit in this embodiment are shown when the first and second circuits are turned on.
[0034] Compare Figures 3 to 7 and Figures 8 to 10 As can be seen from the two embodiments shown, among the four terminals of the switching module, the first terminal A1 and the second terminal A2 do not need to be connected in a specific order to the two signal output terminals SIGNAL_IN. It is only necessary to ensure that one of the signal output terminals SIGNAL_IN is grounded, and to connect the switching resistor R3 in series between the grounded signal output terminal SIGNAL_IN and its corresponding first terminal A1 or second terminal A2. Accordingly, this also shows that in the embodiments of this application, the first terminal A1 is not limited to being connected to the first circuit, and the second terminal A2 is not limited to being connected to the second circuit. The key to distinguishing between the first circuit and the second circuit is whether the switching resistor R3 is connected in series in these two current circuits powered by the internal power supply.
[0035] Furthermore, it can be seen that when an external power source 3 is connected, regardless of the polarity of the first terminal A1 and the second terminal A2, the potential at the third terminal A3 is higher than the potential at the fourth terminal A4.
[0036] Figure 11 A circuit diagram of a specific embodiment of the switch quantity detection circuit is shown, such as... Figure 11 As shown, the switching module 11 adopts a full-wave rectifier bridge structure composed of four diodes D2, D3, D4, and D5. The full-wave rectifier bridge includes two AC terminals and two DC terminals (DC positive terminal and DC negative terminal). One of the two AC terminals of the full-wave rectifier bridge is used as the first terminal A1 and connected to the lower signal input terminal SIGNAL_IN. The other is used as the second terminal A2 and connected to the upper signal input terminal SIGNAL_IN. The DC positive terminal is used as the third terminal A3, and the DC negative terminal is used as the fourth terminal A4. At the same time, the lower signal input terminal SIGNAL_IN is connected to the ground terminal of the internal power supply, and the switching resistor R3 is connected in series between the first terminal A1 and the lower signal input terminal SIGNAL_IN.
[0037] It should be known that, Figure 11 The embodiment shown is only one optional implementation of the switching module 11. Those skilled in the art can use other components with direction selection characteristics to construct the switching module 11 without departing from the working principle of the switching module 11.
[0038] like Figure 11 As shown, in this switch quantity detection circuit, signal detection unit 2 is selected from... Figure 1 The optocoupler OC1, identical to the one described above, has four terminals B1, B2, B3, and B4. Terminals B1 and B2 are connected to the two ends of sampling resistor R5, respectively. Terminal B4 is powered by VCC (3.3V) through resistor R2. Terminal B3 is connected to one signal output terminal, SIGNAL_OUT, for outputting high and low level signals. The other signal output terminal, SIGOUT_OUT, is grounded. Resistor R6 and capacitor CA1 are connected between the two signal output terminals, SIGOUT_OUT. When terminals B4 and B3 of optocoupler OC1 are connected, a high-level signal is output; when terminals B4 and B3 are disconnected, a low-level signal is output. Its specific working principle has been explained above and will not be repeated here.
[0039] It should be understood that, although Figure 11 The signal detection unit 2 shown adopts the method of outputting a high level when there is a switch signal and outputting a low level when there is no switch signal. However, those skilled in the art can also ground one signal output terminal SIGOUT_OUT and connect the other signal output terminal SIGOUT_OUT to terminal B4, and connect it to VCC3V3 through a pull-up resistor, thereby constructing a signal detection unit that can output a low level when there is a switch signal and output a high level when there is no switch signal.
[0040] In some preferred embodiments, a first diode D1 is connected in series between the positive terminal of the internal power supply and the sampling resistor R5, with the cathode of the first diode D1 facing the sampling resistor, to prevent backflow of current when the external power supply 3 is connected.
[0041] In some preferred embodiments, a first current-limiting resistor R1 is connected in series between the positive terminal of the internal power supply and the sampling resistor; in other preferred embodiments, a second current-limiting resistor R4 is connected in series between the switching resistor R3 and the ground terminal of the internal power supply to provide protection for the switching module 11.
[0042] exist Figure 11In the illustrated embodiment, the positive terminal of the internal power supply is VCC_5V, the sampling resistor R5 has a resistance of 3.3K ohms, and the switching resistor R3 has a resistance of 12K ohms, i.e., R5 / R3=0.275. The threshold voltage of the optocoupler OC1 is 1.2 to 1.4V. This configuration is suitable for detecting passive switching quantities and active switching quantities of DC24V. It ensures that when both signal input terminals SIGNAL_IN are open, the sampling voltage is less than the threshold voltage, resulting in a low-level signal output. When both signal input terminals SIGNAL_IN are directly connected or connected to the DC24V power supply, the sampling voltage is higher than the threshold voltage, resulting in a high-level signal output. Obviously, those skilled in the art can adapt this configuration accordingly. Figure 11 The parameter values of one or more components are selected to meet specific measurement requirements.
[0043] Furthermore, in some preferred embodiments, the ratio of R5 / R3 can be further reduced (or the ratio of R3 / R5 can be increased) by increasing the resistance of the switching resistor R3 or decreasing the resistance of the sampling resistor R5, so that when the first circuit is turned on, the sampling voltage across the sampling resistor R5 drops to 0.7V or lower, thereby ensuring that the switching quantity detection circuit can accurately output the corresponding level signal when the closed passive or active switch is not connected.
[0044] like Figure 11 As shown, in some preferred embodiments, the switching quantity detection circuit further includes a Zener diode DZ1. The Zener diode DZ1 is connected in series between the switching module 1 and the sampling resistor R5, with its cathode connected to the third terminal A3 and its anode connected to the sampling resistor R5. With the Zener diode DZ1 configured, it will only break down and conduct the third circuit when both signal input terminals SIGNAL_IN are connected to an external power supply 3 that meets the voltage requirements (e.g., DC24V). This prevents interference to the signal input terminal SIGNAL_IN from misleadingly conducting the third circuit.
[0045] Accordingly, it is easy to know that when adopting Figure 11 When selecting components as shown, the component specifications should ensure... After subtracting the voltage drop after the breakdown of Zener diode DZ1, the voltage drops of the two diodes, and the voltage division of the switching resistor R3, the sampling voltage across the sampling resistor R5 exceeds the threshold voltage.
[0046] Figure 12 A flowchart illustrating a design method for designing the switch quantity detection circuit according to some embodiments of this application is shown, such as... Figure 12 As shown, this design method includes the following steps: Step 100: Determine the voltage of the external power supply; Step 200: Determine the model and specifications of the internal power supply, line switching unit, sampling resistor, and signal detection unit.
[0047] Specifically, the external power supply is used to power the active switch to be tested, and the model specifications of the internal power supply, external power supply, line switching unit, sampling resistor and signal detection unit satisfy the relationship between equations (1) and (2) above.
[0048] In addition, in some preferred embodiments, diodes, Zener diodes, current-limiting resistors, capacitors and other components can be added to the switch quantity detection circuit and their connection methods and model specifications can be determined to ensure that the switch quantity detection circuit still satisfies equations (1) and (2) after these components are added.
[0049] The specific embodiments of this application have been described in detail above. For those skilled in the art, several improvements and modifications can be made to this application without departing from the principle of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A switch quantity detection circuit, having two signal input terminals and two signal output terminals, characterized in that, Also includes: Internal power supply; The line switching unit is connected between the positive terminal and the ground terminal of the internal power supply. When the two signal input terminals are open, the first circuit is activated; when the two signal input terminals are short-circuited, the second circuit is activated; and when the two signal input terminals are connected to the external power supply, the third circuit is activated. The voltage of the external power supply is greater than the voltage of the internal power supply, and the current of the first circuit is less than the current of the second and third circuits. The sampling resistor outputs a corresponding sampling voltage based on the current flowing through it. When the first circuit, the second circuit, and the third circuit are all turned on, current flows through the sampling resistor. The signal detection unit switches the level of the signal output terminal based on whether the sampled voltage exceeds a preset threshold voltage.
2. The switching quantity detection circuit according to claim 1, characterized in that, The first and second circuits are both powered by the internal power supply when they are in the conducting state, while the third circuit is powered by the external power supply when it is in the conducting state. When the first circuit is turned on, the sampling voltage is greater than zero and less than the threshold voltage; When the second circuit or the third circuit is turned on, the sampling voltage is greater than the threshold voltage.
3. The switching quantity detection circuit according to claim 1, characterized in that, The line switching unit includes a switching module and a switching resistor; The switching module has a first terminal, a second terminal, a third terminal, and a fourth terminal. in, The first terminal and the second terminal are each connected to a signal input terminal; One of the two signal input terminals is connected to the ground terminal of the internal power supply, and the switching resistor is connected in series between the signal input terminal and the first or second terminal connected thereto. The sampling resistor is connected in series between the third terminal and the fourth terminal, and the third terminal is connected to the positive terminal of the internal power supply.
4. The switching quantity detection circuit according to claim 3, characterized in that, The first circuit is a current loop connecting the positive terminal of the internal power supply, the sampling resistor, the fourth terminal of the switching module, the switching resistor, and the ground terminal of the internal power supply. The second circuit is a current loop connecting the positive terminal of the internal power supply, the sampling resistor, the fourth terminal of the switching module, and the ground terminal of the internal power supply.
5. The switching quantity detection circuit according to claim 3, characterized in that, When the two signal input terminals are connected to an external power supply, the positive terminal of the external power supply is connected to the first terminal and the negative terminal is connected to the second terminal, or the positive terminal of the external power supply is connected to the second terminal and the negative terminal is connected to the first terminal. The third circuit is a current loop connecting the positive terminal of the external power supply, the third terminal, the sampling resistor, the fourth terminal, the switching resistor, and the negative terminal of the external power supply.
6. The switching quantity detection circuit according to claim 3, characterized in that, It also includes a Zener diode, which is connected in series between the switching module and the sampling resistor, and the cathode of the Zener diode is connected to the third terminal.
7. The switching quantity detection circuit according to claim 3, characterized in that, The resistance value of the switching resistor is greater than the resistance value of the sampling resistor.
8. The switching quantity detection circuit according to claim 3, characterized in that, The switching module is a full-wave rectifier bridge. The switching module uses the two AC terminals of the full-wave rectifier bridge as the first terminal and the second terminal, the DC positive terminal of the full-wave rectifier bridge as the third terminal, and the DC negative terminal of the full-wave rectifier bridge as the fourth terminal.
9. The switching quantity detection circuit according to claim 8, characterized in that, The voltage difference between the positive terminal and the ground terminal of the internal power supply is 5V; The voltage difference between the positive and negative terminals of the external power supply is 24V; The threshold voltage is 1.2V to 1.4V; The ratio of the sampling resistor to the switching resistor is less than or equal to 0.
275.
10. The switching quantity detection circuit according to claim 1, characterized in that, The signal detection unit includes any one of the following: Optocouplers, digital isolators, power switches, comparators, relays, and transistors.
11. The switching quantity detection circuit according to claim 1, characterized in that, It also includes at least one of the following elements: A first diode, a first current-limiting resistor, and a second current-limiting resistor; The first diode is connected in series between the positive terminal of the internal power supply and the sampling resistor, and the cathode of the first diode faces the sampling resistor; The first current-limiting resistor is connected in series between the positive terminal of the internal power supply and the sampling resistor; The second current-limiting resistor is connected in series between the switching resistor and the ground terminal of the internal power supply.
12. A design method for designing the switch quantity detection circuit of claim 1, characterized in that, Includes the following steps: Determine the voltage of the external power supply, which is used to power the active switch to be tested; Determine the model specifications of the internal power supply, line switching unit, sampling resistor, and signal detection unit, wherein the specifications of the internal power supply, external power supply, line switching unit, sampling resistor, and signal detection unit satisfy the following relationship: , , in, The sampling voltage across the sampling resistor is... The threshold voltage of the signal detection unit. The internal power supply voltage is... The voltage of the external power supply.
Citation Information
Patent Citations
Active and passive input compatible switching value acquisition circuit and detection method
CN118884205A