A power failure detection device
Through the combination of a microcontroller, a voltage measurement circuit and a power failure detection circuit, the STM32 series microcontroller detects voltage fluctuations in real time and sets the threshold value, the problem of excessively long power failure detection time in the prior art is solved, and a rapid power failure judgment within the range of 200V-240V is achieved.
Patent Information
- Application Number
- CN202010578332.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-23
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2040-06-23
Smart Images

Figure CN111751603B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a detection device, and particularly to a power failure detection device. Background Art
[0002] When performing power failure detection on a power supply line, after the line loses power, the power failure judgment of the power supply line is very important for other control systems. The shorter the judgment time, the greater the significance. In the case of voltage fluctuations within 200V - 240V, the power failure detection time should not be greater than 5ms, and it is very difficult for ordinary detection devices to meet this requirement. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a power failure detection device that can effectively judge a power supply line within a power failure judgment time of not more than 5ms.
[0004] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0005] A power failure detection device includes a single-chip microcomputer, a voltage measurement circuit, a power failure detection circuit, and a power failure output I / O circuit. The single-chip microcomputer is bidirectionally connected to the voltage measurement circuit that real-time detects the voltage to be measured, the power failure detection circuit that determines the power failure of the line to be measured within not more than 5ms, and the power failure output I / O circuit that outputs a status as a control signal for other control systems. The single-chip microcomputer collects the output voltage signal of the voltage measurement circuit and the output current of the power failure detection circuit. The voltage measurement circuit real-time detects the specific data of voltage fluctuations, and the power failure detection circuit detects current data. During the process of the power failure detection circuit detecting the current decay data, a threshold value is set. When the measured current in the power failure detection circuit is lower than the threshold value, the measured point loses power. The power failure output I / O circuit outputs a status as a control signal for other control systems. The output result of this status is 0, otherwise, the output status is 1, and 1 indicates power on.
[0006] The power failure detection circuit determines whether there is a power failure by detecting whether the decay of the signal current is zero. Due to the residual voltage of the integration capacitor in the detection circuit, the decay of the detection current to zero lags far behind the decay of the actual line current to zero. During the signal decay process, a threshold value is set. When the measured current is lower than the threshold value, it is determined that the measured point loses power at this time. In this way, the power failure detection time will be shortened. When the line to be measured fluctuates within a certain voltage range, the voltage measurement circuit will real-time detect the voltage fluctuations and match the corresponding threshold value through table lookup to ensure that the power failure detection time within the voltage range of 200V - 240V is not more than 5ms.
[0007] The single-chip microcomputer uses a 32-bit single-chip microcomputer of the STM32 series. The single-chip microcomputer is connected to the voltage measurement circuit through the ADCV port on it, connected to the power loss detection circuit through the ADC1 port on it, and connected to the power loss output I / O circuit through the I / O port on it.
[0008] The voltage measurement circuit includes a first transformer, a first amplifier, and a first comparator. The S1 terminal of the first transformer is connected to the L terminal after passing through the resistor R4. The S2 terminal of the first transformer is connected to the N terminal. The S3 terminal of the first transformer is connected to the input terminal IN+ of the first amplifier. The S4 terminal of the first transformer is connected to the input terminal IN- of the first amplifier. Another path of the input terminal IN- of the first amplifier is connected to the output terminal OUT of the first amplifier after passing through the resistor R7. A capacitor C3 is connected in parallel with the resistor R7. The output terminal OUT of the first amplifier is connected to the input terminal IN+ of the first comparator after passing through the node between it and the resistor R7, and another path is connected to the input terminal IN- of the first comparator after passing through D2 and the resistor R6. The power supply terminal V+ of the first comparator is connected to the input terminal IN- of the first comparator after passing through the resistor R1. The input terminal IN- of the first comparator is connected to the resistor R6 after passing through D3 and then through the resistor R8, and another path is connected to the S3 terminal of the first transformer. A capacitor C4 is connected in parallel with the resistor R8. The power supply terminal V- of the first comparator is connected to the resistor R5 through the output terminal of D3. The other end of the resistor R5 is connected to the input terminal IN+ of the first comparator. A capacitor C1 is connected in parallel with the resistor R5. The output terminal OUT of the first comparator is connected to +5V after passing through the resistor R2, grounded after passing through the capacitor C2, and directly connected to the single-chip microcomputer.
[0009] The power loss detection circuit includes a second comparator, a third comparator, and a fourth comparator. One path of the input terminal IN+ of the second comparator is connected to the input terminal IN- of the second comparator after passing through resistors R12, R11, and R14. Another path is connected to the output terminal OUT of the second comparator after passing through resistor R10. A capacitor C5 is connected in parallel with resistor R10. Another path of the input terminal IN- of the second comparator is grounded after passing through resistor R16, and another path is connected to the output terminal OUT of the second comparator after passing through a sliding resistor R15. The sliding end of the sliding resistor R15 is connected to the single-chip microcomputer. A capacitor C6 is connected in parallel with resistor R16. One path of the output terminal OUT of the third comparator is energized and connected to the wire node between resistor R11 and resistor R14 through diode D6. Another path is connected to the input terminal IN+ of the third comparator after passing through diodes D2 and D5, and the wire between diodes D2 and D5 is energized and connected to the wire node between resistor R11 and resistor R12. One path of the input terminal IN+ of the third comparator is energized and connected to the wire node between resistor R11 and resistor R14 through diode D4. Another path is connected to the output terminal OUT of the fourth comparator after passing through resistor R13. The input terminal IN- of the third comparator is grounded through resistor R17. Another path of the output terminal OUT of the fourth comparator is connected to the input terminal IN- of the fourth comparator after passing through resistor R18. A capacitor C7 is connected in parallel with resistor R18. One path of the input terminal IN+ of the fourth comparator is connected to the S2 terminal of the second transformer through diode D9. Another path is connected to the S4 terminal of the second transformer. A diode D8 with the opposite polarity direction is connected in parallel with diode D9. The S4 terminal of the second transformer is connected to the S1 terminal of the second transformer, and the S2 terminal of the second transformer is connected to the S3 terminal of the second transformer.
[0010] Both the first transformer and the second transformer are voltage dual operational amplifiers of model TVA1421, and the first comparator, the second comparator, the third comparator, and the fourth comparator are all four-channel differential comparators of model OP07.
[0011] The beneficial effects of the present invention are as follows:
[0012] 1. The present invention uses a single-chip microcomputer to collect the output signals of the voltage measurement circuit and the power loss detection circuit, ensuring the accuracy of the collected measured line signals. After collection, it judges the power loss and controls the output of the power loss output I / O circuit according to the judgment result.
[0013] 2. The design of the present invention is reasonable and easy to implement. It can achieve power loss detection of the measured circuit within 5 ms under the condition of voltage fluctuation (200V - 240V), output the control state, and the output state can be applied to other control systems, such as the control of dual - power fast - transfer switches, etc., with good economic benefits.
[0014] 3. In the present invention, the power loss detection circuit determines whether there is a power loss by detecting whether the attenuation of the signal current is zero; a threshold value is set during the signal attenuation process. When the measured current is lower than the threshold value, it is determined that the measured point has a power loss. Thus, different threshold values result in different power loss detection times; when the measured circuit fluctuates within a certain voltage range, the voltage detection circuit will detect the voltage fluctuation in real - time and match the corresponding threshold value through look - up table to ensure that the power loss detection time is no more than 5 ms within the voltage range of 200V - 240V. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is the structural schematic diagram of a power loss detection device of the present invention;
[0016] Figure 2 is the matching table of voltage and threshold value in a power loss detection device of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0017] Embodiment: A power loss detection device includes a single - chip microcomputer, a voltage measurement circuit, a power loss detection circuit, and a power loss output I / O circuit. The single - chip microcomputer is bidirectionally connected to the voltage measurement circuit that real - time detects the measured voltage, the power loss detection circuit that determines the power loss of the measured circuit within no more than 5 ms, and the power loss output I / O circuit that outputs a state as a control signal for other control systems. The single - chip microcomputer collects the output voltage signal of the voltage measurement circuit and the output current of the power loss detection circuit. The voltage measurement circuit detects the specific data of the voltage fluctuation in real - time, and the power loss detection circuit detects the current data. A threshold value is set during the process of the power loss detection circuit detecting the current attenuation data. By looking up the table, the relationship between the voltage value in the voltage measurement circuit and the current threshold value in the power loss detection circuit is obtained to determine whether there is a power loss. When the measured current in the power loss detection circuit is lower than the threshold value, it is determined that the measured point has a power loss. The power loss output I / O circuit outputs a state as a control signal for other control systems. The output result of this state is 0. Conversely, the output state is 1, where 1 indicates power on.
[0018] The single - chip microcomputer uses a 32 - bit single - chip microcomputer of the STM32 series. The single - chip microcomputer is connected to the voltage measurement circuit through the ADCV port on it, connected to the power loss detection circuit through the ADC1 port on it, and connected to the power loss output I / O circuit through the I / O port on it.
[0019] The voltage measurement circuit includes a first mutual inductor, a first amplifier, and a first comparator. The S1 terminal of the first mutual inductor is connected to the L terminal after passing through the resistor R4. The S2 terminal of the first mutual inductor is connected to the N terminal. The S3 terminal of the first mutual inductor is connected to the input terminal IN+ of the first amplifier. The S4 terminal of the first mutual inductor is connected to the input terminal IN- of the first amplifier. Another path of the input terminal IN- of the first amplifier is connected to the output terminal OUT of the first amplifier after passing through the resistor R7. A capacitor C3 is connected in parallel with the resistor R7. The output terminal OUT of the first amplifier passes through the node between it and the resistor R7 and then one path is connected to the input terminal IN+ of the first comparator after passing through D1 and the resistor R3, and the other path is connected to the input terminal IN- of the first comparator after passing through D2 and the resistor R6. The power supply terminal V+ of the first comparator is connected to the input terminal IN- of the first comparator after passing through the resistor R1. The input terminal IN- of the first comparator passes through D3 and then one path is connected to the resistor R6 after passing through the resistor R8, and the other path is connected to the S3 terminal of the first mutual inductor. A capacitor C4 is connected in parallel with the resistor R8. The power supply terminal V- of the first comparator is connected to the resistor R5 after passing through the output terminal of D3. The other end of the resistor R5 is connected to the input terminal IN+ of the first comparator. A capacitor C1 is connected in parallel with the resistor R5. The output terminal OUT of the first comparator is connected to +5V after passing through the resistor R2, grounded after passing through the capacitor C2, and directly connected to the single-chip microcomputer through another path.
[0020] The power loss detection circuit includes a second comparator, a third comparator, and a fourth comparator. One path of the input terminal IN+ of the second comparator is connected to the input terminal IN- of the second comparator after passing through resistors R12, R11, and R14, and the other path is connected to the output terminal OUT of the second comparator after passing through resistor R10. A capacitor C5 is connected in parallel with resistor R10. Another path of the input terminal IN- of the second comparator is grounded after passing through resistor R16, and the other path is connected to the output terminal OUT of the second comparator after passing through a sliding resistor R15. The sliding terminal of the sliding resistor R15 is connected to the single-chip microcomputer. A capacitor C6 is connected in parallel with resistor R16. One path of the output terminal OUT of the third comparator is electrically connected to the wire node between resistor R11 and resistor R14 through diode D6, and the other path is connected to the input terminal IN+ of the third comparator after passing through diode D2 and diode D5. And the wire between diode D2 and diode D5 is electrically connected to the wire node between resistor R11 and resistor R12. One path of the input terminal IN+ of the third comparator is electrically connected to the wire node between resistor R11 and resistor R14 after passing through diode D4, and the other path is connected to the output terminal OUT of the fourth comparator after passing through resistor R13. The input terminal IN- of the third comparator is grounded through resistor R17. Another path of the output terminal OUT of the fourth comparator is connected to the input terminal IN- of the fourth comparator after passing through resistor R18. A capacitor C7 is connected in parallel with resistor R18. One path of the input terminal IN+ of the fourth comparator is connected to the S2 terminal of the second transformer after passing through diode D9, and the other path is connected to the S4 terminal of the second transformer. A diode D8 with the opposite polarity direction is connected in parallel with diode D9. The S4 terminal of the second transformer is connected to the S1 terminal of the second transformer, and the S2 terminal of the second transformer is connected to the S3 terminal of the second transformer.
[0021] Both the first transformer and the second transformer are voltage dual operational amplifiers of model TVA1421, and the first comparator, the second comparator, the third comparator, and the fourth comparator are all four-way differential comparators of model OP07.
[0022] The power loss output I / O circuit outputs a status as a control signal for other control systems. The output result of this status is 0 or 1, where 0 represents power loss and 1 represents power on.
[0023] Within the allowable measured line voltage range, record the time from the maximum to zero of the output value of the power loss detection circuit when the line voltage changes by 2V each time and the power loss determination time under the set quantization threshold value, and make a voltage and threshold value matching table for the power loss detection device. Figure 2 ; Within the allowable measured line voltage range, when different voltages are input to the measured line, according to the voltage value collected by the voltage measurement circuit, look up the table to obtain a set quantization threshold value as the basis for power loss detection and judgment.
[0024] The power loss detection circuit determines whether there is a power loss by detecting whether the attenuation of the signal current is zero. Due to the residual voltage of the integration capacitor in the detection circuit, the detection current decays to zero much later than the actual line current decays to zero. A threshold value is set during the signal attenuation process. When the measured current is lower than the threshold value, it is determined that the measured point has a power loss, thus shortening the power loss detection time. When the measured line fluctuates within a certain voltage range, the voltage detection circuit will detect the voltage fluctuation in real time, and the single-chip microcomputer will match the corresponding threshold value by looking up the table to ensure that the power loss detection time is no more than 5 ms within the voltage range of 200V - 240V.
[0025] The above are only the preferred embodiments of the present invention, and do not impose any form of limitation on the present invention. Any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A power loss detection device, comprising a single-chip microcomputer, a voltage measurement circuit, a power loss detection circuit, and a power loss output I / O circuit, characterized in that: The single-chip microcomputer is bidirectionally connected to the voltage measurement circuit that real-time detects the voltage to be measured, the power loss detection circuit that determines whether the circuit to be measured loses power within no more than 5 ms, and the power loss output I / O circuit that outputs a status as a control signal for other control systems. The voltage measurement circuit real-time detects the specific data of voltage fluctuations, the power loss detection circuit detects current data, the single-chip microcomputer collects the output voltage signal of the voltage measurement circuit and the output current of the power loss detection circuit. Different set quantization threshold values are used under different real-time voltages. A threshold value is set during the process of the power loss detection circuit detecting current decay data. When the measured current in the power loss detection circuit is lower than the threshold value, the measured point loses power. The power loss output I / O circuit outputs a status as a control signal for other control systems. The output result of this status is 0. Conversely, the output status is 1, where 1 indicates power on. The voltage measurement circuit includes a first transformer, a first amplifier, and a first comparator. The S1 terminal of the first transformer is connected to the L terminal after passing through a resistor R4. The S2 terminal of the first transformer is connected to the N terminal. The S3 terminal of the first transformer is connected to the input terminal IN+ of the first amplifier. The S4 terminal of the first transformer is connected to the input terminal IN- of the first amplifier. Another path of the input terminal IN- of the first amplifier is connected to the output terminal OUT of the first amplifier after passing through a resistor R7. A capacitor C3 is connected in parallel with the resistor R7. The output terminal OUT of the first amplifier passes through its node with the resistor R7 and then one path is connected to the input terminal IN+ of the first comparator after passing through D1 and a resistor R3, and the other path is connected to the input terminal IN- of the first comparator after passing through D2 and a resistor R6. The power supply terminal V+ of the first comparator is connected to the input terminal IN- of the first comparator after passing through a resistor R1. The input terminal IN- of the first comparator passes through D3 and then one path is connected to the resistor R6 after passing through a resistor R8, and the other path is connected to the S3 terminal of the first transformer. A capacitor C4 is connected in parallel with the resistor R8. The power supply terminal V- of the first comparator is connected to the resistor R5 through the output terminal of D3. The other end of the resistor R5 is connected to the input terminal IN+ of the first comparator. A capacitor C1 is connected in parallel with the resistor R5. The output terminal OUT of the first comparator is connected to +5V after passing through a resistor R2, grounded after passing through a capacitor C2, and directly connected to the single-chip microcomputer.
2. The power-off detection device according to claim 1, characterized in that: The single-chip microcomputer uses a 32-bit single-chip microcomputer of the STM32 series. The single-chip microcomputer is connected to the voltage measurement circuit through the ADCV port on it, connected to the power loss detection circuit through the ADC1 port on it, and connected to the power loss output I / O circuit through the I / O port on it.
3. The power loss detection device according to claim 1, characterized in that: The power-off detection circuit includes a second comparator, a third comparator, and a fourth comparator. One path of the input terminal IN+ of the second comparator is connected to the input terminal IN- of the second comparator after passing through resistors R12, R11, and R14, and the other path is connected to the output terminal OUT of the second comparator after passing through resistor R10. A capacitor C5 is connected in parallel with resistor R10. Another path of the input terminal IN- of the second comparator is grounded after passing through resistor R16, and the other path is connected to the output terminal OUT of the second comparator after passing through a sliding resistor R15. The sliding end of the sliding resistor R15 is connected to the single-chip microcomputer, and a capacitor C6 is connected in parallel with resistor R16. One path of the output terminal OUT of the third comparator is energized and connected to the wire node between resistor R11 and resistor R14 through diode D6, and the other path is connected to the input terminal IN+ of the third comparator after passing through diode D2 and diode D5. And the wire between diode D2 and diode D5 is energized and connected to the wire node between resistor R11 and resistor R12. One path of the input terminal IN+ of the third comparator is energized and connected to the wire node between resistor R11 and resistor R14 through diode D4, and the other path is connected to the output terminal OUT of the fourth comparator after passing through resistor R13. The input terminal IN- of the third comparator is grounded through resistor R17. Another path of the output terminal OUT of the fourth comparator is connected to the input terminal IN- of the fourth comparator after passing through resistor R18. A capacitor C7 is connected in parallel with resistor R18. One path of the input terminal IN+ of the fourth comparator is connected to the S2 terminal of the second transformer through diode D9, and the other path is connected to the S4 terminal of the second transformer. A diode D8 with the opposite polarity direction is connected in parallel with diode D9. The S4 terminal of the second transformer is connected to the S1 terminal of the second transformer, and the S2 terminal of the second transformer is connected to the S3 terminal of the second transformer.
4. The power loss detection device according to claim 3, characterized in that: Both the first transformer and the second transformer are voltage dual-channel operational amplifiers of model TVA1421, and the first comparator, the second comparator, the third comparator, and the fourth comparator are all four-channel differential comparators of model OP07.
Citation Information
Patent Citations
AC / DC power failure monitoring system and method based on substation
CN109596880A
Power loss detection device
CN212275840U