CN115441399A - Leakage protection circuit, integrated circuit, electronic device, and method - Google Patents
Leakage protection circuit, integrated circuit, electronic device, and method Download PDFInfo
- Publication number
- CN115441399A CN115441399A CN202210917962.8A CN202210917962A CN115441399A CN 115441399 A CN115441399 A CN 115441399A CN 202210917962 A CN202210917962 A CN 202210917962A CN 115441399 A CN115441399 A CN 115441399A
- Authority
- CN
- China
- Prior art keywords
- circuit
- leakage
- current
- compensation
- detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02H—EMERGENCY PROTECTIVE CIRCUIT ARRANGEMENTS
- H02H3/00—Emergency protective circuit arrangements for automatic disconnection directly responsive to an undesired change from normal electric working condition with or without subsequent reconnection ; integrated protection
Landscapes
- Semiconductor Integrated Circuits (AREA)
- Measurement Of Current Or Voltage (AREA)
Abstract
The embodiment of the application provides an electric leakage protection circuit, an integrated circuit, electronic equipment and a method, wherein the electric leakage protection circuit comprises an electric leakage detection circuit, a compensation trigger circuit and an electric leakage compensation circuit, the electric leakage detection circuit comprises a detection capacitor and is used for connecting a circuit to be detected and charging the detection capacitor by using the electric leakage current of the circuit to be detected; the compensation trigger circuit is connected with the leakage detection circuit and used for detecting the magnitude of leakage current during the charging period of the detection capacitor and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; the leakage compensation circuit is connected to the compensation trigger circuit and used for providing compensation current corresponding to the leakage current for the circuit to be tested according to the trigger signal. The leakage protection circuit provided by the embodiment can effectively eliminate the influence of system leakage and improve the detection range and the accuracy of signals.
Description
Technical Field
The present application relates to the field of electronic circuit technology, and in particular, to a leakage protection circuit, an integrated circuit, an electronic device, and a method.
Background
The Internet of Things (IoT) is a highly integrated and comprehensive application of a new generation of information technology. The architecture of the Internet of things is divided into a sensing layer, a network layer and an application layer. The sensing layer of the Internet of things is composed of a sensor and a gateway, information is obtained through the sensor, and a control instruction is obtained through the gateway.
The sensor is used as the most basic link in the internet of things, and can condition (for example, acquisition, amplification, offset compensation, temperature compensation, linear compensation and the like) various weak signals (for example, pressure signals, gas signals and the like). However, during the small signal processing, any leakage in the system affects the quality of the small signal processing, thereby causing signal distortion. Therefore, how to perform leakage protection on the system is important.
Disclosure of Invention
In view of the above problems, embodiments of the present application provide a leakage protection circuit, an integrated circuit, an electronic device, and a method to solve the above technical problems.
The embodiment of the application is realized by adopting the following technical scheme:
a leakage protection circuit comprises a leakage detection circuit, a compensation trigger circuit and a leakage compensation circuit, wherein the leakage detection circuit comprises a detection capacitor and is used for connecting a circuit to be detected and charging the detection capacitor by using the leakage current of the circuit to be detected; the compensation trigger circuit is connected with the leakage detection circuit and used for detecting the magnitude of leakage current during the charging period of the detection capacitor and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; the leakage compensation circuit is connected to the compensation trigger circuit and used for providing compensation current corresponding to the leakage current for the circuit to be tested according to the trigger signal.
In some embodiments, a compensation trigger circuit includes a comparison circuit, a clock control circuit, and a counter; the comparison circuit is connected with the electric leakage detection circuit, preset with reference voltage and used for outputting a comparison signal according to the voltage of the detection capacitor and the reference voltage; the clock control circuit is connected with the comparison circuit and the electric leakage detection circuit and used for outputting a clock signal according to the comparison signal and controlling the electric leakage detection circuit to charge or discharge the detection capacitor through the clock signal; the counter is connected with the clock control circuit and used for detecting the magnitude of the leakage current during the charging period of the detection capacitor according to the clock signal and outputting a trigger signal when the leakage current is larger than or equal to a preset threshold value.
In some embodiments, the clock signal comprises a first level signal and a second level signal, and the leakage current comprises a first leakage current of the circuit to be tested leaking to the ground and a second leakage current between the circuit to be tested and the power supply; the clock control circuit is used for outputting a first level signal according to the comparison signal and outputting a second level signal after delaying for a preset time, and the leakage detection circuit is used for controlling the detection capacitor to discharge within the preset time according to the first level signal and charging the detection capacitor by using first leakage current according to the second level signal; or the clock control circuit is used for outputting a second level signal according to the comparison signal and outputting a first level signal after delaying for a preset time, and the leakage detection circuit is used for controlling the detection capacitor to discharge within the preset time according to the second level signal and charging the detection capacitor by using a second leakage current according to the first level signal.
In some embodiments, the counter is further configured to count according to a preset reference clock when the leakage detection circuit charges the detection capacitor with the first leakage current according to the second level signal, so as to detect a magnitude of the first leakage current; or, the counter is further configured to count according to a preset reference clock when the leakage detection circuit charges the detection capacitor with the second leakage current according to the first level signal, so as to detect a magnitude of the second leakage current.
In some embodiments, the clock control circuit includes a D flip-flop connected to the comparison circuit and an RS flip-flop connected to the D flip-flop.
In some embodiments, the leakage compensation circuit includes a compensation control circuit connected to the compensation trigger circuit and a current source unit connected to the compensation control circuit, and the compensation control circuit is configured to determine a magnitude of the leakage current according to the trigger signal and provide a compensation current corresponding to the magnitude of the leakage current to the circuit to be tested through the current source unit.
In some embodiments, the current source unit is a current source array, and the compensation control current is used for selecting a current source corresponding to the magnitude of the leakage current in the current source array according to the magnitude of the leakage current to provide the compensation current.
In some embodiments, the leakage detection circuit includes a first leakage detection circuit and a second leakage detection circuit, and the detection capacitor includes a first detection capacitor and a second detection capacitor; the first leakage detection circuit is used for connecting a circuit to be detected and charging the first detection capacitor by using first leakage current when the circuit to be detected leaks electricity to the ground; the second leakage detection circuit is used for connecting the circuit to be detected and charging the second detection capacitor by using second leakage current between the circuit to be detected and the power supply.
In some embodiments, the first leakage detection circuit includes a first switch, a second switch, and a first detection capacitor; one end of the first detection capacitor is connected with the power supply, and the other end of the first detection capacitor is connected with the first switch; the second switch is connected in parallel with two ends of the first detection capacitor; the connection node of the first detection capacitor and the first switch is connected with the compensation trigger circuit; the second leakage detection circuit comprises a third switch, a fourth switch and a second detection capacitor; one end of the second detection capacitor is grounded, the other end of the second detection capacitor is connected to the third switch, and the other end of the third switch is connected to the other end of the first switch; the fourth switch is connected in parallel with two ends of the second detection capacitor; the connection node of the second detection capacitor and the third switch is connected with the compensation trigger circuit; the connection node of the first switch and the third switch is used for connecting a circuit to be tested; the first switch, the second switch, the third switch and the fourth switch are controlled by a clock signal.
In some embodiments, the comparison circuit includes a first comparator and a second comparator, the reference voltage includes a first reference voltage and a second reference voltage; a first reference voltage is preset at a first input end of the first comparator, a second input end of the first comparator is connected to a connection node of the first detection capacitor and the first switch, and an output end of the first comparator is connected to the clock control circuit; the first input end of the second comparator is connected with the connecting node of the second detection capacitor and the third switch, the second input end is preset with a second reference voltage, and the output end is connected with the clock control circuit.
In some embodiments, the compensation trigger circuit further comprises a gating circuit connected between the comparison circuit and the clock control circuit and configured to select one of the first comparator and the second comparator to be connected to the clock control circuit.
In some embodiments, the current source unit includes a first current source unit and a second current source unit, the compensation control circuit is configured to determine a magnitude of a leakage current when the circuit to be tested leaks electricity to the ground according to the trigger signal, and provide a compensation current corresponding to the magnitude of the leakage current for the circuit to be tested through the first current source unit; the compensation control circuit is also used for determining the magnitude of leakage current between the circuit to be tested and the power supply according to the trigger signal and providing compensation current corresponding to the leakage current for the circuit to be tested through the second current source unit.
An embodiment of the present application further provides an integrated circuit including the leakage protection circuit described above.
The embodiment of the application further provides an electronic device, which comprises a device body and the integrated circuit arranged in the device body.
The embodiment of the present application further provides a leakage protection method, which is applied to any one of the above leakage protection circuits, and the method includes charging a detection capacitor by using a leakage current of a circuit to be detected; detecting the magnitude of leakage current during the charging period of the detection capacitor, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and providing a compensation current corresponding to the leakage current for the circuit to be tested according to the trigger signal.
In the leakage protection circuit, the integrated circuit, the electronic device and the method provided by the embodiment of the application, the leakage protection circuit is provided with a leakage detection circuit, a compensation trigger circuit and a leakage compensation circuit, and the leakage detection circuit comprises a detection capacitor; charging the detection capacitor by using the leakage current of the circuit to be detected through the leakage detection circuit; detecting the magnitude of leakage current during the charging period of the detection capacitor through the compensation trigger circuit, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and finally, providing a compensation current corresponding to the leakage current for the circuit to be detected through the leakage compensation circuit according to the trigger signal, thereby effectively eliminating the influence of system leakage and improving the detection range and precision of the signal.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a block diagram of a leakage protection circuit provided in an embodiment of the present application.
Fig. 2 shows another block diagram of the leakage protection circuit provided in the embodiment of the present application.
Fig. 3 shows another block diagram of the leakage protection circuit provided in the embodiment of the present application.
Fig. 4 shows a schematic circuit structure diagram of a leakage protection circuit provided in an embodiment of the present application.
Fig. 5 shows a schematic structural diagram of a reference voltage generating circuit provided in an embodiment of the present application.
Fig. 6 shows a schematic circuit diagram of negative leakage protection provided in the embodiment of the present application.
Fig. 7 shows a schematic circuit diagram of the forward leakage protection provided by the embodiment of the present application.
Fig. 8 shows a schematic flowchart of a leakage protection method provided in an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
In order to make those skilled in the art better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be apparent that the described embodiments are only a few embodiments of the present application, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
As shown in fig. 1, fig. 1 schematically shows a block diagram of an electrical leakage protection circuit 100 provided in an embodiment of the present application, where the electrical leakage protection circuit 100 may be connected to a circuit to be tested 10 and perform electrical leakage protection on the circuit to be tested 10. In measurement applications, the circuit under test 10 may be a sensor, which may be a pressure sensor, a temperature sensor, a humidity sensor, or the like. Taking a pressure sensor as an example, the leakage protection circuit 100 can perform leakage protection on a pressure detection system formed by a wheatstone bridge in the pressure sensor. Of course, the embodiments of the present application can also be applied to other fields, and the circuit to be tested 10 can also be any other circuit with a risk of leakage.
The leakage protection circuit 100 includes a leakage detection circuit 110, a compensation trigger circuit 120, and a leakage compensation circuit 130. The leakage detection circuit 110 includes a detection capacitor, and the leakage detection circuit 110 is configured to connect to the circuit to be detected 10 and charge the detection capacitor with a leakage current of the circuit to be detected 10; the compensation trigger circuit 120 is connected to the leakage detection circuit 110, and is configured to detect a magnitude of a leakage current during a period of detecting charging of the capacitor, and output a trigger signal when the leakage current is greater than or equal to a preset threshold; the leakage compensation circuit 130 is connected to the compensation trigger circuit 120, and is configured to provide a compensation current corresponding to the leakage current for the circuit to be tested 10 according to the trigger signal.
When the circuit 10 to be detected leaks electricity, the detection capacitor is charged by using the leakage current, and in the charging time window of the detection capacitor, the magnitude of the leakage current can be detected because the charging current of the detection capacitor is related to the leakage current. When the leakage current is greater than or equal to the preset threshold, it indicates that the leakage of the circuit to be tested 10 exceeds the given leakage threshold, which may affect the detection of the signal. At this time, the compensation current is provided to the circuit to be detected 10, the compensation current is a current opposite to the direction of the leakage current, the compensation current can completely compensate the leakage current, and can also partially compensate the leakage current to reduce the leakage current to a given threshold value, so that the influence of the leakage current on signal detection is eliminated, and the precision of the signal detection is improved.
The leakage protection circuit provided by the embodiment of the application is provided with a leakage detection circuit, a compensation trigger circuit and a leakage compensation circuit, wherein the leakage detection circuit comprises a detection capacitor; charging the detection capacitor by using the leakage current of the circuit to be detected through the leakage detection circuit; detecting the magnitude of leakage current during the charging period of the detection capacitor through a compensation trigger circuit, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and finally, providing a compensation current corresponding to the leakage current for the circuit to be detected through the leakage compensation circuit according to the trigger signal, thereby effectively eliminating the influence of system leakage and improving the detection range and precision of the signal.
As shown in fig. 2, the embodiment of the present application further provides a leakage protection circuit 200, where the leakage protection circuit 200 has a leakage detection circuit 210, a compensation trigger circuit 220 and a leakage compensation circuit 230 that are the same as the leakage protection circuit 100, and on this basis, the compensation trigger circuit 220 includes a comparison circuit 221, a clock control circuit 222 and a counter 223.
The comparison circuit 221 is connected to the leakage detection circuit 210, preset with a reference voltage, and configured to output a comparison signal according to the voltage of the detection capacitor and the reference voltage; the clock control circuit 222 is connected to the comparison circuit 221 and the leakage detection circuit 210, and configured to output a clock signal according to the comparison signal, and control the leakage detection circuit 210 to charge or discharge the detection capacitor through the clock signal; the counter 223 is connected to the clock control circuit 222, and is configured to detect a magnitude of the leakage current during the capacitor charging period according to the clock signal, and output a trigger signal when the leakage current is greater than or equal to a preset threshold.
In this embodiment, the leakage current includes at least one of a first leakage current of the circuit to be tested 10 leaking to the ground and a second leakage current between the circuit to be tested 10 and the power supply. The clock signal includes a first level signal and a second level signal. The clock control circuit 222 is further configured to output a first level signal according to the comparison signal, delay a preset time, and output a second level signal, and the leakage detection circuit 210 is configured to control the detection capacitor to discharge within the preset time according to the first level signal, and charge the detection capacitor with a first leakage current according to the second level signal; or, the clock control circuit 222 is configured to output a second level signal according to the comparison signal, delay a preset time, and output a first level signal, and the leakage detection circuit 210 is configured to control the detection capacitor to discharge within the preset time according to the second level signal, and charge the detection capacitor with a second leakage current according to the first level signal.
Specifically, the comparison circuit 221 in this embodiment is connected to the clock control circuit 222 to form an oscillation circuit, so that the clock control circuit 222 alternately outputs a first level signal and a second level signal at a certain frequency, thereby controlling the detection capacitor to alternately discharge and charge at a certain frequency. When the circuit to be tested 10 generates a leakage current and the leakage current is the first leakage current, the second level signal may control the leakage detecting circuit 210 to charge the detection capacitor with the first leakage current in a time period when the clock control circuit 222 outputs the second level signal. When the voltage charged to the two ends of the detection capacitor can change the output of the comparison circuit 221, the comparison circuit 221 outputs a comparison signal to the clock control circuit 222, and after receiving the comparison signal, the clock control circuit 222 outputs a first level signal to the leakage detection circuit 210 to control the leakage detection circuit 210 to discharge the detection capacitor, that is, the detection capacitor is not charged by the first leakage current. Meanwhile, the clock control circuit 222 starts to delay, which is the discharge time of the detection capacitor, and after the delay for a preset time, the clock control circuit 222 outputs the second level signal to the leakage detection circuit 210 again, so that the leakage detection circuit 210 performs a new round of detection on the first leakage current. In this embodiment, the clock control circuit 222 may include a D flip-flop and an RS flip-flop. Through the process, the continuous detection of the first leakage current of the circuit to be detected for the ground leakage can be realized, and the quick response can be further carried out on the leakage of the circuit to be detected 10.
When the circuit to be tested 10 generates a leakage current and the leakage current is the second leakage current, the first level signal may control the leakage detecting circuit 210 to charge the detection capacitor with the second leakage current in a time period when the clock control circuit 222 outputs the first level signal. When the voltage charged to the two ends of the detection capacitor can change the output of the comparison circuit 221, the comparison circuit 221 outputs a comparison signal to the clock control circuit 222, and after receiving the comparison signal, the clock control circuit 222 outputs a second level signal to the leakage detection circuit 210 to control the leakage detection circuit 210 to discharge the detection capacitor, that is, the detection capacitor is not charged by using the second leakage current. Meanwhile, the clock control circuit 222 starts to perform a delay, during which the discharging time of the capacitor is also detected, and after a preset time is delayed, the clock control circuit 222 outputs the first level signal to the leakage detection circuit 210 again, so that the leakage detection circuit 210 performs a new round of detection on the second leakage current. In this embodiment, the clock control circuit 222 may include a D flip-flop and an RS flip-flop. Through the process, the continuous detection of the second leakage current of the circuit to be tested for the power leakage can be realized, and the quick response can be further carried out on the leakage of the circuit to be tested 10.
Alternatively, the first leakage current and the second leakage current may be alternately detected by a leakage detecting circuit 210 and a comparing circuit 221 in a time-sharing manner; the detection of the first leakage current and the second leakage current may be performed by the two leakage detection circuits 210 and the two comparison circuits 221, respectively.
Furthermore, the counter is also used for counting according to a preset reference clock when the leakage detection circuit charges the detection capacitor by using the first leakage current according to the second level signal so as to detect the magnitude of the first leakage current; or, the counter is further configured to count according to a preset reference clock when the leakage detection circuit charges the detection capacitor with the second leakage current according to the first level signal, so as to detect a magnitude of the second leakage current.
During the charging of the detection capacitor, the counter 223 starts counting. In this embodiment, when the leakage current is the first leakage current, the counter 223 counts by using the high frequency reference clock within the pulse width window of the second level signal to detect the magnitude of the first leakage current. Wherein the high frequency reference clock is the input clock of the counter 223. The pulse width window of the second level signal is also the high level time window of the second level signal, and the detection capacitor is charged in the high level time window. In the charging time window of the detection capacitor, if the high-frequency count is less than or equal to the given count threshold, that is, it indicates that the first leakage current is greater than or equal to the preset threshold, and the leakage of the circuit to be detected 10 to the ground exceeds the given range, at this time, the counter 223 outputs a trigger signal to the leakage compensation circuit 230 to trigger the leakage compensation circuit 230 to compensate the first leakage current.
When the leakage current is the second leakage current, the counter 223 counts by using the high frequency reference clock within the pulse width window of the first level signal to detect the magnitude of the second leakage current. Wherein the high frequency reference clock is the input clock of the counter 223. The pulse width window of the first level signal is also the high level time window of the first level signal, and in the high level time window, the detection capacitor is charging. In the charging time window of the detection capacitor, if the high-frequency count is less than or equal to the given count threshold, that is, it indicates that the second leakage current is greater than or equal to the preset threshold, the leakage of the circuit to be detected 10 to the power supply exceeds the given range, at this time, the counter 223 outputs a trigger signal to the leakage compensation circuit 230 to trigger the leakage compensation circuit 230 to compensate the second leakage current.
It should be noted that the less the counter 223 counts at high frequency, i.e., the less time it takes to detect the capacitor charging to the reference voltage, the greater the leakage current. Through the above process of the counter 223, the magnitudes of the first leakage current and the second leakage current can be accurately detected, and leakage compensation is triggered accordingly.
Further, the leakage compensation circuit 230 provided by the present embodiment includes a compensation control circuit 231 connected to the compensation trigger circuit 220 and a current source unit 232 connected to the compensation control circuit 231, and the current source unit 232 is further connected to the circuit under test 10. The compensation control circuit 231 is configured to determine a magnitude of the leakage current according to the trigger signal, and provide a compensation current corresponding to the magnitude of the leakage current for the circuit to be tested 10 through the current source unit 232. When the compensation control circuit 231 receives the trigger signal output by the counter 223, the compensation control circuit 231 may determine the magnitude of the leakage current, and then control the current source unit 232 to generate a reverse current opposite to the direction of the leakage current, and input the reverse current to the circuit under test 10 to counteract the influence of the leakage current. In this embodiment, the magnitude of the reverse current may be equal to the magnitude of the leakage current, so as to completely offset the leakage current and eliminate the influence of the leakage current. In some embodiments, the magnitude of the reverse current may be greater than a difference between the leakage current and a predetermined threshold, so as to partially cancel the leakage current, and reduce the influence of the leakage current to within a given threshold.
In this embodiment, the current source unit 232 may be a current source array. The compensation control circuit 231 is configured to select a current source corresponding to the magnitude of the leakage current in the current source array according to the magnitude of the leakage current, so as to provide the compensation current. Through the current source array, the current corresponding to the magnitude of the leakage current can be matched, and then the leakage current can be dynamically compensated.
Further, when the circuit to be tested 10 leaks to the ground, the leakage is negative leakage, that is, the first leakage current flows to the ground, and the first leakage current is negative leakage current; when the circuit to be tested 10 leaks to the power supply, the leakage is positive leakage, that is, a second leakage current leaks from the power supply, and the second leakage current is a positive leakage current. As shown in fig. 3 and 4, in the present embodiment, the leakage detecting circuit 210 includes a first leakage detecting circuit 211 and a second leakage detecting circuit 212, the first leakage detecting circuit 211 includes a first detecting capacitor C1, and the second leakage detecting circuit 212 includes a second detecting capacitor C2. The first leakage detection circuit 211 is configured to be connected to the circuit to be detected 10, and charge the first detection capacitor C1 with a leakage current generated when the circuit to be detected 10 leaks to the ground, that is, the first leakage detection circuit 211 is configured to detect a negative leakage current. The second leakage detection circuit 212 is configured to connect the circuit to be detected 10, and charge the second detection capacitor C2 by using a leakage current between the circuit to be detected 10 and a power supply, that is, the second leakage detection circuit 212 is configured to detect a forward leakage current. The leakage detection circuit 210 detects the positive and negative bidirectional leakage, so that the leakage protection circuit 200 can compensate the positive and negative bidirectional leakage, and further eliminate the influence of the positive and negative bidirectional leakage on signal detection.
Specifically, as shown in fig. 3 and 4, the first leakage detecting circuit 211 includes a first switch S1, a second switch S2 and a first detecting capacitor C1; one end of the first detection capacitor C1 is connected to a power supply VDD, and the other end is connected to the first switch S1; the second switch S2 is connected in parallel with two ends of the first detection capacitor C1; the connection node of the first detection capacitor C1 and the first switch S1 is connected with the compensation trigger circuit; the second leakage detection circuit 212 includes a third switch S3, a fourth switch S4 and a second detection capacitor C2; one end of the second detection capacitor C2 is grounded, the other end of the second detection capacitor C2 is connected to one end of a third switch S3, and the other end of the third switch S3 is connected to the other end of the first switch S1; the fourth switch S4 is connected in parallel with two ends of the second detection capacitor C2; the connection node of the second detection capacitor C2 and the third switch S3 is connected with the compensation trigger circuit; the connection node of the first switch S1 and the third switch S3 is used for connecting a circuit to be tested 10; the first switch S1, the second switch S2, the third switch S3 and the fourth switch S4 are controlled by a clock signal.
The comparison circuit 221 includes a first comparator CMP1 and a second comparator CMP2. The reference voltages include a first reference voltage Vpos and a second reference voltage Vneg, and the first reference voltage Vpos and the second reference voltage Vneg have the same magnitude. A first input terminal of the first comparator CMP1 is configured to access the first reference voltage Vpos, a second input terminal of the first comparator CMP1 is connected to a connection node between the first detection capacitor C1 and the first switch S1, and an output terminal of the first comparator CMP1 is connected to the clock control circuit 222; the first input terminal of the second comparator CMP2 is connected to the connection node between the second detection capacitor C2 and the third switch S3, the second input terminal is used for accessing the second reference voltage Vneg, and the output terminal is connected to the clock control circuit 222. In this embodiment, the first input terminal of the first comparator CMP1 is a non-inverting input terminal, and the second input terminal is an inverting input terminal; the first input terminal of the second comparator CMP2 is a non-inverting input terminal, and the second input terminal is an inverting input terminal.
The first reference voltage Vpos and the second reference voltage Vneg may be generated by an external reference voltage generating circuit. As shown in fig. 5, the reference voltage generating circuit may include a first MOS transistor Q1, a second MOS transistor Q2, a third MOS transistor Q3, a fourth MOS transistor Q4, a first resistor R1, a second resistor R2, a third resistor R3, and a fourth resistor R4. For example, the first MOS transistor Q1 and the third MOS transistor Q3 are N-MOS transistors, and the second MOS transistor Q2 and the fourth MOS transistor Q4 are P-MOS transistors, the drain of the first MOS transistor Q1 is connected to a power supply VDD through a first resistor R1, the source is connected to the source of the second MOS transistor Q2, and the gate is connected to the gate of the third MOS transistor Q3; the drain electrode of the first MOS tube Q1 is connected with the grid electrode; the drain electrode of the second MOS tube Q2 is grounded through a second resistor R2, and the grid electrode of the second MOS tube Q2 is connected with the grid electrode of the fourth MOS tube Q4; the drain electrode of the second MOS tube Q2 is connected with the grid electrode; the drain electrode of the third MOS transistor Q3 is connected with a power supply VDD through a third resistor R3, and the source electrode of the third MOS transistor Q3 is connected with the source electrode of the fourth MOS transistor Q4; the drain of the fourth MOS transistor Q4 is grounded through a fourth resistor R4. A connection node of the third MOS transistor Q3 and the third resistor R3 is connected to a first input terminal of the first comparator CMP1 to supply the first reference voltage Vpos to the first comparator CMP 1; a connection node of the fourth MOS transistor Q4 and the fourth resistor R4 is connected to the second input terminal of the second comparator CMP2 to supply the second reference voltage Vneg to the second comparator CMP2. The current Ithreshold is a threshold current, the first reference voltage Vpos is (VDD-Ithreshold R), the second reference voltage Vneg is (Ithreshold R), and the resistances of the first resistor R1 to the fourth resistor R4 are all R.
As shown in fig. 4, in this embodiment, the leakage protection circuit further includes a gating circuit 240. The gating circuit 240 is connected between the comparing circuit 221 and the clock control circuit 222, and is used to select one of the first comparator CMP1 and the second comparator CMP2 to be connected to the clock control circuit 222. The gate circuit 240 includes a switch Smux1, a switch Smux2, a switch Smux3, a switch Smux4, a switch Smux5, and a switch Smux6. The clock control circuit 222 includes a D flip-flop and an RS flip-flop. A switch Smux1 and a switch Smux2 connected in series with each other are connected between the output terminal of the first comparator CMP1 and the output terminal of the second comparator CMP2. The input end D of the D flip-flop is connected to the connection node of the switch Smux1 and the switch Smux2. The output end Q0 of the D flip-flop and a preset RST signal are connected to the reset end R0 of the D flip-flop through an OR gate, and the RST signal is a circuit initial reset signal. A switch Smux3 and a switch Smux4 which are mutually connected in series are connected between the output end of the first comparator CMP1 and the output end Q0 of the D trigger; a switch Smux5 and a switch Smux6 connected in series with each other are connected between the output terminal of the second comparator CMP2 and the output terminal Q0 of the D flip-flop. The set end S of the RS trigger is connected to a connection node of the switch Smux3 and the switch Smux4; the reset terminal R1 of the RS flip-flop is connected to the connection node of the switches Smux5 and Smux6.
As shown in fig. 3 and 4, the counter 223 includes a first counter and a second counter. The RS flip-flop includes a first output Q1 and a second output QB, where the first output Q1 and the second output QB are two complementary outputs, that is, when the first output Q1 outputs a high level, the second output QB outputs a low level; when the first output terminal Q1 outputs a low level, the second output terminal QB outputs a high level. The enable terminal EN1 of the first counter is connected with the first output end Q of the RS trigger, and the enable terminal EN2 of the second counter is connected with the second output end QB of the RS trigger. The clock input end CLK1 of the first counter and the clock input end CLK2 of the second counter are both connected to the high frequency reference clock, and the output ends of the first counter and the second counter are both connected to the leakage compensation circuit 230.
The leakage compensation circuit 230 includes a compensation control circuit 231 and a current source unit 232. The Compensation control circuit 231 is an Auto-Current Compensation (Auto-Current Compensation) circuit, and the Current source unit 232 is a Current source array. The input terminal of the compensation control circuit 231 is connected to the output terminals of the first counter and the second counter, and the output terminal of the compensation control circuit 231 is connected to the current source array. The current source array comprises a positive current source array and a negative current source array connected with the positive current source array. One end of each forward current source in the forward current source array is connected to the circuit to be tested 10, and the other end is connected to a power supply VDD through a switch; one end of each positive current source in the negative current source array is connected to the circuit to be tested 10, and the other end is grounded through the switch.
The principle of the leakage protection circuit provided in this embodiment will be described below with reference to fig. 6 to 7.
The switch Smux1, the switch Smux2, the switch Smux3, the switch Smux4, the switch Smux5, and the switch Smux6 may be controlled by external timing. By controlling the timing of the switches, switching between positive leakage protection and negative leakage protection is possible.
As shown in fig. 6, when the switch Smux1, the switch Smux3, and the switch Smux5 are closed and the switch Smux2, the switch Smux4, and the switch Smux6 are open, the leakage detection system performs negative leakage protection, and the current Ileakage is a negative leakage current flowing from the circuit to be measured 10 to the ground. At this time, the output terminal of the first comparator CMP1 is connected to the input terminal D of the D flip-flop and the set terminal S of the RS flip-flop. The reset end R0 of the D trigger is connected with the output end Q0 of the D trigger, and the reset end R1 of the RS trigger is connected between the output end Q0 of the D trigger and the reset end R0 of the D trigger. The clock input end CLK0 of the D flip-flop is connected with a high-frequency reference clock. A first output end Q1 of the RS flip-flop outputs a first clock signal CK1 to the leakage detection circuit 210 to control the on/off of the second switch S2 and the third switch S3; the second output terminal QB of the RS flip-flop outputs the second clock signal CK2 to the leakage detecting circuit 210 to control the on/off of the first switch S1 and the fourth switch S4. And the first output end Q1 of the RS trigger outputs a first clock signal CK1 to the first counter; the second output terminal QB of the RS flip-flop outputs the second clock signal CK2 to the second counter. In this embodiment, the first level signal is a first clock signal CK1=1 and a second clock signal CK2=0, that is, the first clock signal is a high level signal and the second clock signal is a low level signal; the second level signals are the first clock signal CK1=0 and the second clock signal CK2=1, that is, the first clock signal is a low level signal and the second clock signal is a high level signal. It is noted that the first clock signal and the second clock signal are a set of non-overlapping clock signals.
When the RS flip-flop outputs the second level signal, i.e., the first clock signal CK1=0 and the second clock signal CK2=1, the first switch S1 and the fourth switch S4 are respectively controlled by the second clock signal CK2 to be turned on, and the second switch S2 and the third switch S3 are respectively controlled by the first clock signal CK1 to be turned off. At this time, the leakage of the power supply VDD and the turned-on first switch S1 provide a charging loop for the detection capacitor C1, the detection capacitor C1 starts to be charged, and the charging current is leakage current Ileakage. In the process of charging the sensing capacitor C1, the node voltage Va, which is an input voltage of the inverting input terminal of the first comparator CMP1, decreases from the power supply voltage, and when the sensing capacitor C1 is charged until the node voltage Va is less than the first reference voltage Vpos, the first comparator CMP1 outputs a high level signal. When the output of the first comparator CMP1 changes from a low level signal to a high level signal, the high level signal is input to the set terminal S of the RS flip-flop, so that the first clock signal CK1 output by the first output terminal Q1 of the RS flip-flop is inverted from 0 to 1, and the second clock signal CK2 output by the second output terminal QB of the RS flip-flop is inverted from 1 to 0. Meanwhile, when the output of the first comparator CMP1 is converted from a low-level signal to a high-level signal, and after the high-frequency reference clock edge of the D flip-flop is triggered, the output end Q0 of the D flip-flop outputs the high-level signal, and the high-level signal output by the D flip-flop and the RST signal are subjected to or operation and then reset the D flip-flop, so that the output end Q0 of the D flip-flop is converted into the low-level signal.
At this time, the RS flip-flop outputs the first level signal, that is, the first clock signal CK1=1 and the second clock signal CK2=0, so that the first switch S1 is turned off, the second switch S2 is turned on, the third switch S3 is turned on, and the fourth switch S4 is turned off. The sensing capacitor C1 starts discharging through the turned-on second switch S2, so that the node voltage Va gradually increases to the power supply voltage. Meanwhile, the D flip-flop starts to delay, and after the delay for the preset time Tdelay, the D flip-flop outputs a high pulse signal to the reset terminal R1 of the RS flip-flop, so that the RS flip-flop is reset, further, the first clock signal is inverted to CK1=0, the second clock signal is inverted to CK2=1, and the detection capacitor starts to perform a new round of charging. In this process, the discharging time of the capacitor C1 is detected as a preset time Tdelay, the charging time is (Ithreshold R C1/ilekage), and the low-frequency oscillation period T is (Tdelay + Ithreshold R C1/ilekage).
During the charging process of the detection capacitor C1, the enable terminal EN2 of the second counter becomes high level due to the first clock signal CK1=0 and the second clock signal CK2=1, and the second counter starts to operate. In the input clock high-frequency reference clock of the second counter, in a charging time window (Ithreshold R C1/Ileakage) of the detection capacitor C1, since the charging current of the detection capacitor C1 is the leakage current Ileakage, the high-frequency counting result of the second counter can directly reflect the magnitude of the leakage current Ileakage. Further, if the high frequency count is less than a given count threshold Nthreshold, i.e., ithreshold R C1/Ileakage
* Fclk < nth, it can be deduced that ilekage > Ithreshold R C1/(Fclk nth), i.e. the leakage current ilekage exceeds a predetermined leakage threshold, ithreshold R C1 | h
(Fclk × nth) is also a preset leakage threshold.
When the leakage current Ileakage exceeds the preset leakage threshold, the compensation control circuit 231 selects a forward current corresponding to the leakage current Ileakage by controlling a switch in the forward current source array and inputs the forward current to the circuit to be detected 10, so as to dynamically compensate the circuit to be detected 10. Alternatively, the output current of each current source in the forward current source array may be the same or different, and the compensation control circuit 231 may select to connect a current source with an appropriate output current to the circuit under test to compensate for the leakage current Ileakage, or may select to simultaneously connect a plurality of current sources to the circuit under test 10 to superimpose a sufficient output current to compensate for the leakage current Ileakage. In other words, compensation can be performed by switching the switched-in current sources, and compensation can also be performed by controlling the number of switched-in current sources.
As shown in fig. 7, when the switch Smux2, the switch Smux4, and the switch Smux6 are closed and the switch Smux1, the switch Smux3, and the switch Smux5 are open, the leakage detection system performs forward leakage protection, and the current Ileakage is a forward leakage current flowing from the power supply VDD to the circuit under test 10. At this time, the output terminal of the second comparator CMP2 is connected to the input terminal D of the D flip-flop and the reset terminal R1 of the RS flip-flop. The reset end R0 of the D trigger is connected with the output end Q0 of the D trigger, and the reset end R1 of the RS trigger is connected between the output end Q0 of the D trigger and the reset end R0 of the D trigger. The clock input end CLK0 of the D flip-flop is connected with a high-frequency reference clock. A first output end Q1 of the RS flip-flop outputs a first clock signal CK1 to the leakage detection circuit 210 to control the on/off of the second switch S2 and the third switch S3; the second output terminal QB of the RS flip-flop outputs the second clock signal CK2 to the leakage detecting circuit 210 to control the on/off of the first switch S1 and the fourth switch S4. A first output end Q1 of the RS trigger outputs a first clock signal CK1 to the first counter; the second output terminal QB of the RS flip-flop outputs the second clock signal CK2 to the second counter. In this embodiment, the first level signal is a first clock signal CK1=1 and a second clock signal CK2=0, that is, the first clock signal is a high level signal and the second clock signal is a low level signal; the second level signals are the first clock signal CK1=0 and the second clock signal CK2=1, that is, the first clock signal is a low level signal and the second clock signal is a high level signal. It is noted that the first clock signal and the second clock signal are a set of non-overlapping clock signals.
When the RS flip-flop outputs the first level signal, i.e., the first clock signal CK1=1 and the second clock signal CK2=0, the first switch S1 and the fourth switch S4 are respectively controlled by the second clock signal CK2 to be turned off, and the second switch S2 and the third switch S3 are respectively controlled by the first clock signal CK1 to be turned on. The power supply VDD and the conducting third switch S3 provide a charging loop for the detection capacitor C2, the detection capacitor C2 starts to be charged, and the charging current is the leakage current Ileakage. In the process of charging the detection capacitor C2, the node voltage Vb increases from zero, the node voltage Vb is the input voltage of the non-inverting input terminal of the second comparator, and when the detection capacitor C2 is charged until the node voltage Va is greater than the second reference voltage Vneg, the second comparator CMP2 outputs a high level signal. When the output of the second comparator CMP2 changes from a low-level signal to a high-level signal, and after the high-frequency reference clock edge of the D flip-flop is triggered, the output Q0 of the D flip-flop outputs a high-level signal to the set terminal S of the RS flip-flop, so that the first clock signal CK1=0 output by the first output Q1 of the RS flip-flop, and the second clock signal CK2=1 output by the second output QB of the RS flip-flop are enabled. When the output end Q0 of the D trigger is changed into high level, the high level signal and the RST signal output by the D trigger are OR-operated and then the D trigger is reset, so that the output end Q0 of the D trigger is converted into a low level signal.
At this time, when the RS flip-flop outputs the second level signal, i.e., the first clock signal CK1=0 and the second clock signal CK2=1, the first switch S1 is turned on, the second switch S2 is turned off, the third switch S3 is turned off, and the fourth switch S4 is turned on. The detection capacitor C2 starts to discharge through the turned-on fourth switch S3, so that the node voltage VB gradually decreases to zero. Meanwhile, the D flip-flop starts to delay, and after the delay for the preset time Tdelay, the D flip-flop outputs a high pulse signal to the set terminal S of the RS flip-flop, so that the first clock signal CK1=1 and the second clock signal CK2=0 make the detection capacitor C2 start to charge for a new round. In this process, the discharging time of the capacitor C2 is detected as a preset time Tdelay, the charging time is (Ithreshold R × C2/ilekage), and the low-frequency oscillation period T is (Tdelay + Ithreshold R × C1/ilekage).
During the charging process of the detection capacitor C2, the enable terminal EN1 of the first counter becomes high level due to the first clock signal CK1=1 and the second clock signal CK2=0, and the first counter starts to operate. In the input clock high-frequency reference clock of the first counter, in a charging time window (Ithreshold R C2/Ileakage) of the detection capacitor C2, the charging current of the detection capacitor C2 is the leakage current Ileakage, so the high-frequency counting result of the first counter can directly reflect the magnitude of the leakage current Ileakage. Further, if the high frequency count is less than a given count threshold Nthreshold, i.e., ithreshold R C2/Ileakage
* Fclk < nth, it can be deduced that ilekage > Ithreshold R C2/(Fclk nth), i.e. the leakage current ilekage exceeds a predetermined leakage threshold, ithreshold R C1 | h
(Fclk × nth) is also a preset leakage threshold.
When the leakage current Ileakage exceeds the preset leakage threshold, the compensation control circuit 231 selects a negative current corresponding to the leakage current Ileakage by controlling a switch in the negative current source array and inputs the negative current to the circuit to be detected 10, so as to dynamically compensate the circuit to be detected 10. Alternatively, the output currents of each current source in the negative current source array may be the same or different, and the compensation control circuit 231 may select to connect a current source with an appropriate output current to the circuit to be tested to compensate for the leakage current Ileakage, or may select to simultaneously connect a plurality of current sources to the circuit to be tested 10 to superimpose sufficient output currents to compensate for the leakage current Ileakage. In other words, it is possible to compensate by switching the switched-in current sources, and also by controlling the number of switched-in current sources.
In some embodiments, a smaller leakage threshold may be set for identifying leakage. For example, when the high-frequency count of the counter 223 is smaller than a count threshold that is larger than the count threshold nth, it indicates that the circuit under test 10 has an electric leakage; when the high frequency count of the counter 223 is smaller than the count threshold value nth, it indicates that the leakage of the circuit under test 10 exceeds the preset leakage threshold value.
As shown in fig. 3-4 and 6-7, the first branch formed by the first leakage detecting circuit 211 and the first comparator CMP1 and the second branch formed by the second leakage detecting circuit 212 and the second comparator CMP2 are symmetric to each other, and the operating clock levels are opposite, so that in the leakage protection circuit of this embodiment, the first branch and the second branch may be set at the same time, and the positive leakage detection and the negative leakage detection are performed through two different branches, respectively; or only the first branch or the second branch can be arranged, and under the action of the clock signal, the positive electric leakage detection and the negative electric leakage detection are alternately carried out through a single branch in a time-sharing manner.
The leakage protection circuit provided by the embodiment can realize different types of leakage detection through the first detection capacitor or the second detection capacitor (i.e. a single detection capacitor). When the circuit 10 to be tested has positive and negative leakage, a closed loop feedback is formed by detecting the charge and discharge of a capacitor, a comparator, a D trigger, an RS trigger and the like to form a low-frequency oscillator, the oscillation period T of the low-frequency oscillator is (Tdelay + Ithreshold R C1/Ileakage), a low-frequency clock signal with a high low-level duty ratio can be formed by adjusting the preset time Tdelay, the low-level time window of the low-frequency clock signal indicates a charging time window of the detection capacitor, and the high-level time window indicates a discharging time window of the detection capacitor. And then, the counter 223 counts the high-frequency reference clock in a low-level time window of the low-frequency oscillator in an accumulated manner, and when the positive and negative leakage exceeds a certain range, the system outputs related identification bits (NegSideLeak and PosSideLeak) to perform leakage identification. Meanwhile, when the positive and negative leakage currents exceed a given range, the leakage compensation circuit 230 can be activated to perform reverse current cancellation, so that the influence of the leakage current is effectively eliminated, and the detection range and the detection precision of the signal are improved.
The embodiment of the present application further provides an integrated circuit, which includes the leakage protection circuit 100 or the leakage protection circuit 200. In this embodiment, the integrated circuit may be a leakage protection chip.
The integrated circuit provided by the embodiment is provided with a leakage detection circuit, a compensation trigger circuit and a leakage compensation circuit, wherein the leakage detection circuit comprises a detection capacitor; charging the detection capacitor by using the leakage current of the circuit to be detected through the leakage detection circuit; detecting the magnitude of leakage current during the charging period of the detection capacitor through the compensation trigger circuit, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and finally, providing a compensating current corresponding to the leakage current for the circuit to be detected through the leakage compensating circuit according to the trigger signal, thereby effectively eliminating the influence of system leakage and improving the detection range and precision of the signal.
The embodiment of the application also provides the electronic equipment, the electronic equipment main body and the integrated circuit arranged in the electronic equipment main body. In this embodiment, the electronic device includes, but is not limited to, at least one sensor of a temperature sensor, a pressure sensor, an infrared sensor, an ultrasonic sensor, a humidity sensor, an illumination sensor, and a gravity sensor.
The electronic device provided by the embodiment is provided with an electric leakage detection circuit, a compensation trigger circuit and an electric leakage compensation circuit, wherein the electric leakage detection circuit comprises a detection capacitor; charging a detection capacitor by using the leakage current of the circuit to be detected through a leakage detection circuit; detecting the magnitude of leakage current during the charging period of the detection capacitor through a compensation trigger circuit, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and finally, providing a compensating current corresponding to the leakage current for the circuit to be detected through the leakage compensating circuit according to the trigger signal, thereby effectively eliminating the influence of system leakage and improving the detection range and precision of the signal.
As shown in fig. 8, the present embodiment further provides a leakage protection method 300, which is applied to the leakage protection circuit 100 or the leakage protection circuit 200. The leakage protection method 300 includes the following steps S1 to S3.
S1: and charging the detection capacitor by using the leakage current of the circuit to be detected.
When the circuit to be detected leaks electricity, the detection capacitor is charged by using the leakage current of the circuit to be detected, and the charging current of the detection capacitor is also the leakage current of the circuit to be detected.
And in the charging process of the detection capacitor, changing the charging and discharging state of the detection capacitor according to the voltage at two ends of the detection capacitor and the reference voltage. Specifically, when the voltage across the detection capacitor rises to the reference voltage or falls to the reference voltage, the detection capacitor is changed to the discharge state. After the detection capacitor is changed into the discharging state, delaying for a preset time, so that the detection capacitor is changed into the charging state from the discharging state again.
In one embodiment, the voltage of the detection capacitor may be input to the comparator, and when the output state of the comparator changes (i.e., the output signal of the comparator changes from a high-level signal to a low-level signal or from a low-level signal to a high-level signal), a comparison signal is generated to an oscillation circuit formed by the D flip-flop and the RS flip-flop, so that the oscillation circuit outputs a first clock signal to the control switch of the detection capacitor, thereby changing the detection capacitor from the charging state to the discharging state. After the detection capacitor is converted into the discharging state, the oscillation circuit delays the preset time to output a second clock signal to the control switch of the detection capacitor, and then the detection capacitor is converted into the charging state from the discharging state again.
Further, the leakage current comprises a first leakage current of the circuit to be tested which leaks electricity to the ground and a second leakage current between the circuit to be tested and the power supply. The oscillating circuit alternately outputs a first clock signal and a second clock signal at a certain frequency, thereby controlling the detection capacitor to alternately discharge and charge at a certain frequency. When the leakage current is the first leakage current, the detection capacitor may be charged with the first leakage current in a time period in which the oscillation circuit outputs the second clock signal. When the voltage charged to the two ends of the detection capacitor can change the output of the comparator, the comparator outputs a comparison signal to the oscillating circuit, and after the oscillating circuit receives the comparison signal, the oscillating circuit outputs a first clock signal to the control switch of the detection capacitor so as to control the discharge of the detection capacitor, namely the first leakage current is not used for charging the detection capacitor. And meanwhile, the oscillating circuit starts to delay, namely the discharge time of the detection capacitor is detected during the delay, and the oscillating circuit outputs a second clock signal to the control switch of the detection capacitor again after delaying the preset time, so that the first leakage current is detected for a new round.
When the leakage current is the second leakage current, the detection capacitor may be charged with the second leakage current in a time period in which the oscillation circuit outputs the first clock signal. When the voltage charged to the two ends of the detection capacitor can change the output of the comparator, the comparator outputs a comparison signal to the oscillation circuit, and after the oscillation circuit receives the comparison signal, the oscillation circuit outputs a second clock signal to the control switch of the detection capacitor so as to control the discharge of the detection capacitor, namely the second leakage current is not used for charging the detection capacitor. And meanwhile, the oscillating circuit starts to delay, namely the discharge time of the detection capacitor is detected during the delay, and the oscillating circuit outputs the first clock signal to the control switch of the detection capacitor again after delaying the preset time, so that the second leakage current is detected for a new round.
S2: and detecting the magnitude of the leakage current during the charging period of the detection capacitor, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value.
Since the leakage current is the charging current of the detection capacitor, the magnitude of the leakage current can be detected within the charging time window of the detection capacitor. When the leakage current is larger than or equal to the preset threshold value, the leakage of the circuit to be tested reaches the given leakage threshold value, and at the moment, a trigger signal is output.
In one embodiment, when the detection capacitor is changed from the discharging state to the charging state, a clock pulse is output to an enabling end of the counter through an oscillating circuit formed by a D trigger and an RS trigger, and then the counter counts a high-frequency reference clock in a charging time window of the detection capacitor, and the counting value of the counter can reflect the magnitude of the leakage current. It should be noted that the smaller the count value of the counter, the shorter the time for detecting the charging of the capacitor, the larger the leakage current. When the counting value of the counter is smaller than the counting threshold value, the leakage current of the circuit to be tested reaches the given leakage threshold value, and the counting signal of the counter is equivalent to a trigger signal.
Further, when the leakage current is the first leakage current, the counter counts by using the high-frequency reference clock within the pulse width window of the second clock signal to detect the magnitude of the first leakage current. Wherein, the high frequency reference clock is the input clock of the counter. The pulse width window of the second clock signal is also the high level time window of the second clock signal, and the detection capacitor is charged in the high level time window. And in the charging time window of the detection capacitor, if the high-frequency count is less than or equal to a given count threshold, namely the first leakage current is greater than or equal to a preset threshold, the electric leakage of the circuit to be detected to the ground exceeds a given range, and at the moment, the counter outputs a trigger signal to trigger the compensation of the first leakage current.
When the leakage current is the second leakage current, the counter counts by using the high-frequency reference clock in the pulse width window of the first clock signal to detect the magnitude of the second leakage current. Wherein, the high frequency reference clock is the input clock of the counter. The pulse width window of the first clock signal is also the high level time window of the first clock signal, and the detection capacitor is charged in the high level time window. And in the charging time window of the detection capacitor, if the high-frequency count is less than or equal to a given count threshold, that is, the second leakage current is greater than or equal to a preset threshold, the leakage of the circuit to be detected to the power supply exceeds a given range, and at the moment, the counter outputs a trigger signal to trigger the compensation of the second leakage current.
S3: and providing compensation current corresponding to the leakage current for the circuit to be tested according to the trigger signal.
According to the trigger signal, a compensation current corresponding to the leakage current can be provided for the circuit to be tested. The compensation current is reverse current opposite to the direction of the leakage current, can completely compensate the leakage current, and can partially compensate the leakage current to reduce the leakage current to a given threshold value, thereby eliminating the influence of the leakage current on signal detection and improving the precision of the signal detection.
In one embodiment, the automatic current compensation control circuit may control the current source to generate a reverse current corresponding to the leakage current, and input the reverse current to the circuit under test to provide current compensation for the circuit under test. The automatic current compensation control circuit can select to connect a current source with proper output current with a circuit to be detected to compensate the leakage current, and can also select to simultaneously connect a plurality of current sources with the circuit to be detected to superpose enough output current to compensate the leakage current. In other words, compensation can be performed by switching the switched-in current sources, and compensation can also be performed by controlling the number of switched-in current sources.
According to the leakage protection method provided by the embodiment of the application, the detection capacitor is charged by using the leakage current of the circuit to be detected; detecting the magnitude of the leakage current in the charging period of the detection capacitor, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and finally, providing compensation current corresponding to the leakage current for the circuit to be detected according to the trigger signal, thereby effectively eliminating the influence of system leakage and improving the detection range and precision of the signal.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application to the details of the foregoing description, and it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (15)
1. An earth leakage protection circuit, comprising:
the leakage detection circuit comprises a detection capacitor, is used for connecting a circuit to be detected and charging the detection capacitor by using leakage current of the circuit to be detected, and comprises a first leakage current for ground leakage, wherein the first leakage current is negative leakage current;
the compensation trigger circuit is connected with the leakage detection circuit and used for detecting the magnitude of the leakage current during the charging period of the detection capacitor and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and
and the leakage compensation circuit is connected with the compensation trigger circuit and used for providing compensation current corresponding to the leakage current for the circuit to be tested according to the trigger signal, and the compensation current comprises forward current for compensating the first leakage current.
2. The leakage protection circuit of claim 1, wherein the compensation trigger circuit comprises:
the comparison circuit is connected with the electric leakage detection circuit, preset with reference voltage and used for outputting a comparison signal according to the voltage of the detection capacitor and the reference voltage;
the clock control circuit is connected with the comparison circuit and the electric leakage detection circuit and used for outputting a clock signal according to the comparison signal and controlling the electric leakage detection circuit to charge or discharge the detection capacitor through the clock signal; and
and the counter is connected with the clock control circuit and used for detecting the magnitude of the leakage current during the charging period of the detection capacitor according to the clock signal and outputting a trigger signal when the leakage current is greater than or equal to the preset threshold value.
3. The leakage protection circuit of claim 2, wherein the clock signal comprises a first level signal and a second level signal;
the clock control circuit is used for outputting the first level signal according to the comparison signal and outputting the second level signal after delaying for a preset time, and the electric leakage detection circuit is used for controlling the detection capacitor to discharge within the preset time according to the first level signal and charging the detection capacitor by using the first electric leakage current according to the second level signal.
4. The leakage protection circuit of claim 3,
the counter is further configured to count according to a preset reference clock when the leakage detection circuit charges the detection capacitor with the first leakage current according to the second level signal, so as to detect a magnitude of the first leakage current.
5. The leakage protection circuit of claim 3 wherein said clock control circuit comprises a D flip-flop connected to said comparison circuit and an RS flip-flop connected to said D flip-flop.
6. The leakage protection circuit of claim 3, wherein the leakage compensation circuit comprises a compensation control circuit connected to the compensation trigger circuit and a current source unit connected to the compensation control circuit, and the compensation control circuit is configured to determine a magnitude of the leakage current according to the trigger signal and provide a compensation current corresponding to the magnitude of the leakage current to the circuit under test through the current source unit.
7. The leakage protection circuit of claim 6, wherein the current source unit is a current source array, and the compensation control current is configured to select a current source corresponding to the leakage current in the current source array according to the leakage current to provide a compensation current.
8. The leakage protection circuit of claim 6 wherein said leakage detection circuit comprises a first leakage detection circuit, said detection capacitor comprises a first detection capacitor;
the first leakage detection circuit is used for being connected with the circuit to be detected and charging the first detection capacitor by utilizing the first leakage current when the circuit to be detected leaks electricity to the ground.
9. The leakage protection circuit of claim 8 wherein said first leakage detection circuit comprises a first switch, a second switch, and said first detection capacitor; one end of the first detection capacitor is connected to a power supply, and the other end of the first detection capacitor is connected to one end of the first switch; the second switch is connected in parallel to two ends of the first detection capacitor; the connection node of the first detection capacitor and the first switch is connected with the compensation trigger circuit;
the other end of the first switch is used for connecting the circuit to be tested; the first switch and the second switch are controlled by the clock signal.
10. The leakage protection circuit of claim 9 wherein said comparison circuit comprises a first comparator, said reference voltage comprising a first reference voltage and a second reference voltage;
the first reference voltage is preset at the first input end of the first comparator, the second input end of the first comparator is connected to the connection node of the first detection capacitor and the first switch, and the output end of the first comparator is connected to the clock control circuit.
11. The leakage protection circuit of claim 10 wherein said compensation trigger circuit further comprises a gating circuit connected between said comparison circuit and said clock control circuit for selecting connection of said first comparator to said clock control circuit.
12. The earth leakage protection circuit of claim 10, wherein the current source unit comprises a first current source unit, and the compensation control circuit is configured to determine a magnitude of an earth leakage current when the circuit to be tested leaks electricity to earth according to the trigger signal, and provide a compensation current corresponding to the magnitude of the earth leakage current for the circuit to be tested through the first current source unit.
13. An integrated circuit comprising a leakage protection circuit as claimed in any one of claims 1 to 12.
14. An electronic device comprising a device body and the integrated circuit of claim 13 disposed within the device body.
15. A leakage protection method applied to the leakage protection circuit according to any one of claims 1 to 12, comprising:
charging the detection capacitor by using the leakage current of the circuit to be detected;
detecting the magnitude of the leakage current during the charging period of the detection capacitor, and outputting a trigger signal when the leakage current is greater than or equal to a preset threshold value; and
and providing a compensation current corresponding to the leakage current for the circuit to be tested according to the trigger signal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210917962.8A CN115441399A (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010457524.9A CN111585244B (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
CN202210917962.8A CN115441399A (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010457524.9A Division CN111585244B (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115441399A true CN115441399A (en) | 2022-12-06 |
Family
ID=72125317
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010457524.9A Active CN111585244B (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
CN202210917962.8A Pending CN115441399A (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
CN202210917958.1A Pending CN115360667A (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010457524.9A Active CN111585244B (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210917958.1A Pending CN115360667A (en) | 2020-05-26 | 2020-05-26 | Leakage protection circuit, integrated circuit, electronic device, and method |
Country Status (1)
Country | Link |
---|---|
CN (3) | CN111585244B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112165071B (en) * | 2020-08-26 | 2022-06-17 | 浙江朗威微***有限公司 | Leakage current early warning protection circuit with self-test function |
CN113281676B (en) * | 2020-12-03 | 2023-04-14 | 珠海迈巨微电子有限责任公司 | Device for judging leakage current in battery and battery management system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1057929A (en) * | 1990-07-03 | 1992-01-15 | 沈涛 | Automatic balance device for three phase current leakage |
CN1328587C (en) * | 2005-12-27 | 2007-07-25 | 通领科技集团有限公司 | Life-stopping intelligent inspection and inspector for leakage protector |
CN102437548A (en) * | 2011-12-30 | 2012-05-02 | 邹溪 | Zero-residual-current circuit protection method and residual-current protection circuit breaker using same |
CN202815139U (en) * | 2012-09-11 | 2013-03-20 | 深圳市金宏威技术股份有限公司 | Digital insulation monitoring sensor |
EP2778715A1 (en) * | 2013-03-14 | 2014-09-17 | Agfa Healthcare | A pixel unit for a radiographic image detecting apparatus |
CN208174241U (en) * | 2017-02-17 | 2018-11-30 | 杰华特微电子(杭州)有限公司 | A kind of leakage protection circuit |
CN108107396B (en) * | 2017-08-01 | 2024-06-04 | 国网江西省电力公司电力科学研究院 | Current transformer error detection device for compensating leakage current |
CN107359587B (en) * | 2017-08-04 | 2019-04-30 | 江苏师范大学 | The non-reliability earthed system self-adaption route selection leakage protection system of three-phase and method |
-
2020
- 2020-05-26 CN CN202010457524.9A patent/CN111585244B/en active Active
- 2020-05-26 CN CN202210917962.8A patent/CN115441399A/en active Pending
- 2020-05-26 CN CN202210917958.1A patent/CN115360667A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
CN115360667A (en) | 2022-11-18 |
CN111585244A (en) | 2020-08-25 |
CN111585244B (en) | 2022-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0540052B1 (en) | Ripple-free phase detector using two sample-and-hold circuits | |
US8749224B2 (en) | Voltage detection circuit and method for controlling the same | |
US7279941B2 (en) | Voltage-frequency conversion apparatus and method of changing reference voltage thereof | |
US20110187389A1 (en) | Capacitance measuring circuit for touch sensor | |
US7737730B2 (en) | Method of detecting the frequency of an input clock signal of an integrated circuit and integrated circuit | |
CN111585244B (en) | Leakage protection circuit, integrated circuit, electronic device, and method | |
EP2344896A1 (en) | Current sensor capacitance measuring circuit | |
EP3557206B1 (en) | Temperature sensor in an integrated circuit having offset cancellation | |
EP1963870A2 (en) | Current measurement circuit and method | |
US7053674B1 (en) | Track-and-hold peak detector circuit | |
US6756787B2 (en) | Integrated circuit having a current measuring unit | |
KR20190090223A (en) | Temperature sensing device and temperature-voltage converter | |
US6731129B1 (en) | Apparatus for measuring capacitance of a semiconductor device | |
US6693416B2 (en) | Method and device for measuring the phase shift between a periodic signal and an output signal at an output of an electronic component | |
JP2005024559A (en) | Method and device for determination of ratio of rc time constant in integrated circuit to target value | |
US10274536B2 (en) | Time to current converter | |
WO2002075331A1 (en) | Capacitance measuring circuit | |
US10656032B2 (en) | Temperature sensor in an integrated circuit and method of calibrating the temperature sensor | |
JP4415748B2 (en) | Sample hold circuit | |
KR101719098B1 (en) | Circuit and method for pulse width measurement | |
US20240106401A1 (en) | Measurement system, related integrated circuit and method | |
CN117233571A (en) | Test circuit, test system, test method and semiconductor chip | |
CN115097190A (en) | Signal detection method, circuit and storage medium | |
CN116626384A (en) | Clock frequency detection circuit | |
WO2024064504A1 (en) | Frequency monitoring circuitry with voltage conversion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |