Key detection circuit and energy storage power supply
By designing a button detection circuit including a detection unit and a controller, the problem of not detecting button faults in the energy storage inverter is solved, and timely detection of button faults and disconnection of power output is achieved to avoid electric shock accidents.
Patent Information
- Application Number
- CN202421732456.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2034-07-19
AI Technical Summary
Existing energy storage inverters cannot detect the faults of the shrapnel keys in time, especially the AC key and DC keys cannot be restored after being pressed at the same time, resulting in the risk of potential electric shock accidents.
A button detection circuit is designed, including a first detection unit, a second detection unit, a first switching unit and a controller. By determining whether the button is faulty by the duration of the detection signal, ensuring that the button failure is detected within the preset time period and the power output is disconnected.
Timely detection of button failures is achieved, the occurrence of electric shock accidents is avoided, and the user's safety is ensured.
Smart Images

Figure CN223078435U_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of button detection, and particularly to a button detection circuit and an energy storage power supply. Background Art
[0002] Energy storage inverters are usually equipped with multiple buttons to control their different functions. Generally, three buttons are configured, namely: a power button (Power button) for turning on or off the inverter, an AC output button (AC button) for controlling the AC output of the inverter, and a DC input button (DC button) for controlling the DC input of the inverter.
[0003] Exemplarily, a snap-action button is used as the button of the energy storage inverter, and this type of button pops up after being pressed.
[0004] However, due to certain factors, such as frequent pressing and use causing damage to the button's snap-action piece, the AC button and the DC button cannot be restored after being pressed. Especially when the AC button and the DC button are pressed simultaneously and cannot be restored, if the energy storage inverter fails to detect the button failure in time, it is easy to cause an electric shock accident to the user. Summary of the Utility Model
[0005] The button detection circuit and the energy storage power supply provided by the embodiments of this application are used to solve the defect that existing buttons fail and cannot be detected in time.
[0006] In a first aspect, an embodiment of this application provides a button detection circuit, which is applied to the failure detection of a first button SW1 and a second button SW2. The button detection circuit includes: a first detection unit, a second detection unit, a first switch unit, and a controller; the first detection unit is respectively connected to the first button SW1 and the first switch unit, the second detection unit is respectively connected to the second button SW2 and the first switch unit, and the first switch unit is further connected to the controller; the first detection unit is used to output a first control signal when the first button SW1 is pressed; the second detection unit is used to output a first control signal when the second button SW2 is pressed; the first switch unit is used to output a first detection signal when both the first detection unit and the second detection unit output the first control signal; the controller is used to determine that both the first button SW1 and the second button SW2 are in a failure state when the duration of the first detection signal is greater than or equal to a preset duration.
[0007] Optionally, the first switching unit includes a first constant voltage power supply VCC1, a first triode VT1, a second triode VT2, a first diode D1, a second diode D2, a first capacitor C1, a second capacitor C2, a first MOS transistor Q1, a second MOS transistor Q2, a third resistor R3, and a fourth resistor R4; the base of the first triode VT1 is connected to the first detection unit, the collector of the first triode VT1 is respectively connected to the first constant voltage power supply VCC1 and the anode of the first diode D1, and the emitter of the first triode VT1 is connected to ground; the cathode of the first diode D1 is respectively connected to the cathode of the second diode D2, the first end of the first capacitor C1, and the gate of the first MOS transistor Q1, and the second end of the first capacitor C1 is connected to ground; the base of the second triode VT2 is connected to the second detection unit, the collector of the second triode VT2 is respectively connected to the first constant voltage power supply VCC1 and the anode of the second diode D2, and the emitter of the second triode VT2 is connected to ground; the drain of the first MOS transistor Q1 is respectively connected to the first end of the third resistor R3 and the first end of the fourth resistor R4, the source of the first MOS transistor Q1 is connected to ground, and the second end of the third resistor R3 is connected to the first constant voltage power supply VCC1; the first end of the fourth resistor R4 is respectively connected to the first end of the second capacitor C2 and the gate of the second MOS transistor Q2, and the second end of the fourth resistor R4, the second end of the second capacitor C2, and the source of the second MOS transistor Q2 are all connected to ground; the drain of the second MOS transistor Q2 is connected to the controller.
[0008] Optionally, the first switching unit further includes a fifth resistor R5, a sixth resistor R6, a seventh resistor R7, and an eighth resistor R8; the first end of the fifth resistor R5 is connected to the first constant voltage power supply VCC1, and the second end of the fifth resistor R5 is connected to the collector of the first triode VT1; the first end of the sixth resistor R6 is connected to the first constant voltage power supply VCC1, and the second end of the sixth resistor R6 is connected to the collector of the second triode VT2; the first end of the seventh resistor R7 is connected to the drain of the first MOS transistor Q1, and the second end of the seventh resistor R7 is respectively connected to the first end of the third resistor R3 and the first end of the fourth resistor R4; the first end of the eighth resistor R8 is connected to the gate of the first MOS transistor Q1, and the second end of the eighth resistor R8 is connected to ground.
[0009] Optionally, the key detection circuit further includes a second constant voltage power supply VCC2; the first detection unit includes a third triode VT3, a ninth resistor R9, a tenth resistor R10, an eleventh resistor R11, and a third capacitor C3; the collector of the third triode VT3 is connected to the first end of the tenth resistor R10, the second end of the tenth resistor R10 is connected to the second constant voltage power supply VCC2, the base of the third triode VT3 is respectively connected to the first end of the third capacitor C3, the first end of the ninth resistor R9, and the first end of the eleventh resistor R11, the emitter of the third triode VT3, the second end of the third capacitor C3, and the second end of the ninth resistor R9 are all connected to ground; both pin 1 and pin 2 of the first key SW1 are connected to the second constant voltage power supply VCC2, and both pin 3 and pin 4 of the first key SW1 are respectively connected to the first switch unit and the second end of the eleventh resistor R11.
[0010] Optionally, the second detection unit includes a fourth triode VT4, a twelfth resistor R12, a thirteenth resistor R13, a fourteenth resistor R14, and a fourth capacitor C4; the collector of the fourth triode VT4 is connected to the first end of the twelfth resistor R12, the second end of the twelfth resistor R12 is connected to the second constant voltage power supply VCC2, the base of the fourth triode VT4 is respectively connected to the first end of the fourth capacitor C4, the first end of the thirteenth resistor R13, and the first end of the fourteenth resistor R14, the emitter of the fourth triode VT4, the second end of the fourth capacitor C4, and the second end of the thirteenth resistor R13 are all connected to ground; both pin 1 and pin 2 of the second key SW2 are connected to the second constant voltage power supply VCC2, and both pin 3 and pin 4 of the second key SW2 are respectively connected to the first switch unit and the second end of the fourteenth resistor R14.
[0011] Optionally, the key detection circuit further includes a second switch unit and a third switch unit; the second switch unit is respectively connected to the first detection unit and the controller, and the third switch unit is respectively connected to the second detection unit and the controller; the second switch unit is configured to output a second detection signal when the first detection unit outputs a first control signal; the third switch unit is configured to output a third detection signal when the second detection unit outputs a first control signal; wherein, the voltage levels of the second detection signal and the third detection signal are different; the controller is configured to determine that the first key SW1 is in a fault state when the duration of the second detection signal is greater than or equal to the preset duration; and to determine that the second key SW2 is in a fault state when the duration of the third detection signal is greater than or equal to the preset duration.
[0012] Optionally, the second switch unit includes a fifth triode VT5, a third diode D3, and a fifteenth resistor R15; the base of the fifth triode VT5 is connected to the first detection unit, the collector of the fifth triode VT5 is connected to the cathode of the third diode D3, the anode of the third diode D3 is connected to the controller, the emitter of the fifth triode VT5 is connected to the first end of the fifteenth resistor R15, and the second end of the fifteenth resistor R15 is connected to ground.
[0013] Optionally, the third switch unit includes a sixth triode VT6, a fourth diode D4, and a sixteenth resistor R16; the base of the sixth triode VT6 is connected to the second detection unit, the collector of the sixth triode VT6 is connected to the cathode of the fourth diode D4, the anode of the fourth diode D4 is connected to the controller, the emitter of the sixth triode VT6 is connected to the first end of the sixteenth resistor R16, and the second end of the sixteenth resistor R16 is connected to ground; the resistance value of the sixteenth resistor R16 is different from that of the fifteenth resistor R15.
[0014] Optionally, the key detection circuit further includes a third key SW3 and a third detection unit; the third key SW3 is respectively connected to the third detection unit and the power supply; the third detection unit is configured to output a third control signal when the third key SW3 is pressed; the power supply is configured to output the second constant voltage power supply VCC2 when the third detection unit outputs the third control signal.
[0015] In a second aspect, an embodiment of the present application provides an energy storage power supply. The energy storage power supply includes the key detection circuit as described above.
[0016] At least one advantageous aspect of the key detection circuit provided by the embodiment of the present application is that the first detection unit is respectively connected to the first key SW1 and the first switch unit, the second detection unit is respectively connected to the second key SW2 and the first switch unit, and the first switch unit is further connected to the controller; the first detection unit is used to output a first control signal when the first key SW1 is pressed; the second detection unit is used to output a first control signal when the second key SW2 is pressed; the first switch unit is used to output a first detection signal when both the first detection unit and the second detection unit output the first control signal; the controller is used to determine that both the first key SW1 and the second key SW2 are in a fault state when the duration of the first detection signal is greater than or equal to a preset duration. When the two keys are pressed, both detection units of this key detection circuit output the first control signal, and then the first switch unit outputs the first detection signal according to the first control signal. Thus, the controller determines that both keys are in a fault state according to the duration of the first detection signal being greater than or equal to the preset duration, can detect the fault state of the keys in time, so that the energy storage inverter disconnects the corresponding power output, and further avoids the occurrence of electric shock accidents to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] One or more embodiments are illustrated by way of example in the accompanying drawings, which do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the figures in the drawings do not constitute a proportional limitation.
[0018] Figure 1 It is a functional block diagram of the key detection circuit provided by the embodiment of the present application;
[0019] Figure 2 It is a circuit schematic diagram of the first switch unit provided by the embodiment of the present application;
[0020] Figure 3 It is a circuit schematic diagram of the first detection unit and the second detection unit provided by the embodiment of the present application;
[0021] Figure 4 It is a functional block diagram of the key detection circuit provided by another embodiment of the present application;
[0022] Figure 5 It is a circuit schematic diagram of the second switch unit and the third switch unit provided by the embodiment of the present application;
[0023] Figure 6 It is a circuit schematic diagram of the third detection unit provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] For the convenience of understanding the present utility model, the present utility model will be described in more detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that when an element is expressed as "fixed to" another element, it can be directly on the other element, or there can be one or more intermediate elements therebetween. When an element is expressed as "connected to" another element, it can be directly connected to the other element, or there can be one or more intermediate elements therebetween. The terms "upper", "lower", "inner", "outer", "bottom", etc. used in this specification indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the present utility model and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present utility model. In addition, the terms "first", "second", "third", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0025] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by those skilled in the technical field to which the present utility model belongs. The terms used in this specification in the description of the present utility model are only for the purpose of describing specific embodiments and are not used to limit the present utility model. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0026] In addition, the technical features involved in different embodiments of the present utility model described below can be combined with each other as long as they do not conflict with each other.
[0027] Energy storage inverters are usually equipped with a series of buttons for operating and setting the device. These buttons may include a power on / off button, a mode switch button, a setting button, etc., which allow users to adjust the working state and parameters of the inverter as needed.
[0028] Generally, an energy storage inverter is configured with 3 buttons, namely: a power button (Power button) for turning on or off the inverter, an AC output button (AC button) for controlling the AC output of the inverter, and a DC input button (DC button) for controlling the DC input of the inverter.
[0029] Exemplarily, a snap-action button is used as the button of the energy storage inverter, and this type of button pops up after being pressed.
[0030] However, due to certain factors, such as frequent pressing and use resulting in damage to the snap of the button, the AC button and the DC button cannot be restored after being pressed, especially when the AC button and the DC button are pressed simultaneously and cannot be restored. If the energy storage inverter fails to detect the button failure in time, it is easy to cause an electric shock accident to the user.
[0031] In view of the defect that the existing buttons may fail and cannot be detected in time, the embodiment of the present application provides a button detection circuit, which is applied to the failure detection of the first button SW1 and the second button SW2. When both buttons are pressed, both detection units output a first control signal, and then the first switch unit outputs a first detection signal according to the first control signal. Thus, when the duration of the first detection signal is greater than or equal to a preset duration, the controller determines that both buttons are in a failure state, and can detect the failure state of the buttons in time, so that the energy storage inverter disconnects the corresponding power output, thereby avoiding the occurrence of electric shock accidents to users.
[0032] It should be noted that the embodiment of the present application exemplarily shows the application scenario of the button detection circuit in the energy storage power supply for the sake of simplicity of description. However, those skilled in the art can understand that based on similar principles, the button detection circuit provided in the embodiment of the present application can also be applied to other power supply scenarios that require button detection.
[0033] Figure 1 is a functional block diagram of the button detection circuit provided in the embodiment of the present application, as Figure 1 shown, the button detection circuit 10 includes: a first detection unit 11, a second detection unit 12, a first switch unit 13, and a controller 14.
[0034] Among them, the first detection unit 11 is respectively connected to the first button SW1 and the first switch unit 13, the second detection unit 12 is respectively connected to the second button SW2 and the first switch unit 13, and the first switch unit 13 is further connected to the controller 14.
[0035] The first detection unit 11 is configured to output a first control signal when the first button SW1 is pressed.
[0036] The second detection unit 12 is configured to output a first control signal when the second button SW2 is pressed.
[0037] The first switch unit 13 is configured to output a first detection signal when both the first detection unit 11 and the second detection unit 12 output the first control signal.
[0038] The controller 14 is configured to determine that both the first button SW1 and the second button SW2 are in a failure state when the duration of the first detection signal is greater than or equal to a preset duration.
[0039] As an example rather than a limitation, the preset duration can be 5 seconds or 10 seconds, and the specific preset duration can be set according to the actual application scenario.
[0040] To better describe how to solve the problem that the existing energy storage inverter fails to detect in time the fault that the AC button and the DC button are pressed simultaneously and cannot be restored, in the embodiments of the present application, the first button SW1 is used as the AC output button (AC button) for controlling the inverter. Therefore, when the AC button is pressed, the output end BUTTON_AC of the first detection unit 11 outputs a first control signal. In the embodiments of the present application, the second button SW2 is used as the DC input button (DC button) for controlling the inverter. Therefore, when the DC button is pressed, the output end BUTTON_DC of the second detection unit 12 outputs a first control signal.
[0041] In some embodiments, the first detection unit 11 is configured to output a second control signal when the first button SW1 is not pressed; the second detection unit 12 is configured to output a second control signal when the second button SW2 is not pressed; the first switch unit 13 is configured to output a fourth detection signal when the first detection unit 11 or the second detection unit 12 outputs the second control signal; the controller 14 is configured to determine that the first button SW1 and the second button SW2 are not in a simultaneous fault state when the fourth detection signal persists.
[0042] Among them, the voltage level of the fourth detection signal is different from the voltage level of the first detection signal. By way of example, the first detection signal is a low-level signal, and the fourth detection signal is a high-level signal.
[0043] Figure 2 is the circuit schematic diagram of the first switch unit provided by the embodiments of the present application. As Figure 2 shown, the first switch unit 13 includes a first constant voltage power supply VCC1, a first triode VT1, a second triode VT2, a first diode D1, a second diode D2, a first capacitor C1, a second capacitor C2, a first MOS transistor Q1, a second MOS transistor Q2, a third resistor R3, and a fourth resistor R4.
[0044] Among them, the base b of the first triode VT1 is connected to the first detection unit 11. Specifically, the base b of the first triode VT1 is connected to the output end BUTTON_AC of the first detection unit 11, and is used to receive the first control signal output by the first detection unit 11 when the first button SW1 is pressed. The collector c of the first triode VT1 is respectively connected to the first constant voltage power supply VCC1 and the positive pole “+” of the first diode D1, and the emitter e of the first triode VT1 is connected to the ground GND.
[0045] The negative pole “-” of the first diode D1 is respectively connected to the negative pole “-” of the second diode D2, the first end of the first capacitor C1, and the gate G of the first MOS transistor Q1, and the second end of the first capacitor C1 is connected to the ground GND.
[0046] The base b of the second triode VT2 is connected to the second detection unit 12. Specifically, the base b of the second triode VT2 is connected to the output terminal BUTTON_DC of the second detection unit 12, and is used to receive the first control signal output by the second detection unit 12 when the second button SW2 is pressed. The collector c of the second triode VT2 is respectively connected to the first constant voltage power supply VCC1 and the anode “+” of the second diode D2, and the emitter e of the second triode VT2 is connected to the ground GND.
[0047] The drain D of the first MOS transistor Q1 is respectively connected to the first end of the third resistor R3 and the first end of the fourth resistor R4. The source S of the first MOS transistor Q1 is connected to the ground GND. The second end of the third resistor R3 is connected to the first constant voltage power supply VCC1. The gate G of the first MOS transistor Q1 is respectively connected to the cathode “-” of the first diode D1, the cathode “-” of the second diode D2, and the first end of the first capacitor C1.
[0048] The first end of the fourth resistor R4 is respectively connected to the first end of the second capacitor C2 and the gate G of the second MOS transistor Q2. The second end of the fourth resistor R4, the second end of the second capacitor C2, and the source S of the second MOS transistor Q2 are all connected to the ground GND.
[0049] The drain D of the second MOS transistor Q2 is connected to the controller 14. Specifically, the drain D of the second MOS transistor Q2 is connected to the detection terminal BUTTON_NG of the controller 14, and the drain D of the second MOS transistor Q2 is used to output the first detection signal to the controller 14.
[0050] In some embodiments, the first switch unit 13 further includes a fifth resistor R5, a sixth resistor R6, a seventh resistor R7, and an eighth resistor R8.
[0051] Among them, the first end of the fifth resistor R5 is connected to the first constant voltage power supply VCC1, and the second end of the fifth resistor R5 is connected to the collector c of the first triode VT1. The first end of the sixth resistor R6 is connected to the first constant voltage power supply VCC1, and the second end of the sixth resistor R6 is connected to the collector c of the second triode VT2. The first end of the seventh resistor R7 is connected to the drain D of the first MOS transistor Q1, and the second end of the seventh resistor R7 is respectively connected to the first end of the third resistor R3 and the first end of the fourth resistor R4. The first end of the eighth resistor R8 is connected to the gate G of the first MOS transistor Q1, and the second end of the eighth resistor R8 is connected to the ground GND.
[0052] It should be noted that the resistance value of the fourth resistor R4 is greater than that of the third resistor R3, and the resistance value of the third resistor R3 is greater than that of the seventh resistor R7. For example, R4 = 20 KΩ, R3 = 2 KΩ, and R7 = 47 Ω.
[0053] It should be noted that the resistance value of the eighth resistor R8 is greater than that of the fifth resistor R5 and the sixth resistor R6. By way of example, R8 = 1 MΩ, and R5 = R6 = 10 KΩ.
[0054] In some embodiments, the first switch unit 13 further includes a third constant voltage power supply VCC3. The third constant voltage power supply VCC3 is respectively connected to the drain D of the second MOS transistor Q2 and the controller 14. When the first detection unit 11 or the second detection unit 12 outputs a second control signal, the second MOS transistor Q2 is controlled to be in an off state, and the third constant voltage power supply VCC3 is directly connected to the controller 14 so that the first switch unit 13 outputs a fourth detection signal. By way of example, the third constant voltage power supply VCC3 is 3.3 V, and the fourth detection signal is a high-level signal.
[0055] In some embodiments, the first switch unit 13 further includes a seventeenth resistor R17, an eighteenth resistor R18, and a nineteenth resistor R19.
[0056] Among them, the first end of the seventeenth resistor R17 is connected to the first detection unit 11, and the second end of the seventeenth resistor R17 is connected to the base b of the first triode VT1. The first end of the eighteenth resistor R18 is connected to the second detection unit 12, and the second end of the eighteenth resistor R18 is connected to the base b of the second triode VT2. The first end of the nineteenth resistor R19 is connected to the third constant voltage power supply VCC3, and the second end of the nineteenth resistor R19 is respectively connected to the drain D of the second MOS transistor Q2 and the controller 14.
[0057] To better understand the implementation process of the key detection circuit in the embodiments of the present application, the following is a description of the circuit principle with reference to Figure 2 for elaboration:
[0058] (1) When both the first button SW1 and the second button SW2 are pressed, the first detection unit 11 outputs a first control signal, and the second detection unit 12 outputs a first control signal. It should be noted that both the first control signal and the first control signal are high-level signals. Therefore, the base b of the first triode VT1 is at a high level, the first triode VT1 conducts, the positive pole "+" of the first diode D1 is connected to the ground GND. At the same time, the base b of the second triode VT2 is at a high level, the second triode VT2 conducts, the positive pole "+" of the second diode D2 is connected to the ground GND, the voltage across the first capacitor C1 is 0, the first MOS transistor Q1 is cut off. At this time, the third resistor R3 and the fourth resistor R4 are connected in series to divide the voltage of the first constant voltage power supply VCC1. Assuming that the first constant voltage power supply VCC1 is 3.3V, R4 = 20KΩ, R3 = 2KΩ. Since the resistance value of the fourth resistor R4 is much larger than that of the third resistor R3, the voltage across the fourth resistor R4 is 3.3V, and the voltage across the second capacitor C2 is also 3.3V. Thus, the second MOS transistor Q2 conducts and is grounded to GND, and then a first detection signal is output at the drain D of the second MOS transistor Q2. At this time, the first detection signal is at a low level. When the detection terminal BUTTON_NG of the controller 14 detects that the duration of the first detection signal is greater than or equal to the preset duration, it is determined that both the first button SW1 and the second button SW2 are in a fault state, and a fault reminder message is generated to remind the user.
[0059] (2) When neither the first button SW1 nor the second button SW2 is pressed, the first detection unit 11 outputs a second control signal, and the second detection unit 12 outputs a second control signal. It should be noted that the second control signal is a low-level signal, both the first triode VT1 and the second triode VT2 are cut off, the first MOS transistor Q1 is cut off, and the second MOS transistor Q2 is cut off. The third constant voltage power supply VCC3 is directly connected to the controller 14, so that the first switch unit 13 outputs a fourth detection signal, and the fourth detection signal is a high-level signal. When the detection terminal BUTTON_NG of the controller 14 detects the continuous presence of the fourth detection signal, it is determined that the first button SW1 and the second button SW2 are not in a simultaneous fault state.
[0060] (3) When the first button SW1 is pressed alone, the first detection unit 11 outputs a first control signal, and the first control signal is a high-level signal. Therefore, the base b of the first triode VT1 is at a high level, the first triode VT1 conducts, the positive pole “+” of the first diode D1 is connected to the ground GND, but the negative pole “-” of the first diode D1 is pulled up by the sixth resistor R6. Assuming R8 = 1MΩ, R5 = R6 = 10KΩ, since the resistance value of the eighth resistor R8 is much larger than that of the sixth resistor R6, therefore, the current flows from the first constant voltage power supply VCC1 through the sixth resistor R6, the second diode D2, and the eighth resistor R8. At this time, the voltage across the eighth resistor R8 is 3.3V, and the first MOS transistor Q1 conducts. Assuming R4 = 20KΩ, R3 = 2KΩ, R7 = 47Ω, since the third resistor R3 is much larger than the seventh resistor R7, the parallel resistance between the seventh resistor R7 and the fourth resistor R4 is less than 47Ω. Therefore, the current flows from the first constant voltage power supply VCC1 through the third resistor R3, the seventh resistor R7, and the first MOS transistor Q1, so that the voltage across the second capacitor C2 is 0, and the second MOS transistor Q2 is cut off. And the third constant voltage power supply VCC3 always outputs a high-level signal. Therefore, the controller 14 cannot determine whether the first button SW1 is in the pressed state. When the second button SW2 is pressed alone, it is the same principle. In summary, only when the first button SW1 and the second button SW2 are pressed simultaneously can the fault detection of the two buttons be realized.
[0061] In some embodiments, Figure 3 is the circuit schematic diagram of the first detection unit and the second detection unit provided by the embodiment of the present application. As Figure 3 shown, the button detection circuit 10 further includes a second constant voltage power supply VCC2, and the first detection unit 11 includes a third triode VT3, a ninth resistor R9, a tenth resistor R10, an eleventh resistor R11, and a third capacitor C3.
[0062] Among them, the collector c of the third triode VT3 is connected to the first end of the tenth resistor R10, the second end of the tenth resistor R10 is connected to the second constant voltage power supply VCC2, the base b of the third triode VT3 is respectively connected to the first end of the third capacitor C3, the first end of the ninth resistor R9, and the first end of the eleventh resistor R11. The emitter e of the third triode VT3, the second end of the third capacitor C3, and the second end of the ninth resistor R9 are all connected to the ground GND.
[0063] Pin 1 and pin 2 of the first button SW1 are both connected to the second constant voltage power supply VCC2. Pin 3 and pin 4 of the first button SW1 are respectively connected to the first switch unit 13 and the second end of the eleventh resistor R11. Specifically, pin 3 and pin 4 of the first button SW1, as well as the second end of the eleventh resistor R11, are all connected to the output terminal BUTTON_AC, and the output terminal BUTTON_AC is connected to the first switch unit 13.
[0064] In some embodiments, such as Figure 3 shown, the second detection unit 12 includes a fourth triode VT4, a twelfth resistor R12, a thirteenth resistor R13, a fourteenth resistor R14, and a fourth capacitor C4.
[0065] Among them, the collector c of the fourth triode VT4 is connected to the first end of the twelfth resistor R12. The second end of the twelfth resistor R12 is connected to the second constant voltage power supply VCC2. The base b of the fourth triode VT4 is respectively connected to the first end of the fourth capacitor C4, the first end of the thirteenth resistor R13, and the first end of the fourteenth resistor R14. The emitter e of the fourth triode VT4, the second end of the fourth capacitor C4, and the second end of the thirteenth resistor R13 are all connected to the ground GND.
[0066] Pin 1 and pin 2 of the second button SW2 are both connected to the second constant voltage power supply VCC2. Pin 3 and pin 4 of the second button SW2 are respectively connected to the first switch unit 13 and the second end of the fourteenth resistor R14. Specifically, pin 3 and pin 4 of the second button SW2, as well as the second end of the fourteenth resistor R14, are all connected to the output terminal BUTTON_DC, and the output terminal BUTTON_DC is connected to the first switch unit 13.
[0067] In some embodiments, Figure 4 is a functional block diagram of a button detection circuit provided by another embodiment of the present application. As Figure 4 shown, the button detection circuit 10 further includes a second switch unit 15 and a third switch unit 16.
[0068] Among them, the second switch unit 15 is respectively connected to the first detection unit 11 and the controller 14. The third switch unit 16 is respectively connected to the second detection unit 12 and the controller 14.
[0069] The second switch unit 15 is configured to output a second detection signal when the first detection unit 11 outputs a first control signal.
[0070] The third switch unit 16 is configured to output a third detection signal when the second detection unit 12 outputs a first control signal.
[0071] It should be noted that the voltage levels of the second detection signal and the third detection signal are different.
[0072] The controller 14 is configured to determine that the first button SW1 is in a faulty state when the duration of the second detection signal is greater than or equal to a preset duration; and to determine that the second button SW2 is in a faulty state when the duration of the third detection signal is greater than or equal to a preset duration.
[0073] It should be noted that when one of the first button SW1 and the second button SW2 fails and the other button is normally reset, it is impossible to detect which button has failed through the first switch unit 13, while it is possible to detect which button has failed through the second switch unit 15 and the third switch unit 16.
[0074] In some embodiments, Figure 5 is the circuit schematic diagram of the second switch unit and the third switch unit provided by the embodiment of the present application, as Figure 5 shown, the second switch unit 15 includes a fifth triode VT5, a third diode D3, and a fifteenth resistor R15.
[0075] Wherein, the base b of the fifth triode VT5 is connected to the first detection unit 11, the collector c of the fifth triode VT5 is connected to the negative electrode "-" of the third diode D3, the positive electrode "+" of the third diode D3 is connected to the controller 14, specifically, the positive electrode "+" of the third diode D3 is connected to the detection terminal BUTTON_NG of the controller 14, the emitter e of the fifth triode VT5 is connected to the first end of the fifteenth resistor R15, and the second end of the fifteenth resistor R15 is connected to the ground GND. The positive electrode "+" of the third diode D3 is also connected to the second end of the nineteenth resistor R19.
[0076] In some embodiments, as Figure 5 shown, the second switch unit 15 further includes a twentieth resistor R20, the first end of the twentieth resistor R20 is connected to the first detection unit 11, specifically, the first end of the twentieth resistor R20 is connected to the output terminal BUTTON_AC of the first detection unit 11, and the second end of the twentieth resistor R20 is connected to the base b of the fifth triode VT5.
[0077] When the first detection unit 11 outputs a first control signal, the base b of the fifth triode VT5 is at a high level, and the fifth triode VT5 conducts, so that the fifteenth resistor R15 and the nineteenth resistor R19 are connected in series, so that the third constant voltage power supply VCC3 forms a second detection signal at the positive electrode "+" of the third diode D3, and thus outputs the second detection signal to the controller 14.
[0078] In some embodiments, as Figure 5 shown, the third switch unit 16 includes a sixth triode VT6, a fourth diode D4, and a sixteenth resistor R16.
[0079] Among them, the base b of the sixth triode VT6 is connected to the second detection unit 12, the collector c of the sixth triode VT6 is connected to the negative pole "-" of the fourth diode D4, and the positive pole "+" of the fourth diode D4 is connected to the controller 14. Specifically, the positive pole "+" of the fourth diode D4 is connected to the detection terminal BUTTON_NG of the controller 14, the emitter e of the sixth triode VT6 is connected to the first end of the sixteenth resistor R16, and the second end of the sixteenth resistor R16 is connected to the ground GND. The positive pole "+" of the fourth diode D4 is also connected to the second end of the nineteenth resistor R19.
[0080] In some embodiments, such as Figure 5 As shown, the third switch unit 16 further includes a twenty-first resistor R21. The first end of the twenty-first resistor R21 is connected to the second detection unit 12. Specifically, the first end of the twenty-first resistor R21 is connected to the output terminal BUTTON_DC of the second detection unit 12, and the second end of the twenty-first resistor R21 is connected to the base b of the sixth triode VT6.
[0081] When the second detection unit 12 outputs a first control signal, the base b of the sixth triode VT6 is at a high level, and the sixth triode VT6 conducts, so that the sixteenth resistor R16 and the nineteenth resistor R19 are connected in series, so that the third constant voltage power supply VCC3 forms a third detection signal at the positive pole "+" of the fourth diode D4, and then outputs the third detection signal to the controller 14.
[0082] It should be noted that the resistance value of the sixteenth resistor R16 is different from that of the fifteenth resistor R15, so that the voltage level of the second detection signal is different from that of the third detection signal.
[0083] In some embodiments, the key detection circuit 10 further includes a third key SW3 and a third detection unit.
[0084] Among them, the third key SW3 is respectively connected to the third detection unit and the power supply. The third detection unit is used to output a third control signal when the third key SW3 is pressed, and the power supply is used to output the second constant voltage power supply VCC2 when the third detection unit outputs the third control signal.
[0085] It should be noted that since the embodiment of the present application is applied to automatically detect the key failure during power-on, the third key SW3 is set as the power-on key. When the third key SW3 is pressed, the power supply outputs the second constant voltage power supply VCC2. In other scenarios, the third key SW3 may not be used, and the second constant voltage power supply VCC2 can be directly used for power supply.
[0086] In some embodiments, Figure 6It is the circuit schematic diagram of the third detection unit provided by the embodiment of the present application. The third detection unit includes the seventh triode VT7, the twenty-second resistor R22, the twenty-third resistor R23, the twenty-fourth resistor R24, the twenty-fifth resistor R25 and the fifth capacitor C5.
[0087] Among them, the collector c of the seventh triode VT7 is connected to the first end of the twenty-second resistor R22. The second end of the twenty-second resistor R22 is respectively connected to the second end of the tenth resistor R10, the pins 1 and 2 of the first button SW1, the second end of the twelfth resistor R12, and the pins 1 and 2 of the second button SW2. The second end of the twenty-second resistor R22 is used to output the second constant voltage power supply VCC2. The base b of the seventh triode VT7 is respectively connected to the first end of the fifth capacitor C5, the first end of the twenty-third resistor R23 and the first end of the twenty-fourth resistor R24. The emitter e of the seventh triode VT7, the second end of the fifth capacitor C5 and the second end of the twenty-third resistor R23 are all connected to the ground GND.
[0088] The pins 3 and 4 of the third button SW3 are respectively connected to the energy storage inverter and the second end of the twenty-fourth resistor R24. The pins 1 and 2 of the third button SW3 are respectively connected to the first end of the twenty-fifth resistor R25. The second end of the twenty-fifth resistor R25 is connected to the power supply BAT+.
[0089] In some embodiments, the button detection circuit 10 is used to detect the on-off states of two buttons or switches. For example, when the first switch unit 13 outputs the first detection signal, the controller 14 determines that both the first button SW1 and the second button SW2 are in the conducting state.
[0090] In some embodiments, the embodiment of the present application provides an energy storage power supply, and the energy storage power supply includes the button detection circuit 10.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; under the idea of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order, and there are many other variations in different aspects of the present invention as described above. For the sake of brevity, they are not provided in detail; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A key detection circuit is applied to the fault detection of the first key SW1 and the second key SW2, and is characterized in that It includes a first detection unit, a second detection unit, a first switch unit and a controller; The first detection unit is respectively connected to the first button SW1 and the first switch unit, the second detection unit is respectively connected to the second button SW2 and the first switch unit, and the first switch unit is also connected to the controller; The first detection unit is used to output a first control signal when the first button SW1 is pressed; The second detection unit is used to output a first control signal when the second button SW2 is pressed; The first switch unit is used to output a first detection signal when both the first detection unit and the second detection unit output the first control signal; The controller is used to determine that both the first button SW1 and the second button SW2 are in a fault state when the duration of the first detection signal is greater than or equal to a preset duration.
2. The key detection circuit according to claim 1, wherein The first switch unit includes a first constant voltage power supply VCC1, a first triode VT1, a second triode VT2, a first diode D1, a second diode D2, a first capacitor C1, a second capacitor C2, a first MOS transistor Q1, a second MOS transistor Q2, a third resistor R3 and a fourth resistor R4; The base of the first triode VT1 is connected to the first detection unit, the collector of the first triode VT1 is respectively connected to the first constant voltage power supply VCC1 and the positive electrode of the first diode D1, and the emitter of the first triode VT1 is connected to the ground; The negative electrode of the first diode D1 is respectively connected to the negative electrode of the second diode D2, the first end of the first capacitor C1 and the gate of the first MOS transistor Q1, and the second end of the first capacitor C1 is connected to the ground; The base of the second triode VT2 is connected to the second detection unit, the collector of the second triode VT2 is respectively connected to the first constant voltage power supply VCC1 and the positive electrode of the second diode D2, and the emitter of the second triode VT2 is connected to the ground; The drain of the first MOS transistor Q1 is respectively connected to the first end of the third resistor R3 and the first end of the fourth resistor R4, the source of the first MOS transistor Q1 is connected to the ground, and the second end of the third resistor R3 is connected to the first constant voltage power supply VCC1; The first end of the fourth resistor R4 is respectively connected to the first end of the second capacitor C2 and the gate of the second MOS transistor Q2, and the second end of the fourth resistor R4, the second end of the second capacitor C2 and the source of the second MOS transistor Q2 are all connected to the ground; The drain of the second MOS transistor Q2 is connected to the controller.
3. The key detection circuit according to claim 2, wherein The first switch unit further includes a fifth resistor R5, a sixth resistor R6, a seventh resistor R7 and an eighth resistor R8; The first end of the fifth resistor R5 is connected to the first constant voltage power supply VCC1, and the second end of the fifth resistor R5 is connected to the collector of the first triode VT1; The first end of the sixth resistor R6 is connected to the first constant voltage power supply VCC1, and the second end of the sixth resistor R6 is connected to the collector of the second triode VT2; The first end of the seventh resistor R7 is connected to the drain of the first MOS transistor Q1, and the second end of the seventh resistor R7 is respectively connected to the first end of the third resistor R3 and the first end of the fourth resistor R4; The first end of the eighth resistor R8 is connected to the gate of the first MOS transistor Q1, and the second end of the eighth resistor R8 is connected to ground.
4. The key detection circuit according to claim 1, wherein The key detection circuit further includes a second constant voltage power supply VCC2; the first detection unit includes a third triode VT3, a ninth resistor R9, a tenth resistor R10, an eleventh resistor R11, and a third capacitor C3; The collector of the third triode VT3 is connected to the first end of the tenth resistor R10, the second end of the tenth resistor R10 is connected to the second constant voltage power supply VCC2, the base of the third triode VT3 is respectively connected to the first end of the third capacitor C3, the first end of the ninth resistor R9, and the first end of the eleventh resistor R11, and the emitter of the third triode VT3, the second end of the third capacitor C3, and the second end of the ninth resistor R9 are all connected to ground; Pin 1 and pin 2 of the first key SW1 are both connected to the second constant voltage power supply VCC2, and pin 3 and pin 4 of the first key SW1 are respectively connected to the first switch unit and the second end of the eleventh resistor R11.
5. The key detection circuit according to claim 4, characterized in that, The second detection unit includes a fourth triode VT4, a twelfth resistor R12, a thirteenth resistor R13, a fourteenth resistor R14, and a fourth capacitor C4; The collector of the fourth triode VT4 is connected to the first end of the twelfth resistor R12, the second end of the twelfth resistor R12 is connected to the second constant voltage power supply VCC2, the base of the fourth triode VT4 is respectively connected to the first end of the fourth capacitor C4, the first end of the thirteenth resistor R13, and the first end of the fourteenth resistor R14, and the emitter of the fourth triode VT4, the second end of the fourth capacitor C4, and the second end of the thirteenth resistor R13 are all connected to ground; Pin 1 and pin 2 of the second key SW2 are both connected to the second constant voltage power supply VCC2, and pin 3 and pin 4 of the second key SW2 are respectively connected to the first switch unit and the second end of the fourteenth resistor R14.
6. The key detection circuit according to claim 1, wherein The key detection circuit further includes a second switch unit and a third switch unit; The second switch unit is respectively connected to the first detection unit and the controller, and the third switch unit is respectively connected to the second detection unit and the controller; The second switch unit is configured to output a second detection signal when the first detection unit outputs a first control signal; The third switch unit is configured to output a third detection signal when the second detection unit outputs a first control signal; Wherein, the voltage levels of the second detection signal and the third detection signal are different; The controller is configured to determine that the first key SW1 is in a fault state when the duration of the second detection signal is greater than or equal to the preset duration; and When the duration of the third detection signal is greater than or equal to the preset duration, it is determined that the second button SW2 is in a faulty state.
7. The key detection circuit according to claim 6, wherein The second switch unit includes a fifth triode VT5, a third diode D3, and a fifteenth resistor R15; The base of the fifth triode VT5 is connected to the first detection unit, the collector of the fifth triode VT5 is connected to the negative electrode of the third diode D3, the positive electrode of the third diode D3 is connected to the controller, the emitter of the fifth triode VT5 is connected to the first end of the fifteenth resistor R15, and the second end of the fifteenth resistor R15 is connected to the ground.
8. The key detection circuit according to claim 7, wherein The third switch unit includes a sixth triode VT6, a fourth diode D4, and a sixteenth resistor R16; The base of the sixth triode VT6 is connected to the second detection unit, the collector of the sixth triode VT6 is connected to the negative electrode of the fourth diode D4, the positive electrode of the fourth diode D4 is connected to the controller, the emitter of the sixth triode VT6 is connected to the first end of the sixteenth resistor R16, and the second end of the sixteenth resistor R16 is connected to the ground; The resistance value of the sixteenth resistor R16 is different from the resistance value of the fifteenth resistor R15.
9. The key detection circuit according to claim 4, characterized in that, The button detection circuit further includes a third button SW3 and a third detection unit; The third button SW3 is respectively connected to the third detection unit and the power supply; The third detection unit is configured to output a third control signal when the third button SW3 is pressed; The power supply is configured to output the second constant voltage power supply VCC2 when the third detection unit outputs the third control signal.
10. A energy storage power supply, characterized in that, Comprising: The button detection circuit according to any one of claims 1-9.