Electric quantity detection circuit, method and computer readable storage medium

By using a low-precision MCU processor without AD detection function in the power detection circuit, combined with the charging chip in the charging module to detect the battery power, the problem of high power detection cost in the prior art is solved, and an economical and practical power detection method is realized.

CN110954840BActive Publication Date: 2025-03-04广东金莱特智能科技有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201911324029.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-20
Publication Date
2025-03-04
Estimated Expiration
2039-12-20

AI Technical Summary

Technical Problem

Existing battery capacity detection technology requires high-precision MCU processors and AD detection functions, resulting in high circuit costs and high economic requirements.

Method used

The lower-precision MCU processor without AD detection function is used to detect the battery power through the charging chip in the charging module, and the VDD port voltage detection and display are used to realize the voltage detection and display of the charging chip.

Benefits of technology

It effectively reduces the cost of the power detection circuit, realizes multiple power detection of battery products, and improves the accuracy and practicality of the detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110954840B_ABST
    Figure CN110954840B_ABST
Patent Text Reader

Abstract

The present invention discloses a power detection circuit, method and computer-readable storage medium, including a charging module, including a charging chip, the charging chip is provided with a first CHRG pin for indicating whether the battery is full; a power supply module connected to the charging module, the power supply module includes a battery; a control module connected to the power supply module, the control module includes an MCU processor, the MCU processor is provided with a VDD port and a second CHRG pin, the second CHRG pin is connected to the first CHRG pin; a display module is connected to the control module. The technical solution of the present invention can effectively reduce costs and is practical by using an MCU processor without an AD detection function to detect the power of a product battery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of circuit detection, and in particular to a power detection circuit, method and computer-readable storage medium. Background Art

[0002] At present, most products such as mobile phones, notebooks, computers and other electronic devices are generally powered by internal batteries. During the use of the product, if it has a power indication function, the product usage time can be predicted in advance, the product can be charged in advance, and the battery power status can be displayed intuitively. For users, the use of the product is more reasonable. Therefore, during the use of the product, the battery power needs to be detected in time. The existing battery power detection technology requires the use of a high-precision MCU processor with AD detection, but the circuit built by this detection technology requires a high cost and high economic requirements. Summary of the invention

[0003] 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 power detection circuit, method and computer-readable storage medium, which uses a low-precision MCU processor without AD detection to detect the power of battery products, effectively reducing costs and having practicality.

[0004] The technical solution adopted by the present invention to solve the problem is:

[0005] In a first aspect of an embodiment of the present invention, a power detection circuit is provided, comprising a charging module, comprising a charging chip, wherein the charging chip is provided with a first CHRG pin for indicating whether the battery is full; a power supply module, connected to the charging module, wherein the power supply module comprises a battery; a control module, connected to the power supply module, wherein the control module comprises an MCU processor, wherein the MCU processor is provided with a VDD port and a second CHRG pin, wherein the second CHRG pin is connected to the first CHRG pin; and a display module, connected to the control module.

[0006] According to some embodiments of the present invention, a PWM regulation module is further included, and the PWM regulation module is arranged between the control module and the power supply module.

[0007] According to some embodiments of the present invention, a nineteenth resistor is further included, one end of the nineteenth resistor is used to be connected to the power supply, and the other end is connected to the VCC port of the charging chip, a twentieth resistor is arranged in parallel at both ends of the nineteenth resistor, the VCC port of the charging chip is also connected to the ground through the first resistor and the second resistor in sequence, a first capacitor is arranged in parallel at both ends of the second resistor, the VCC port of the charging chip is also connected to the ground through the third capacitor, the PROG port of the charging chip is connected to the ground through the third resistor, the GND port of the charging chip is connected to the ground, the BT port of the charging chip is connected to the ground through the second capacitor, and is also connected to the power supply module.

[0008] According to some embodiments of the present invention, the positive electrode of the battery is connected to the ground via a fourth resistor and a fourth capacitor in sequence, the negative electrode of the battery is connected to the ground, and the control module is also connected between the fourth resistor and the fourth capacitor.

[0009] According to some embodiments of the present invention, the SW port of the MCU processor is connected to the ground through a touch switch, the VDD port and the Exp port of the MCU processor are respectively connected to the charging module, the MCU processor is also provided with at least one output port, each of the output ports is respectively connected to the display module, the GND port of the MCU processor is connected to the ground, the PWM port of the MCU processor is connected to the ground through the twelfth resistor and the thirteenth resistor in sequence, and the PWM adjustment module is also connected between the twelfth resistor and the thirteenth resistor.

[0010] According to a second aspect of an embodiment of the present invention, a power detection method is provided, which is applied to the power detection circuit described in the first aspect above, and the method includes: obtaining voltage values ​​of at least two time periods of the VDD port of the MCU processor, and obtaining the voltage average value of all the time periods; obtaining a reference voltage value for comparison with the voltage average value to obtain the battery power; the method also includes at least one of the following: setting a first rebound voltage value greater than the reference voltage value, and comparing the voltage average value with the first rebound voltage value during battery discharge or load reduction to obtain and display the battery power; setting a second rebound voltage value less than the reference voltage value, and comparing the voltage average value with the second rebound voltage value during battery charging or load increase to obtain and display the battery power.

[0011] According to some embodiments of the present invention, the method further comprises at least one of the following:

[0012] Detecting the discharge time of each voltage segment of the battery, obtaining the discharge range of the battery, acquiring a reference discharge range, comparing the discharge range with the reference discharge range, and determining whether the power level of the battery is displayed correctly;

[0013] The charging time of each voltage segment of the battery is detected to obtain the charging range of the battery, a reference charging range is obtained, the charging range is compared with the reference charging range, and it is determined whether the power level of the battery is displayed correctly.

[0014] According to some embodiments of the present invention, it also includes: if the voltage average value is greater than or equal to a preset voltage threshold, shielding the voltage detection of the VDD port of the MCU processor, and detecting the indication level of the first CHRG pin of the charging chip; matching and comparing the indication level with the preset level, obtaining the battery power and displaying it.

[0015] According to some embodiments of the present invention, the indication level is matched and compared with a preset level to obtain and display the battery power, including at least one of the following: if the indication level is a high level, the battery power is displayed as being not fully charged; if the indication level is a low level, the battery power is displayed as being fully charged.

[0016] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the power detection method as described in any one of the second aspects above.

[0017] According to one or more technical solutions provided in the embodiments of the present invention, at least the following beneficial effects are achieved: the embodiments of the present invention provide a power detection circuit, method and computer-readable storage medium, by adopting a control module, the control module is provided with an MCU processor without an AD detection function, and the battery in the power supply module is charged by adopting a charging module, and the charging module is provided with a charging chip, and the charging chip is also provided with a first CHRG pin for indicating whether the battery is full, and the power supply module is connected to the control module, the MCU processor in the control module is used to detect the voltage of the VDD port to detect the battery power, and transmit the battery power signal to the display module, so that the display module displays the battery power; the MCU processor is also provided with a second CHRG pin, which is connected to the first CHRG pin through the second CHRG pin, and detects whether the battery power is full by detecting the indication level of the first CHRG pin. Compared with the prior art, the technical solution of the present invention can perform multiple power detection on battery products, effectively reduce costs, and has practicality.

[0018] 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

[0019] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0020] Figure 1 A schematic diagram of the structure of a power detection circuit provided by an embodiment of the present invention;

[0021] Figure 2 A flow chart of a method for detecting electric quantity provided by an embodiment of the present invention;

[0022] Figure 3 A flow chart of a method for detecting electric quantity provided by another embodiment of the present invention;

[0023] Figure 4 A flow chart of a method for detecting electric quantity provided by another embodiment of the present invention;

[0024] Figure 5 A flow chart of a method for detecting electric quantity provided by another embodiment of the present invention;

[0025] Figure 6 A flow chart of a method for detecting electric quantity provided by another embodiment of the present invention;

[0026] Figure 7 This is a flow chart of a power detection method provided by another embodiment of the present invention.

[0027] Reference numerals:

[0028] Charging module 100 , power supply module 200 , control module 300 , display module 400 , PWM regulation module 500 . DETAILED DESCRIPTION

[0029] 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.

[0030] In the description of the present invention, it should be understood that descriptions involving orientation, such as up, down, front, back, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying 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.

[0031] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of the first, second, third, and fourth, it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0032] 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.

[0033] Reference Figure 1 According to a first aspect of an embodiment of the present invention, a power detection circuit is provided, including: a charging module 100, including a charging chip U1, the charging chip U1 is provided with a first CHRG pin for indicating whether the battery BT is full; a power supply module 200, connected to the charging module 100, the power supply module 200 includes a battery BT; a control module 300, connected to the power supply module 200, the control module 300 includes an MCU processor, the MCU processor is provided with a VDD port and a second CHRG pin, the second CHRG pin is connected to the first CHRG pin; a display module 400, connected to the control module 300.

[0034] In this embodiment, the MCU processor in the control module 300 does not have an AD detection function, the charging module 100 is provided with a charging chip U1, and the charging chip U1 is also provided with a first CHRG pin for indicating whether the battery BT is fully charged. The charging module 100 is used to charge the battery BT in the power supply module 200, and the power supply module 200 is connected to the control module 300. The control module 300 is used to continuously detect the voltage value of the VDD port of the MCU processor, thereby detecting the battery BT power, and transmitting the battery BT power signal to the display module 400, so that the display module 400 displays the battery BT power; and the second CHRG pin of the MCU processor is connected to the first CHRG pin of the charging chip U1, and can detect whether the battery BT is fully charged by detecting the indication level of the first CHRG pin and comparing the indication level with the preset level. Specifically, the voltage detection of the VDD port of the MCU processor is shielded, and the indication level is compared with the preset level. If the indication level is high, the MCU processor in the control module 300 sends a signal to the display module 400, and the display module 400 displays that the power of the battery BT is not fully charged; if the indication level is low, the MCU processor in the control module 300 sends a signal to the display module 400, and the display module 400 displays that the power of the battery BT is fully charged.

[0035] In other embodiments, the battery BT may be a nickel-metal hydride battery, a lithium battery, a nickel-cadmium battery, etc. In other embodiments, multiple groups of indicator lights may be provided in the display module 400 according to product requirements, for example, four groups of indicator lights may be provided, and the power level of the battery BT may be judged by observing the display status of the four groups of indicator lights, which may include: one group of indicator lights is on, indicating that the battery BT has one level of power left; two groups of indicator lights are on, indicating that the battery BT has two levels of power left; three groups of indicator lights are on, indicating that the battery BT has three levels of power left; four groups of indicator lights are on, indicating that the battery BT has four levels of power and is fully charged; none of the four groups of indicator lights are on, indicating that the battery BT is in a state of no power; and the color of the indicator lights may also be set to indicate the working status of the battery BT, for example, a red indicator light is set to indicate that the battery BT is in a low power state, a white indicator light is set to indicate that the battery BT is in a charging state, etc.

[0036] According to one or more technical solutions provided in the embodiments of the present invention, at least the following beneficial effects are achieved: the technical solution of the embodiment of the present invention detects and displays the battery BT power by adopting a control module 300, the control module 300 includes an MCU processor without an AD detection function, and is provided with a charging module 100, a power supply module 200 and a display module 400. Compared with the prior art, the technical solution of the present invention can perform multiple power detections on the battery BT, effectively reducing costs and being practical; and a charging module 100 is provided, and the charging module 100 has an overcharge protection function, which can cut off the charging current when the battery BT is full, thereby protecting the battery BT.

[0037] According to some embodiments of the present invention, a PWM regulation module 500 is further included, and the PWM regulation module 500 is arranged between the control module 300 and the power supply module 200. Figure 1 , the PWM regulating module 500 includes a fifth resistor R5, a first indicator LED1 and a semiconductor field effect transistor Q1, one end of the fifth resistor R5 is connected to the power supply module 200, and the other end is connected to the control module 300 through the first indicator LED1 and the semiconductor field effect transistor Q1 in sequence. In this embodiment, a PWM regulating module 500 is provided, and the PWM regulating module 500 is controlled by the MCU processor in the control module 300. For example, a touch switch SW1 can be provided at the SW port of the MCU processor, so that the touch switch SW1 controls the output of the PWM regulating module 500 to perform multi-speed control. Specifically, since in this embodiment, the MCU processor in the control module 300 does not have an AD detection function, and the PWM regulating module 500 is used, the signals transmitted from the MCU processor to the controlled power supply module 200 are all in digital form, and no digital-to-analog conversion is required. The transmission signal in digital form can minimize the influence of noise, thereby enhancing the noise resistance.

[0038] According to some embodiments of the present invention, a nineteenth resistor R19 is further included, one end of the nineteenth resistor R19 is used to connect to the power supply, and the other end is connected to the VCC port of the charging chip U1, and the two ends of the nineteenth resistor R19 are connected in parallel with a twentieth resistor R20, and the VCC port of the charging chip U1 is also connected to the ground through the first resistor R1 and the second resistor R2 in sequence, and the two ends of the second resistor R2 are connected in parallel with a first capacitor C1, and the VCC port of the charging chip U1 is also connected to the ground through a third capacitor C3, and the PROG port of the charging chip U1 is connected to the ground through the third resistor R3, and the GND port of the charging chip U1 is connected to the ground, and the BT port of the charging chip U1 is connected to the ground through the second capacitor C2, and is also connected to the power supply module 200. In this embodiment, by setting the charging module 100, the charging chip U1 is provided in the charging module 100, and the VCC port of the charging chip U1 is connected to the power supply through the nineteenth resistor R19, so that the charging module 100 charges the battery BT in the power supply module 200, and realizes the charging function of the product battery BT, so that the product can be reused and has practicality.

[0039] According to some embodiments of the present invention, the positive electrode of the battery BT is connected to the ground through the fourth resistor R4 and the fourth capacitor C4 in sequence, the negative electrode of the battery BT is connected to the ground, and the control module 300 is also connected between the fourth resistor R4 and the fourth capacitor C4. By setting the power supply module 200, the power supply module 200 includes the battery BT, so that the charging module 100 charges the battery BT, and the control module 300 is used to detect the power of the battery BT, and finally display the power status of the battery BT through the display module 400, so that the user can intuitively observe the power status of the battery BT and predict the use time of the product in advance according to the display result of the display module 400, and take timely measures, such as charging the product with insufficient power in time.

[0040] Reference Figure 1According to some embodiments of the present invention, the SW port of the MCU processor is connected to the ground through the touch switch SW1, the VDD port and the Exp port of the MCU processor are respectively connected to the charging module 100, the MCU processor is also provided with at least one output port, each output port is respectively connected to the display module 400, the GND port of the MCU processor is connected to the ground, the PWM port of the MCU processor is connected to the ground through the twelfth resistor R12 and the thirteenth resistor R13 in turn, and the PWM adjustment module 500 is also connected between the twelfth resistor R12 and the thirteenth resistor R13. By setting the control module 300, the display module 400 and the PWM adjustment module 500 are centrally controlled, the second CHRG pin of the MCU processor is connected to the first CHRG pin, the MCU processor detects the indicated level of the first CHRG pin of the charging chip U1, and compares the indicated level with the preset level to obtain and display the battery BT power. In other embodiments, the MCU processor in the control module 300 can also detect the voltage average value of the VDD port in real time, compare the voltage average value with the preset reference voltage value, and obtain and display the battery BT power.

[0041] Reference Figure 1 In other embodiments, the MCU processor is provided with four output ports, namely, a first output port L1, a second output port L2, a third output port L3 and a fourth output port L4; the display module 400 includes a fourteenth resistor R14, a fifteenth resistor R15, a sixteenth resistor R16, a seventeenth resistor R17, a second indicator light LED2, a third indicator light LED3, a fourth indicator light LED4 and a fifth indicator light LED5, one end of the fourteenth resistor R14 is connected to the ground through the second indicator light LED2, and the other end is connected to the first output port L1 of the MCU processor; one end of the fifteenth resistor R15 is connected to the ground through the third indicator light LED3, and the other end is connected to the second output port L2 of the MCU processor; one end of the sixteenth resistor R16 is connected to the ground through the fourth indicator light LED4, and the other end is connected to the third output port L3 of the MCU processor; one end of the seventeenth resistor R17 is connected to the ground through the fifth indicator light LED5, and the other end is connected to the fourth output port L4 of the MCU processor. By setting the second indicator LED2, the third indicator LED3, the fourth indicator LED4 and the fifth indicator LED5 to respectively display the power status of the battery BT, the user can judge the current power status of the battery BT according to the number or color of the indicator lights, which is practical. It should be noted that the number of indicator lights in the display module 400 is not limited to four in this embodiment. The display of the display module 400 can be controlled by the control module 300 according to product requirements to realize the diversified status display of the battery BT power, which will not be repeated here.

[0042] Reference Figures 2 to 4 According to a second aspect of an embodiment of the present invention, there is provided a method for detecting electric quantity, which is applied to the electric quantity detection circuit according to the first aspect. The method comprises:

[0043] Step S100, obtaining voltage values ​​of the VDD port of the MCU processor in at least two time periods, and obtaining an average voltage value of all time periods;

[0044] Step S200, obtaining a reference voltage value for comparison with the voltage average value to obtain the battery BT power;

[0045] The method further comprises at least one of the following:

[0046] Step S300a, setting a first rebound voltage value greater than the reference voltage value, and comparing the voltage average value with the first rebound voltage value during the discharge of the battery BT or the load reduction, to obtain and display the power of the battery BT;

[0047] Step S300b, setting a second rebound voltage value that is smaller than the reference voltage value, and comparing the voltage average value with the second rebound voltage value during charging of the battery BT or load increase to obtain and display the power level of the battery BT.

[0048] Specifically, in order to save costs, an MCU processor without an AD detection function is used. When a product with a battery BT is in operation, the voltage value of the VDD port of the MCU processor is detected through a low voltage detection function, and a reference voltage value for comparing with the voltage value to obtain the battery BT power is obtained. By comparing the voltage value with the reference voltage value, the battery BT power at each time state can be obtained. However, since the product with a battery BT is affected by the load when it is working, the voltage of the VDD port of the MCU processor forms a relatively fluctuating voltage waveform. Therefore, using a voltage value to compare with the reference voltage value will cause the indicator light in the display module 400 to jump. To solve this problem, refer to Figure 2, obtain the voltage values ​​of at least two time periods of the VDD port of the MCU processor, and obtain the voltage average value of all time periods, and obtain the reference voltage value used to compare with the voltage average value to obtain the battery BT power. Since the voltage fluctuation of the VDD port of the MCU processor will still be large when the load changes, that is, it is easy for the indicator light of the battery BT to fluctuate greatly, so the rebound voltage value can be set. For example, the battery BT is set to have multiple power display states, and the voltage average value is compared with the reference voltage value. When the voltage average value is lower than the reference voltage value, it will enter the next power display state of the battery BT. After that, when the voltage average value re-enters the original power display state, it only needs to set a rebound voltage value higher or lower than the reference voltage value before re-entering the original power display state. Therefore, in this embodiment, during the discharge of the battery BT or the reduction of the load, since the voltage of the battery BT will increase, a first rebound voltage value greater than the reference voltage value is set, and the voltage average value is compared with the first rebound voltage value, so as to obtain the battery BT power and display it. By real-time detection and acquisition of the average voltage of the VDD port of the MCU processor to determine the power status of the battery BT, errors can be effectively reduced and the accuracy of battery BT power detection can be improved.

[0049] Reference Figure 3 In other embodiments, the voltage values ​​of at least two time periods of the VDD port of the MCU processor are obtained, and the voltage average value of all time periods is obtained, and a reference voltage value for comparison with the voltage average value is obtained to obtain the battery BT power. Because the voltage fluctuation of the VDD port of the MCU processor will still be large when the load changes, that is, the indicator light of the battery BT is prone to fluctuate greatly. During the charging of the battery BT or the increase of the load, the voltage of the battery BT will drop, so a second rebound voltage value that is less than the reference voltage value is set, and the voltage average value is compared with the second rebound voltage value to obtain the battery BT power and display it. By real-time detection and acquisition of the average voltage of the VDD port of the MCU processor to determine the battery BT power state, it is possible to effectively reduce errors and improve the accuracy of battery BT power detection.

[0050] Reference Figure 4In other embodiments, when a product with a battery BT is in the process of charging and discharging at the same time, the voltage value of at least two time periods of the VDD port of the MCU processor is obtained, and the voltage average value of all time periods is obtained, and a reference voltage value for comparison with the voltage average value is obtained to obtain the battery BT power. Because the voltage fluctuation of the VDD port of the MCU processor will still be large when the load changes, that is, the indicator light of the battery BT is prone to fluctuate greatly. Therefore, by setting a first rebound voltage value greater than the reference voltage value, during the discharge of the battery BT or the load reduction, the voltage average value is compared with the first rebound voltage value to obtain the battery BT power and display it. Also, by setting a second rebound voltage value less than the reference voltage value, during the charging of the battery BT or the load increase, the voltage average value is compared with the second rebound voltage value to obtain the battery BT power and display it. According to the working state or load change of the product, the voltage average value is compared with the first rebound voltage value or the second rebound voltage value to obtain the battery BT power and display it. By real-time detection and acquisition of the average voltage of the VDD port of the MCU processor to judge the battery BT power state, errors can be effectively reduced and the accuracy of battery BT power detection can be improved.

[0051] In other embodiments, multiple indicator lights can be set in the display module 400 to reflect the multi-grid power status of the battery BT. For example, by setting four indicator lights, the four-grid power status of the battery BT can be correspondingly corresponded. It can be set as follows: one indicator light indicates that the battery BT has one grid of power, two indicator lights indicate that the battery BT has two grids of power, three indicator lights indicate that the battery BT has three grids of power, and four indicator lights indicate that the battery BT has four grids of power. Specifically, the voltage values ​​of the VDD port of the MCU processor in at least two time periods are obtained, and the voltage average value of all time periods is obtained;

[0052] Obtaining a first reference voltage value, a second reference voltage value, a third reference voltage value, and a fourth reference voltage value for comparing with the voltage average value to obtain the battery BT power;

[0053] The method further comprises at least one of the following:

[0054] A first rebound voltage value A greater than the first reference voltage value, a first rebound voltage value B greater than the second reference voltage value, a first rebound voltage value C greater than the third reference voltage value, and a first rebound voltage value D greater than the fourth reference voltage value are set respectively. During the discharge or load reduction of the battery BT, the voltage average value is compared with the first rebound voltage value A, the first rebound voltage value B, the first rebound voltage value C, and the first rebound voltage value D respectively to obtain the power of the battery BT and display it. For example, when the voltage average value is greater than the first rebound voltage value A but less than the first rebound voltage value B, the control module 300 controls an indicator light in the display module 400 to light up, that is, the battery BT displays one grid of power; when the voltage average value is less than the first rebound voltage value A, no indicator light is on, that is, the battery BT is in a state of insufficient power, and the product needs to be charged by connecting an external power supply, so as to judge the power state of the battery BT by real-time detection and acquisition of the average voltage of the VDD port of the MCU processor.

[0055] A second rebound voltage value A that is less than the first reference voltage value, a second rebound voltage value B that is less than the second reference voltage value, a second rebound voltage value C that is less than the third reference voltage value, and a second rebound voltage value D that is less than the fourth reference voltage value are set respectively. During the period of charging or load increase of the battery BT, the voltage average value is compared with the second rebound voltage value A, the second rebound voltage value B, the second rebound voltage value C, and the second rebound voltage value D respectively to obtain the power of the battery BT and display it. For example, when the voltage average value is greater than the second rebound voltage value C but less than the second rebound voltage value D, the control module 300 controls the three indicator lights in the display module 400 to light up, that is, the battery BT displays three grids of power; when the voltage average value is greater than the second rebound voltage value D, four indicator lights are on, that is, the battery BT is in a full state, so that the power state of the battery BT can be judged by real-time detection and acquisition of the average voltage of the VDD port of the MCU processor. It should be noted that in other embodiments, multiple display modes of the display module 400 can be set according to product requirements, such as setting multiple groups of indicator lights, or setting the color changes of the indicator lights, display time, etc., to reflect the power status of the battery BT, which is not limited to this embodiment and will not be repeated here.

[0056] Reference Figure 5 According to some embodiments of the present invention, the method further comprises at least one of the following:

[0057] Step S400, detecting the discharge time of each voltage segment of the battery BT, obtaining the discharge range of the battery BT, obtaining the reference discharge range, comparing the discharge range with the reference discharge range, and determining whether the power level of the battery BT is displayed correctly;

[0058] Step S500, detecting the charging time of each voltage segment of the battery BT, obtaining the charging range of the battery BT, acquiring the reference charging range, comparing the charging range with the reference charging range, and determining whether the power level of the battery BT is displayed correctly.

[0059] In order to improve the accuracy of battery BT detection, the power detection method of this embodiment is added to ensure the accuracy of battery BT power display. Since the load is relatively stable during the charging or discharging process of the product, and the charging current or discharging current of the battery BT is basically fixed during operation, the charging range or discharging range of each voltage segment of the battery BT can be obtained by detecting the charging time or discharging time of the product respectively. Specifically, by detecting the discharge time of each voltage segment of the battery BT, the discharge range of the battery BT is obtained, the reference discharge range is obtained, and the discharge range is compared with the reference discharge range. At the same time, by continuously detecting the voltage average value of the VDD port of the MCU processor, combined with the comparison result of the voltage average value and the discharge range, it is determined whether the power of the battery BT is displayed correctly. When there is an error between the detected discharge range and the reference discharge range, the error can also be reduced by compensation processing, for example, by setting a rebound voltage value. In addition, the charging range of the battery BT can be obtained by detecting the charging time of each voltage segment of the battery BT, obtaining the reference charging range, and comparing the charging range with the reference charging range. At the same time, by continuously detecting the voltage average value of the VDD port of the MCU processor, combined with the comparison result of the voltage average value and the charging range, it is determined whether the battery BT power is displayed correctly. When there is an error between the detected charging range and the reference charging range, the error can be reduced by compensation processing, for example, by setting the rebound voltage value. By comparing the charging time and the discharge time with the voltage average value of the VDD port of the MCU processor, the power state of the battery BT in any state can be displayed more accurately, which is practical.

[0060] Reference Figure 6 , according to some embodiments of the present invention, further comprising:

[0061] Step S600, if the voltage average value is greater than or equal to the preset voltage threshold, shield the voltage detection of the VDD port of the MCU processor, and detect the indication level of the first CHRG pin of the charging chip U1;

[0062] Step S700, matching and comparing the indicated level with the preset level, obtaining the power level of the battery BT and displaying it.

[0063] In this embodiment, the charging chip U1 in the charging module 100 is provided with a first CHRG pin for indicating whether the battery BT is full, and the MCU processor is provided with a second CHRG pin. Since the product uses the charging module 100 to charge the battery BT in the power supply module 200, and since there is a difference between the overcharge voltage value of the charging chip U1 in the charging module 100 and the overcharge voltage value detected by the MCU processor, in order to reduce the error, the second CHRG pin is connected to the first CHRG pin, and the first CHRG pin of the charging chip U1 is detected by the second CHRG pin of the MCU processor. Specifically, by obtaining the average voltage value of the VDD port of the MCU processor, if the average voltage value is greater than or equal to the preset voltage threshold, the voltage detection of the VDD port of the MCU processor is shielded, and the indication level of the first CHRG pin of the charging chip U1 is detected, and the indication level is matched and compared with the preset level to obtain the power of the battery BT and display it. Based on the comparison between the voltage average value and the first rebound voltage value or the second rebound voltage value, the power level of the battery BT is obtained and displayed, and then by detecting the indication level of the first CHRG pin of the charging chip U1, the indication level and the preset level are matched and compared to obtain the power level of the battery BT and display it, thereby improving the detection accuracy.

[0064] Reference Figure 7 According to some embodiments of the present invention, step 700, matching and comparing the indicated level with the preset level, obtaining the power level of the battery BT and displaying it, includes at least one of the following:

[0065] Step 700a, if the indication level is high, it indicates that the battery BT is not fully charged;

[0066] Step 700b: if the indication level is a low level, it indicates that the battery BT is fully charged.

[0067] In this embodiment, since the first CHRG pin of the charging chip U1 is in a high impedance state before the battery BT is fully charged, the first CHRG pin will be connected to the ground when the battery BT is fully charged, and the second CHRG pin of the MCU processor is in a pull-up state. At the same time, by detecting the voltage state of the first CHRG pin of the charging chip U1, it can be determined whether the battery BT is fully charged. Specifically, if the indication level of the first CHRG pin is a high level, it is displayed that the battery BT is not fully charged; if the indication level of the first CHRG pin is a low level, it is displayed that the battery BT is fully charged. Since the MCU processor used in this embodiment does not have an AD detection function and has low accuracy, in the final state of the battery BT charging, the voltage detection of the VDD port of the MCU processor is shielded, and by detecting the indication level of the first CHRG pin of the charging chip U1, it is determined whether the battery BT is fully charged and displayed, for example, the display module 400 is set to increase the detection rate.

[0068] In a third aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, Figure 1 The MCU processor in the embodiment can execute the above one or more processors to execute the power detection method in the above method embodiment, for example, to execute the above described Figure 2 Method steps S100 to S300a, Figure 3 or Figure 4 Method steps S100 to S300b, Figure 5 Steps S400 to S500 of the method, Figure 6 Steps S600 to S700, Figure 7 Method steps S700 to S700b in.

[0069] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "particularly", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0070] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0071] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A power detection circuit, characterized in that: include: A charging module, comprising a charging chip, wherein the charging chip is provided with a first CHRG pin for indicating whether the battery is fully charged; A power supply module connected to the charging module, wherein the power supply module includes a battery; A control module connected to the power supply module, the control module comprising an MCU processor, the MCU processor being provided with a VDD port and a second CHRG pin, the second CHRG pin being connected to the first CHRG pin; A display module connected to the control module; The MCU processor is used to execute the following method: Obtaining voltage values ​​of a VDD port of an MCU processor in at least two time periods, and obtaining an average voltage value of all the time periods; Obtaining a reference voltage value for comparing with the voltage average value to obtain battery power; The method that the MCU processor is further used to execute also includes at least one of the following: Setting a first rebound voltage value greater than the reference voltage value, and comparing the voltage average value with the first rebound voltage value during battery discharge or load reduction to obtain and display the battery power; A second rebound voltage value is set which is smaller than the reference voltage value. During battery charging or load increase, the voltage average value is compared with the second rebound voltage value to obtain and display the battery power.

2. The electric quantity detection circuit according to claim 1, characterized in that: It also includes a PWM regulation module, which is arranged between the control module and the power supply module.

3. The power detection circuit according to claim 1, characterized in that: It also includes a nineteenth resistor, one end of the nineteenth resistor is used to be connected to the power supply, and the other end is connected to the VCC port of the charging chip, the two ends of the nineteenth resistor are connected in parallel with a twentieth resistor, the VCC port of the charging chip is also connected to the ground through the first resistor and the second resistor in sequence, the two ends of the second resistor are connected in parallel with a first capacitor, the VCC port of the charging chip is also connected to the ground through a third capacitor, the PROG port of the charging chip is connected to the ground through the third resistor, the GND port of the charging chip is connected to the ground, the BT port of the charging chip is connected to the ground through the second capacitor, and is also connected to the power supply module.

4. The power detection circuit according to claim 1, characterized in that: The positive electrode of the battery is connected to the ground through a fourth resistor and a fourth capacitor in sequence, the negative electrode of the battery is connected to the ground, and the control module is also connected between the fourth resistor and the fourth capacitor.

5. The electric quantity detection circuit according to claim 2, characterized in that: The SW port of the MCU processor is connected to the ground through a touch switch, the second CHRG pin and the Exp port of the MCU processor are respectively connected to the charging module, the MCU processor is also provided with at least one output port, each of the output ports is respectively connected to the display module, the GND port of the MCU processor is connected to the ground, and the PWM port of the MCU processor is connected to the ground through the twelfth resistor and the thirteenth resistor in sequence, and the PWM adjustment module is also connected between the twelfth resistor and the thirteenth resistor.

6. A method for detecting electric quantity, characterized in that: Applied to the power detection circuit according to any one of claims 1 to 5, the method comprises: Obtaining voltage values ​​of a VDD port of an MCU processor in at least two time periods, and obtaining an average voltage value of all the time periods; Obtaining a reference voltage value for comparing with the voltage average value to obtain battery power; The method further comprises at least one of the following: Setting a first rebound voltage value greater than the reference voltage value, and comparing the voltage average value with the first rebound voltage value during battery discharge or load reduction to obtain and display the battery power; A second rebound voltage value is set which is smaller than the reference voltage value. During battery charging or load increase, the voltage average value is compared with the second rebound voltage value to obtain and display the battery power.

7. The method for detecting electric quantity according to claim 6, characterized in that: The method further comprises at least one of the following: Detecting the discharge time of each voltage segment of the battery, obtaining the discharge range of the battery, acquiring a reference discharge range, comparing the discharge range with the reference discharge range, and determining whether the power level of the battery is displayed correctly; The charging time of each voltage segment of the battery is detected to obtain the charging range of the battery, a reference charging range is obtained, the charging range is compared with the reference charging range, and it is determined whether the power level of the battery is displayed correctly.

8. The method for detecting electric quantity according to claim 6, characterized in that: Also includes: If the voltage average value is greater than or equal to the preset voltage threshold, shield the voltage detection of the VDD port of the MCU processor, and detect the indication level of the first CHRG pin of the charging chip; The indicated level is matched and compared with a preset level to obtain the battery power level and display it.

9. The method for detecting electric quantity according to claim 8, characterized in that: The step of matching and comparing the indicated level with a preset level to obtain and display the battery power level includes at least one of the following: If the indication level is a high level, it indicates that the battery is not fully charged; If the indication level is a low level, it indicates that the battery is fully charged.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the power detection method according to any one of claims 6 to 9.

Citation Information

Patent Citations

  • A battery device for intelligent electric device

    CN206742879U

  • Battery power manages circuit

    CN207765577U

  • Electric quantity detection circuit

    CN211698114U