Low power consumption standby current detection circuit, method and electronic device
By designing a low-power standby current detection circuit and using the MCU to control the current mirror circuit and sampling circuit, high-precision detection of the device's own standby current is achieved, which solves the problems of inaccurate detection and high cost in the existing technology and is suitable for low-power applications. equipment in a depleted state.
Patent Information
- Application Number
- CN202211412353.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-11-11
AI Technical Summary
In the existing technology, the standby current detection of equipment in low power consumption state is inaccurate and costly, and the equipment itself cannot directly obtain the standby current, requiring cumbersome external wiring.
Design a low-power standby current detection circuit that controls the current mirror circuit and sampling circuit through the MCU to achieve high-precision detection of the device's own standby current without the need for an external ammeter. It is composed of a current mirror branch and a sampling circuit. Through short pulse charging and ADC input detects standby current.
It achieves high-precision detection of the device's own standby current, reduces costs, avoids the use of external ammeters, and is suitable for devices in low-power consumption states.
Smart Images

Figure CN115728538B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of current detection, and in particular to a low-power standby current detection circuit, method and electronic equipment. Background Art
[0002] At present, in order to accurately obtain the operating status of the equipment in battery-powered devices, it is necessary to perform real-time detection of the equipment's standby current, so as to promptly discover problems when the equipment is working abnormally, quickly complete maintenance of the abnormal equipment, and avoid adverse effects.
[0003] The standby current of the device is very critical information. The standby current determines the standby power consumption and usable time of the device. Once the standby power consumption of the device is abnormal due to hardware or software problems, the battery will be quickly consumed and the device will stop working normally.
[0004] In the prior art, the standby current of the device is detected through an external ammeter. However, the standby current of the device in a low-power state can reach the microampere level. The low accuracy of ordinary external ammeters leads to inaccurate detection results. If a high-precision external ammeter is used, the cost is relatively high. In addition, the MCU of the device itself cannot directly obtain its own standby current, and cumbersome steps such as external wiring are required. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a low-power standby current detection circuit, method and electronic device, which can enable the MCU of the device to detect its own standby current without the need for an external ammeter, thereby saving costs.
[0006] According to the first aspect of the present invention, a low-power standby current detection circuit is used to detect the standby current of a device, and includes: an MCU; a current mirror circuit, the current mirror circuit includes a first current mirror branch for providing an output current to the MCU and a second current mirror branch for providing a detection current proportional to the output current; a first switch device, the first switch device is connected to the input end of the second current mirror branch, and the control end of the first switch device is connected to the first pin of the MCU; a sampling circuit, the sampling circuit includes a resistor R1, a capacitor C1, a resistor R4, a resistor R3 and a diode D1, the resistor R1 is connected to the output end of the second current mirror branch, the common end of the resistor R1 and the second current mirror branch is connected to the cathode of the diode D1, the anode of the diode D1 is grounded through the resistor R3 and the capacitor C1 connected in series, and the common end of the resistor R3 and the capacitor C1 is connected to the second pin of the MCU through the resistor R4.
[0007] The low power standby current detection circuit according to the first aspect of the present invention has at least the following beneficial effects:
[0008] In the embodiment of the present invention, a current mirror circuit is formed by a first current mirror branch and a second current mirror branch. The current I flowing through the first current mirror branch is Q1 and the current I flowing through the second current mirror branch Q2 The MCU controls the first switch device to turn on through the first pin, so that I flowing through the first current mirror branch Q1 and the current I flowing through the second current mirror branch Q2 equal; the MCU outputs a short pulse of high level through the second pin to charge the capacitor C1, and then sets the second pin as the ADC input and enters the sleep state to form a standby environment; when the circuit of the second current mirror branch and the sampling circuit reaches a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current of the device according to the voltage of the second pin. The present invention can detect the standby current of the device itself through the MCU, does not require an external ammeter, has low cost, and can achieve high-precision standby current detection.
[0009] According to some embodiments of the present invention, the first current mirror branch adopts a transistor Q1, and the second current mirror branch adopts a transistor Q2, both the transistor Q1 and the transistor Q2 are PNP transistors, the base of the transistor Q1 is connected to the base of the transistor Q2, the emitter of the transistor Q1 is connected to the power supply, the emitter of the transistor Q2 is connected to the power supply through a first switching device, the collector of the transistor Q1 is connected to the power supply end of the device, the collector of the transistor Q1 is connected to the base of the transistor Q1, and the collector of the transistor Q2 is grounded through a resistor R1.
[0010] According to some embodiments of the present invention, the first switching device is a MOS transistor Q3.
[0011] According to some embodiments of the present invention, the control terminal of the first switch device is connected to the first pin of the MCU via a resistor R2.
[0012] According to a second aspect of the present invention, a circuit low-power standby current detection method includes the following steps:
[0013] The MCU controls the first switch device to turn on through the first pin, so that the current IQ1 flowing through the first current mirror branch and the current IQ2 flowing through the second current mirror branch are equal;
[0014] The MCU outputs a short pulse of high level through the second pin to charge the capacitor C1, and then sets the second pin as ADC input and enters the sleep state to form a standby environment;
[0015] When the circuits of the second current mirror branch and the sampling circuit reach a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current of the MCU according to the voltage of the second pin.
[0016] The low power standby current detection method according to the second embodiment of the present invention has at least the following beneficial effects:
[0017] In the embodiment of the present invention, a current mirror circuit is formed by a first current mirror branch and a second current mirror branch. The current I flowing through the first current mirror branch is Q1 and the current I flowing through the second current mirror branch Q2 The MCU controls the first switch device to turn on through the first pin, so that I flowing through the first current mirror branch Q1 and the current I flowing through the second current mirror branch Q2 equal; the MCU outputs a short pulse of high level through the second pin to charge the capacitor C1, and then sets the second pin as the ADC input and enters the sleep state to form a standby environment; when the circuit of the second current mirror branch and the sampling circuit reaches a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current of the device according to the voltage of the second pin. The present invention can detect the standby current of the device itself through the MCU, does not require an external ammeter, has low cost, and can achieve high-precision standby current detection.
[0018] According to some embodiments of the present invention, a condition for determining whether the circuit of the second current mirror branch and the sampling circuit reaches a balanced state is that the voltages across the capacitor C1 and the resistor R1 are the same.
[0019] An electronic device according to a third embodiment of the present invention includes an MCU and the above-mentioned low-power standby current detection circuit.
[0020] The electronic device according to the third embodiment of the present invention has at least the following beneficial effects:
[0021] In the embodiment of the present invention, a current mirror circuit is formed by a first current mirror branch and a second current mirror branch. The current I flowing through the first current mirror branch is Q1 and the current I flowing through the second current mirror branch Q2 The MCU controls the first switch device to turn on through the first pin, so that I flowing through the first current mirror branch Q1 and the current I flowing through the second current mirror branch Q2equal; the MCU outputs a short pulse of high level through the second pin to charge the capacitor C1, and then sets the second pin as the ADC input and enters the sleep state to form a standby environment; when the circuit of the second current mirror branch and the sampling circuit reaches a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current of the device according to the voltage of the second pin. The present invention can detect the standby current of the device itself through the MCU, does not require an external ammeter, has low cost, and can achieve high-precision standby current detection.
[0022] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:
[0024] Figure 1 is a circuit schematic diagram of a low-power standby current detection circuit in an embodiment of the present invention;
[0025] Figure 2 Flow chart of low power standby current detection in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0027] In the description of the present invention, it should be understood that descriptions involving orientation, such as orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0028] In the description of the present invention, "a plurality" means more than two. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0029] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0030] Reference Figure 1 As shown, a low-power standby current detection circuit is used to detect the standby current of a device, including: an MCU, a current mirror circuit, a first switch device and a sampling circuit. The current mirror circuit includes a first current mirror branch and a second current mirror branch that are mirror images of each other, and the first current mirror branch is used to provide output current to the MCU and other functional circuits in the device. In this embodiment, the first current mirror branch uses a transistor Q1, and the second current mirror branch uses a transistor Q2. Both transistors Q1 and Q2 are PNP transistors. The base of transistor Q1 is connected to the base of transistor Q2, and the emitter of transistor Q1 is connected to a power supply. In this embodiment, the power supply is a battery BAT. The collector of transistor Q1 is connected to the power supply end of the device, and the MCU and other functional circuits are powered through the power supply end. The base of the transistor Q1 is connected to the base of the transistor Q2, and the collector of the transistor Q1 is connected to the base of the transistor Q2. In this embodiment, the first switching device adopts a MOS transistor Q3, the emitter of the transistor Q2 is connected to the battery BAT through the MOS transistor Q3, and the gate of the MOS transistor Q3 is connected to the pin CURRENT of the MCU through the resistor R2.
[0031] The sampling circuit includes a resistor R1, a capacitor C1, a resistor R4, a resistor R3 and a diode D1. The collector of the transistor Q2 is grounded through the resistor R1. The common end of the resistor R1 and the transistor Q2 is connected to the cathode of the diode D1. The anode of the diode D1 is grounded through the resistor R3 and the capacitor C1 connected in series in sequence. The common end of the resistor R3 and the capacitor C1 is connected to the ADC pin of the MCU through the resistor R4.
[0032] The working principle of the present invention is:
[0033] The current mirror circuit is formed by two PNP transistors Q1 and Q2. The current flowing through transistor Q1 is in a mirror relationship with the current flowing through transistor Q2, that is, I Q1 =I Q2 , the MCU controls the conduction of the second current mirror branch through the MOS tube Q3. When the gate of the MOS tube Q3 is at a low level, the second current mirror branch is turned on. When the gate of the MOS tube Q3 is at a high level, the second current mirror branch is turned off. In this embodiment, the resistor R1 is a current sampling resistor, the resistor R3 and the resistor R4 are current limiting resistors, and the capacitor C1 is a sampling capacitor.
[0034] I Q1 The supply current of the device. When it is necessary to detect I Q1 When the current reaches 100, the MCU sets the pin CURRENT to a low level, thereby turning on the MOS tube Q3. At this time, a current connected to I Q1 The same current I Q2At this time, a voltage that follows the current change will be output at the upper end of the resistor R1. The MCU outputs a short pulse of high level through the pin ADC to charge the C1 capacitor. The specific value of the short pulse is adaptively selected according to the linear capacity of the C1 capacitor. As long as the capacitor C1 is fully charged, the MCU will immediately set the pin ADC to ADC input after outputting a high level, and then enter the sleep mode to form a standby environment. At this time, the voltage on the capacitor C1 will pass through the resistor R3, the diode D1 and the resistor R1 to form a loop. When the voltages across the capacitor C1 and the resistor R1 are the same, the circuit reaches a balanced state. The MCU is awakened after the sleep time ends. After waking up, the voltage of the pin ADC is immediately detected. The voltage of the pin ADC is the collected voltage V of the capacitor C1. C1 , and then record the collected voltage, and use formula I 待机 =V C1 / R1 can calculate the standby current I when the MCU is in sleep mode 待机 , R1 is the resistance value of resistor R1.
[0035] The present invention also relates to a circuit low power consumption standby current detection method, referring to Figure 2 As shown, the following steps are included:
[0036] S100, MCU controls the first switch device to turn on through the first pin, so that I flowing through the first current mirror branch Q1 and the current I flowing through the second current mirror branch Q2 equal;
[0037] S200, MCU outputs a short pulse of high level through the second pin to charge capacitor C1, and then sets the second pin as ADC input and enters the sleep state to form a standby environment;
[0038] S300, when the circuit of the second current mirror branch and the sampling circuit reaches a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current I of the MCU according to the voltage of the second pin 待机 , the calculation formula is I 待机 =V C1 / R1.
[0039] The condition for determining whether the circuits of the second current mirror branch and the sampling circuit reach a balanced state is that the voltages across the capacitor C1 and the resistor R1 are the same.
[0040] The present invention also relates to an electronic device, comprising an MCU and the low-power standby current detection circuit of the above embodiment.
[0041] The present invention forms a current mirror circuit by using a first current mirror branch and a second current mirror branch. The current I flowing through the first current mirror branch Q1 and the current I flowing through the second current mirror branchQ2 The MCU controls the first switch device to turn on through the first pin, so that I flowing through the first current mirror branch Q1 and the current I flowing through the second current mirror branch Q2 equal; the MCU outputs a short pulse of high level through the second pin to charge the capacitor C1, and then sets the second pin as the ADC input and enters the sleep state to form a standby environment; when the circuit of the second current mirror branch and the sampling circuit reaches a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current of the device according to the voltage of the second pin. The present invention can detect the standby current of the device itself through the MCU, without the need for an external ammeter and with low cost. High-precision standby current detection can also be achieved under low power consumption.
[0042] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A low-power standby current detection circuit for detecting the standby current of a device, characterized in that: include: MCU; A current mirror circuit, the current mirror circuit comprising a first current mirror branch for providing an output current to a device and a second current mirror branch for providing a detection current proportional to the output current; A first switch device, wherein the first switch device is connected to an input end of the second current mirror branch, and a control end of the first switch device is connected to a first pin of the MCU; A sampling circuit, the sampling circuit comprising a resistor R1, a capacitor C1, a resistor R4, a resistor R3 and a diode D1, the resistor R1 is connected to the output end of the second current mirror branch, the common end of the resistor R1 and the second current mirror branch is connected to the cathode of the diode D1, the anode of the diode D1 is grounded through the resistor R3 and the capacitor C1 connected in series, and the common end of the resistor R3 and the capacitor C1 is connected to the second pin of the MCU through the resistor R4; The low-power standby current detection circuit detects the standby current of the device through a low-power standby current detection method, and the low-power standby current detection method includes the following steps: The MCU controls the first switch device to turn on through the first pin, so that the current IQ1 flowing through the first current mirror branch and the current IQ2 flowing through the second current mirror branch are equal; The MCU outputs a short pulse of high level through the second pin to charge the capacitor C1, and then sets the second pin as ADC input and enters the sleep state to form a standby environment; When the circuit of the second current mirror branch and the sampling circuit reaches a balanced state, the MCU wakes up and immediately detects the voltage of the second pin, and calculates the standby current of the MCU according to the voltage of the second pin; The condition for determining whether the circuit of the second current mirror branch and the sampling circuit reaches a balanced state is that the voltages across the capacitor C1 and the resistor R1 are the same.
2. The low power consumption standby current detection circuit according to claim 1, characterized in that: The first current mirror branch adopts a transistor Q1, and the second current mirror branch adopts a transistor Q2. Both the transistor Q1 and the transistor Q2 are PNP transistors. The base of the transistor Q1 is connected to the base of the transistor Q2, the emitter of the transistor Q1 is connected to the power supply, the emitter of the transistor Q2 is connected to the power supply through a first switching device, the collector of the transistor Q1 is connected to the power supply end of the device, the collector of the transistor Q1 is connected to the base of the transistor Q1, and the collector of the transistor Q2 is grounded through a resistor R1.
3. The low power consumption standby current detection circuit according to claim 1, characterized in that: The first switch device is a MOS tube Q3.
4. The low power consumption standby current detection circuit according to claim 1, characterized in that: The control end of the first switch device is connected to the first pin of the MCU through a resistor R2.
5. An electronic device, characterized in that: The invention comprises an MCU and a low-power standby current detection circuit as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Low power standby mode monitor
CN101133335A
Air conditioner controller automatic testing system and testing method thereof
CN103984338A
Output voltage dual-mode detection circuit of switching power supply
CN104600963A
Circuit for testing standby current
CN104777340A
Saturation voltage drop measuring circuit for high-voltage IGBT device
CN109633223A
