Automatic identification method and system for non-removable battery type of handheld device
By changing the output voltage of the motherboard GPIO port and querying the battery temperature value of the NTC resistor, the problem of the non-removable battery type identification in handheld devices requires a special ID pin, and the battery type identification with simple structure, reliable detection, low cost and software-compatible is achieved.
Patent Information
- Application Number
- CN202410245388.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-03-05
AI Technical Summary
The prior art requires special ID pins when identifying the non-removable battery type in handheld devices, which occupies structural space and is incompatible with the software, so it is impossible to use different battery components in the same version of software.
By changing the output voltage of the motherboard GPIO port, obtain the NTC port voltage of the non-removable battery, and query the battery temperature values of different types of NTC resistors through the voltage thermometer, and compare with the motherboard temperature to determine the type of NTC resistor.
The number of functional pins of the battery pack is reduced, structural simplicity and detection reliability is improved, production costs and software maintenance costs are reduced, and two different battery components are correctly identified in the same version of software.
Smart Images

Figure CN118091435B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery detection, and in particular to a method and system for automatically identifying the type of a non-removable battery of a handheld device. Background Art
[0002] In handheld devices, batteries are essential components. There is an NTC resistor inside the battery that is pulled down to the negative electrode of the battery pack to reflect the temperature information of the battery when it is working. The charging and discharging characteristic curves of different batteries are often very different. The system software needs to call the characteristic parameters and battery temperature information of the corresponding battery to correctly reflect the current power information of the battery in use. Due to supply, cost, performance and other reasons, some products will choose two types of batteries as alternative materials for compatible use in the same product. In order to identify different battery components, in the prior art, another special ID pin other than the NTC pin is generally used. The ID pin inside the battery pack is pulled down to the negative electrode of the battery pack through a resistor of a specific resistance value. The ID pin is connected to a pull-up GPIO port or ADC port inside the mobile device. Different battery components are distinguished by reading the high and low level states of the ID pin or the voltage value of the pull-up and pull-down resistor divider. However, the existing technology has the following disadvantages: 1) Structurally, the battery connector requires a dedicated ID pin, which potentially occupies a larger structural space; 2) If the ID pin is not reserved before the product is mass-produced, and there is a new demand for using alternative battery components after mass production, they cannot be used compatible in the same version of software. Only two separate versions of software using different battery parameters can be used to match the corresponding battery components, resulting in a burden on software version maintenance. Summary of the invention
[0003] The invention provides an automatic identification method for the type of a non-detachable battery of a handheld device, which is used to solve the problem that the existing battery type identification needs to set a special ID pin and the software is incompatible.
[0004] The invention also provides an automatic identification system for the type of non-detachable batteries of handheld devices.
[0005] To achieve the purpose of the present invention, the present invention provides a method for automatically identifying the type of a non-removable battery of a handheld device, the method comprising the following steps:
[0006] a. Connect the mainboard to the NTC port of the non-removable battery;
[0007] b. Get the motherboard temperature T b ;
[0008] c. Output the GPIO port of the mainboard to a low level. The mainboard will N-L Get the battery temperature value T corresponding to different types of NTC resistors X-L, where X is the type of NTC resistor;
[0009] d. Output high level to the GPIO port of the mainboard. The mainboard will output high level according to the voltage V of the NTC port of the battery. N-H Get the battery temperature value T corresponding to different types of NTC resistors X-H , where X is the type of NTC resistor;
[0010] e. The battery temperature values T obtained in step c are X-L And the battery temperature value T obtained in step d X-H With T b Compare and determine the type of NTC resistor in your battery.
[0011] Furthermore, the step c comprises:
[0012] c1. Set the mainboard GPIO port to output low level;
[0013] c2. Read the voltage V at the battery NTC port N-L ;
[0014] c3. According to the voltage V N-L Query the battery temperature values T corresponding to different types of NTC resistors in the first voltage-temperature table X-L ;
[0015] The step d comprises:
[0016] d1. Set the mainboard GPIO port to output high level;
[0017] d2. Read the voltage V at the battery NTC port N-H ;
[0018] d3. According to the voltage V N-H Query the battery temperature value T corresponding to different types of NTC resistors in the second voltage-temperature table X-H .
[0019] Further, step e comprises:
[0020] e1. The battery temperature values T obtained in step c3 are X-L With T b Compare and convert the battery temperature value T X-L Medium and T b The NTC resistor corresponding to the closest temperature value is recorded as the first type resistor;
[0021] e2, respectively, the battery temperature value T obtained in step d3 X-H With T b Compare and convert the battery temperature value T X-H Medium and T bThe NTC resistor corresponding to the closest temperature value is recorded as the second type resistor;
[0022] e3. Compare the first type resistor with the second type resistor. If they are consistent, it is determined to be the type of the current NTC resistor; if they are inconsistent, an error is reported.
[0023] Optionally, the types of the NTC resistor of the non-removable battery include a resistor with a resistance of 10K at a temperature of 25° C. and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25° C. and an accuracy of 1%.
[0024] Further, in step c3, the first voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a low level, and the first voltage-temperature table is obtained by calculating the resistance value of the NTC resistor through Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors;
[0025] In step d3, the second voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a high level. The second voltage-temperature table is obtained by calculating the resistance value of the NTC resistor through Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors.
[0026] In some embodiments, before step a, step a0 is further included: mainboard testing, wherein step a0 includes:
[0027] a01. Connect the connection between the mainboard and the NTC port to a 10K resistor and then to ground;
[0028] a02, set the mainboard GPIO port to output high or low level;
[0029] a03. Read the voltage value at the input end of the 10K resistor, and query the battery temperature value T1 corresponding to the 10K resistor in the first voltage-temperature table or the second voltage-temperature table according to the voltage value;
[0030] a04, connect the connection terminal between the mainboard and the NTC port to a 47K resistor and then to ground;
[0031] a05. Read the voltage value at the input end of the 47K resistor, and query the battery temperature value T2 corresponding to the 47K resistor in the first voltage-temperature table or the second voltage-temperature table according to the voltage value;
[0032] a06. Compare T1 and T2. If both T1 and T2 are within 25±2℃, the mainboard is normal, otherwise the mainboard is invalid.
[0033] In some embodiments, in step e3, if the first type resistor is inconsistent with the second type resistor, the following steps are performed:
[0034] f1. Set the mainboard GPIO port to output high impedance;
[0035] f2. Read the voltage V at the battery NTC port N-V ;
[0036] f3, according to the voltage V N-V Query the battery temperature value T corresponding to different types of NTC resistors in the third voltage-temperature table X-V , where X is the type of NTC resistor;
[0037] f4, respectively, the battery temperature value T obtained in step f3 X-V With T b and compare it with T b The NTC resistor corresponding to the closest temperature value is recorded as the third type resistor;
[0038] f5. Compare the third type resistor with the first type resistor and the second type resistor. If the third type resistor is consistent with the first type resistor or the second type resistor, it is determined to be the type of the current NTC resistor.
[0039] The present invention also provides an automatic identification system for the type of non-removable battery of a handheld device, the system comprising a mainboard and a non-removable battery electrically connected thereto, the mainboard being provided with a GPIO port, an ADC input port and a power supply, the non-removable battery being provided with an NTC resistor and an NTC port, one end of the NTC resistor being connected to one end of the NTC port, and the other end thereof being grounded, the other end of the NTC port being respectively connected to the GPIO port, the ADC input port and the power supply VDD, and the GPIO port outputting a high level or a low level.
[0040] Furthermore, a first resistor R1 is provided between the NTC port and the GPIO port, and a second resistor R2 is provided between the NTC port and the power supply VDD.
[0041] Further,
[0042] When the GPIO port outputs a low level, the relationship between the NTC port voltage of the NTC resistor and the battery temperature is calculated by the following formula:
[0043]
[0044] Among them, V N-L is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 1 is the resistance value of the first resistor R1, R2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor;
[0045] When the GPIO port outputs a high level, the relationship between the NTC port voltage of the NTC resistor and the battery temperature is calculated by the following formula:
[0046]
[0047] Among them, V N-H is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 1 is the resistance value of the first resistor R1, R 2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor;
[0048] When R is calculated N Then, according to R N By looking up the resistance-temperature comparison table of different types of NTCs, you can get the relationship between the NTC port voltage and temperature.
[0049] The beneficial effects of the present invention are as follows: the present invention changes the output voltage of the mainboard GPIO port to obtain the NTC port voltage of the non-removable battery in different states, and queries the battery temperature value corresponding to different types of NTC resistors in the voltage temperature table through the NTC port voltage, and then compares the queried battery temperature value with the mainboard temperature, and determines the type of NTC resistor according to the comparison result. The number of functional pins of the battery pack is reduced, which not only has a simple structure, high detection reliability, and low production cost; and two different battery components can be correctly identified in the same version of software, with good compatibility and reduced software maintenance costs.
[0050] On the other hand, before detecting the battery type, a resistor of a known model is connected to the connection terminal between the mainboard and the NTC port to obtain the battery temperature value corresponding to the resistor of this type, and to determine whether the battery temperature value is within 25±2℃, so as to determine whether the mainboard is working normally, thereby further improving the reliability of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a flow chart of the method of embodiment 1 of the present invention.
[0052] Figure 2 This is a curve diagram of the change of the NTC port voltage and the battery temperature when the GPIO port outputs a low level in Example 1 of the present invention.
[0053] Figure 3 This is a curve diagram of the change of the NTC port voltage and the battery temperature when the GPIO port of Example 1 of the present invention outputs a high level.
[0054] Figure 4 This is a flow chart of the motherboard testing method of embodiment 2 of the present invention.
[0055] Figure 5 It is a system circuit diagram of the mainboard test of embodiment 2 of the present invention.
[0056] Figure 6 It is a method flow chart of step S300 of embodiment 3 of the present invention.
[0057] Figure 7 This is a curve diagram of the change of the NTC port voltage and the battery temperature when the GPIO port of Example 3 of the present invention outputs a high impedance state.
[0058] Figure 8 It is a system circuit diagram of the present invention. DETAILED DESCRIPTION
[0059] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0060] Example 1
[0061] See also Figure 1 The present invention provides a method for automatically identifying the type of a non-removable battery of a handheld device, comprising the following steps:
[0062] S110. Connect the mainboard to the NTC port of the non-removable battery.
[0063] In this step, if Figure 8 As shown, the mainboard is provided with a GPIO port, an ADC input port and a power supply, wherein the ADC input port is connected to the NTC port of the non-removable battery, and the voltage value of the NTC port of the non-removable battery can be obtained by reading the voltage of the ADC input port. The GPIO port and the power supply are respectively connected to the NTC port of the non-removable battery, and the NTC port voltage of the non-removable battery in different states can be obtained by changing the output voltage of the GPIO port. Different types of non-removable batteries have different types of NTC resistors.
[0064] S120, get the mainboard temperature T b .
[0065] In this step, since the battery and the mainboard are in the same environment in a device with a non-removable battery, the mainboard temperature and the battery temperature tend to be the same when not working. Therefore, the type of battery can be determined by comparing the battery temperature with the mainboard temperature.
[0066] S130, the mainboard GPIO port outputs a low level, and the mainboard is based on the voltage V of the battery NTC port N-L Get the battery temperature value T corresponding to different types of NTC resistors X-L .
[0067] This step includes the following steps:
[0068] S131, set the mainboard GPIO port to output low level.
[0069] In this step, if Figure 8 As shown, a first resistor R1 is provided between the mainboard GPIO port and the battery NTC port, and a second resistor R2 is provided between the power supply and the battery NTC port. The output of the mainboard GPIO port is set to a low level, that is, the mainboard GPIO port is grounded. At this time, the NTC resistor is connected in parallel with the first resistor R1 and then in series with the second resistor R2.
[0070] S132, read the voltage V of the battery NTC port N-L .
[0071] In this step, the mainboard reads the voltage V at the battery NTC port. N-L , that is, the mainboard reads the ADC voltage.
[0072] S133, according to the voltage V N-L Query the battery temperature values T corresponding to different types of NTC resistors in the first voltage-temperature table X-L , where X is the type of NTC resistor.
[0073] In this step, the first voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a low level, which is stored in the mainboard. The first voltage-temperature table is obtained by calculating the resistance value of the NTC resistor through Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors in Table 1.
[0074]
[0075] Specifically, according to Ohm's law, we get:
[0076]
[0077] Among them, V N-L is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 1 is the resistance value of the first resistor R1, R 2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor;
[0078] That is, when the mainboard obtains the voltage V of the battery NTC port N-L When the resistance of the NTC resistor is N By looking up the resistance-temperature comparison table of different types of NTC resistors in Table 1, the corresponding temperature values T of different types of batteries can be obtained. X-L .
[0079] The types of NTC resistors in this embodiment are described by taking two commonly used resistors, a resistor with a resistance of 10K and an accuracy of 1% at a temperature of 25° C. and a resistor with a resistance of 47K and an accuracy of 1% at a temperature of 25° C. As a matter of course, the types of NTC resistors are not limited thereto.
[0080] Specifically, assume that the NTC resistor in the non-removable battery is a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1%, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V. N-L Substituting into formula (1), we get R N , and then calculate the R N Look up the temperature corresponding to the 10K, 1% resistor value in Table 1, and you will get the voltage V N-L The corresponding temperature value T 10K-L . Change the temperature value T 10K-L , you can check the corresponding NTC resistor value R from Table 1 N , and then the resistance R N Substituting into formula (1), we can get the NTC port voltage value V at different temperatures: N-L The motherboard will calculate the NTC port voltage value V corresponding to different temperatures N-L The first voltage-temperature table is prepared and saved for subsequent query. Figure 2 As shown, the NTC port voltage value V N-L and battery temperature T 10K-L Draw the voltage and temperature curve to facilitate user query. Figure 2 In the embodiment shown, it is assumed that the voltage value V N-L When it is 0.1V, Figure 2 It can be seen that the temperature value T corresponding to NTC 10K-L It is about 40°.
[0081] Assume that the NTC resistor in the non-removable battery is a resistor with a resistance of 47K at 25°C and an accuracy of 1%, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V. N-L Substituting into formula (1), we get RN , and then calculate the R N Look up the temperature corresponding to the 47K, 1% resistor value in Table 1, and you will get the voltage V N-L The corresponding temperature value T 47K-L . Change the temperature value T 47K-L , you can check the corresponding NTC resistor value R from Table 1 N , and then the resistance R N Substituting into formula (1), we can get the NTC port voltage value V at different temperatures: N-L The motherboard will calculate the NTC port voltage value V corresponding to different temperatures N-L The first voltage-temperature table is prepared and saved for subsequent query. Figure 2 As shown, the NTC port voltage value V N-L and battery temperature T 47K-L Draw the voltage and temperature curve to facilitate user query. Figure 2 In the embodiment shown, it is assumed that the voltage value V N-L When it is 0.6V, Figure 2 It can be seen that the temperature value corresponding to NTC is about 18°.
[0082] S140, the mainboard GPIO port outputs a high level, and the mainboard is based on the voltage V of the battery NTC port N-H Get the battery temperature value T corresponding to different types of NTC resistors X-H .
[0083] This step includes the following steps:
[0084] S141, set the mainboard GPIO port to output high level.
[0085] In this step, if Figure 7 As shown, a first resistor R1 is provided between the mainboard GPIO port and the battery NTC port, and a second resistor R2 is provided between the power supply and the battery NTC port. The mainboard GPIO port output is set to a high level, that is, the mainboard GPIO port output voltage is equal to the power supply voltage. At this time, the first resistor R1 and the second resistor R2 are connected in parallel and then in series with the NTC resistor.
[0086] S142, read the voltage V of the battery NTC port N-H .
[0087] In this step, the mainboard reads the voltage V at the battery NTC port. N-H , that is, the mainboard reads the ADC voltage.
[0088] S143, according to the voltage V N-HQuery the battery temperature value T corresponding to different types of NTC resistors in the second voltage-temperature table X-H , where X is the type of NTC resistor.
[0089] In this step, the second voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a high level, which is stored in the mainboard. The second voltage-temperature table is obtained by calculating the resistance value of the NTC resistor through Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors in Table 1.
[0090] Specifically, according to Ohm's law, we get:
[0091]
[0092] Among them, V N-H is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 1 is the resistance value of the first resistor R1, R 2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor;
[0093] That is, when the mainboard obtains the voltage V of the battery NTC port N-H When the resistance of the NTC resistor is N By looking up the resistance-temperature comparison table of different types of NTC resistors in Table 1, the corresponding temperature values T of different types of batteries can be obtained. X-H .
[0094] The types of NTC resistors in this embodiment are described by taking two commonly used resistors, a resistor with a resistance of 10K at a temperature of 25° C. and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25° C. and an accuracy of 1%. Of course, the types of resistors are not limited to these.
[0095] Specifically, assume that the NTC resistor in the non-removable battery is a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1%, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V. N-H Substituting into formula (2), we get R N , and then calculate the R N Look up the temperature corresponding to the 10K, 1% resistor value in Table 1, and you will get the voltage V N-H The corresponding temperature value T 10K-H . Change the temperature value T 10K-H , you can check the corresponding NTC resistor value R from Table 1 N , and then the resistance RN Substituting into formula (2), we can get the NTC port voltage value V at different temperatures: N-H The motherboard will calculate the NTC port voltage value V corresponding to different temperatures N-H A second voltage-temperature table is prepared and saved for subsequent query. Figure 3 As shown, the NTC port voltage value V N-H and battery temperature T 10K-H Draw the voltage and temperature curve to facilitate user query. Figure 3 In the embodiment shown, it is assumed that the voltage value V N-H When it is 0.2V, Figure 3 It can be seen that the temperature value T corresponding to NTC 10K-H It is about 30°.
[0096] Assume that the NTC resistor in the non-removable battery is a resistor with a resistance of 47K at 25°C and an accuracy of 1%, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V. N-H Substituting into formula (2), we get R N , and then calculate the R N Look up the temperature corresponding to the 47K, 1% resistor value in Table 1, and you will get the voltage V N-H The corresponding temperature value T 47K-H . Change the temperature value T 47K-H , you can check the corresponding NTC resistor value R from Table 1 N , and then the resistance R N Substituting into formula (2), we can get the NTC port voltage value V at different temperatures: N-H The motherboard will calculate the NTC port voltage value V corresponding to different temperatures N-H A second voltage-temperature table is prepared and saved for subsequent query. Figure 3 As shown, the NTC port voltage value V N-H and battery temperature T 47K-H Draw the voltage and temperature curve to facilitate user query. Figure 3 In the embodiment shown, it is assumed that the voltage value V N-H When it is 1.0V, Figure 3 It can be seen that the temperature value corresponding to NTC is about 12°C.
[0097] S150, respectively calculate the battery temperature value T obtained in step S130 X-L and the battery temperature value T obtained in step S140 X-H With Tb Compare and determine the type of NTC resistor in the battery.
[0098] In this step, the battery temperature value T obtained in step S130 is first X-L With T b and compare it with T b The NTC resistor corresponding to the closest temperature value is the first type resistor. X-H With T b and compare it with T b The NTC resistor corresponding to the closest temperature value is the second type resistor. The first type resistor is compared with the second type resistor. If they are consistent, it is determined to be the type of the current NTC resistor; if they are inconsistent, an error is reported.
[0099] Specifically, assuming that the temperature of the motherboard is T b is 30°C, the battery temperature value T obtained in step S130 10K-L At 28°C, T 47K-L is 65℃, then T 10K-L With T b The resistance temperature value T obtained in step S140 is 10K-H 31℃, T 47K-H is 68℃, then T 10K-H With T b At this time, the first type resistor is consistent with the second type resistor, both of which are 10K resistors, which means that the type of the NTC resistor is a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1%.
[0100] Assume that the temperature of the motherboard is T b The battery temperature value T obtained in step S130 is 30°C. 10K-L At 15°C, T 47K-L is 29℃, then T 47K-L With T b The resistance temperature value T obtained in step S140 is 10K-H At 25°C, T 47K-H is 15℃, then T 10K-H With T b If the first type resistor is closer to the second type resistor, the second type resistor is a 10K resistor. At this time, the first type resistor is inconsistent with the second type resistor, and the motherboard reports an error.
[0101] Example 2
[0102] The steps of the method for automatically identifying the type of a non-removable battery of a handheld device in this embodiment are the same as those of the method for automatically identifying the type of a non-removable battery of a handheld device in Embodiment 1, except that a motherboard test is further included before step S110.
[0103] like Figure 4 As shown, the motherboard test includes the following steps:
[0104] S210, connect the connection between the mainboard and the NTC port to the ground after connecting it to a 10K resistor.
[0105] In this step, if Figure 5 As shown, the mainboard is provided with a GPIO port, an ADC input port and a power supply, wherein the GPIO port and the power supply output end of the mainboard are respectively connected to a 10K resistor and then grounded, and a first resistor R1 is provided between the GPIO port of the mainboard and the 10K resistor, and a second resistor R2 is provided between the power supply and the 10K resistor, and the ADC input port of the mainboard is connected to the input end of the 10K resistor to read the voltage value of the input end of the 10K resistor. In this embodiment, the first resistor R1 is a resistor with a resistance value of 220K and an accuracy of 1%, the second resistor R2 is a resistor with a resistance value of 100K and an accuracy of 1%, and the power supply voltage VDD is 1.8V.
[0106] S220, set the mainboard GPIO port to output high level or low level.
[0107] In this step, the output of the mainboard GPIO port can be set to a high level or a low level. In this embodiment, the mainboard GPIO output is set to a low level as an example for description.
[0108] S230, reading the voltage value of the input end of the 10K resistor, and the mainboard searches the first voltage-temperature table or the second voltage-temperature table for the battery temperature value T1 corresponding to the 10K resistor according to the voltage value.
[0109] In this step, the mainboard reads the voltage of the ADC, which is the voltage at the input end of the 10K resistor. The voltage value read is then queried in the first voltage temperature table or the second voltage temperature table for the battery temperature value T1 corresponding to the 10K resistor. Among them, the first voltage temperature table is the first voltage temperature table in step S133 in Example 1. The second voltage temperature table is the second voltage temperature table in step S143 in Example 1. For example, when the mainboard GPIO port outputs a low level, the voltage value read is queried in the first voltage temperature table for the battery temperature value T1 corresponding to the 10K resistor. When the mainboard GPIO port outputs a high level, the voltage value read is queried in the second voltage temperature table for the battery temperature value T1 corresponding to the 10K resistor.
[0110] S240, then connect the connection between the mainboard and the NTC port to a 47K resistor and then to ground.
[0111] In this step, the 10K resistor connected to the GPIO port and the power output end of the mainboard is replaced with a 47K resistor, that is, the GPIO port and the power output end of the mainboard are respectively connected to the 47K resistor and then grounded, and the ADC input port of the mainboard is connected to the 47K resistor input end to read the voltage value of the 47K resistor input end.
[0112] S250, reading the voltage value of the input end of the 47K resistor, and the mainboard searches the first voltage-temperature table or the second voltage-temperature table for the battery temperature value T2 corresponding to the 47K resistor according to the voltage value.
[0113] In this step, the mainboard reads the voltage of the ADC, which is the voltage at the input end of the 47K resistor. The read voltage value is then queried in the first voltage temperature table or the second voltage temperature table for the battery temperature value T2 corresponding to the 47K resistor. Among them, the first voltage temperature table is the first voltage temperature table in step S133 in Example 1. The second voltage temperature table is the second voltage temperature table in step S143 in Example 1. For example, when the mainboard GPIO port outputs a low level, the read voltage value is queried in the first voltage temperature table for the battery temperature value T2 corresponding to the 47K resistor. When the mainboard GPIO port outputs a high level, the read voltage value is queried in the second voltage temperature table for the battery temperature value T2 corresponding to the 47K resistor.
[0114] S260, compare T1 and T2. If both T1 and T2 are within 25±2℃, the mainboard is normal, otherwise the mainboard is invalid.
[0115] In this step, the battery temperature value T1 corresponding to the detection of the 10K resistor and the battery temperature value T2 corresponding to the detection of the 47K resistor are compared with 25°C. If both T1 and T2 are within 25±2°C, it means that the mainboard is normal. This is because, as can be seen from Table 1, the temperature when the resistance value corresponding to the 10K NTC resistor is 10K is 25°C. Therefore, if T1 is within the range of 25°C±2°C, it means that the calculated resistance at this time is 10K, which is consistent with the known resistance value of the connected resistor. If T1 is not within the range of 25°C±2°C, it means that the calculated resistance at this time is not 10K, which is inconsistent with the known resistance value of the connected resistor, indicating that the mainboard has failed. Similarly, as can be seen from Table 1, the temperature when the resistance value corresponding to the 47K NTC resistor is 47K is 25°C. Therefore, if T2 is within the range of 25°C±2°C, it means that the calculated resistance at this time is 47K, which is consistent with the known resistance value of the connected resistor. If T2 is not within the range of 25°C ± 2°C, it means that the calculated resistance is not 47K, which is inconsistent with the known resistance value of the connection, indicating that the motherboard is failed. After the motherboard detection is completed, the normal motherboard is subjected to steps S100 to S150 of embodiment 1, and the failed motherboard is repaired.
[0116] Before detecting the battery type, this embodiment connects a resistor of a known type to the connection terminal between the mainboard and the NTC port to obtain the battery temperature value corresponding to the resistor of this type, and determines whether the battery temperature value is within 25±2°C to determine whether the mainboard is working normally, thereby further improving the reliability of detection.
[0117] Example 3
[0118] The steps of the method for automatically identifying the type of a non-removable battery of a handheld device in this embodiment are the same as the steps of the method for automatically identifying the type of a non-removable battery of a handheld device in Embodiment 1, except that, after step S150, step S300 is further included: when the mainboard reports an error, the type of NTC resistor is continuously identified by changing the output voltage of the mainboard GPIO port.
[0119] Specifically, Figure 6 As shown, step S300 includes the following steps:
[0120] S310, set the mainboard GPIO port to output high impedance.
[0121] In this step, if Figure 8 As shown, a first resistor R1 is provided between the mainboard GPIO port and the battery NTC port, and a second resistor R2 is provided between the power supply and the battery NTC port. The mainboard GPIO port output is set to a high impedance state, that is, the mainboard GPIO port is suspended, at this time, the NTC resistor is connected in series with the second resistor R2.
[0122] S320, read the voltage V of the battery NTC port N-V .
[0123] In this step, the mainboard reads the voltage V at the battery NTC port. N-V , that is, the mainboard reads the ADC voltage.
[0124] S330, according to the voltage V N-V Query the battery temperature value T corresponding to different types of NTC resistors in the third voltage-temperature table X-V , where X is the type of NTC resistor.
[0125] In this step, the third voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a high impedance state. The third voltage-temperature table is obtained by calculating the resistance value of the NTC resistor by Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors in Table 1.
[0126] Specifically, according to Ohm's law, we get:
[0127]
[0128] Among them, V N-V is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor.
[0129] That is, when the mainboard obtains the voltage V of the battery NTC port N-V When the resistance of the NTC resistor is N By looking up the resistance-temperature comparison table of different types of NTC resistors in Table 1, the corresponding battery temperature value T can be obtained. X-V .
[0130] The types of NTC resistors in this embodiment are described by taking two commonly used resistors, a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25°C and an accuracy of 1%, as examples. Of course, the types of resistors are not limited thereto.
[0131] Specifically, assume that the NTC resistor in the non-removable battery is a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1%, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V. N-V Substituting into formula (3), we get R N , and then calculate the R N Look up the temperature corresponding to the 10K, 1% resistor value in Table 1, and you will get the voltage V N-V The corresponding temperature value T 10K-V . Change the temperature value T 10K-V , you can check the corresponding NTC resistor value R from Table 1 N , and then the resistance R N Substituting into formula (3), we can get the NTC port voltage value V at different temperatures: N-V The motherboard will calculate the NTC port voltage value V corresponding to different temperatures N-V A third voltage-temperature table is prepared and saved for subsequent query. Figure 7 As shown, the NTC port voltage value V can also be calculated according to the third voltage temperature table. N-V and battery temperature T 10K-V Draw the voltage and temperature curve to facilitate user query. Figure 7 In the embodiment shown, it is assumed that the voltage value V N-V When it is 0.2V, Figure 7 It can be seen that the battery temperature value T 10K-V It is about 18℃.
[0132] Assume that the NTC resistor in the non-removable battery is a resistor with a resistance of 47K at 25°C and an accuracy of 1%, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V. N-V Substituting into formula (3), we get R N , and then calculate the R N Look up the temperature corresponding to the 47K, 1% resistor value in Table 1, and you will get the voltage V N-V The corresponding battery temperature value T 47K-V . Change the battery temperature value T 47K-V , you can check the corresponding NTC resistor value R from Table 1 N , and then the resistance R N Substituting into formula (3), we can get the NTC port voltage value V at different temperatures: N-V The motherboard will calculate the NTC port voltage value V corresponding to different temperatures N-V A third voltage-temperature table is prepared and saved for subsequent query. Figure 7 As shown, the NTC port voltage value V can also be calculated according to the third voltage temperature table. N-V and battery temperature T 47K-V Draw the voltage and temperature curve to facilitate user query. Figure 7 In the embodiment shown, it is assumed that the voltage value V N-V When it is 1.0V, Figure 7 It can be seen that the battery temperature is about 5°C.
[0133] S340, respectively calculate the battery temperature value T obtained in step S330 X-V With T b and compare it with T b The type of NTC resistor corresponding to the closest temperature value is recorded as a third type resistor, and then the third type resistor is compared with the first type resistor and the second type resistor to determine the type of the NTC resistor.
[0134] In this step, if the third type resistor is consistent with one of the first type resistor or the second type resistor, the identical resistor is determined to be the type of the current NTC resistor.
[0135] Specifically, assuming that the temperature of the motherboard is T b is 30°C, the battery temperature value T obtained in step S330 10K-V At 28°C, T 47K-V is 65℃, then T 10K-V With T b The battery temperature value T obtained in step S130 is 10K-L 31℃, T47K-L is 68℃, then T 47K-L With T b The resistance temperature value T obtained in step S140 is 10K-H At 25°C, T 47K-H is 15℃, then T 10K-H With T b The second type resistor is closer to 10K. Since the second type resistor is consistent with the third type resistor, it means that the type of the NTC resistor is a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1%.
[0136] Example 4
[0137] See also Figure 8 The automatic identification system of the non-removable battery type of a handheld device of this embodiment includes a mainboard 10 and a non-removable battery 20. Among them, the mainboard 10 is provided with a GPIO port, an ADC input port and a power supply, and the non-removable battery is provided with an NTC resistor and an NTC port. One end of the NTC resistor is connected to one end of the NTC port, and the other end thereof is grounded. The other end of the NTC port is respectively connected to the GPIO port, the ADC input port and the power supply VDD, and the GPIO port outputs a high level or a low level. The NTC port voltage of the non-removable battery in different states is obtained by changing the output voltage of the mainboard GPIO port, and the battery temperature values corresponding to different types of NTC resistors are queried in the voltage temperature table through the NTC port voltage, and then the queried battery temperature value is compared with the mainboard temperature, and the type of the NTC resistor is determined according to the comparison result.
[0138] like Figure 8 As shown, a first resistor R1 is provided between the GPIO port and the NTC port of the mainboard, and a second resistor R2 is provided between the NTC port and the power supply VDD. When the GPIO port outputs a low level, that is, the GPIO port of the mainboard is grounded, at this time, the NTC resistor is connected in parallel with the first resistor R1 and then in series with the second resistor R2. When the GPIO port outputs a high level, that is, the output voltage of the GPIO port of the mainboard is equal to the power supply voltage, at this time, the first resistor R1 is connected in parallel with the second resistor R2 and then in series with the NTC resistor.
[0139] Specifically, Figure 8 As shown in the figure, when the GPIO port outputs a low level, according to Ohm's law:
[0140]
[0141] Among them, V N-L is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 1 is the resistance value of the first resistor R1, R 2is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor.
[0142] That is, when the mainboard obtains the voltage V of the battery NTC port N-L When the resistance of the NTC resistor is N By looking up the resistance-temperature comparison table of different types of NTC resistors in Table 1, the temperature value T of the NTC resistor at this time can be obtained. X-L .
[0143] The types of NTC resistors in this embodiment are described by taking two commonly used resistors, a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25°C and an accuracy of 1%, as examples. Of course, the types of resistors are not limited thereto.
[0144] At the same time, in order to facilitate user query, the change curve of the corresponding value of the NTC port voltage value and the battery temperature can be drawn according to formula (1) and Table 1, such as Figure 2 In the illustrated embodiment, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V.
[0145] When the GPIO port outputs a high level, according to Ohm's law:
[0146]
[0147] Among them, V N-H is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 1 is the resistance value of the first resistor R1, R 2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor.
[0148] That is, when the mainboard obtains the voltage V of the battery NTC port N-H When the resistance of the NTC resistor is N By looking up the resistance-temperature comparison table of different types of NTC resistors, the temperature value T of the NTC resistor can be obtained. X-H .
[0149] The types of NTC resistors in this embodiment are described by taking two commonly used resistors, a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25°C and an accuracy of 1%, as examples. Of course, the types of resistors are not limited thereto.
[0150] At the same time, in order to facilitate user query, the change curve of the NTC port voltage value and the corresponding value of the battery temperature can be drawn according to formula (2) and Table 1, such as Figure 3 In the illustrated embodiment, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V.
[0151] In some embodiments, the GPIO port output of the mainboard can also be set to a high impedance state, that is, the GPIO port is left floating, at which time the NTC resistor is connected in series with the second resistor R2. Specifically, when the GPIO port outputs a high impedance state, according to Ohm's law:
[0152]
[0153] Among them, V N-V is the NTC port voltage measured on the mainboard, V is the voltage of the power supply VDD, R 2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor.
[0154] That is, when the mainboard obtains the voltage V of the battery NTC port N-V When the resistance of the NTC resistor is N By looking up the resistance-temperature comparison table of different types of NTC resistors, the temperature value T of the battery at this time can be obtained. X-V .
[0155] The types of NTC resistors in this embodiment are described by taking two commonly used resistors, a resistor with a resistance of 10K at a temperature of 25°C and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25°C and an accuracy of 1%, as examples. Of course, the types of resistors are not limited thereto.
[0156] At the same time, in order to facilitate user query, a curve of the change of the NTC port voltage value and the corresponding value of the battery temperature can be drawn according to formula (3) and Table 1, such as Figure 7 In the illustrated embodiment, the resistance of the first resistor R1 is 220K, the resistance of the second resistor R2 is 100K, and the power supply voltage VDD is 1.8V.
[0157] In summary, the present invention changes the output voltage of the GPIO port of the mainboard to obtain the NTC port voltage of the non-removable battery in different states, and queries the battery temperature value corresponding to different types of NTC resistors in the voltage temperature table through the NTC port voltage, and then compares the queried battery temperature value with the mainboard temperature, and determines the type of NTC resistor according to the comparison result. The number of functional pins of the battery pack is reduced, which not only has a simple structure, high detection reliability, and low production cost; and can correctly identify two different battery components in the same version of software, with good compatibility and reduced software maintenance costs. On the other hand, before detecting the battery, a resistor of a known model is connected to the connection terminal between the mainboard and the NTC port to obtain the battery temperature value corresponding to the type of NTC resistor, and to determine whether the battery temperature value is within 25±2℃, so as to determine whether the mainboard is working normally, and further improve the reliability of detection. In addition, when the mainboard GPIO port outputs low level and high level and the battery type cannot be determined, the mainboard GPIO port can also output a high impedance state to further determine the battery type, and further improve the reliability of detection.
[0158] Although the present invention is disclosed through the above embodiments, the protection scope of the present invention is not limited thereto. Without departing from the concept of the present invention, any deformation, replacement, etc. made to the above components shall fall within the scope of the claims of the present invention.
Claims
1. A method for automatically identifying the type of non-removable battery of a handheld device, characterized in that: The method comprises the following steps: a. Connect the mainboard to the NTC port of the non-removable battery; wherein a first resistor is provided between the mainboard GPIO port and the battery NTC port, and a second resistor is provided between the power supply and the battery NTC port; b. Get the motherboard temperature T b ; c. Output the GPIO port of the mainboard to a low level. The mainboard will N-L Get the battery temperature value T corresponding to different types of NTC resistors X-L , where X is the type of NTC resistor; d. Output high level to the GPIO port of the mainboard. The mainboard will output high level according to the voltage V of the NTC port of the battery. N-H Get the battery temperature value T corresponding to different types of NTC resistors X-H , where X is the type of NTC resistor; e. The battery temperature values T obtained in step c are X-L And the battery temperature value T obtained in step d X-H With T b Compare and identify the type of NTC resistor in the battery; The step c comprises: c1. Set the mainboard GPIO port to output low level; c2. Read the voltage V at the battery NTC port N-L ; c3. According to the voltage V N-L Query the battery temperature values T corresponding to different types of NTC resistors in the first voltage-temperature table X-L ; The step d comprises: d1. Set the mainboard GPIO port to output high level; d2. Read the voltage V at the battery NTC port N-H ; d3. According to the voltage V N-H Query the battery temperature value T corresponding to different types of NTC resistors in the second voltage-temperature table X-H ; Step e includes: e1. The battery temperature values T obtained in step c3 are X-L With T b Compare and convert the battery temperature value T X-L Medium and T b The NTC resistor corresponding to the closest temperature value is recorded as the first type resistor; e2, respectively, the battery temperature value T obtained in step d3 X-H With T b Compare and convert the battery temperature value T X-H Medium and T b The NTC resistor corresponding to the closest temperature value is recorded as the second type resistor; e3. Compare the first type resistor with the second type resistor. If they are consistent, determine that it is the type of the current NTC resistor; If the first type of resistor is inconsistent with the second type of resistor, perform the following steps: f1. Set the mainboard GPIO port to output high impedance; the NTC resistor is connected in series with the second resistor; f2. Read the voltage V at the battery NTC port N-V ; f3, according to the voltage V N-V Query the battery temperature value T corresponding to different types of NTC resistors in the third voltage-temperature table X-V , where X is the type of NTC resistor; f4, respectively, the battery temperature value T obtained in step f3 X-V With T b and compare it with T b The NTC resistor corresponding to the closest temperature value is recorded as the third type resistor; f5. Compare the third type resistor with the first type resistor and the second type resistor. If the third type resistor is consistent with the first type resistor or the second type resistor, it is determined to be the type of the current NTC resistor.
2. The method for automatically identifying the type of a non-removable battery of a handheld device as claimed in claim 1, characterized in that: The types of the NTC resistor of the non-removable battery include a resistor with a resistance of 10K at a temperature of 25° C. and an accuracy of 1% and a resistor with a resistance of 47K at a temperature of 25° C. and an accuracy of 1%.
3. The method for automatically identifying the type of a non-removable battery of a handheld device as claimed in claim 1, characterized in that: In step c3, the first voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a low level, and the first voltage-temperature table is obtained by calculating the resistance value of the NTC resistor by Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors; In step d3, the second voltage-temperature table is a table of the NTC port voltage of each type of NTC resistor and the corresponding battery temperature value when the mainboard GPIO port outputs a high level. The second voltage-temperature table is obtained by calculating the resistance value of the NTC resistor through Ohm's law and then querying the resistance-temperature comparison table of different types of NTC resistors.
4. The method for automatically identifying the type of a non-removable battery of a handheld device as claimed in claim 1, characterized in that: Before step a, the method further includes step a0: mainboard testing, wherein step a0 includes: a01. Connect the connection between the mainboard and the NTC port to a 10K resistor and then to ground; a02, set the mainboard GPIO port to output high or low level; a03. Read the voltage value at the input end of the 10K resistor, and query the battery temperature value T1 corresponding to the 10K resistor in the first voltage-temperature table or the second voltage-temperature table according to the voltage value; a04, connect the connection terminal between the mainboard and the NTC port to a 47K resistor and then to ground; a05. Read the voltage value at the input end of the 47K resistor, and query the battery temperature value T2 corresponding to the 47K resistor in the first voltage-temperature table or the second voltage-temperature table according to the voltage value; a06. Compare T1 and T2. If both T1 and T2 are within 25±2℃, the mainboard is normal, otherwise the mainboard is invalid.
5. An automatic identification system using the automatic identification method of the non-removable battery type of a handheld device according to claim 1, characterized in that: The system includes a mainboard and a non-removable battery electrically connected thereto, wherein the mainboard is provided with a GPIO port, an ADC input port and a power source, the non-removable battery is provided with an NTC resistor and an NTC port, one end of the NTC resistor is connected to one end of the NTC port, and the other end thereof is grounded, the other end of the NTC port is respectively connected to the GPIO port, the ADC input port and a power source VDD, and the GPIO port outputs a high level or a low level; A first resistor R1 is provided between the NTC port and the GPIO port, and a second resistor R2 is provided between the NTC port and the power supply VDD; When the GPIO port outputs a low level, the relationship between the NTC port voltage of the NTC resistor and the battery temperature is calculated by the following formula: Among them, V N-L is the NTC port voltage measured by the mainboard, V is the voltage of the power supply VDD, R1 is the resistance value of the first resistor R1, R2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor; When the GPIO port outputs a high level, the relationship between the NTC port voltage of the NTC resistor and the battery temperature is calculated by the following formula: Among them, V N-H is the NTC port voltage measured by the mainboard, V is the voltage of the power supply VDD, R1 is the resistance value of the first resistor R1, R2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor; When the GPIO port outputs a high impedance state, the relationship between the NTC port voltage of the NTC resistor and the battery temperature is calculated by the following formula: Among them, V N-V is the NTC port voltage measured by the mainboard, V is the voltage of the power supply VDD, R2 is the resistance value of the second resistor R2, R N is the resistance value of the NTC resistor; When R is calculated N Then, according to R N By looking up the resistance-temperature comparison table of different types of NTC resistors, you can get the relationship between the NTC port voltage and temperature.
Citation Information
Patent Citations
Method and device for detecting temperature and ID of battery
CN105676145A
Lithium battery acquisition board detection method, system and device, medium and equipment
CN116068428A
Battery identification device
CN209927933U
Battery control device, method, program, and vehicle
JP2021128933A