Manual alarm input three-state detection device and method

The three-state detection device for manual alarm input by the optocoupler isolator and diode components is designed to solve the problem of difficulty in detecting three states of manual alarm in the prior art, and achieve fast, accurate and low-cost detection to avoid CPU damage And improves system stability.

CN118942223APending Publication Date: 2024-11-12四川千页科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411011897.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art is difficult to detect three input states of manual alarms at a stable and low cost, and there are problems such as CPU damage and complex circuit structure.

Method used

The manual alarm input three-state detection device designed with components such as optocouple isolators and diodes. The manual alarm is judged by switches J3 and J4 through the optocouple isolators U1 and U2, resistors R1, R4, R5, diodes D1, D2. The access and working state of the CPU avoids direct use of the A/D port of the CPU, achieving high interference resistance and low cost detection.

Benefits of technology

It realizes the three states of high/low/hanging of switches quickly and accurately, avoids CPU damage, increases the system's anti-interference, reduces costs, and improves detection speed and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118942223A_ABST
    Figure CN118942223A_ABST
Patent Text Reader

Abstract

The invention discloses a manual alarm input three-state detection device and method. The device comprises an optical coupling isolator U1, an optical coupling isolator U2, a resistor R1, a resistor R4, a resistor R5, a diode D1 and a diode D2. According to the invention, only an I / O port of a CPU is used, an A / D port is not used, high / low / suspension states of the switch can be rapidly detected, and the CPU is prevented from being damaged; through optical coupler isolation, the anti-interference performance of the system can be improved, and the detection accuracy is ensured. The method is low in cost, high in detection speed and high in stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of manual alarm state detection, and in particular to a manual alarm input three-state detection device and method. Background Art

[0002] Manual alarm input status detection is a very common phenomenon in engineering applications, especially in energy storage control systems, where manual alarms are an essential part of every control system. The working principle of a manual alarm is similar to a switch quantity, with the working state being closed and the non-working state being disconnected. However, in control systems, most controllers can only detect two input states of the manual alarm, namely disconnected and closed. In engineering applications, if the manual alarm line is disconnected or not properly connected, which coincides with the disconnection of the manual alarm, it is impossible to distinguish between line disconnection and alarm disconnection when only disconnection and closure are detected. Therefore, in order to detect the cause of the fault, it is necessary to detect the three states of disconnection, closure, and disconnection (not connected) of the manual alarm.

[0003] The invention patent with application number 201210338759B uses the clock generation module to generate a periodic trigger signal, which is sent to the square wave generation module and the judgment module respectively; the square wave generation module generates periodically flipped high and low levels, which are sent to the level conversion circuit, and the level conversion circuit performs level conversion on the electrical signal, which is sent to the drive circuit for voltage and current amplification, and the drive circuit outputs the N analog-to-digital conversion modules through N first and second current limiting resistors connected in series, and the N analog-to-digital conversion modules output digital quantities, which are sent to the judgment module for judgment. The detection circuit provided by this scheme has no effective measures for protection, and is directly introduced into the CPU IO port by the resistor, which may damage the CPU, and the circuit structure is complex, which increases the cost, and has certain limitations in engineering applications.

[0004] Application number is CN103605017B Detection principle is as follows Figure 4 shown.

[0005] When INPUT inputs a high level, diode D1 is cut off, diode D2 is turned on, transistor Q1 is saturated and turned on, and OUTPUT outputs a TTL low level;

[0006] When INPUT inputs a low level (grounded or grounded), diode D1 is turned on, diode D2 is turned off, transistor Q1 is turned off, and OUTPUT outputs a TTL high level;

[0007] However, when INPUT becomes a normal switch and has no level, INPUT being high or disconnected is a logic that cannot be distinguished.

[0008] The circuit topology of the invention patent with publication number CN103605017B is optimized, but the patent can only detect the level signal of the switch input, that is, it can only detect the high, low level and disconnection of the switch. It cannot make a judgment on the dry node (passive) signal, that is, the passive signal (no high or low level) that is only open or closed. Summary of the invention

[0009] In view of the above-mentioned deficiencies in the prior art, a manual alarm input three-state detection device and method provided by the present invention solves the problem that the prior art is difficult to detect the manual alarm input three-state stably and at low cost.

[0010] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0011] Provided is a manual alarm input three-state detection device, which includes an optocoupler isolator U1, an optocoupler isolator U2, a resistor R1, a resistor R4, a resistor R5, a diode D1 and a diode D2;

[0012] Pin 2 and pin 3 of the optocoupler isolator U2 are both grounded; pin 4 of the optocoupler isolator U2 is connected to one end of the resistor R5 and serves as the signal output terminal FB1; the other end of the resistor R5 is connected to an external power supply; pin 1 of the optocoupler isolator U2 is connected to the cathode of the diode D1, and the anode of the diode D1 is connected to the cathode of the diode D2; the anode of the diode D2 is respectively connected to one end of the resistor R1 and one end of the switch J3 representing whether the manual alarm is connected; the other end of the resistor R1 is connected to the external power supply; the other end of the switch J3 is connected to pin 1 of the optocoupler isolator U1; pin 2 of the optocoupler isolator U1 is connected to one end of the switch J4 representing the working state of the manual alarm and one end of the manual alarm equivalent resistor R2; the other end of the switch J4 is connected to the other end of the manual alarm equivalent resistor R2 and grounded;

[0013] Pin 3 of the optocoupler isolator U1 is grounded; Pin 4 of the optocoupler isolator U1 is connected to one end of the resistor R4 and serves as a signal output terminal FB0; The other end of the resistor R4 is connected to an external power supply;

[0014] When the manual alarm is connected, the switch J3 is closed; when the manual alarm is not connected, the switch J3 is disconnected; when the manual alarm is in working state, the switch J4 is closed; when the manual alarm is not in working state, the switch J4 is disconnected.

[0015] Furthermore, the models of the optocoupler isolator U1 and the optocoupler isolator U2 are both PS2501-1; the models of the diode D1 and the diode D2 are both 1N4007.

[0016] Furthermore, the resistance value of resistor R1 is 6.8kΩ, and the external power supply connected to it is a 24V DC power supply; the resistance value of resistor R4 is 47kΩ, and the external power supply connected to it is a 3.3V DC power supply; the resistance value of resistor R5 is 20kΩ, and the external power supply connected to it is a 3.3V DC power supply.

[0017] Provided is a detection method based on a manual alarm input three-state detection device, specifically:

[0018] When the signal output terminal FB0 is at a high level and the signal output terminal FB1 is at a low level, it is determined that the manual alarm is not connected;

[0019] When the signal output terminal FB0 is at a low level and the signal output terminal FB1 is at a high level, it is determined that the manual alarm is connected and closed;

[0020] When the signal output terminal FB0 is at a low level and the signal output terminal FB1 is at a low level, it is determined that the manual alarm is connected and disconnected.

[0021] The beneficial effects of the present invention are:

[0022] 1. The present invention only uses the I / O port of the CPU, without the A / D port, and can quickly detect the high / low / suspended states of the switch while avoiding damage to the CPU.

[0023] 2. The present invention can increase the anti-interference ability of the system and ensure detection accuracy through optical coupling isolation.

[0024] 3. The present invention has low cost, fast detection speed and high stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is a circuit diagram of the detection device when the manual alarm is not connected and the manual alarm is closed;

[0026] Figure 2 This is a circuit diagram of the detection device connected to a manual alarm and the manual alarm is closed;

[0027] Figure 3 This is a circuit diagram of the detection device connected to a manual alarm and the manual alarm disconnected;

[0028] Figure 4 This is the detection principle diagram of application number CN103605017B. DETAILED DESCRIPTION

[0029] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0030] like Figure 1 , Figure 2 and Figure 3 As shown, the manual alarm input three-state detection device includes an optocoupler isolator U1, an optocoupler isolator U2, a resistor R1, a resistor R4, a resistor R5, a diode D1 and a diode D2;

[0031] Pin 2 and pin 3 of the optocoupler isolator U2 are both grounded; pin 4 of the optocoupler isolator U2 is connected to one end of the resistor R5 and serves as the signal output terminal FB1; the other end of the resistor R5 is connected to an external power supply; pin 1 of the optocoupler isolator U2 is connected to the cathode of the diode D1, and the anode of the diode D1 is connected to the cathode of the diode D2; the anode of the diode D2 is respectively connected to one end of the resistor R1 and one end of the switch J3 representing whether the manual alarm is connected; the other end of the resistor R1 is connected to the external power supply; the other end of the switch J3 is connected to pin 1 of the optocoupler isolator U1; pin 2 of the optocoupler isolator U1 is connected to one end of the switch J4 representing the working state of the manual alarm and one end of the manual alarm equivalent resistor R2; the other end of the switch J4 is connected to the other end of the manual alarm equivalent resistor R2 and grounded;

[0032] Pin 3 of the optocoupler isolator U1 is grounded; Pin 4 of the optocoupler isolator U1 is connected to one end of the resistor R4 and serves as a signal output terminal FB0; The other end of the resistor R4 is connected to an external power supply;

[0033] When the manual alarm is connected, the switch J3 is closed; when the manual alarm is not connected, the switch J3 is disconnected; when the manual alarm is in working state, the switch J4 is closed; when the manual alarm is not in working state, the switch J4 is disconnected.

[0034] In this embodiment, the models of the optocoupler isolator U1 and the optocoupler isolator U2 are both PS2501-1; the models of the diode D1 and the diode D2 are both 1N4007. The resistance value of the resistor R1 is 6.8kΩ, and the external power supply connected is a 24V DC power supply; the resistance value of the resistor R4 is 47kΩ, and the external power supply connected is a 3.3V DC power supply; the resistance value of the resistor R5 is 20kΩ, and the external power supply connected is a 3.3V DC power supply. The manual alarm equivalent resistor R2 and the switch J4 are combined to represent the manual alarm.

[0035] When the switch J3 is disconnected, the driving end of the optocoupler isolator U1 is not connected to the power supply and cannot be driven, that is, pin 1 and pin 2 of the optocoupler isolator U1 are not conducting. According to the working principle of the optocoupler, pin 3 and pin 4 of the optocoupler isolator U1 are cut off, and the signal output end FB0 is pulled up to a high level of 3.3V through the pull-up resistor R4, that is, FB0 is a high level.

[0036] According to the device manual, the maximum forward voltage of the two diodes is 1.4V, and the maximum forward voltage of pins 1 and 2 of the optocoupler isolator U2 is 1.1V. Then the voltage at pin 2 of resistor R1 is:

[0037] U=24-1.4-1.1-1.4=20.1V.

[0038] The current IF of the VCC-R1-D2-D1-U2 (pins 1 and 2)-GND loop = 20.1 / 6800 = 2.96mA (minimum value).

[0039] According to the PS2501-1 device manual, assuming that the saturation conduction Vce = 0.2V, CTR takes the minimum value of 0.8. Then the circuit is:

[0040] The current IC of VDD-R5-U2 (pins 4, 3)-GND = (3.3-0.2) / 20 = 0.155mA.

[0041] According to the optocoupler saturation conduction condition IC<βIF, IC=0.155<βIF=3*0.8=2.4mA.

[0042] The optocoupler isolator U2 is saturated and turned on, that is, the voltage of the 3rd and 4th pins of the optocoupler isolator U2 is about 0.2V, and 0.2V is a low level in the high-low level system, that is, FB1 is a low level.

[0043] When the manual alarm is engaged and closed:

[0044] VCC-R1-J3-U1(pins 1, 2)-J4-GND loop current IF=(24-1.4) / 6.8=3.3mA.

[0045] Loop VDD-R4-U1 (pins 3 and 4)-GND loop current IC=(3.3-0.2) / 47=0.066mA.

[0046] According to the optocoupler saturation conduction condition IC<βIF, IC=0.066<βIF=3.3*0.8=2.4mA.

[0047] The optocoupler isolator U1 is saturated and turned on, that is, the voltage between the 3rd and 4th pins of the optocoupler isolator U1 is about 0V + the voltage between U1 (3rd and 4th pins) 0.2V, and 0.2V is a low level in the high-low level system, that is, FB0 is a low level.

[0048] When the optocoupler isolator U1 is turned on, the voltage between the optocoupler isolator U1 (pins 1 and 2) is equal to the sum of the voltages of the diode D1, the diode D2, and the optocoupler isolator U2 (pins 1 and 2). The optocoupler isolators U1 and U2 have the same parameters, that is, when the optocoupler isolator U1 is turned on, the optocoupler isolator U2 cannot be turned on. That is, the voltage between the optocoupler isolator U2 (pins 3 and 4) is approximately the VDD voltage.

[0049] FB1 voltage = U2 (pins 3 and 4) = 3.3V. In the high and low level system, 3.3V is the high level.

[0050] Expressed in terms of high and low levels, when the manual alarm is connected and closed, FB0=0 and FB1=1.

[0051] When the manual alarm is connected and disconnected:

[0052] The voltage at terminal 2 of resistor R1 is U=1.1+1.4+1.4=3.9V.

[0053] VCC-R1-J3-U1 (pins 1, 2)-R2-GND loop current IF = (3.9-1.1) / 1 = 2.8mA.

[0054] Loop VDD-R4-U1 (pins 3 and 4)-GND loop current IC=(3.3-0.2) / 47=0.066mA.

[0055] According to the optocoupler saturation conduction condition IC<βIF, IC=0.066<βIF=2.8*0.8=2.24mA.

[0056] The optocoupler isolator U1 is saturated and turned on, that is, the voltage between the 3rd and 4th pins of the optocoupler isolator U1 is about 0V + the voltage between U1 (3rd and 4th pins) 0.2V, and 0.2V is a low level in the high-low level system, that is, FB0 is a low level.

[0057] Loop VCC-R1-D2-D1-U2(1,2)-GND loop current IF=(24-1.4-1.4-1.1) / 6.8=2.96mA.

[0058] The current IC of VDD-R5-U2 (pins 4, 3)-GND = (3.3-0.2) / 20 = 0.155mA.

[0059] According to the optocoupler saturation conduction condition IC<βIF, IC=0.155<βIF=2.96*0.8=2.4mA.

[0060] The optocoupler isolator U2 is saturated and turned on, that is, the voltage of the 3rd and 4th pins of the optocoupler isolator U2 is about 0.2V, and 0.2V is a low level in the high-low level system, that is, FB1 is a low level.

[0061] Based on the circuit analysis of the above-mentioned manual alarm input three-state detection device, the manual alarm input three-state detection method is:

[0062] When the signal output terminal FB0 is at a high level and the signal output terminal FB1 is at a low level, it is determined that the manual alarm is not connected;

[0063] When the signal output terminal FB0 is at a low level and the signal output terminal FB1 is at a high level, it is determined that the manual alarm is connected and closed;

[0064] When the signal output terminal FB0 is at a low level and the signal output terminal FB1 is at a low level, it is determined that the manual alarm is connected and disconnected.

[0065] The corresponding judgment logic is shown in Table 1.

[0066] Table 1: Judgment logic

[0067] Manual alarm access status FB0 Status FB1 Status Not connected 1 0 Connect and close 0 1 Connect and disconnect 0 0

[0068] In summary, the present invention only uses the I / O port of the CPU, without the A / D port, and can quickly detect the three states of high / low / suspended of the switch, while avoiding damage to the CPU; the present invention can increase the anti-interference of the system through optical coupling isolation and ensure detection accuracy. The present invention has low cost, fast detection speed and high stability.

Claims

1. A three-state detection device for manual alarm input, characterized in that: It includes an optocoupler isolator U1, an optocoupler isolator U2, a resistor R1, a resistor R4, a resistor R5, a diode D1 and a diode D2; Pin 2 and pin 3 of the optocoupler isolator U2 are both grounded; pin 4 of the optocoupler isolator U2 is connected to one end of the resistor R5 and serves as the signal output terminal FB1; the other end of the resistor R5 is connected to an external power supply; pin 1 of the optocoupler isolator U2 is connected to the cathode of the diode D1, and the anode of the diode D1 is connected to the cathode of the diode D2; the anode of the diode D2 is respectively connected to one end of the resistor R1 and one end of the switch J3 representing whether the manual alarm is connected; the other end of the resistor R1 is connected to the external power supply; the other end of the switch J3 is connected to pin 1 of the optocoupler isolator U1; pin 2 of the optocoupler isolator U1 is connected to one end of the switch J4 representing the working state of the manual alarm and one end of the manual alarm equivalent resistor R2; the other end of the switch J4 is connected to the other end of the manual alarm equivalent resistor R2 and grounded; Pin 3 of the optocoupler isolator U1 is grounded; Pin 4 of the optocoupler isolator U1 is connected to one end of the resistor R4 and serves as a signal output terminal FB0; The other end of the resistor R4 is connected to an external power supply; When the manual alarm is connected, the switch J3 is closed; when the manual alarm is not connected, the switch J3 is disconnected; when the manual alarm is in working state, the switch J4 is closed; when the manual alarm is not in working state, the switch J4 is disconnected.

2. The manual alarm input three-state detection device according to claim 1, characterized in that: The models of the optocoupler isolator U1 and the optocoupler isolator U2 are both PS2501-1; the models of the diode D1 and the diode D2 are both 1N4007.

3. The manual alarm input three-state detection device according to claim 2, characterized in that: The resistance value of resistor R1 is 6.8kΩ, and the external power supply connected to it is a 24V DC power supply; the resistance value of resistor R4 is 47kΩ, and the external power supply connected to it is a 3.3V DC power supply; the resistance value of resistor R5 is 20kΩ, and the external power supply connected to it is a 3.3V DC power supply.

4. A detection method based on the manual alarm input three-state detection device as shown in any one of claims 1 to 3, characterized in that: When the signal output terminal FB0 is at a high level and the signal output terminal FB1 is at a low level, it is determined that the manual alarm is not connected; When the signal output terminal FB0 is at a low level and the signal output terminal FB1 is at a high level, it is determined that the manual alarm is connected and closed; When the signal output terminal FB0 is at a low level and the signal output terminal FB1 is at a low level, it is determined that the manual alarm is connected and disconnected.