Charging management and electric quantity detection method of battery
By using CC signal detection, real-time voltage detection and integral calculation in battery charging management and power detection methods, the problems of insufficient accuracy and high cost of power display in the existing technology are solved, and the accurate display of power and low cost are achieved. Designed for miniaturized products.
Patent Information
- Application Number
- CN202411598481.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art lacks accuracy in battery display, especially in products such as waist belts and neck belts, which cannot accurately display battery power, which causes inconvenience to users. At the same time, the existing high-precision power detection methods are costly and are not suitable for miniaturized products.
A battery charging management and power detection method is adopted to calculate power through CC signal detection, real-time voltage detection, MCU timer statistics discharge time, integral calculation of power, and the power state is indicated by the flashing frequency of the LED indicator to achieve accurate power display and low cost design.
It realizes accurate display and real-time monitoring of battery power, reduces circuit design complexity and component costs, and is suitable for miniaturized products such as waist belts and neck belts.
Smart Images

Figure CN119438937A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the charge and discharge management and power detection of lithium batteries, and in particular to a battery charge management and power detection method. Background Art
[0002] There are many methods for battery charge and discharge management and control as well as power detection. The factors to be considered for solutions applied to different products will also be different. For high-precision and expensive equipment, high accuracy is the main consideration, while for civilian small appliances, low cost is the main consideration. For example, in the medical field, for products such as waist belts and neck belts that have electric heating auxiliary treatment, the existing technology often focuses on low cost, and the display of product power is very inaccurate.
[0003] Observing the power display function of the common waist and neck guards on the market, it is not difficult to find that there is a general lack of accurate and intuitive power display function. Some products can only display the currently selected heating gear through the LED indicator, and distinguish the battery charging status by whether the LED indicator flashes. If it is charging, the LED indicator flashes, and if it is fully charged, the LED indicator is always on. This method does not allow users to clearly know the current battery charging progress and current power status, and the remaining battery power is not clear during the use of the product (that is, when it is not charged). For users, it is completely unclear whether the remaining power is sufficient to support their continued use of the product, which brings a very bad experience to users. There are also a small number of products that use a resistor voltage divider to monitor the battery voltage for power indication. This method can only roughly display the power and is very inaccurate, especially when there is a large difference between no-load and loaded.
[0004] In the pursuit of high accuracy of battery power detection, the prior art mainly uses a voltage detection module to measure the terminal voltage of the battery, and a current detection module to measure the charge and discharge current of the battery. Then, based on a power calculation module, the input / output power of the battery is calculated, and then the time is integrated through an integral calculation module according to the input / output power to obtain the input / output power of the battery. Although this method can achieve accurate power detection, it is costly and requires the cooperation of a voltage detection module, a current detection module, and a power calculation module. The above modules not only have many components, but also occupy area in circuit design, which is not suitable for products that pursue miniaturization. Summary of the invention
[0005] The invention discloses a battery charging management and power detection method, which can accurately display the power of the battery and has the characteristics of low cost and simple circuit design, and is very suitable for use on small products with electric heating functions such as waist belts and neck belts.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is: A battery charging management and power detection method, including the following contents: First, perform CC signal detection to determine whether the charger is connected; Detect the battery voltage in real time and judge the feedback signals of the STDBY port and CHARGE port of the charge and discharge management chip; When it is detected that the charger is not connected and the function of the power consumption module is activated, the MCU timer starts to count the discharge time. The fixed power value of the power consumption module is set in the system. The power consumption in the discharge stage is obtained by integrating the fixed power value with the discharge time. The initial remaining power of the battery before discharge is obtained according to the battery voltage measured at the beginning of discharge. The real-time remaining power of the battery can be obtained and displayed through the difference between the initial remaining power and the power consumption. The time parameters of the battery are saved in real time, and the discharge time parameters recorded this time are compared with the historical record parameters. If they exceed the set range, calibration is performed; When it is detected that a charger is connected, the charging status of the battery is judged based on the feedback signals of the STDBY port and the CHARGE port. If the battery is fully charged, the MCU timing ends and the current battery power is displayed. If the battery starts to charge, the MCU timer starts and the charging time is recorded. During the charging stage, the current charge capacity of the battery is obtained based on the integration of the real-time detected battery voltage and battery current over the charging time, and the initial power of the battery is obtained based on the measured initial voltage of the battery. The current power of the battery is obtained and displayed based on the sum of the initial power and the charging capacity. The battery time parameters are saved in real time, and the charging time parameters recorded this time are compared with the historical record parameters. If they exceed the set range, calibration is performed.
[0007] Furthermore, when it is detected that the battery is in a charging state, it is first determined whether the battery has been replaced. If the battery has not been replaced, the power integral calculation in the subsequent charging stage is still performed according to the parameters saved last time. If the battery has been replaced, the power integral calculation of the current battery is first performed according to the parameters saved last time. After multiple cycles of charge and discharge, autonomous learning is completed to obtain the time parameters of the replaced new battery. The time parameters of the new battery are saved to replace the originally saved time parameters, and the power is subsequently accumulated according to the time parameters of the new battery.
[0008] Furthermore, the method for determining whether the battery has been replaced is as follows: the detected current battery voltage is compared with the historically saved value. If the current voltage value is within ±20% of the last saved value, the battery is considered to be the same battery.
[0009] Furthermore, when the battery is charged, when the measured battery voltage is lower than the set voltage value, the battery adopts a constant current charging mode, and when the measured battery voltage reaches the set voltage value, the battery adopts a constant voltage charging mode until the battery is fully charged.
[0010] Furthermore, after the battery enters the constant voltage charging mode, it is determined whether the battery is fully charged based on the feedback signals from the STDBY port and the CHARGE port. If it is detected that the battery is fully charged, the power integration result after the battery enters the constant voltage charging mode is calibrated and then displayed.
[0011] Furthermore, when the battery is in the charging stage, in addition to obtaining the current power result based on the integral calculation and directly displaying it, the current power status of the battery is indicated by the change in the flashing frequency of the LED indicator. The higher the battery voltage, the smaller the flashing frequency of the LED indicator. The MCU determines the flashing frequency of the LED indicator based on the detected battery voltage value.
[0012] Furthermore, when the battery power is lower than 40%, the battery voltage is between 0 and 3.7V, and the LED indicator light flashes at a frequency of 2HZ; when the battery power is between 40% and 80%, the battery voltage is between 3.7V and 3.9V, and the LED indicator light flashes at a frequency of 1HZ; when the battery power is between 80% and 99%, the battery voltage is between 3.9V and 4.19V, and the LED indicator light flashes at a frequency of 0.5HZ; when the battery power is between 99% and 100%, the battery voltage is equal to 4.2V and the charging current is ≤10% of the set value, the battery is considered to be fully charged, and the LED indicator light does not flash.
[0013] Furthermore, in the TYPE-C charging interface circuit of the battery, the CC port is grounded.
[0014] Furthermore, the charge and discharge management chip adopts a TP4056 chip or an AP5056 chip.
[0015] Furthermore, the power consumption module includes a heating wire heating module and / or a motor vibration module and / or a voice module. The heating module and the motor vibration module are both set with multiple gears. The fixed power values between different gears of the same functional module are different. The voice module adopts a set fixed voice broadcast instruction. The voice module is used for voice broadcast of the currently selected gear and / or for voice broadcast of the current battery power.
[0016] The battery charging management and power detection scheme disclosed in the present invention is very suitable for use on waist belts and neck belts with heating and / or vibration massage functions. It can not only accurately display the battery power level, making it convenient for users to grasp the current battery power status in real time and better arrange timely charging of products, but also meet the urgent demand for low cost of civilian products and simplify the design of the entire control circuit. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a control structure block diagram of the heating waist belt provided in the embodiment; Figure 2 This is the IO pin assignment diagram of the main control MCU; Figure 3 A circuit diagram of a charging management chip in an embodiment; Figure 4 A circuit diagram of a voice chip in an embodiment; Figure 5 A circuit diagram of a heating wire in an embodiment; Figure 6 This is a motor control circuit diagram used in the vibration massage function in the embodiment; Figure 7 It is a temperature detection circuit diagram in the embodiment; Figure 8 A battery voltage detection circuit diagram in an embodiment; Fig. 9 This is the circuit diagram of the LED charging indicator light in the embodiment; Fig.10 TYPE-C interface circuit diagram in the embodiment; Fig.11 is the charge and discharge current-voltage curve of the battery; Fig.12 FIG. 4 is a flow chart of battery power detection in an embodiment. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0019] This embodiment takes a waist belt with electric heating and vibration massage functions as an example to illustrate the lithium battery charging management and power detection method in the product. Figure 1 As shown, it mainly includes a main control MCU, a key input module, a charging management circuit, a lithium battery, a DC-DC step-down circuit, a battery voltage detection module, an NTC, a voice chip, a heating wire, a motor and an LED. The key input module can be used to set the required heating or massage gear to the main control MCU. The charging and discharging of the lithium battery is controlled by the charging management circuit. The voltage output by the lithium battery is reduced to 3.3V by the DC-DC step-down circuit to power the main control MCU. The detection result of the lithium battery voltage is fed back to the main control MCU, and the NTC temperature detection result is fed back to the main control MCU. The output end of the main control MCU is respectively connected to the heating wire drive module, the motor, the LED and the voice chip. The voice chip plays a preset voice through a speaker, and the LED displays the power of the lithium battery by flashing.
[0020] The main control MCU in the control circuit is a single chip microcomputer of model STM32G030F6P6TR in this embodiment, and the IO pins of the main control MCU are as follows: Figure 2 The chip used in the charging management circuit in this embodiment needs to have a STDBY port and a CHARGE port. For example, the TP4056 chip and the AP5056 chip both meet the above requirements. Figure 3 The TP4056 chip shown in the figure is taken as an example. This type of chip has a built-in current and voltage detection circuit, which can be used to detect the voltage and current of the lithium battery. The voice chip in this embodiment uses the WTN6020 chip, and its circuit is as follows Figure 4 The heating wire in this embodiment adopts a heating sheet with a fixed resistance, such as Figure 5 As shown, the power control is adjusted by the duty cycle of the PWM of the MOS tube. The heating function in this embodiment has three gears, and the heating power of each gear is fixed and known. The power of the first gear is 3W, the power of the second gear is 4W, and the power of the third gear is 5W, which can be selected by the user. The control system sets the temperature upper limit value of each gear, and the heating stops when the temperature upper limit value of the corresponding gear is reached. The motor vibration circuit in this embodiment is as shown in FIG. Figure 6 As shown in the figure, there are three gears in total. The power corresponding to each gear is different, but the power of each gear is also fixed and known. Figure 7 As shown, the battery voltage detection circuit is as follows Figure 8 As shown, the LED indicator circuit is as Fig. 9 shown.
[0021] In this embodiment, the power detection of the lithium battery can be divided into a discharge stage and a charge stage. Fig.12 As shown in the figure, after the product is powered on, the CC signal is first used to determine whether the TYPE-C interface is connected to the charger. For some chargers with fast charging function, the CC signal needs to detect the voltage handshake signal before outputting the voltage. In order to be compatible with more types of chargers, in this embodiment, Fig.10As shown, the CC port is grounded, and after connecting to the charger, it is considered to be normally connected so that the voltage can be output. In this embodiment, the voltage of the lithium battery is detected in real time. When the charger is not detected to be connected, and the user enables the power consumption module (in this embodiment, it refers to any one of the heating mode or vibration massage mode, or both functions are enabled at the same time), the MCU timer is turned on until the timing ends after the set time is reached, thereby obtaining the discharge time T of the battery. In view of the above-mentioned fact that the power of the heating module and the vibration module in this embodiment are fixed and preset in the system, and the voice broadcast also uses a set fixed voice broadcast instruction, and its voice duration is also fixed and known, therefore, the power consumption W of the main power consumption module is fixed and known, and the power consumption of the battery can be calculated according to Q=W×T, and no additional power consumption calculation is required, which saves a lot of component costs compared with the prior art. Before using the product, the initial voltage value of the lithium battery has been obtained by detecting the battery voltage. The main control MCU can know the current remaining battery power based on the initial voltage value. The real-time remaining battery power can be obtained by subtracting the power consumption obtained by integral calculation from the current remaining power. The result is directly displayed on the display screen, and the relevant time parameters obtained during the detection process are saved.
[0022] When it is detected that the charger is connected, the charging status of the battery is first determined by the signal fed back to the main control MCU through the STDBY port and CHARGE port of the charging management chip. If the STDBY port outputs a low level, it means that the battery is fully charged. If the CHARGE port outputs a low level, it means that the battery is being charged. If the battery is fully charged, the MCU timing ends, directly displays the current battery power as 100%, and saves the battery-related parameters. If the battery starts to charge, the MCU timer starts and records the charging time until the MCU timing ends after charging is completed, and records the battery charging time parameters. The charging process in this embodiment is as follows: When the measured battery voltage is lower than the set voltage value, the battery adopts a constant current charging mode. When the measured battery voltage reaches the set voltage value, the battery adopts a constant voltage charging mode until the battery is fully charged. In the constant current charging stage, the battery current is basically stable, and the battery voltage gradually rises. Based on the integration of the measured battery voltage and battery current over the charging time, the real-time charge capacity of the battery can be obtained. Based on the measured initial charging voltage, the initial charge capacity of the battery can be obtained. Based on the sum of the initial charge capacity and the charge capacity, the current charge capacity of the battery can be obtained. The time parameters of the charging stage are saved in real time and the charge capacity is displayed in real time. In the constant voltage charging stage, the charge capacity calculated based on the charge and discharge integration is not very accurate, because during the battery charging process, such as Fig.11 As shown ( Fig.11In the figure, the upper part is the current curve and the lower part is the voltage curve), the battery first enters the constant current charging mode after pre-charging. In the constant current mode, the battery voltage rises slowly. When the battery voltage is close to 4.2V, the battery enters the constant voltage charging mode. In the constant voltage mode, the battery voltage remains stable, but the current decreases. Therefore, the integral calculated power in the constant voltage charging stage is not accurate. In the constant voltage charging stage, this embodiment also monitors the feedback signals of the STDBY port and the CHARGE port to determine whether the battery is full, so as to calibrate the current charging integral calculation result, that is, if it is detected that the battery is full, the power calculation result after the battery enters the constant voltage charging mode is calibrated before displaying, and the relevant values are saved.
[0023] In this embodiment, the percentage of remaining power of the battery can be displayed in real time during the battery discharge process, so that the user can clearly know whether the remaining power of the battery is sufficient to support its continued use. In the charging stage of the battery, in addition to observing the current battery power percentage displayed on the display screen, the user can also know the current power of the battery from a distance by the flashing speed of the LED indicator. Of course, the power display in the charging stage is not limited to the above-mentioned LED flashing method, and common methods such as a marquee, a digital tube display, or a voice broadcast can also be used. In this embodiment, the LED flashing method is taken as an example. According to the range of the battery voltage value detected in the charging stage, the battery power is divided into four sections for display reminders. The higher the battery voltage, the slower the flashing frequency of the LED indicator. The frequency of the LED indicator can be set by the program of the LED driver chip, so only one LED indicator needs to be set to indicate multiple different charging states. In the prior art, it is usually necessary to set multiple LED lights, and the corresponding LED lights are lit when the corresponding power is reached. This method has a large number of components, which is not conducive to cost reduction and circuit simplification. In this embodiment, the frequency of the LED indicator light is set as follows: when the battery power is lower than 40%, the detected battery voltage is between 0 and 3.7V, and the LED indicator light flashes at a frequency of 2HZ; when the battery power is between 40% and 80%, the detected battery voltage is between 3.7V and 3.9V, and the LED indicator light flashes at a frequency of 1HZ; when the battery power is between 80% and 99%, the detected battery voltage is between 3.9V and 4.19V, and the LED indicator light flashes at a frequency of 0.5HZ, indicating that the battery is about to be fully charged and will immediately enter the trickle charging state; when the battery power is between 99% and 100%, the battery voltage is equal to 4.2V and the charging current is ≤10% of the set value, the battery is considered to be fully charged at this time, and the LED indicator light is fully on and does not flash.
[0024] This embodiment is based on the TP4056 charging management chip and cooperates with battery voltage detection to integrate charging and discharging to calculate the battery power. When the MCU monitors that the power is low, the remaining power information will be saved in time to the MCU's FLASH. When charging again, after the MCU is powered on, it first reads the historically saved value from the FLASH and compares it with the currently detected battery voltage to determine whether the current battery is the same as the last battery (that is, to determine whether the battery has been replaced with a new battery). Because the time parameters (battery capacity, charging and discharging time, etc.) of different batteries are not the same, once the battery is replaced, the historically saved time parameters are greatly different from the currently used battery, which will affect the calculation result of the power. Therefore, in this embodiment, when it is detected that the battery is in a charging state, it is first determined whether the battery has been replaced, and the detected current battery voltage is compared with the historically saved value. If the current voltage value is within the range of ±20% of the last saved value, it is considered that the battery is the same battery, otherwise it is determined that the battery is replaced. If the battery has not been replaced, the power detection in the subsequent charging stage will still accumulate the power according to the time parameters saved last time. If the battery has been replaced, the power will be accumulated according to the time parameters saved historically first (the calculation result is not accurate at this time). This process is the autonomous learning stage. After several cycles of charge and discharge, the autonomous learning is completed, and the time parameters of the replaced new battery can be obtained. The time parameters of the new battery are saved to replace the time parameters of the old battery that were originally saved. Subsequently, the power is accumulated according to the time parameters of the new battery to obtain accurate power calculation results.
[0025] As the battery is used for a longer time, its parameters such as charging and discharging time will also change, and it is necessary to calibrate the saved battery time parameters in time, otherwise it will affect the accuracy of power calculation. Therefore, the present invention saves the battery time parameters in real time during the charging and discharging stages of the battery, and compares the currently obtained time parameters with the last recorded time parameters. If they exceed the specified range, the historically saved values are calibrated by the currently obtained time parameters. The calibrated time parameters will improve the accuracy of the subsequent preliminary judgment of the battery power based on the battery voltage.
[0026] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A battery charging management and power detection method, characterized in that: It includes the following: First, perform CC signal detection to determine whether the charger is connected; Detect the battery voltage in real time and judge the feedback signals of the STDBY port and CHARGE port of the charge and discharge management chip; When it is detected that the charger is not connected and the function of the power consumption module is activated, the MCU timer starts to count the discharge time. The fixed power value of the power consumption module is set in the system. The power consumption in the discharge stage is obtained by integrating the fixed power value with the discharge time. The initial remaining power of the battery before discharge is obtained according to the battery voltage measured at the beginning of discharge. The real-time remaining power of the battery can be obtained and displayed through the difference between the initial remaining power and the power consumption. The time parameters of the battery are saved in real time, and the discharge time parameters recorded this time are compared with the historical record parameters. If they exceed the set range, calibration is performed; When it is detected that a charger is connected, the charging status of the battery is judged based on the feedback signals of the STDBY port and the CHARGE port. If the battery is fully charged, the MCU timing ends and the current battery power is displayed. If the battery starts to charge, the MCU timer starts and the charging time is recorded. During the charging stage, the current charge capacity of the battery is obtained based on the integration of the real-time detected battery voltage and battery current over the charging time, and the initial power of the battery is obtained based on the measured initial voltage of the battery. The current power of the battery is obtained and displayed based on the sum of the initial power and the charging capacity. The battery time parameters are saved in real time, and the charging time parameters recorded this time are compared with the historical record parameters. If they exceed the set range, calibration is performed.
2. A battery charging management and power detection method according to claim 1, characterized in that: When it is detected that the battery is in the charging state, it is first determined whether the battery has been replaced. If the battery has not been replaced, the power integral calculation in the subsequent charging stage is still performed according to the parameters saved last time. If the battery has been replaced, the power integral calculation of the current battery is performed according to the parameters saved last time. After multiple cycles of charge and discharge, autonomous learning is completed to obtain the time parameters of the new battery after replacement. The time parameters of the new battery are saved to replace the originally saved time parameters, and the power is subsequently accumulated according to the time parameters of the new battery.
3. A battery charging management and power detection method according to claim 2, characterized in that: The method for determining whether the battery has been replaced is as follows: the detected current battery voltage is compared with the historically saved value. If the current voltage value is within ±20% of the last saved value, the battery is considered to be the same battery.
4. The method for battery charging management and power detection according to claim 1, characterized in that: When the battery is charged, when the measured battery voltage is lower than the set voltage value, the battery adopts a constant current charging mode, and when the measured battery voltage reaches the set voltage value, the battery adopts a constant voltage charging mode until the battery is fully charged.
5. A battery charging management and power detection method according to claim 4, characterized in that: After the battery enters the constant voltage charging mode, it is determined whether the battery is fully charged based on the feedback signals from the STDBY port and the CHARGE port. If it is detected that the battery is fully charged, the power integration result after the battery enters the constant voltage charging mode is calibrated and then displayed.
6. A battery charging management and power detection method according to claim 1, characterized in that: When the battery is in the charging stage, in addition to obtaining the current power result based on the integral calculation and directly displaying it, the current power status of the battery is also indicated by the change in the flashing frequency of the LED indicator. The higher the battery voltage, the smaller the flashing frequency of the LED indicator. The MCU determines the flashing frequency of the LED indicator based on the detected battery voltage value.
7. A battery charging management and power detection method according to claim 6, characterized in that: When the battery power is lower than 40%, the battery voltage is between 0 and 3.7V, and the LED indicator flashes at a frequency of 2HZ; when the battery power is between 40% and 80%, the battery voltage is between 3.7V and 3.9V, and the LED indicator flashes at a frequency of 1HZ; when the battery power is between 80% and 99%, the battery voltage is between 3.9V and 4.19V, and the LED indicator flashes at a frequency of 0.5HZ; when the battery power is between 99% and 100%, the battery voltage is equal to 4.2V and the charging current is ≤10% of the set value, the battery is considered to be fully charged, and the LED indicator does not flash.
8. A battery charging management and power detection method according to claim 1, characterized in that: In the TYPE-C charging interface circuit of the battery, the CC port is grounded.
9. A battery charging management and power detection method according to claim 1, characterized in that: The charge and discharge management chip adopts a TP4056 chip or an AP5056 chip.
10. A battery charging management and power detection method according to claim 1, characterized in that: The power consumption module includes a heating wire heating module and / or a motor vibration module and / or a voice module. The heating module and the motor vibration module are both set with multiple gears. The fixed power values between different gears of the same functional module are different. The voice module adopts a set fixed voice broadcast instruction. The voice module is used for voice broadcast of the currently selected gear and / or for voice broadcast of the current battery power.