Summary of the invention
In view of above-mentioned the deficiencies in the prior art part, the object of the present invention is to provide a kind of terminal and method of accurately obtaining cell voltage when charging by discharge mode, can when battery charges, by discharge mode, accurately obtain the voltage of battery, and then obtain the true electric weight of battery.
In order to achieve the above object, the present invention has taked following technical scheme:
When charging, by discharge mode, accurately obtain a terminal for cell voltage, comprise charging inlet, battery, resistance, power management module and central processing unit;
When described power management module charges for detection of battery, it is zero that notice central processing unit arranges initial drain, and by power management module, is obtained the voltage difference at described resistance two ends, and has judged whether that according to described voltage difference electric current flows through described resistance; Wherein: when not having electric current to flow through described resistance, directly obtain the voltage of described battery; When having electric current to flow through described resistance, notice central processing unit increases after discharging current, obtains the voltage difference at described resistance two ends, then has judged whether that electric current flows through described resistance, until while not having electric current to flow through described resistance, obtain the voltage of described battery.
Described accurately obtains in the terminal of cell voltage by discharge mode when charging, and described central processing unit comprises:
Discharge cell, for electric discharge;
Electric discharge setting unit, for arranging the discharging current of described discharge cell.
Described accurately obtains in the terminal of cell voltage by discharge mode when charging, and described power management module comprises:
Whether input detection unit, access charge power supply for detection of charging inlet;
Cell voltage acquiring unit, for obtaining the magnitude of voltage of described battery;
Voltage comparison unit, for the voltage difference at comparison resistance two ends, and has judged whether that according to described voltage difference electric current flows through described resistance; Wherein: when not having electric current to flow through described resistance, directly notify cell voltage acquiring unit to obtain the voltage of described battery; When having electric current to flow through described resistance, notice electric discharge setting unit increases after discharging current, obtain again the voltage difference at described resistance two ends and judged whether that electric current flows through described resistance, if still there is electric current to flow through described resistance, reinforming electric discharge setting unit increases the discharging current of discharge cell, until while not having electric current to flow through described resistance, notice cell voltage acquiring unit obtains the voltage of described battery.
Described accurately obtains in the terminal of cell voltage by discharge mode when charging, described system module comprises for exporting the discharge voltage unit of variable discharge voltage, described discharge cell comprises triode and discharge resistance, the base stage of described triode connects electric discharge setting unit, the collector electrode of triode connects described discharge voltage unit, and the emitter of triode is by described discharge resistance ground connection; Described electric discharge setting unit connects described discharge voltage unit, for the discharge voltage of described discharge voltage unit output is set.
Described when charging, by discharge mode, accurately obtain in the terminal of cell voltage, the setting of described electric discharge setting unit discharging current be:
Wherein, Vdisching is the discharge voltage of discharge voltage unit output, when VQ1_CE is triode conducting, and the pressure drop between collector and emitter.
An above-mentioned cell voltage acquisition methods that accurately obtains the terminal of cell voltage when charging by discharge mode, it comprises:
Whether A, detection mobile terminal access charge power supply, and if so, by central processing unit, initial drain being set is zero;
B, by power management module, obtained the voltage difference at described resistance two ends, and judged whether that according to described voltage difference electric current flows through described resistance; Wherein: when not having electric current to flow through described resistance, directly obtain the voltage of described battery; When having electric current to flow through described resistance, notice central processing unit increases after discharging current, obtains the voltage difference at described resistance two ends, then has judged whether that electric current flows through described resistance, until while not having electric current to flow through described resistance, obtain the voltage of described battery.
In described cell voltage acquisition methods, described steps A specifically comprises:
Whether the VBUS end of A1, detection charging inlet is high level;
A2, when the VBUS end of described charging inlet is during for high level, it is zero that notice central processing unit arranges initial drain.
In described cell voltage acquisition methods, described step B specifically comprises:
B1, by the voltage difference at voltage comparison unit comparison resistance two ends, and judged whether that according to described voltage difference electric current flows through described resistance; If it is perform step B2; Otherwise, execution step B3;
B2, notice electric discharge setting unit increase after discharging current, execution step B1;
B3, notice cell voltage acquiring unit obtain the voltage of described battery.
In described cell voltage acquisition methods, electric discharge setting unit setting discharging current be:
Wherein, Vdisching is the discharge voltage of discharge voltage unit output, when VQ1_CE is triode conducting, and the pressure drop between collector and emitter.
Compared to prior art, terminal and the method for accurately obtaining cell voltage when charging by discharge mode provided by the invention, can when battery charges, by discharge mode, make do not have electric current to flow through in the internal resistance of cell, thereby can accurately obtain the virtual voltage of battery, and then obtain the true electric weight of battery, and be shown to user, make user know battery electric weight number, also can make terminal in when charging, guarantee that battery is full of, make the charging of battery more stable, accurate.
Embodiment
The invention provides a kind of terminal and method of accurately obtaining cell voltage when charging by discharge mode, when battery charges, by discharge mode, make do not have electric current to flow through in the internal resistance of cell, thereby can obtain accurately the real voltage of battery, and then the accurate electric weight of obtaining battery is presented to user.
For making object of the present invention, technical scheme and effect clearer, clear and definite, referring to accompanying drawing, developing simultaneously, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to Fig. 2, it is the structured flowchart that accurately obtains the terminal of cell voltage when charging by discharge mode provided by the invention.As shown in Figure 2, described terminal comprises charging inlet 100, battery 200, resistance R 1, power management module 300 and central processing unit 400.Described power management module 300 connects the power input of the system module 500 of charging inlet 100, resistance R 1, battery 200, central processing unit 400 and terminal.Described system module 500 is terminal other all chips except power management module etc.
Wherein, when described power management module 300 charges for detection of battery, it is zero that notice central processing unit 400 arranges initial drain, and by power management module 300, is obtained the voltage difference at described resistance R 1 two ends, and has judged whether that according to described voltage difference electric current flows through described resistance R 1; Wherein: when not having electric current to flow through described resistance R 1, directly obtain the voltage of described battery 200; When having electric current to flow through described resistance R 1, notice central processing unit 400 increases after discharging current, obtains the voltage difference at described resistance R 1 two ends, then has judged whether that electric current flows through described resistance R 1, until while not having electric current to flow through described resistance R 1, obtain the voltage of described battery 200.
In the present embodiment, when the voltage of resistance R 1 is zero, the electric current of process resistance R 1 is also zero, and the electric current that now flows through the internal resistance of cell is also zero, and therefore, the voltage that power management module 300 now obtains battery 200 is battery voltage accurately.
Please continue to refer to Fig. 2, described charging inlet 100 is USB interface, and when battery 200 is charged, described power management module 300 is connected with charger by charging inlet 100, and then charge by 300 pairs of batteries 200 of power management module, and obtain the accurate voltage of rechargeable battery 200.
In the embodiment of the present invention, described central processing unit 400 comprises discharge cell 401 and electric discharge setting unit 402, and described discharge cell 401, for electric discharge; Electric discharge setting unit 402 connects discharge cell 401 and system module 500, for the discharging current of described discharge cell 401 is set.Wherein, the initial drain that described electric discharge setting unit 402 arranges is zero ampere, when increasing discharging current, only need to increase the discharge voltage of system module 500 outputs, and the discharge voltage that can control system module 500 can increase by a certain fixed value (as 0.01V), so that discharging current exists certain rule.
See also Fig. 3, discharge cell 401 comprises triode Q1 and discharge resistance R2, and described system module 500 comprises for exporting the discharge voltage unit 501 of variable discharge voltage.Wherein, the base stage of described triode Q1 connects electric discharge setting unit 402, and the collector electrode of triode Q1 connects described discharge voltage unit 501, and the emitter of triode Q1 is by described discharge resistance R2 ground connection; Described electric discharge setting unit 402 connects described discharge voltage unit 501, for the discharge voltage of described discharge voltage unit 501 outputs is set, thus the discharging current of controlled discharge unit 401.
In the present embodiment, described triode Q1 is NPN triode, when described electric discharge setting unit 402 output high level, and described triode Q1 conducting, the discharge voltage of discharge voltage unit 501 outputs discharges discharge resistance R2 over the ground; When described electric discharge setting unit 402 Shu Chushi level, described triode Q1 cut-off, discharge resistance R2 can not work.
Wherein, described electric discharge setting unit 402 arrange discharging current be:
Wherein, Vdisching is the discharge voltage of discharge voltage unit 501 outputs, V
q1_CEduring for triode Q1 conducting, the pressure drop between collector and emitter.From above-mentioned formula, when increasing discharging current in, only need to increase by electric discharge setting unit 402 discharge voltage of discharge voltage unit 501 outputs in system modules 500, and the discharge voltage exported of discharge voltage unit 501 0.01V that at every turn raises.
Please again consult Fig. 2, described power management module 300 specifically comprises: input detection unit 310, voltage comparison unit 320 and cell voltage acquiring unit 330.
Wherein, the input of described input detection unit 310 connects the VBUS end of charging inlet 100, for detection of charging inlet 100, whether accesses charge power supply; The output of input detection unit 310 connects the power input of one end, discharge cell 401 and the system module 500 of battery R1.
During concrete enforcement, when inserting charger charging in charging inlet 100, its VBUS end is high level; When not inserting charging, its VBUS end is low level.Take USB interface as example, when charging inlet 100 connecting charger, its VBUS end is 5V, when charging inlet 100 not during connecting charger VBUS end be 0V, so whether 310 of the input detection units VBUS end that needs to detect charging inlet 100 is that high level just can judge whether connecting charger of charging inlet 100.
The first input end IN1 of voltage comparison unit 320 connects one end of described resistance R 1, the second input IN2 of voltage comparison unit 320 connects the other end of described resistance R 2 and the positive pole of battery 200, the first output OUT1 of described voltage comparison unit 320 connects electric discharge setting unit 402, the second output OUT2 and connects cell voltage acquiring unit 330.
Described voltage comparison unit 320 is for the voltage difference at comparison resistance R1 two ends, and judged whether that according to described voltage difference electric current flows through described resistance R 1, its specific works is: judge whether described voltage difference is zero, when described voltage difference is zero, while representing not have electric current to flow through described resistance R 1, directly notify cell voltage acquiring unit 330 to obtain the voltage of described battery 200; When described voltage difference is non-vanishing, indicate that electric current flows through described resistance R 1, notice electric discharge setting unit 402 increases after discharging current, obtain again the voltage difference at described resistance R 1 two ends and judged whether that electric current flows through described resistance R 1, if still there is electric current to flow through described resistance R 1, reinforming electric discharge setting unit 402 increases the discharging current of discharge cells 401, until while not having electric current to flow through described resistance R 1, notice cell voltage acquiring unit 330 obtains the voltage of described battery 200.
In specific implementation process, described voltage comparison unit 320 comparison resistance R1 both end voltage VIN1, VIN2, if VIN1 is greater than VIN2, the discharge voltage that in notice electric discharge setting unit 402 elevation system modules 500, discharge voltage unit 501 is exported, with this, increase the discharging current of discharge cell 401, then comparison resistance R1 both end voltage VIN1, VIN2; If VIN1 is still greater than VIN2, notice electric discharge setting unit 402 discharge voltage of discharge voltage unit 501 outputs in elevation system module 500 again, until VIN1 equals VIN2.In the present embodiment, the discharge voltage of the described electric discharge setting unit 402 discharge voltage unit 501 outputs 0.01V that at every turn raises.If voltage comparison unit 320 relatively VIN1 equals VIN2, notify cell voltage acquiring unit 330 to obtain the voltage of described battery.In the present embodiment, the magnitude of voltage that described cell voltage acquiring unit 330 obtains is inside battery electric weight memory block both end voltage, the i.e. value of Vbat in Fig. 1.
The present invention also provides a kind of cell voltage acquisition methods, refers to Fig. 4, and it is the flow process of cell voltage acquisition methods provided by the invention.As shown in Figure 4, described cell voltage acquisition methods comprises the following steps:
Whether S100, detection mobile terminal access charge power supply, and if so, by central processing unit, initial drain being set is zero;
S200, by power management module, obtained the voltage difference at described resistance two ends, and judged whether that according to described voltage difference electric current flows through described resistance; Wherein: when not having electric current to flow through described resistance, directly obtain the voltage of described battery; When having electric current to flow through described resistance, notice central processing unit increases after discharging current, obtains the voltage difference at described resistance two ends, then has judged whether that electric current flows through described resistance, until while not having electric current to flow through described resistance, obtain the voltage of described battery.
In step S100, when mobile terminal being detected, there is charge power supply when access, initial drain is set is zero to power management module notice central processing unit, concrete, step S100 comprises: whether the VBUS end that detects charging inlet is high level; When the VBUS of described charging inlet end is high level, it is zero that notice central processing unit arranges initial drain.
Refer to Fig. 4, in order to obtain accurately battery, described step S200 specifically comprises:
S201, by the voltage difference at voltage comparison unit comparison resistance two ends, and judged whether that according to described voltage difference electric current flows through described resistance; If it is perform step S202; Otherwise, execution step S203.
S202, notice electric discharge setting unit increase after discharging current, and execution step S201, until while not having electric current to flow through in resistance, obtain the voltage of resistance.
S203, notice cell voltage acquiring unit obtain the voltage of described battery.
Wherein, the discharging current of electric discharge setting unit setting is:
Wherein, Vdisching is the discharge voltage of discharge voltage unit output, V
q1_CEduring for triode conducting, the pressure drop between collector and emitter.
Below in conjunction with Fig. 2 and Fig. 3, take terminal as smart mobile phone is example, the cell voltage acquisition methods of terminal of the present invention is described in detail.
When charging inlet 100 access chargers charge to smart mobile phone, now the VBUS end of charging inlet 100 to be detected be the input of 5V high level to the input detection unit 310 in power management module 300, and it is zero that initial drain is set.Simultaneously, IN1 end and the IN2 end of voltage comparison unit 320 obtain voltage VIN1 and the VIN2 at resistance R 1 two ends, and the two is compared, when VIN1 is greater than VIN2, representing has pressure drop in resistance R 1, there is current flowing resistance R1, now the OUT1 end output control signal notice electric discharge setting unit 402 by voltage comparison unit 320 makes discharge voltage unit 501 increase the discharge voltage that adds of 0.01V, thereby increase the discharging current of discharge cell 401, and again obtain voltage VIN1 and the VIN2 at resistance R 1 two ends, and compare, if VIN1 is still greater than VIN2, the OUT1 of voltage comparison unit 320 end is again exported control signal notice electric discharge setting unit 402 and is made discharge voltage unit 501 again increase the discharge voltage (now discharge voltage 0.02V) of 0.01V, thereby again increase the discharging current of discharge cell 401, until VIN1 and VIN2 equate, now by OUT2 output control signal notice cell voltage acquiring unit 330, obtained the voltage of battery 200, now because having electric current, the internal resistance of cell do not flow through, the voltage that cell voltage acquiring unit 330 obtains is the real voltage of battery, corresponding relation by voltage and electric weight is converted into corresponding electric weight and presents to user.In addition, because voltage comparison unit 320 is the electric weight that periodically obtain in resistance R 1, and the time of voltage and electric discharge of obtaining is short, and the present invention's electric discharge when charging is influenced hardly to the charging interval of battery.
In sum, terminal and the method for accurately obtaining cell voltage when charging by discharge mode provided by the invention, in can making the internal resistance of cell by discharge mode when charging, do not have electric current to flow through, thereby can Obtaining Accurate the real-time voltage of battery, and then know the real-time electric weight of battery, and be shown to user, make user know the number of the electric weight of battery, also can make terminal when charging, accurately whether battery charging is full of, and makes the charging of battery more stable, accurate.
Be understandable that, for those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection range of the appended claim of the present invention.